Ubuntu 12.10 – Maximizing Battery Backup

Here is a quick tutorial, to maximize battery backup of your laptop. This is based on ubuntu 12.10, which has many improved feature which you need to tweak to improve the backup.

Tools used are :
1. “Disks” 3.6.1
2. Jupiter Applet
3. PowerTop

Disks, This program comes default with ubuntu 12.10, it has many improved features this time. One important feature is, it also controls HDD Drive speed, which can end up in maximizing performance to battery.

After opening the Drive Settings, It shows power managements options for HDD. You can set power as low as possible to increase the Drive speed.

Next is, Jupiter applet, , after installing, start the jupiter applet and change power settings to Power Saving Mode.

Next and the last is, PowerTOP, install it by typing the terminal.

$ sudo apt-get install powertop

After installing it, give command in the terminal.

$ sudo powertop 

Your application will start running, switch screens with left and right arrow, and get into “Tuneable Tab” and change all setting which are bad.

Thats what made my battery backup approximately 80 minutes more then my normal battery backup, Thanks for reading, I hope you find this post helpful.

SSH access : Time saVVy Hack

If you deal with a lot of servers and SSH connections, then this post is a must read for you, welcome.

I will go through some easy tricks, which will make your SSH login to server without asking a things.

How to setup :

  1. Setup key based SSH access
  2. Command alias

Start with issuing following commands :

$ ssh-keygen

Then ssh-keygen will ask you the filename in which to store the generated key in ~/.ssh/YourFileName

Next, copy the key’s .pub file to the server, which you want to connect using ssh.

$ ssh-copy-id -i ~/.ssh/YourFileName.pub user@server.com

now open you ~/.bashrc file, and add alias. Paste this code in the end of your .bashrc file, and change values accordingly

alias conny='ssh user@server'

Save and exit, thats it, you just run $ conny or any other name you wrote there. It will setup an SSH connection directly to the server.

MUTT – encrypting password with GNUpg

To encrypt password with mutt, we will be using GNUpg, install it :

For Debian based : $ sudo apt-get install gnupg gnupg-agent
For RPM based : $ sudo yum install gnupg gnupg-agent

after installing it you need to generate an encryption key by using following.

gpg --gen-key

Select appropriate options. Enter you name, email and passphare when it asks. Do not forget your passphrase.
now create a file .pass place it in your home folder, I am placing it here :

touch ~/.mutt/.pass

contents fo following file should be :

GMail:mySecretPassowrd

encrypt it by using:

cd ~/.mutt
gpg --encrypt .pass

Now you will see a file is created as .pass.gpg , if it is there, you can delete orignal .pass file. After this step you have to make changes to .muttrc file. Append the following by doing appropriate changes

set imap_pass = `gpg -d ~/.mutt/.pass.gpg | awk '/GMail:/ {print $2}'`

NOTE : if imap_pass and smtp_pass are defined anywhere else, you have to remove them or comment those two lines like this :

#set imap_pass = ""
#set smtp_pass = ""

Thats it, now you can start mutt and it will ask the passphrase for your key, and will never irritate you again 🙂
Good Luck.