Saturday, November 13, 2010

Save more than 10% battery life with adblock

As I mentioned before, I bought a netbook recently. Naturally I was experimenting with ways of getting the most out of the built-in battery. I just realized that blocking flash based moving ads on websites can enable you to save more than 10% battery life.

Here is the main result.
the power consumption of the netbook is:
  1. 11.2 Watts before blocking, and
  2. 9.5 Watts after.
So, if you are on the go and doing web browsing, and would like save some battery power, block ads.

Notes:
1. link to adblock: http://addons.mozilla.org/en-US/firefox/addon/1865/
2. in order to see power stats, use the linux command "gnome-power-statistics".

Friday, November 12, 2010

how to switch/reassign keyboard keys in linux / ubuntu / fedora

I recently bought a netbook which came with a good size keyboard. However, due to the space constraint, the netbook producer, turns out, combined the Page-up and Home, and Page-Down and End keys. Well, as a touch typist and a programmer, I often use Home and End keys, and it is certainly a pain to be able to access them only via a Function key like Fn+Page-up=Home. So I did some googling, and here is the result.

1. Install Xmodmap
in ubuntu do: sudo apt-get install xmodmap
in fedora do: sudo yum install xmodmap

2. get the "keysym" name of the keys using xev
keysym of "home" key is "Home"
xev
press the Home key
KeyRelease event, serial 33, synthetic NO, window 0x1800001,
root 0xaa, subw 0x0, time 3028114, (288,433), root:(289,515),
state 0x0, keycode 110 (keysym 0xff50, Home), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False


via xev: keysym of "Page up" key is "Prior"
xev
press the Page up key
KeyRelease event, serial 33, synthetic NO, window 0x1800001,
root 0xaa, subw 0x0, time 2825051, (322,253), root:(323,335),
state 0x0, keycode 112 (keysym 0xff55, Prior), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False


4. switch keys by doing two assignments
xmodmap -e "keysym Home = Prior" -e "keysym Prior = Home"