Jaunty Jackalope Review
Ever since jaunty released , I had cleared made up my mind not to try it out. I thought 6 months was too little time to spend with intrepid . I was completely configured and running smoothly on intrepid that I never felt the need for upgrading to the next version though I heard about the new notification system or the awesome boot up time . But yesterday night , I was crazy and wanted to do something and installed jaunty
. So this is sort of my review. Now what made me so crazy was that , I had failed in all my attempts to install amarok 2.1 in intrepid . It just wouldn’t install . All it did was install amarok 2.0.1 and i downloaded the source of 2.1 and compiled and tried to install. Still failure . So I was determined to do something successful and was convincing myself about the upgrade . So then came the confusion of whether to go for kubuntu or ubuntu . Because some of the kubuntu plasma screen shots were just awesome and inviting . I some how settled with ubuntu and gnome .
At first , the Live CD itself was fast . I couldnt see any lag and I tried to see if it had the latest drivers for my nvidia graphics card ( this sort of screwed the first boot after my installation ) . It downloaded the drivers succesfully and thinking it was a normal install , had asked me to restart . I chucked it and went along to install jaunty and the installation was also quick . Using Ext4 now . And then the first boot struck the panic .
Since I had downloaded the nvidia drivers in my live session to check if drivers do exist, it had downloaded it on to the RAM and marked it to be used on the next boot which happens to be my first boot after installing . But sadly the downloaded drivers are no more because it was temporarily on RAM and the Xorg crashed saying not able to find the nvidia driver modules.I recovered from that and then went on to configure the system ( first update in FB that I am into jaunty now ) . Then I went on to download the proper nvidia drivers this time on to my / and enabled it . Installed compiz , and transferred all the config files from intrepid that I had taken back up to jaunty . All my themes and Icons , fonts , splash screens , GDM s from intrepid are now on jaunty . In about 2 hours , I was totally settled with Jaunty . This is what I really liked about Ubuntu when compared to Fedora . If I was doing the same process in Fedora , it would have taken me easily about a day or more . I got everything installed in Jaunty in a Jiffy from realplayer , texmaker , vlc , amarok , php5 , falsh players and stuff . Did all changes to bashrc , fstab , etc etc .
In general , I was really happy to have switched to Jaunty for the following
1. Awesome boot up time . It booted off in some 20-25 secs .
2. The system was a bit fast now .
3. Ext 4 is something new
4. The new notifications
5. The new usplash and GDM .
6. Was surprised to see the new Xorg server work fine without any of the so called reported probs .
I don’t think I had any probs apart from the initial nvidia screw up and one pidgin screw up . I had added a buddy pounce in my pidgin to shut down pidgin when this somebody@gmail.com comes online . And looks like the pounce was activated each time I tried starting pidgin and that “somebody” was online . Gave some segmentation fault because I was trying to kill pidgin from itself I guess . Apart from all these jaunty looks new and exiting and yeah , I finally had amarok 2.1 in my jaunty and it was making good progress towards to a stable release with all features of amarok 1.4 . From now on , I guess all that is between upgrading from one ubuntu release to another is just 4 hours of work and a really fast internet connection
And I am mirroring the repos for jaunty from IIT M tomoro . So ppl who need it can get it from me
.. or I ll put it up in coll when I am back ![]()
Any reviews or followups , leave it in comments please .

