Coherent Blah's
Converting Video/Audio on Linux is a breeze, and there is no shortage of tools. Especially between ffmpeg and mencoder, I can't think of any conversion that's not possible.
However, the problem is finding the right parameters suited for a specific task. There are multiple "wrapper" tools (e.g. Avidemux, HandBrake) that make life a lot easier. However, sometimes, knowing the actual conversion parameters help.

I was trying to convert some videos so that they play on Windows without need for any extra codecs etc. WMV format is the way to go for this. The following ffmpeg recipe seems to be working fine:

ffmpeg -i <input_file_name>  -s <output_resolution> -b <video_bitrate> -vcodec wmv2 -acodec wmav2 -ar 44100 -ab <audio_bitrate> -ac 1 -y <output.wmv>


Example:
ffmpeg -i output.avi  -s 180x120 -b 300k -vcodec wmv2 -acodec wmav2 -ar 44100 -ab 48000 -ac 1 -y movie.wmv
Del.ico.us

  Recently I was playing with couple of link scraping libraries, and was impressed by the simplicity of the mechanize toolkit. The only problem they have is lack of documentation.
  Following is an example script written in python that can do a google search and scrape the result links (of class ‘l’) in a few lines of code.

import re
import sys
from mechanize import Browser,DefaultFactory
import mechanize;

br = mechanize.Browser( factory=DefaultFactory(iwantbrokenxhtmlsupport=True))
br.addheaders = [ (“User-agent”, “Mozilla/5.0 (compatible)”) ]
br.sethandlerobots(False)

br.open(‘http://www.google.com/search?q=’+sys.argv[1])

def arrtonamed(arr):
        ret = {};
        for x in arr:
                ret[x[0]] = x[1];
        return ret;
# follow second link with element text matching regular expression
for link in br.links():
    hash = arrtonamed(link.attrs);
    if hash.has_key(‘class’):
            if (hash[‘class’] == ‘l’):
                print link.url+’[‘+link.text+’]’


A sample output for the script is:

$ python goog.py samya
http://www.thinkbabynames.com/meaning/0/Samya[Samya - meaning of Samya name]
http://www.samyatech.com/[SAMYA Technology : Green Power Expert! 祥業科技股份有限公司: 綠色 ...]
http://www.yawiktionary.com/s/1148371572412.html[samya - definition of samya - yawiktionary.com]
http://samya.indiangeek.com/[[ IndianGeek ] Welcome to Samya's HomePage]
http://www.hossamramzy.com/stars/starsofegypt_samya.htm[The Stars of Egypt ® | Hossam Ramzy]
http://www.belly-dance.org/samia-gamal.html[Samya Gamaal - the queen of raqs sharki]
http://www.samya.ca/[Samya Therapies Splash Page]
http://samya-photography.deviantart.com/[Samya-Photography on deviantART]
http://www.facebook.com/people/Samya_Badraoui/1434855400[Samya Badraoui | Facebook]
http://www.healthgrades.com/directory_search/physician/profiles/dr-md-reports/Dr-Samya-Nasr-MD-EB461FD0.cfm[Dr. Samya Z. Nasr, MD, Pediatric Pulmonology, Pediatrics, located ...]


Del.ico.us
On my impending trip to India, I'm planning to move my family from using Windows to Linux. I have Kubuntu Intrepid Ibex in mind as the distro.
The primary applications for my parents are Email (Thunderbird) & Web browsing (Firefox), both of them work like charm on Linux.
However, my father being a writer, he needs an editor that allows him to write in bengali, a regional language. Now, there is of course the keyboard layouts available for writing in bengali, and generate unicode output, it's not that useful as it doesn't support phonetic input. So, the writer will have to remember the keyboard layout.
Then I found Bhasha, a Java stand-alone application that allows writing in bengali phonetically, and produces unicode output. Problem solved.
Here is a screenshot.

Del.ico.us
This video is about how our brain works... well, some parts of it. This is by an Indian, and it's simply amazing.
Link to Talk
Del.ico.us
  With pretty much all smart phones these days coming with a GPS and Location based services, a cool thing will be to have adaptive Event Reminders based on location. When we add an event to a calendar, normally we specify a time before the event when the reminder will fire. It's not really useful if you are mobile. For example, I have a meeting at my office, and I have set a reminder at 5 minutes before the meeting. However, I went to a Starbucks to grab a latte, and the starbucks is, say, 10 mins from my office. A 5 minute reminder is not going to do me any good, right (unless I have a jetpack).
  However, the phone I have reminder in knows exactly where I am, and has the ability to calculate the distance and time to reach my office (assuming the event location is also geotagged). So, it should add that time to the reminder and fire it based on that. This will be a cool addition for the Android/I-Phone.
Del.ico.us
This talk was simply amazing.

Del.ico.us
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