eXTReMe Tracker
Dec 222014

The purpose is to to convert a 3-dimensional image file which contains X,Y and the dimensions containing RGB values to a 2D image file in grayscale. It can be done in linux command line using imagemagick.

convert <img_in> -set colorspace Gray -separate -average <img_out>

The resulting image is a 2D image generated by averaging the R,G,B arrays.

Sep 162014

Every once in a while as you are trying to make a .iso file from a DVD using Brasero, you might get an error saying that couldn’t retrieve the keys because of libdvdscc2.

An alternative to that is a command line tool called dvdbackup which first needs to be installed

sudo apt-get install dvdbackup

After installing that program, you can make backup of your entire dvd, unfortunately not an .iso. You can create an iso from the folder that gets generated once you backup the dvd using dvdbackup. To create a backup, open your terminal and run:

 dvdbackup -M -i /path/to/dvd/  -n Title_For_Backup -o /path/to/output/directory

To get help of dvdbackup you simply have to type in dvdbackup at the terminal.

Oct 292012

As it turns out the if statement in bash isn’t as friendly towards floating point variables as it is for integer and string variables.

First of all the -gt and -lt switches don’t work.Even the unary operators >,<, etc. don’t work. The only way is to do a comparison between the floating point variables using bc and using the logical outout as a comparison string.

a=11.5; b=11.3
compare_result=`echo "$a >$b" | bc`
 if [ $compare_result -gt 0 ]; then
 echo $a
echo $b


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.


Mar 152011

If you are on a network that has MAC addresses hardwired, i.e. you can only access the network if a certain MAC address is plugged into a specific ethernet jack on the wall, you don’t have too many options.

One option I used recently is spoofing the MAC address of your device. Its done by editing the hardware address to match the MAC address of the device that’s allowed on that ethernet jack.

If you are using Linux, make a note of your current IP address in a text file.

sudo ifconfig -a | grep eth0 > ~/Desktop/netaddressbak.txt

Run the same command on the device that’s attached to the network to find its MAC address: Lets say its – 01:82:39:B2:41:30

Before you attach your new device to the ethernet cable, change its MAC address to the one listed above.

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 01:82:39:B2:41:30
sudo ifconfig eth0 up
sudo ifconfig eth0 | grep HWaddr

This should now list the address as 01:82:39:B2:41:30.

You can now attach this device on the network to gain full connectivity (unless there are some programs that are supposed to ping every once in a while).

Oct 262009

Its not quite obvious how to change the default size of gnome-terminal from the gconf-editor menu. The terminal itself is a subset of xterm. Gnome-terminal is an xterm emulator, and it follows a termcap file for this.

On gnome based distributions (Fedora/SUSE/Debian/Ubuntu etc.) do the following:

sudo gedit /usr/share/vte/termcap/xterm

There’s a lot of stuff in this file you probably don’t want to touch, but you can change the line that describes the terminal geometry:

xterm-xfree86|xterm-new|xterm terminal emulator (XFree86):\

:co#80 specifies 80 columns, and li#24 specifies 24 lines. Change this to 100 and 30 or whatever you want.


Now all terminals should open for this default size.

Adopted from a post on Fedora Forums.
Jan 302009

Until today’s kernel update to, the Atheros wifi card was not functioning correctly. Since the update to new kernel, the wifi card can now be used with the ath5k module which can be found in linux-backports-modules.

In order to get the Atheros 5007EG card to work, you first need to disable the built-in hardware driver.

System >> Administration  >> Hardware Drivers > Deactivate “Support for Atheros 802.11 cards”

Selection of Hardware Drivers in Januty

Selection of Hardware Drivers in Januty

Disable the Support for Atheros 802.11 cards

Disable the Support for Atheros 802.11 cards

After the card has been deactivated, open the terminal and install the backports modules for Jaunty.

sudo apt-get update && sudo apt-get install linux-backports-modules-jaunty

Install Jaunty backports modules

Install Jaunty backports modules

This adds the ath5k module which supports the Atheros 5007EG card.

The computer needs to be Shutdown and powered back on. Somehow Restarting doesn’t work at times. The card has to be completely powered down for a few seconds and then started during power up.

You should be able to see the available wireless network list by clicking on the network manager icon. Thereon, you all know what to do :)

Jan 212009

The norm has been to watch live streams over the internet if you are unable to watch a certain program on your TV at a scheduled time. The limitation of these live streams is that you can’t afford to miss anything, cause there is no way to rewind and replay.

Under Windows there are several tools that can capture live streams and save them to a file. These streams are usually broadcasted over the mms:// protocol. Oftentimes, this protocol is wrapped inside a .asx or .wmv wrapper. These wrappers have the information required to fetch the streaming media, either live or recorded.

There is an application in the Universe repository since Gutsy which enables us to store the streaming media as a local file. Its called mimms, and under Intrepid Ibex its running on version 3.2.1-1.

If your universe repository is enable, you can install mimms using aptitude:

$ sudo apt-get install mimms

Using mimms to record streaming media

Using mimms to record streaming media

Once the program is installed, you can do recordings of mms:// streams via terminal. The link of currently streaming video can usually be obtained by right-clicking on the video window and copy-link. To start recording type the copied mms:// link as an argument for mimms, which starts saving the streaming content to your /home/user folder.

$ mimms mms://cnnvideo.streamserver.asx

It displays the size of the output file in real time. You can stop the recording at any time by ctrl-c without damaging the file. This file can then be played using the media player of your choice.