Making a Screencast in Linux !!
Making small utilities in Linux is fun . There are a hell lot of small tools in linux that when you put together , make cool things. I made a few this week when I was bored after watching “House” continuosly.
There are three things I am gonna put up here .
- Making a screencast of your desktop .
- Making a recursive video
- Opening a man page in a pdf viewer .
1. Making screencast of your desktop :
The main motivation behind this is Topcoder and Petr(yeah the target red coder … he is an Alien too ) . Petr used to screencast his topcoder matches to the world . So I started looking into the net for tools to capture my desktop as a video file ( not that I wanted to screencast my topcoder matches . Would be pathetic
) . So I came across a couple of GUI’s for windows and then Abhilash was out looking for the same thing ( may be his screencast would be interesting . He types at an amazing 90 wpm
) . By this time I had got my hands on this tool ffmpeg which had the option to grab the video from anything . So little bit of googling lead me to a site which gave me this
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq ~/Desktop/out.mpg
But sadly this didnt work for me . And then I went on to read the man pages of ffmpeg and this is when i found it buggy to read the man page of a big command in terminal and I went on to create a small utility to open man pages in evince (later on this ) . But this command didnt work for me and gave some error in the input format. Reading the man pages, -f is for forcing the source format which is “grabbing the X11 display ” ( the desktop of X actually ) . The -s argument is for the output video resolution size and found that setting it to wxga was the mistake . I changed it to suit my resolution which is xga . -r is for the frame rate in fps . -i gives the input file which in our case is the :0.0 display . -sameq says the ffmpeg to use the same video quality as produced by the source. You might wanna remove this incase you want a video file of small size. And finally this command worked
.
ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq ~/Desktop/1.mpg
Now , this is not an easy command to write and I wont be needing it often . So , I thought why not make a script out of it . So put the following in a file and named it as “capturevideo” and changed the command to
ffmpeg -f x11grab -s xga -r 25 -i :0.0 -sameq ~/Desktop/$1.mpg
so that I can get the output file name from the command line . Now all I had to do was export my PATH variable to make it search my /home/Sathya/Tools folder where I have kept all these small tools . Opened my .bashrc file and added
export PATH=$PATH:/home/Sathya/Tools
and then finally did a
chmod u+x /home/Sathya/Tools/capturevideo .
And Bingo !!! capturevideo sample created a sample video of my desktop operations . I actually made a recursive video out of it
.
2. Making a Recursive video using Step 1 :
Actually I stumbled upon this by mistake . Follow the following steps to make a recursive video .
- Run the above capturevideo command .
- Open the video file that is being created while the command is still running and put it to full screen
- Keep watching till you feel you have recursed enough in the video
.
Now press a ‘q’ in the prompt of capturevideo and enjoy watching the recursive video . Here is a screen shot of my recursive video
. This will create a linear recursion . In case you wanna double up, open it in two players and capture .

3. Opening a man page directly in your pdf viewer.
I had already blogged about a part of this here on how to convert a man page to pdf here . Basically man has a -t option which creates the ps form of the man pages . I redirect that to a file and store it as a post script file and use the ps2pdf utlity to convert the file to pdf. Till now is what i usually used to do . But this was getting irritating since each time I had to delete the files created after I am done viewing the page. Hence this is what I did .
man -t $1 > /tmp/$1.ps ps2pdf /tmp/$1.ps /tmp/$1.pdf evince /tmp/$1.pdf rm -rf /tmp/$1.ps /tmp/$1.pdf
Now we store this in a file called manpdf and then do the following to give it permissions to execute .
chmod u+x /home/Sathya/Tools/manpdf
And from now on , doing a manpdf ls would directly open the man page in evince and after you are done reading the man page , it will delete the temporary files created in the /tmp folder. Is’nt that really simple
Any more easy utilities are welcome as comments
.
gstreamer bug in Ubuntu and a temporary fix
Off late I found that some of the movies that I downloaded from the internet played really wierd . The quality of the movie was good but the colors seem to be distorted and there used to be a green band . Look at the pics below . The one in the left is how the actual movie is supposed to be and the one in the right is how it appears.


