Del.ico.us
The idea here is, there are a set of source directories that I normally go to, or work under directly. Then there are some directories that are more then one level deeper but are under these same source directories. Then there is the rest of the tree where I need to go from time to time.
So when I run "goto xyzd", I want it to run the search in three phases:
1. Check if xyzd is there as the first level subdirectory under any of the common directories I work on. This should be the most common scenario.
2. If not found, do a "find" based search on the specific commonly used source directories only.
3. If pass 2 also fails, do a complete search from root of the tree.
4. In any of the passes, if a directory is found, cd to it.
This works out well for me. There are enhancements that can be done (like, if more than one name is found, giving options), but so far I didn't find any need for it.
The script looks like the following. You will need to change the DEV_ROOT and SDIRS variables to match your tree.
function goto() {\
echo "Searching for $1 ...";
DEV_ROOT="root/dir/for/tree"
SDIRS="src/xxxx/usr.bin:src/xxxx/usr.sbin:src/xxxx/yyyy/common:src/xxxx/sbin";
# Pass 1
for i in `echo $SDIRS|sed 's/:/ /g'` ;
do
if [ -d $DEV_ROOT/$i/$1 ];
then
cd $DEV_ROOT/$i/$1;
return;
fi;
done;
echo "Couldn't find $1 in first pass... Trying second pass...";
# Pass 2
for i in `echo $SDIRS|sed 's/:/ /g'` ;
do
echo "Searching in $DEV_ROOT/$i..."
DIRPATH=`find $DEV_ROOT/$i -type d -name $1`
if [ "$DIRPATH" != '' ];
then
echo $DIRPATH
cd $DIRPATH
return;
fi
done;
echo "Couldn't find $1 in second pass... Trying full search ...";
# Pass 3
DIRPATH=`find $DEV_ROOT/src -type d -name $1`
if [ "$DIRPATH" != '' ];
then
cd $DIRPATH
return;
fi
echo "Failed to find directory $1."
}
Del.ico.us
Here comes an easy trick for quickly posting to your blog from within firefox (or any other browser), without leaving the current page. You can create a bookmark in firefox with the following link (remember to change your blog's mt.cgi path)
http://<path to mt.cgi>?__mode=view&qp=1&_type=entry&blog_id=1
In the "Properties" for the bookmark, remember to select "Load this bookmark in the sidebar" checkbox. Now, if you remain logged in to the blog, you can just start blogging by clicking on this bookmar. Here is how it looks in Firefox while I'm writing this post.

Del.ico.us

There is, however, a flip side to Roku's player. This player runs a variant of Linux. However, the "Watch Now" feature of Netflix is completely unavailable for Linux based PCs. I wonder how long before someone will reverse engineer Roku to write a client for Linux. Especially, because of GPL, it'd be perfectly legal to ask Roku to give out the source code for its player. I'd love to see that happen too.
Del.ico.us
Here is how it looks on Konquerer after loading.

There are two workarounds.
1. Disable Javascript while visiting citicards.com. Lame!!
2. Instead of citicards.com, use https://www.accountonline.com/. It's the real site that's used behind citicards.com. If you login to citicards.com, you will get forwarded to https://www.accountonline.com/. By going to that site directly, you bypass the front page, and the great browser-independent Javascript.
Also, call Citicards, and tell them you'll close your account if they don't fix it ASAP
Del.ico.us
Lets Go Green…. Conserve EnergyThe first search results page raised my suspicion:Google is the second Brain to many of us. We use it frequently. It uses white screen which consumes high power.
Read the following.........
If Google had a black screen, taking in account the huge number of page views, according to calculations, 750 mega watts/hour per year would be saved..!!!!!!In response, Google created a black version of its search engine, called Blackle, with the exact same functions as the white version, but obviously with lower energy consumption:
well done Google!!!!!
Help spread the word. Please use
www.blackle.com
Now, Google displays its ads to the right of the page, not top, and does not call them "Ads by Google". Instead they are called "Sponsored Results".Next thing was checking the whois entry for the domain:
Registrant:
Update: I made a mistake in the registrant... although it doesn't change the end result:
The real registrant of blackle is:
Registrant:
Heap Media
PO Box 4078
Castlecrag, New South Wales 2068
AustraliaNavigation Catalyst Systems, Inc
2141 Rosecrans Ave.
Suite 2020
El Segundo, CA 90245
Email: domainadmin@navigationcatalyst.com
Phone: 3106471592
Fax: 3106476001
Domain Name: BLACKEL.COM
Hmm, and where exactly is Google here? Seems like a Google rip-off!!
BTW, having the screen black doesn't save you much power. For LCDs, most of the power is consumed by the backlight, which remains on no matter the pixel is black or white.
Del.ico.us
I started working on a python script that can translate those fonts to Unicode, and it was going well. But halfway through, I realized someone has already done this, and it is already available as a Mozilla extension.
The extension is named padma, and it's targeting different Indian languages. Works great on Firefox. The download page is here. You'll need to restart Firefox after installing the extension.
Del.ico.us
So what's the big deal!! Write the list down, and take it with me? Unfortunately, pen and paper is not that handy, especially with a two year old running around trying his best to snatch away each and every pen he can.
Okay, pen and paper is not the problem, the problem is, I needed an excuse to do something geeky about the grocery list. What I wanted to do is, quickly type up the list on a [shell|vim|editor] window, and quickly send the list to my cell phone over bluetooth.
Now, there are many apps available for similar thing, but I find almost all of them too heavyweight for just this. Especially, if I have to fire up a GUI for this, it's too many mouse clicks to be simple enough.
Then again, what are shells for (personally, I think, the coolest thing in a *nix environment is its shell and scripting prowess).
Here is what I did:
- First, I need the necessary stuff installed for my Ubuntu Laptop. Just do:
sudo apt-get install obexftp
- Now, I need to find my phone. Run the following command:
~$ obexftp -band you should see output like:
Scanning ...identify the line by name that is your phone.
Using 00:18:xx:xx:xx:xx W810i
- Test out you can really send a file across. Create a file, say, grocery.txt, and send it to the phone by the following command:
~$ obexftp -b 00:18:xx:xx:xx:xx -p grocery.txt
The interesting thing to note here is, different phones store the file in different locations, based on their make and configuration. For example, on my Sony Ericcson W810i, it stores on the memory stick under Webpages/Saved pages category.
Why is this important? Because, when you create a new grocery list, you should be able to replace (remove + add) the older list. For that, knowing the location is necessary.
- Find the real location on the phone. The phone, on its interface, can show a different UI to access the file than the real directory structure that it exposes over bluetooth. Use the obexftp's -l command to browse the directory structure. For example, see the session below:
:~$ obexftp -b 00:18:xx:xx:xx:xx -lSo, at this point of time, I know that my grocery.txt has been sent to the directory "Memory Stick/MSSEMC/Media files/webpage/saved_pages"
Browsing 00:18:xx:xx:xx:xx ...
Channel: 7
Connecting...done
Receiving "(null)"... &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&gt;
&lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&gt;
&lt;folder-listing version="1.0"&gt;&lt;folder name="Phone memory"/&gt;
&lt;folder name="Memory Stick"/&gt;
&lt;/folder-listing&gt;
done
Disconnecting...done
:~$ obexftp -b 00:18:xx:xx:xx:xx -l "Memory Stick"
Browsing 00:18:xx:xx:xx:xx ...
Channel: 7
Connecting...done
Receiving "Memory Stick"... &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&gt;
&lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&gt;
&lt;folder-listing version="1.0"&gt;&lt;parent-folder/&gt;
&lt;file name="MEMSTICK.IND" size="0"/&gt;
&lt;file name="MSTK_PRO.IND" size="0"/&gt;
&lt;folder name="DCIM"/&gt;
&lt;folder name="MP3"/&gt;
&lt;folder name="MSSEMC"/&gt;
&lt;/folder-listing&gt;
done
Disconnecting...done
...
:~$ obexftp -b 00:18:xx:xx:xx:xx -l "Memory Stick/MSSEMC/Media files/webpage/saved_pages"
Browsing 00:18:xx:xx:xx:xx ...
Channel: 7
Connecting...done
Receiving "Memory Stick/MSSEMC/Media files/webpage/saved_pages"... Sending "Memory Stick"... Sending "MSSEMC"... Sending "Media files"... Sending "webpage"... done
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&gt;
&lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&gt;
&lt;folder-listing version="1.0"&gt;&lt;parent-folder/&gt;
&lt;file name="todo.txt" size="0"/&gt;
&lt;file name="grocery.txt" size="11"/&gt;
&lt;/folder-listing&gt;
done
Disconnecting...done
- Now, your script should be like the following. Running it would fire up a vi to enter the list. Replace that line with whatever your favorite editor is (Kate??). Also, remember to replace the PHONE_ADDRESS with bluetooth address of your phone, and the PHONE_PATH with the path you discovered (the one below should work for W810i's with a memory stick). Good Luck!!
#!/bin/bash
export GROCERY_FILE="grocery.txt"
export PHONE_ADDRESS="00:18:xx:xx:xx:xx"
export PHONE_PATH="Memory Stick/MSSEMC/Media files/webpage/saved_pages/$GROCERY_FILE"
export EDITOR=vim
# First create the grocery list.
#
if [ -f $GROCERY_FILE ]
then
echo "File $GROCERY_FILE exists... Re-Editing";
fi
$EDITOR $GROCERY_FILE
if [ -f $GROCERY_FILE ]
then
echo "Removing $GROCERY_FILE from phone location $PHONE_PATH";
obexftp -b $PHONE_ADDRESS -k "$PHONE_PATH" 2&gt; /dev/null
echo "Adding $GROCERY_FILE to phone";
obexftp -b $PHONE_ADDRESS -p $GROCERY_FILE 2&gt; /dev/null
if [ $? -eq 0 ]
then
echo "Added file to phone successfully. Go Shop!!"
else
echo "Failed to add list to phone. Search for paper and pen!!"
fi
else
echo "File $GROCERY_FILE Does not exist... Aborting.";
fi
Del.ico.us
After a long long time, yesterday I watched a movie that does justice to the book it's based on, if not supersedes. It's NameSake by Mira Nair.
I have read the book before watching the movie, and expected the movie to be slow. However, I came out quite surprised. It was a reasonably fast movie, with awesome acting and reasonably good editing. Tabbu and Irfan Khan were superb, so was Kal Penn (of Harold and Kumar fame). A must watch.
Del.ico.us
Tara Tiny is here.
From the report:
The Tata Nano is no longer the world's cheapest car! Jostling along with Tata Nano, this July, will be Tara Tiny and Tara Titu. These are zero emission, electric cars and cost only Rs 99,000! And they come from the Tara International stable.Although I haven't done the calculation myself, this seems very interesting:
"Now, people are driving fuel cars at an average of Rs 6 per km. One can drive our cars at 40 paise per km."Specifications are here:
Specifications of Tara Tiny are as follows:
No of seats: 4 Net weight: 850 kg Wheel base: 2150 mm Maximum speed: 50 km/hour Maximum grade ability: 15% Motor power: 3 kw Battery voltage: 6V*10 Recharge duration: 8 hours Driving charge: 120 km Ground clearance: 150/mm Running cost: 40 p/km Battery capacity: 200/Ah
Del.ico.us