Index ¦ Archives ¦ Atom ¦ RSS

All your aliases are belong to you

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 ...


Query Wikipedia from your terminal

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 ...

Command-line language translation

Here is a simple utility created using Python for translating text from various languages into English. It uses the Google AJAX API to do this.

Usage

prashanth@prashanth-desktop:~$ translate bonjour
hello
prashanth@prashanth-desktop:~$ translate guten morgen
Good morning

Code

#!/usr/bin/env python
'''
Translates text into english using Google Translate ...

On setting up USB RAID

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 ...


Extracting relevant text from HTML pages

Some time back I had done some work on extracting topics from an arbitrary piece of text using Wikipedia data. Recently I thought of a concept to put that algorithm to work. As a part of this project, I need to extract relevant text from an arbitrary HTML page. By ...


Clustering Data using Python

As a part of a project I am working on, I had to cluster urls on a page. After some light googling I found, python-cluster. You can find below a simple python script to illustrate the usage of python-cluster library.

Code

import pprint
from difflib import SequenceMatcher

# http://python-cluster.sourceforge ...

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

XMonad in Gnome 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 ...


Microsoft Surface: Some Videos

I had written earlier about my experience with Microsoft Surface. I’ve captured some videos of me using it. Here they are …


My Dual Monitor Setup

Greetings webizen, I tried hard to get back to my blogging schedule but my laziness got the better of me. I am back truly with a new batch of posts which I will publish over the next few days.

Recently, I went to Veveo’s main office near Boston, USA ...


Microsoft Surface Unboxing

Today, we received the shipment from Microsoft at Veveo. If you have not heard of Microsoft Surface before, It is a touch screen based computer embedded in a table. The surface of table is illuminated from underneath by a projector (rear-projection) and touch input is implemented by reflecting IR radiation ...


Determining the difficulty of Arithmetic Operations

kid math
problemI am trying to write a program to test my arithmetic skills. The program should pose arithmetic problems involving the four basic operations - addition, subtraction, multiplication and division. When the testing session starts, the program should issue ...


Even a python can be abused

python
abuse

The first programming language I coded in is QuickBasic. I loved the simplicity and especially the IDE. It made things simple for a starter. Later I discovered Visual Basic which extended the same simplicity and added the “Visual ...


Nose - TDD - Python

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 ...


Wordza - A Smart Word Quizzer

I’d thought of making a word quizzer as a web application to improve my vocabulary when I took the GRE test a couple of years back. I’d written one in Visual Basic 6 when I wrote SAT :), but desktop applications are boring!

I got inspired to bring my ...


Selecting a random row from a table in mysql

database

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.

The simple but slow method

SELECT * FROM mytable ORDER BY RAND() LIMIT 1;

Although simple, the above query can be very ...


How to generate domain names, place names … product names ?


One of the trickiest and enjoyable parts of starting something new (be it a website, project, band) is naming it! Sometimes a good name can be quite elusive and cause more than the deserved share of brain ache. Here is a list of automated services around the internet that will ...


Visualizing mpeg4 motion compensation vectors using mplayer

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 ...


Creating video thumbnails using ffmpeg

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 ...


Songza - music search engine and jukebox

songza

Every once in a while, someone comes up with a way of doing things in an extremely obvious and simple way. When this happens, a zillion others say, “of course that’s the way to do it!”. Songza is a music search engine and jukebox that is dead simple to ...


Rendezvous with Rama - Goodbye Mr. Clarke

I am a huge fan of the science fiction genre. Arthur C Clarke is one of my favorite science fiction writers after Isaac Asimov. It saddens me to have learnt that he has passed away. Most people get reminded of “2001: A Space Odyssey” when they hear the name Arthur ...

© Prashanth Ellina. Built using Pelican. Theme by Giulio Fidente on github.