eXTReMe Tracker
Jan 112013

To get the stock quotes for NYSE listings create some file named stockval and add it to your PATH.

Then gedit the file with the text:


p=`printf "curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=$1&f=l1'"`
price=`eval $p`;
echo $price












Make that file executable

chmod +x stockval

Close out, and open a terminal. If you have the path correctly configured, execute the stockval command using the company symbol as an argument and it returns the stock price on the line below.

stockval goog

732.15 << output
Aug 082012

Here’s a nifty little script I found.

You need to run it within the directory containing the wma files:


current_directory=$( pwd )

#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done

#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done

#convert file names
for i in *.wma; do mv "$i" "`basename "$i" .wma`.mp3"; done

rm audiodump.wav

If you aren’t happy with underscores and want your spaces back, run this on the command line:

for i in `ls *.mp3`; do p=`echo $i | tr '_'  ' '`; mv $i "$p"; done

They will be in the proper format now, and google music compatible.

Mar 042012

As a prank project we installed a webcam at the front desk of the our office suite, and plugged it into a Linux machine. Then we had a decommissioned 14 inch monitor face the person who was just walking in so that he/she could see themselves in the monitor with absolute clarity. The text beneath said “Smile for the camera”.

This was an one line implementation with VLC. The terminal command for this would be:

vlc --sub-filter "marq{marquee=\$t \$\smile for the camera,color=16776960,position=8}" v4l2:////dev/video0

A false sense of security with some false video surveillance. Of course you can save the stream and turn it into real surveillance.


Nov 092011

Some .avi files tend to have an out of sync audio track, some can’t be scrolled through (forward/reverse), while others might show an message that says the index file needs to be recreated.

Solution is to create a copy of that file that has an index recreated and remove the original and save the copy and all the usual replacement methods.

mencoder -idx files1.avi -ovc copy -oac copy -o file2.avi

Here file1.avi is the input file, and file2 is the output file with corrected index.

Aug 282009

When you are mostly involved with coding, and use the Terminal for a fair amount of time, it’s quite beneficial if we use another Terminal window/tab for IMs. Searching around for a command line instant messenger, I learnt that there was a variant of Pidgin called Finch. It lets you connect and chat with your online buddies using nothing but text.

To install finch on Ubuntu, run:

sudo apt-get install finch

at the Terminal.

Once Finch is installed, you can load it by typing, finch at the Terminal.

Finch Buddy List

Finch Chat Window

Finch Chat Window

Different commands to access and configure finch can be found at:

Using Finch

Jun 262009

Since the analog TV signals have been discontinued in most cases throughout the country, the only way to catch TV signals is to have TV which can capture and process digital transmission, or if you subscribe to cable. Since I’m not too terribly interested in watching TV, there was no point in investing in a new TV and subscribing to cable was totally out of the question. The option then was to get the reception on my desktop computer.

The solution was to get a cheap ATSC tuner which plugged into the USB port and which had a loop antenna for reception.

ATSC digital Tuner Antenna

ATSC digital Tuner Antenna

The antenna plugs into the USB port through a TV tuner card. The one I own is an Artec tuner card. I learned after I purchased it that it didn’t have support in Linux yet. Schade!

ATSC USB tuner for tuning digital TV reception

ATSC USB tuner for tuning digital TV reception

Once the hardware is setup is complete, we can get the local TV station information through Windows Media Center. That program pleasantly surprised me. After asking you for your zip code, it connects to a database and gets the TV schedules for all broadcast stations in your city. Then it scans for available channels and sets up a list of stations with their programming schedule.

Options seen under Windows Media Center, including one for Live TV.

Options seen under Windows Media Center, including one for Live TV.

You can either watch recorded shows or watch Live TV.

You can either watch recorded shows or watch Live TV.

Windows Media Center Live TV in action.

Windows Media Center Live TV in action.

Once Windows Media Center has scanned for the available channels, you can watch HDTV right on your own computer. In addition to being a TV tuner, Windows Media Center converts you computer into a DVR, where you can record programs or Pause and Rewind the shows that you are watching in real time. Pretty impressive stuff. Whats more impressive is that the equipment costed less than $30, that includes shipping.

Unfortunately the Artec card can’t be used within Linux since the kernel still hasn’t incorporated the hardware specs of Artec USB tuners  in video4linux (v4l). But I’m pretty sure it will be available pretty soon.

Mar 042009

In our functional imaging lab we have a poster of Electromagetic radiation spectrum. The chart goes from wavelengths corresponding to millihertz all the way up to EHz which is in 10^18 Hz range. It also describes the kind of systems that use those wavelengths, like for example the 87 to 108 MHz range is used for FM radio broadcasting and so on. I wanted to have that poster for myself so I looked around to see where I can buy one online. I found it on Unihedron website.

EM Radiation Spectrum Chart closeup

EM Radiation Spectrum Chart closeup

The person who created the website has the poster available for download – some of them in PDF and JPG formats. The posters are also on sale on that website, and at least as far as the EM radation spectrum poster goes, its available at quite an affordable price on that website.

There were other posters that were equally interesting, if you are into that kind of things. They were:

  • Value of Pi going up to 350,390 digits.
Poster of Pi: Going up to 350,390 decimals

Poster of Pi: Going up to 350,390 decimals

  • Value of e going up to 350,390 digits.

Poster of e with value going to 350,390 digits

Poster of e: Going up to 350,390 decimals

  • Primes numbers: The first 54,222 prime numbers

Poster with 54,222 primes

Poster with 54,222 primes

These are some great posters, especially the one with EM Radiation. Its a wonderful chart to have for reference if you are dealing with higher frequencies like in telecommunications or in medical imaging.


Feb 112009

There were unmet dependencies (libx264-59) for vlc and mplayer in the latest release of Jaunty Alpha. A bug report was filed by several users on launchpad.net

One of the users posted this workaround to get both mplayer and VLC working in Ubuntu (9.04) Alpha 4.

To solve the problem, just get libx264 here:
Just installed it manually (sudo dpkg -i libx264-59_0.svn20080408-0.0ubuntu1_i386.deb)
I then installed mplayer and vlc using medibuntu repos.


sudo apt-get install mplayer vlc

Gets these packages working!