Few things I tried out to fix this :
1. I thought it was the problem with the video i downloaded because not all videos had this prolem . So I tried using mencoder to convert to other formats and fix the video . Didn’t work
2. Tried re-downloading and changing my torrent managers . Miserably failed
3. Tried playing in all sorts of different player . All of them had the same problem . Now I was sure it was not a problem with the codecs used nor the player.
4. Booted in windows and tried playing . Worked perfectly fine. So I was sure the problem was still with Linux .
In the mean time I had deleted a couple of movies because I really got irritated because of the problem .
This is when googling struck me and I found out about the gstreamer bug . GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing.
Tried meddling with the properties of gstreamer from the command line . No effect
Finally did the following
sudo apt-get remove totem-gstreamer
sudo apt-get install totem-xine gxine
Yippe !!! All videos worked fine with the new players using the xine engine
. I hope they get to the bug fix soon . Mean while you can log your complaints at http://bugzilla.gnome.org/show_bug.cgi?id=357741 and please mention any fixes you get to know . One of them involving changing gstreamer properties seems to work for some .
A Wednesday
This post was supposed to be a big one telling the wednesday story of mine.. I even wrote half a page .. but changed my mind and scrapped it all off..I am gonna put it in a nut shell
1. Working in sun lab in the early hours of day ( like 3.30 in the morning) is totally fun .
2. There are few things that can get classes cancelled and one of them is ” no water in hostels”
( got the whole morning hours cancelled !! ) .
3. I am to some extent good at carrom and I love playing the joker ( to knw more about the fun of being a joker in carrom ask venki and vi
)
4. Never try to cross the first year fence by taking the cycle over it .. You can get oil spilled on your clothes …
5. Writing in latex is fun after the initial hiccups.
6. Never give yourself to something that you dont plan to do in any case.. Now I am struck up with a prog contest that would run only on IE and has no description of any sort.
7 . And whn the time is 7 in the evening and u have an event to manage at pragyan , its time to get settled in sun lab with laptop
Now go back to step 1
I never thought I could stay for a week without watching a movie or tv series.
The easiest way to download Youtube videos in Linux :)
Have you ever wondered to write an application to download a youtube video in linux ?? If you are too geeky , u can do something so complex like , use awk ( which is string processor ) to download you tube videos ( refer this ) . But i am in no position to learn awk just to download youtube videos.So i happened to get to my /tmp folder and realised that a cp command would do the job
Lemme first point out that this method would work for any video that you can watch on your firefox browser ( or any other browser for that matter ) .
All i am gonna do is use a cp command to download youtube videos. Some times things are so simple in Linux you see.
Say you are watching a youtube video in firefox and want to download , you need to do the following .( Donot close the page that hosts the video )
1. Let the video to load completely .
2. Once the video gets loaded completely, open your terminal and do the following :
a=`ls /tmp/Flash*` && cp $a ~/Desktop/1.flv
Voila !!! Thats it .. you are done.. You would find the video in your desktop . Basically when your browser plays the video , it maintains a temporary copy of it in /tmp folder with a name Flash followed by some string . So in case you wanna download , all you have to do is , before closing the site from which you are viewing the video , copy it on to your hard disk
. So simple isnt it ??
In case you have more than one video files in the tmp directory , do the following
for i in `ls /tmp/Flash*`
do
cp $i ~/Desktop/$(basename $i).flv
done
And tht should copy all Flash video files into your desktop.
Leave any simpler ways to do if so in the comments
. Also if the above method fails in any case…
Tuxventure – Online Linux Event at Pragyan 2009
Writing about this takes me back to a year ago when i made my second post about Pengufest at Pragyan 2008
. I was then new to Linux and now looking back , its all nostalgic
.
Tuxventure is an online Linux event , that me and couple of my friends thought of having it for this edition of pragyan. We initially thought of making the event on-site , but owing to technical difficulties , we made the whole thing online. The prelims will be held on February 1st and the Final is to be held on Feb 8th . The prelims will be of MCQ s to test Linux fundamentals and the finals will concentrate on design and shellscripting . So i am hoping to see a great couple of days ahead. Not to forget the days i spent preparing the questions. I hope the participants enjoy the questions
. It was a great venture for me to sit with hari and prepare the ques
And to add to the awesomeness i had an awesome poster designed by eskay for the event .

If you havent yet registered for the prelims do so before Jan 31st. The prelims can be taken any time on Feb 1st .
Site : http://www.pragyan.org/09/home/events/encipher/tux_venture/
Using mencoder to convert Videos in Linux
Have you ever wondered bothering to check on why windows has so many video converters ( of course the pirated ones
) . If you have gone to that extent , you would have realised that the backend for almost all of them is a command line utility called “mencoder”(Its not “men”coder
. Its “m”-encoder
) . There is actually lots to tell about this mencoder . There is also command line player called mplayer which is the counter part of the encoding utility mencoder . mplayer can play all your music in command line and it has support for managing playlist and everything .
To remind you, mencoder was realeased under the GNU GPL and hence as you would expect , there should me more utilities based on mencoder on Linux than Windows. But sadly i exhausted all my resources to finding a suitable GUI for video conversion in Linux . All that i found were small ones that could not handle the full capacity of mencoder. And so was i fed up with this searching process and started to realise why i hadnt tried using mencoder from CLI. I had earlier used mplayer in some occasions . I had this movie which was in VOB format and i wanted to convert it to avi format to reduce the space . I couldnt find any useful repo for video conversion . (If any good ones please let me know ) .
Usually anything you use on Linux is well documented and i would go for the man pages. But i actually cursed myself for typing “man mencoder”. This mecnoder is “WELL” documented that there are 6287 lines of documentation . And thats when i realised the actual power of mencoder . You can almost do anything with a video or audio using mencoder . I could find options for mirroring , rotating the screen and almost conversion from any format to anyother format. But the catch was you will have to do this all in CLI .
So i sat down , scanned through the man pages and foung my exact options for converting from VOB to avi . I would suggest you do this before trying out mencoder .
man -t mencoder > mencoder.ps && ps2pdf mencoder.ps .
This should get you the man pages of mencoder and mplayer in pdf file so that you can read it comfortably .
I cant going into details of mencoder usage because its so big to explain and I havent tried out even 1% of its full options. I am posting below two screen shots of the conversion process .
I executed the following command to convert from VOB to avi .
mencoder ./Mahanadhi/VTS_1.VOB -o ./Mahanadhi/1.avi -of avi -oac copy lavc -lavcopts vcodec=mpeg4Below you can see a screenshot of the conversion process
.

