Five Ubuntu Hacks to make your life easier!

When I made the decision to switch from Windows to Linux after the great


debacle of Windows 8, I knew that the I had to learn and document a few tricks to make my ubuntu deskop as much as (or even better than) Windows. Given in this article are five such ubuntu hacks that came quite handy to me in various situations. I hope you too make the most of it.

Ubuntu Shutdown Dialog

1. Disable animation

One of the first things I do upon installing ubuntu is disable that “eye-candy” animation that most OSX/Windows users are used to. I generally prefer performance to appearance and it goes without saying that disabling the unity animation saves some precious memory and cpu cycles that might be better utilized elsewhere. In order to disable animation, just do this:

  1. Install unity-tweak-tool if you already haven’t.
  2. Trun off Window Manager->General->Window Animations.

2. Enable hibernation

Hibernation is almost an essential feature in laptops nowadays, and though it is disabled by default, you can easily enable it by doing this:

  1. Edit

    in superuser mode.

  2. Enable

    for hibernation (both for upower and logind).

3. Add a shutdown shortcut

The first thing I had noticed since migrating from

Windows 7


Ubuntu 12.04 LTS

was that I can no longer do a


on the desktop to bring the

shutdown dialog

anymore! But no worries, you can enable the same in Ubuntu by doing the following:



and map a key to

gnome-session-quit --power-off

(To assign Ctrl+Alt+Del, you will have to assign another shortcut for logoff first)

4. Learn how to reset your USB Modem:

A nagging issue on many Linux (and even Windows) machines is that the USB modem you use for getting a

Mobile Broadband

connection to Internet just stops responding. What is basically needed here is to reset your USB device. The “practical” way that most folks do this is to physically remove the USB device and plug it back again. But there are ways to reset a USB device in Linux without touching the actual hardware! There are two ways of doing it, first using the standard


command, and second, a more geeky but reliable way of compiling a


program to do your job:

METHOD 1: First, perform a


, so it gives you the vendor-id and product-id of your USB modem, for example:

Bus 003 Device 002: ID 04f9:0224 Brother Industries, Ltd

In this example the vendor ID is


, product ID is


(right, its my printer).
To reset the device, we may then issue:

sudo usb_modeswitch -R -v <vendor ID> -p <product ID>

METHOD 2: First, write and compile the usbreset.c program as described here. To run the program, you have to supply the complete path to the usb device including the bus-id like this:

sudo usbreset /dev/bus/usb/001/002

To avoid looking up the


each time, just add an alias to your


file (make sure to change the vendor search string from


to your own):

#Added by Prahlad
alias 'usbresetReliance=sudo /home/prahlad/source/cpp/linux/usbreset /dev/bus/usb/$(lsusb|grep Huawei| sed "s/Bus //"| sed "s/ Device /\//"|sed "s/:.*//")'

5. Add a path to


environmental variable in bash prompt

One of the commonest thing you need on the bash prompt is the ability to add to the default


environment variable. For instance, if you have copied




somewhere in your


directory, you might want to add those paths to


so you can run those programs form the bash prompt. Here is how to do it:

  1. Edit

    in $HOME folder (and make sure that




    don’t exist as they override your value).

  2. At the last line, set the

    variable as follows:

#Modified by Prahlad:

Hope this helps. That’s all for now.