Category Archives: linux

All your aliases are belong to you 1

I like setting up shortcuts to frequently used commands whether I used Windows or Linux. I use the terminal often and create shortcuts to frequently used commands using “alias” feature of BASH. This has saved me considerable time in the past. However, I recently felt that if I could have a helper tool to monitor [...]

Query Wikipedia from your terminal Comments Off

I refer Wikipedia frequently. I use this BASH function to help me do that from the terminal. For explanation of how this works head over here. BASH function # wiki # eg: wiki India # wiki Apple_Inc # wiki Anglo_Saxon wiki() { dig +short txt $1.wp.dg.cx } Example usage prashanth@prashanth-desktop:~$ wiki India “India, officially the [...]

On setting up USB RAID Comments Off

I bought two Dane-Elec 8GB USB drives recently. Flash memory (as opposed to Hard disk storage) has faster “seek” capability. This is inherent in the design as flash memory is solid state whereas hard disks are electro-mechanical with a “head” that needs to be moved around using a “drive” mechanism. Since seek times are better [...]

XMonad: A Window Manager for “real” people :) 1

I have been a happy Gnome user for many years now and only recently started thinking about switching to KDE 4.2 when Ubuntu 9.04 (Jaunty Jackalope) comes out. However, it so happened that I bought two new widescreen monitors and setup a dual-monitor environment. This is when I started realizing the Gnome was clumsy at [...]

Nose – TDD – Python 2

What, why I’ve been reading up on TDD and it has struck me as particularly useful methodology to achieve “clean code that works”. TDD encourages writing unit tests to cover all the code (because by definition, you write a test before a line of code is written). Because all your code is covered you are [...]

Project Gutenberg Ngram data: English only Comments Off

In my earlier post, I’d posted links to the Project Gutenberg Ngram data I had computed for e-books of all languages. If you are interested in only the English data, get these files instead. These two files are splits of a compressed file which contains all of the Project Gutenberg English e-books downloaded about a [...]

N-gram data from Project Gutenberg 5

I’ve been working on Wordza.com for which I needed Ngram data from a sufficiently large corpus. Initially, I thought of using Wikipedia data which I already have on my disk, but decided on using Project Gutenberg data as it is more representative of the general usage of English language.

Selecting a random row from a table in mysql 9

I have come across more than one instance when I had to select a random record from a table in a MySQL database. Here is how to do it.

Visualizing mpeg4 motion compensation vectors using mplayer 2

The MPEG4 video encoding process makes use of block motion compensation to achieve compression. The motion compensation process serves to produce the intra frames which are the frames between keyframes. I’ve always been fascinated by this process and was delighted to find out that my favorite video player, mplayer, allows one to visualize this process. [...]

Creating video thumbnails using ffmpeg 24

Generating thumbnails/screenshots of a video is useful in many ways. Youtube and many other video sites use this to show a preview of the video as a small thumbnail. Google video captures a series of thumbnails from a video at various time intervals to show a better video preview.

Watching Television on Linux: setting up a TV Tuner card 31

A couple of weeks back, I went shopping looking for a TV tuner card that is compatible with Linux. Googling had told me that “Hauppauge” card was known to be compatible. However, I could not find it anywhere in the market (SP Road, Bangalore, India). On going to one of the shops, I found a [...]

KDE4 on Kubuntu – Impressions and Screenshots 8

I love Gnome and its simplicity and use it regularly. I loathe KDE and its complexity. Although I used KDE about 5 years back, ever since Ubuntu was released, I’ve been using Gnome. However, when KDE4 was announced, I decided to check it out with an open-mind and re-evaluate.

Building a low-cost bad-ass “server” machine 7

I have been playing around with Wikipedia data and tried doing some byte pushing on my Dreamhost web space. Since this is shared web space, the processing power and memory available are limited. I was able to create database tables in mysql by parsing the wiki xml dump and some extra processing as well to [...]

Making Ubuntu 7.10 (Gutsy) look slicker 23

It has been three weeks since I upgraded to Gutsy from the development repositories. Gutsy got released just a little more than a day back. While going through the news from the blogosphere about this event, I wished Ubuntu had released a “non-brown” desktop. I don’t like brown and have seen quite a few others [...]

Ubuntu Gutsy Gibbon and Linux on the Desktop 35

I’ve been using Ubuntu Feisty and waiting to get Gutsy when the release comes out. However my curiosity got the better of me and I could not resist upgrading from the beta repositories. The first thing I noticed after upgrade was the amount of polish and attention to detail. Everything looks slick (thanks to Compiz). [...]

Drawing on your Desktop 5

This is related to the previous post and is meant in part to demonstrate how great Linux is for doing “weird” stuff . This is what we are trying to do. The circles in the background have been drawn by the python script below. To get the script running you should have python and pygame [...]

Matrix Desktop 41

What you see above is how my desktop looks now. You need to be using gnome to get this working. Nautilus draws the desktop (including the icons) for you in gnome by default. We have to tell it to stop doing that, so we can do the matrix animation in its place. Nautilus can be [...]