Coherent Blah's
I've been noticing Firefox using up a lot of CPU lately. At any given time, I normally have about 3 to 4 firefox windows with about 5-6 tabs in each open. But with no activity in them, there should not be much CPU usage. On a hunch, I installed flashblock, a firefox plugin to disable showing flash apps automatically. Instead, it shows a blank rectangle, with a play button in the middle to start the flash app. Installing this made a dramatic effect, and soon I realized this is due to the n number of flash advertisements in different websites. I probably had about 10-15 flash apps playing at the same time, none of them really useful to me. Would highly recomment this add-on. 
Del.ico.us
  As part of my job, I work with a huge source tree structure. In last count, the tree has more than twenty five thousand directories and subdirectories. To get from one part to another in the tree, I use a set of aliases and bash functions. One of them is the following "goto" function.
  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
   One of the applications that I find lacking in Linux is a full featured blogging client. There are a few like BloGTK, blokkal etc. but they are far from being fully featured. There are some plug-in based variants, like Scribus, but I'm not much of a fan of it. The online native posting is still more fully featured than any of these.
   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.
mt_Quickpost.jpg


Del.ico.us
   Netflix now has a set-top box named "Netflix Player" with the coveted "Watch Now" in collaboration with Roku. The idea is good, the price, at 99$, is right, but the problem is, the home entertainment real estate is very limited, and it's just not feasible to add one box for each specialized application. Let's look at it. A normal home theater setup will have a DVD/B-Ray player, a Cable/Sat settop-box, a Game console, an Audio receiver and possibly a DVR like Tivo.That's four to five boxes already. Who wants to add another box to the mix, especially if it looks so ugly:


  The best thing for Netflix would be to get in collaboration with one or more of the set top boxes/game consoles. I'd love if they provide a "Watch Now" client for XBOX 360, and use it more often.

  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
For some time now, the smarties at citicards.com have written some oh-so-cool javascript on their front page that stops it from loading well in Firefox or Konquerer , at least not without disabling Javascript. I can understand a mistake or two here and there, but the frontpage? That also for months? What are those folks thinking!!
Here is how it looks on Konquerer after loading.
Citicard_b.jpg

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
Got this in mail:
Lets Go Green…. Conserve Energy

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
The first search results page raised my suspicion:
Blackle.jpgNow, 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
   Australia

Navigation 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
    One of my major gripes after moving to full-time Linux was, I can't read the Bengali newspaper Anandabazar online anymore. They, absolutely utterly moronically, use a proprietary font (I'm sure someone there paid for it), which does not offer ANY extra advantage over using Unicode Bengali!!
     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
    Okay, confession time. However much I try to, I cannot remember the grocery list after I reach the store. The best I can do is, count the number of items before leaving home, remember that, and try to come up with as many items at the store to meet that number, and then call wifey to fill up the gaps. I blame NPR that I listen to on my way for this temporary amnesia. It's just more interesting than my grocery list.
    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 -b
and you should see output like:
Scanning ...
Using 00:18:xx:xx:xx:xx W810i
identify the line by name that is your phone.
  • 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 -l
Browsing 00:18:xx:xx:xx:xx ...
Channel: 7
Connecting...done
Receiving "(null)"... &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&amp;gt;
&amp;lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&amp;gt;
&amp;lt;folder-listing version="1.0"&amp;gt;&amp;lt;folder name="Phone memory"/&amp;gt;
&amp;lt;folder name="Memory Stick"/&amp;gt;
&amp;lt;/folder-listing&amp;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"... &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&amp;gt;
&amp;lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&amp;gt;
&amp;lt;folder-listing version="1.0"&amp;gt;&amp;lt;parent-folder/&amp;gt;
&amp;lt;file name="MEMSTICK.IND" size="0"/&amp;gt;
&amp;lt;file name="MSTK_PRO.IND" size="0"/&amp;gt;
&amp;lt;folder name="DCIM"/&amp;gt;
&amp;lt;folder name="MP3"/&amp;gt;
&amp;lt;folder name="MSSEMC"/&amp;gt;
&amp;lt;/folder-listing&amp;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
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"&amp;gt;
&amp;lt;!--
XML Coder, (C) 2001 Sony Ericsson Mobile Communications AB
--&amp;gt;
&amp;lt;folder-listing version="1.0"&amp;gt;&amp;lt;parent-folder/&amp;gt;
&amp;lt;file name="todo.txt" size="0"/&amp;gt;
&amp;lt;file name="grocery.txt" size="11"/&amp;gt;
&amp;lt;/folder-listing&amp;gt;
done
Disconnecting...done
So, 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"

  • 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&amp;gt; /dev/null
echo "Adding $GROCERY_FILE to phone";
obexftp -b $PHONE_ADDRESS -p $GROCERY_FILE 2&amp;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

Namesake

| | Comments (0) | TrackBacks (0)

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
Apparently Tata Nano doesn't hold the World's Cheapest Car status anymore. There is a new kid in the block, and it's electric. Thus, the issue of pollution on crowded Indian roads is moot, though the question of the transport infrastructure being able to support it remains.
 
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