Sunday, August 24, 2008

Script fun

If you use Gnome, then you can use this quick script for setting casual reminders from command line.
$ cat ~/bin/remind
#!/bin/bash

msg=$1
shift
( sleep $* && notify-send $msg -t 0 ) &
Usage:
$ remind "Laundry done" 48m
$ remind "Group meeting" 1h 10m
At the end of time, you will see a popup with the reminder message.

Tuesday, August 12, 2008

Visualizing source code

I always find it difficult to understand the legacy code after joining a new project. I cannot understand it until I can visualize it. Cscope, Ctags have been great help in this effort, but they don't present the source code structure in visual form. I tried KScope a while back, it's good. But today I got working a very useful method of visualizing the program execution. It's documented in this article on IBM Developerworks.

If your project has a C binary, then using the pvtrace utility mentioned in the article (which uses addr2line) and graphviz, you can create awesome picture of your C source code. (I haven't tried this yet on C++). One hiccup that was keeping me from getting this to work was resolved today. I was running it on an executable that was linking to a shared library. So even though I was compiling the whole library and the executable with debug symbols, the addr2line utility couldn't get the symbols that were in the shared library. When I realized that, I re-ran the linking part of my executable, so that it would now link the .a file statically, instead of .so file dynamically. The resultant binary had all the symbols.

After following all the steps in the article I came up with this picture.

Sunday, August 10, 2008

OpenMoko photo tour

Today on the OSiM blog, I reviewed 3 major distribution efforts on OpenMoko phone.

Here are the slideshows of the screenshots I collected.

om2007.2



om2008.8



fso



Check out the full article for more into.