Using “at” command to schedule jobs in Linux
Everything has a strong motivation behind it and the reason i am writing on this is because it made downloading from torrents easy for me during the off-charge hours. I usually had to stay awake till 2 am in the morning and put it for download and then have to get up again at morning 8 to switch it off.I was too lazy to do something and at came to my rescue.And last month i usually dont get up by 8 in the morning and i used to overshoot my 1.5GB download limit.
You can always do the following using cron, but again at has its own speciality. While in case of cron , the job runs at the scheduled frame of time on everyday , at can be used to schedule jobs which dont happen regularly. Like my case, i didnt want to download everyday so had to put the download only whn i am at home
.
So at command works like this
sathya@Phoenix:~$ at 11:30AMwarning: commands will be executed using /bin/shat> echo "I was executed at 11:30AM" > ~/Desktop/tempat> <EOT>job 30 at Sun Jan 18 11:30:00 2009sathya@Phoenix:~$
All the above command does is ,it prints the line “”I was executed at 11:30AM” at 11:30 AM . Since the command is run with a shell of its own, to see any sort of output displayed to the stdout , i redirect it to a file of my choice (~/Desktop/temp).There are many ways to specify the time for the at command . For a complete list on the date day , time formats chk /usr/share/doc/at-3.1.8/timespec which contains the exact definition of the time specifications.
You can now do a simple cat ~/Desktop/temp to read the output after 11:30 AM
.
Now coming to options for at .
Use atq to know the current jobs in queue. Jobs that are running have a status as” =” and jobs to be scheduled have a status “a” .The displayed output is the format <job-id> <Time > <jobstatus> <user>. Each scheduled job has a unique ID usually numbered from 0
sathya@sathya@Phoenix:~$ atq 30 Sun Jan 18 11:30:00 2009 a sathya sathya@Phoenix:~$ Phoenix:~$
To know the command to be executed corresponding to a job id , use the following option of at -c <job-ID> . This displays all the details for the job including the variables used for the shell to be invoked for this job . And hence wht u see mostlty would be junk except for the last line which has the command to be executed. So use a tail option to read tht one alone.
sathya@Phoenix:~$ at -c 30 | tail -2 echo "I was executed at 11:30AM" > ~/Desktop/temp sathya@Phoenix:~$
To delete a job use atrm <job-ID> .
Now for ex ,sathya@Phoenix:~$ at 11:58AM warning: commands will be executed using /bin/sh at> gnome-terminal at> <EOT> job 31 at Sun Jan 18 11:58:00 2009 sathya@Phoenix:~$
The above command as expected is supposed to open a terminal for u at 11:58 . But it doesnt . Because at by default does only console applications. To make GUI apps , all u need to do is a small modification ( thanks to akhil for pointing this out ).
sathya@Phoenix:~$ at 11:59AM warning: commands will be executed using /bin/sh at> DISPLAY=:0 gnome-terminal at> <EOT>job 32 at Sun Jan 18 11:59:00 2009 sathya@Phoenix:~$
At command reads usually the commands from stdin but using the -f option allows us to read from a file.All variables except the $DISPLAY and $TERM are retained from the time the command was put into queue. All these variables and their associated values can be viewed using at -c <job-ID>.In case of using non console applications , u need to specify the $DISPLAY manually as shown above .
Ok so the final thing i ll be doing to start my “transmission bit torrent” at 2.00 am and stop it at 8.00 am is the following
sathya@Phoenix:~$ at 2.00AM warning: commands will be executed using /bin/sh at> DISPLAY=:0 transmission at> <EOT> job 35 at Mon Jan 19 02:00:00 2009 sathya@Phoenix:~$ at 8.00AM warning: commands will be executed using /bin/sh at> killall -r transmission at> <EOT> job 36 at Mon Jan 19 08:00:00 2009 sathya@Phoenix:~$
This solves the job of taking care of my downloads.And for a GUI version of this, use Ktimer. But u will have to kill yourself if u r gonna use it after having something cool “at” you
. Any suggestions or improvements or new approaches can be put in comments
My Microsoft interns interview questions
Thought it wub be useful if i put it down here. There was only one panel. No HR
. The questions were easy .
Before he started the questions, he discussed my written paper. I had made a mistake in the complexity of one of the problem and he asked me to explain and then he went on to ask questions. First one seemed really stupid. When i was asked this question i was wondering what the interviewer had in mind. So here goes the question ” Given an array A of n unique elements from X to X+n , sort them ” . I told him the most obvious O(n) soln of putting the (X+i)th number at the position i . But he asked for some other better solution . This is where i began to doubt if i was making a mistake in understanding the problem. This couldnt be done less than O(n) . So i told the same solution in a diff way .. I said start from i=0 and put the value of a[i] at a[i]-X and put the value of a[a[i]-X] at the corresponding postion and keep doing the same. He was satisfied with this solution though both were same .
The second question was better.Given a cycle of n nodes. Each node has a money Bi and each edge of the cycle has a cost Ci.Now whn i am at a node, i acquire the money at the node and if i have to move to the next node in the cycle , i have to pay a cost corresponding to tht edge. Now the cycle is unidirectional and we define a trip as starting from a node and coming back to it. After explaining this question , he asked me to asnwer for the following.
1. Give a necessary and sufficient condition for a trip to exist.
2. Given 1, give an algorithm to find the start node.
I took some time .. Figured out the necessary and sufficient condition and gave first the brute force O(n²) . And i told him i need some more time to think of better solution. And then i made some reductions and converted it another porblem with linear array and gave a O(n) solution . He then asked me to write a prog for the same. And was looking happy and was thinking for abt 5 mins about my solution and noted down something in his laptop.
The third question was again simple one. He asked me to write a cpp program to insert into a sorted double linked list. I happily gave the code and came out. All those guys who went in after me had come out long ago and were queued up for second round. Most of them were asked some linked list operation or string operations like reversing , concatination. And in the end me and nr, who again was interviewed for some one hour , were sent off telling there were no second round for us. I could see that they were running out of time .
New Year at Theoretical Comp-Sci Lab
2008 ended with a bang for me . With results declared on new year eve , i was delighted to see a 9.64 GPA with all the efforts i put in ( refer this ) .Lots of guys were actually not happy with results coming out on new year eve .The next thing i was happy was succesfully downloading the Ubuntu 8.10 repository using deb mirror from the IIT M Mirror . I had downloaded some 24.8 GB of data in some 2 hours . I am planning to set up the repository back at coll so that we have a local mirror (seperate post on using debmirror coming up ) . With this the new year eve ended on a high and i had made some working solutions for the research problem at hand. It was a overwhleming farewell gift of 2008
.



