Saturday, April 29, 2006

vi key bindings and Firefox 1.5

This is shamelessly copied from http://forums.mozillazine.org/viewtopic.php?t=292404&highlight=keybindings These guys were there before me. I am adding some more details to this page.

I am a vi addict. I use vim everywhere including windows, unix, linux. I have learnt typing and type very fast. I hate to move my fingers for navigation keys or mouse from the asdf position. I open vim where everybody opens a notepad, wordpad or any advanced editor. I use inbuilt ftp client to pullout files from servers and edit directly. It saves me lot of time.
The beauty with firefox is I can customize it to my taste. Now for a long time I felt I am missing some kind of vi/vim navigation in firefox browser.

1. Get a jar package. If you are like me (an illiterate) in java, get java development installed on your system. I use cygwin and I downloaded gcj package to get the jar. Otherwise, the standard Sun JDK will have jar bundled.

2. Copy toolkit.jar to a tmp dir found under Mozilla Firefox\chrome. This dir will be usually under c:\Program Files or wherever you installed Firefox 1.5.

3. Open, unjar (untar) the jar file. jar -xvf toolkit.jar. The contents will be stored under content/ dir. Open the file content\global\platformHTMLBindings.xml in your favourite editor (in this case vi) and add the following to the browser section.

<handler event="keypress" key="h" command="cmd_scrollLeft" />
<handler event="keypress" key="j" command="cmd_scrollLineDown" />
<handler event="keypress" key="k" command="cmd_scrollLineUp" />
<handler event="keypress" key="l" command="cmd_scrollRight" />
<handler event="keypress" key="u" command="cmd_scrollPageUp" />

You can add other bindings as well and it depends on your preference.

4. tar... sorry jar is back again using jar -0cvf toolkit.jar content/ . Note the zero which allows jar to tar the contents rather than compress.

5. Take a backup copy of toolkit.jar found in firefox chrome dir and copy the modifed file into that location. Restart Firefox and you got it.
Long weekend, holidays and Firefox

Another bank holiday and long weekend. Planned for a trek/walk but cancelled at the last minute because of a friends bachelor party. It was fun with all the guys drinking and cracking jokes and believe me there was never a mention of girls or any thing related to that. All centered around sports, movies, old college/hostel days and of couse sayari(s). Its been a long time since I went to a party like this.

Coming to the topic, I am still trying to get vi key bindings to work in firefox 1.5. Have tried everything including installing keybind xpi, prefs.js. prefs.js is used mostly pre-1.0 but I want no holes left to be turned. The platformHTMLBindings.xml holds the key but it hasnt worked for me till now. I reliase my mistake now, so bent upon trying to fix that one. I was editing the toolkit.jar with winzip and when I zip back, it is very small. winzip is really compressing the file rather than tarring. Since I don't know java neither use it, I need to find and download jar tools first. Once successful, I plan to write a short tutorial on it.
Nowadays, everbody is talking about ubuntu and I think even the whole slashdot crowd is behind ubuntu. Planning to give dapper a try and find out what is so wonderful about this distribution. I love my OpenSuse 10 which is rock solid and almost on the fly breezy installation including my Broadcom wireless NICs. Meanwhile, my ITIL foundation exam preparation is going very sluggish.

Tuesday, April 18, 2006

WMQ Monitoring

My monitoring page lists the queues and on clicking an entry, displays the details of the queues in a new browser window. But opening a new window is proving costly in terms of performance and so I set out to reimplement the thing in a styled div. Its works really good and the effect I wanted just shows up with tweaked border-width and table formats.

Real nice piece of code I am happy with.

Monday, April 17, 2006

London Trip and Hotel Saravana Bhavan

Finally I managed to go to London with a few close friends and visit Lords, the birthplace of cricket. It was a wonderful tour around the club (it is not a public stadium but a private club). Founded by Thomas Lord and made popular by W G Grace, the cricket is almost a religion in India. Our tour party inside MCC (Marylebone Cricket Club) was mostly of Indians and it was happy to be among fellow lovers of Indian Cricket. Sadly all of the cricket information in the museum relates to English and Australian cricket and there was little mention of other cricket playing nations which I can't complain since it is supposed to be the birthplace of English cricket too. As an interesting side note, I came to know that MCC chalked out the rules of lawn tennis also.

After this trip, I had a hearty meal in Hotel Saravana Bhavan, a south indian hotel food after a long long time. We enjoyed the trip very much and naturally tired also. The train trip from Bristol to London was also enjoyable.

Friday, April 14, 2006

Easter holidays, Fedora Core 5 and Fedora-apache setup

Its holiday time and the long weekend of easter has come. Planning to install Fedora core 5 from the dvd version. I was toying with apache to get it work for new files and dirs instead the root directory but it is getting tough and testing my patience. It is because of the SELinux enabled. The following steps will help to enable apache out of SELinux security grip, but beware and weigh your decision before attempting to free up httpd.

Go to your specific dir and run

ls -Z -d my_support/
chcon -R -t httpd_user_content_t my_support/

This will fix the SELinux httpd security config and allow the files to be served by the webserver.