Tuesday, January 31, 2012

TED Talks Download

I am a big fan of TED talks. Usually I like to listen to them while traveling. So far I have been downloading using the "download" button in their website. Today I found a very interesting website which gives links to all TED talks in Metalink standard file format. This can be used directly to search and download videos in high quality using any downloader that supports metalink.

The Metalink file format is an XML file which can be parsed by any xml parser. I use a Python library for parsing the xml and then use good old wget to get the file directly from TED.

Here is a link to the website for getting the metalink file: http://metated.petarmaric.com/

Wednesday, January 18, 2012

Opening vi and command line in same window

One thing I have always liked about emacs is its ability to open a terminal within it. This makes writing programs a lot easier as you can both compile/debug and write a program without leaving your editor. There exists a few plugins to achieve the same in vi, but none of them are stable and platform independent.

Yesterday while going through the gnu screen man page, I found that it supported splitting the screen. Using that functionality, its easy to open vi and terminal in the same window. Here is a screenshot of what I managed to get:

Here is the step by step guide on how to get this:
  1. Open vi in a screen : screen vi
  2. Split the screen by : ctrl+a S remember that the S is in caps, so you might have to press shift+s
  3. Go to the bottom screen by ctrl+a Tab
  4. Create a new screen by ctrl+a ctrl+c
  5. To switch between the split screens, use ctrl+a Tab
Look up the man page on screen in your system for further cool things that you can do. Here is a stort list of commands which I use everyday (other than the ones in top):
  • list all screens : ctrl+a "
  • disconnect a screen : ctrl+a d 
  • reconnect a screen : screen -r screenNumber 
  • list all the running screens from terminal : screen -ls
  • split screen vertically :  ctrl+a |