Monthly Archives: May 2008

The Calm Before The Blast

Had a weird feeling this Monday morning when not many cars were out and about. Something was not right. Got some sms last night to be alert today. Never got those before. Was almost done getting through the day when we heard the blast in Dehiwala. It was faint and we didn’t think much of it at the time. 5 minutes later we got the news.

Another sad day in Sri Lanka with no end in sight.

Jar Clean Up Story

I’m pretty happy with moving some common Java libraries out of the project source folders.

I have about 4 branches of the same project checked out. Each of them were about 57mb a piece. I noticed this while I was trying to sync my projects to a remote server. (I hate slow running scripts)

I managed to move the jar files out to a common folder which was about 27mb. I wrote another recursive ant clean script (which I will share below) that helped me clean up before the sync.

Moving the libraries was relatively simple with a few changes in the ant build scripts.

Anyway I managed to bring down each project to about 10mb. Here is the recursive ant clean script.


#!/bin/bash

projects=~/projects

for project in $(ls $projects/);
do
if [ -f $projects/$project/build.xml ]; then
echo ""
echo "Cleaning $project"
cd $projects/$project
ant clean
fi
done

I tried a similar script in Windows batch, didn’t work as easily. Don’t need bat files, Cygwin is better. And the same bash shell scripts on Linux most of the time with little or no modification.

For a programmer tweaking never stops. I try not to work on Sunday. But its a good day to take a step back and do backups, cleanups etc.

I knew about this jar duplication but really saw it while trying to run a backup and then looking at the projects folder with jDiskReport. Need more tools like this.

SQL Play with Firefox 3 Places

I heard good things about Firefox 3. Now that I’ve got Ubuntu 8.04 I thought I’d try a few commands.

1. Get the places database
2. open with sqlite
3. query the bookmarks table

cp .mozilla/firefox/xxxxxxxx.default/places.sqlite .

sqlite3 places.sqlite
sqlite> .tables
moz_anno_attributes moz_favicons moz_keywords
moz_annos moz_historyvisits moz_places
moz_bookmarks moz_inputhistory
moz_bookmarks_roots moz_items_annos

sqlite> select * from moz_places limit 1;
1|place:queryType=0&sort=8&maxResults=10|queryType=0&sort=8&maxResults=10||0|1|0||0

Happy data mining!

Make Windows Shortcuts with Cygwin

Did you know that you can make Windows shortcuts with Cygwin and ln? I did not know this, just tried it out today and it works!

This is probably the smallest thing I’m blogging about, but read on you might get some new ideas (like I did) about file organization in Windows. I swear some days Cygwin is the only thing that keeps me sane on this office Windows XP computer.

I like to keep my /projects folder separate from my /clients folder. It just saves clicks I guess and I’m a separation junkie I can’t help it. I could have manually created these shortcuts for each project but now I can do it in a bash script. Yay!

Still not following? Let me explain. I have a clients folder like this.


/clients/a/projects/a
/clients/a/projects/b
/clients/b/projects/c
/clients/a/projects/d

But I like to keep my projects in a root level projects folder like this for easy access and backups etc.


/projects/a
/projects/b
/projects/c
/projects/d

I have simple, unique, short project names. That helps a lot. Here is the magical command that can help me a great deal.


ln -s /cygdrive/d/clients/a/projects/a /cygdrive/d/projects/a

This way I can keep projects I’m currently working on in /projects and move others back to /clients/x/projects. Ideas for a project folder management script is brewing will post about that later.

Acquire Zen

Actually I’m just selling my car. Its a 2006 Maruti (Suzuki) Zen. Its a pretty basic town car.

Zen

Here are some details.

  • Bought in May 2006 brand new KB-77xx series
  • Serviced by AMW till the the last time I went to Laughs.
  • Its a 1 liter MPFI (Multi point fuel injection) engine.
  • Does about 10.5-11 km per liter in Colombo 15+ outside
  • Has done just past 23,000 km
  • 5 speed manual gear
  • Front power windows
  • Added 3M tint all around. 0% tint UV cut for front, 40% tint front sides, 60% rear.
  • Changed stereo head unit from a JVC cassette player to a Sony with front USB 4 way with sub woofer.
  • Changed front JVC 4″ speakers to Blaupunkt.
  • Added 6×9″ Rockford Fosgate Punch speakers to rear.
  • Added active sub woofer.

I’m expecting 1.25 mil. Make me an offer.

Picasa Web Albums – Dilantha – Zen

Maruti Zen 2006 – a set on Flickr

Blaupunkt – Loud Speakers – TH Series – THb 210A