2009 had a great beginning too.It was much of a surprise . After wishing everybody a happy new year , i was off to lab . I hadnt been doing much of work this winter , so i thought of not wasting the new year day. Also there was supposed to be a class on randomised algorithms by Prof C. Pandurangan which i didnt want to miss . So I reached lab around 10 in the morning . And then I discussed my solution for Private Matching with Prof and Phd students and finally i had some meaningful outcome for my brief winter stay at Theoretical Comp Sci Lab ( i think i have been to lab only for some 10 days in total ).So I finally got a green signal to write my kutti results and i should soon be sending it for a journal publication soon
. Hope it goes on well . I was exited with the new year beginning on a good note .

More fun came when the guys here at lab decided to cut a cake and celebrate new year. So they got 2 cakes ( eggless becos prof is strictly vegetarian) , some snacks and two big bottles of Cool Drinks to lab and soon prof joined us for the celebrations , giving his wishes .We put the camera to a good use and also took pics group wise ( perfect security , provable security , graph theory , game theory ) with professor. It was all fun. The atmosphere was unbeleivable .Something i cant get back in my coll and i enjoyed it completely here . Suddenly people started asking prof for his birthday treat. The guys here actually celebrate 4 birthdays of prof . One his actual birthday , his star birthday , the one in his pass port, and the one in his official records
. And apart from this they also celebrate all transitive closure events of each other’s birthday
. (Looks like its more fun doing research
) .
Soon we were headed to Cafe Coffee Day (yeah CCD
) here, with prof and we were around 20 people . Formed a big circle over there in CCD and the rest is all wht usually happens in any treat
. After the treat we again took pics . In all it was a memorable new year . It was followed by a lecture on Randomised algorithms ( which i am planning to blog on soon ) . No one who sits in Pandurangan sir’s class leaves without getting inspired by the subject that he takes. And so was I.
In all this new year was entirely opposite previous one. On the eve of the 2008 new year , me and my dad met with an accident and we were in CMC Hospital . My dad had a minor fracture in his right shoulder and we came back home only on Jan 1st morning after spending the whole night at hospital .So i am really thrilled with this new year beginning on a high .