Evanescent Thoughts

Go Back

Posted in general by Sathya Narayanan on March 14, 2009

If you have come this far , then it means you are wrong . Now Go Back , take a deep breath and start thinking again :)

PS : For those who have no clue what this is all about  ,  this is a clue for the online treasure hunt Klueless for Vortex :) Check it out here

TV Series I covered in my third year :)

Posted in College life, TV Series by Sathya Narayanan on March 11, 2009

Heroes  – 3 seasons

How i met your mom – 4 seasons

Prison Break – 4 seasons

Numbers -3 season

Big Bang Theory -  2 seasons

24 – 6 seasons

House – 2 seasons

Kyle XY – 1 season

Planning to watch All 10 seasons of friends  this summer :)

gstreamer bug in Ubuntu and a temporary fix

Posted in Bugs, College life, Linux, computers by Sathya Narayanan on March 11, 2009

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.

vlcsnap-461622screenshot-madagascar-2avi-vlc-media-player3

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 .

Life and the paradox

Posted in College life, general by Sathya Narayanan on March 1, 2009

It so happens that we are never sure of what we actually want  .  When I’am so free , I used to think , why is life so boring , can’t I have a busy day :P . And when I have my hands full , I think why am I doing all this work . Can’t I just be free for a moment :P   . I am never sure of what I wanted  .  I still dunno why i am posting this , but you  see , something tingled my brain to stop thinking about debugging a code i wrote for the “Pete Mitrichev Contest 3 “  and start writing on some thing . I still can’t  figure out why i have been so dull for the past few days or why my mom keeps saying that ” Nowadays you talk to people only when you dont have your laptop around !! ” ( That includes when i watch some TV Series on the comp too :P ) .Life has changed . In my childhood days , I used to talk a lot to my parents. I used to tell them things that I found funny , things that I found mysterious and things that made an evening with a cup of tea pleasurable . I wish I was a child again :) . But  then , there were lots of other things that I wish I got rid off then . Missing things make them special to you .

Things that are very significant and important to us may very well be worth not even a mention to others . I was walking by yesterday and could see a group of people organizing a culturals in a local govt college .  To them what they were doing at the moment , meant a lot to them . But to some one who just gazes at them for a moment , its yet another insignificant thing compared to plenty other things happening around him .  Its just like the view of variables in a block of code . Two blocks that don’t share a common variable are useless interacting with each other  . But then should we be selfish enough to just keep thinking of things that only concern us or can we just lend an ear to some one who  is virtually jumping to tell you something very special to him  ? You never know the exact answer to such questions .

Perhaps this post will look silly to you or to me at some other point of time .:)

A Wednesday

Posted in College life, computers, general by Sathya Narayanan on February 4, 2009

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” :P ( 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  :P )

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.

Nagesh …

Posted in Kamal, movies by Sathya Narayanan on February 3, 2009

nagesh

Tamil cinema’s most versatile comedian passed away few days back . I was  a big fan of him , not to say the millions of tamilians who have seen him act in more than 1000 films. I never knew when i became a fan , nor do i remember if i wasnt anytime  . But he was one who could almost get you onto floors with his great timing and expression of comedy .

Neither was he exceptional comedian but a classic actor who could almost do any role with perfection. Kamal and nagesh shared a bond more than mutual admirers . Nagesh would appear in most of kamal works and few of them were classics ( the villain role in aboorva sagotharargal , MMKR , nammavar , Magalir mattum ) .

Its ironic that the man who made tamil cinema fans roll on floor with laughter  won his only national award for a his expression after the traumatic suicide of his daughter ( nagesh’s) . Watch it over here  and it sure deserver more than just a national award . Some time we miss things so much that we wish we never missed them .

Though he is no more , his works make him feel he is still around us . Only very few people can earn somthing like that.

The easiest way to download Youtube videos in Linux :)

Posted in College life, Linux, computers by Sathya Narayanan on January 31, 2009

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 :P

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 :P . 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 :P . Also if the above method fails in any case…

Tuxventure – Online Linux Event at Pragyan 2009

Posted in College life, Linux, computers by Sathya Narayanan on January 29, 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 .

tuxventure-final

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

Posted in College life, Linux, computers by Sathya Narayanan on January 25, 2009

Have you ever wondered bothering to check on  why windows has so many video converters ( of course the pirated ones :P ) . 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 :P . Its “m”-encoder  :P ) .  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 . :P

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=mpeg4

Below you can see a screenshot of the conversion process :) .

mencoder01

Using “at” command to schedule jobs in Linux

Posted in College life, Linux, computers, general by Sathya Narayanan on January 18, 2009

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:30AM
warning: commands will be executed using /bin/sh
at> echo "I was executed at 11:30AM" > ~/Desktop/temp
at> <EOT>
job 30 at Sun Jan 18 11:30:00 2009
sathya@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 :P . Any suggestions or improvements or new approaches can be put in comments :)