Archive for March, 2012

A command-line, interactive mini dictionary

March 29, 2012 Leave a comment

In Google, you can use the search term “define:word” to get the definition of a given word. Google can also pronounce the word.

I’ve made a simple script that gives similar functionalities from the command-line. Usage: just type in a word. The script is part of my jabbapylib library; available here.


Jabba's Interactive Mini Dictionary v0.1.0
q - quit | c - clear
>>> barkeeper
A person who owns or operates a bar for the sale of alcoholic beverages.
(1) Aaron called the barkeeper over and asked for a beer.
(2) The barkeeper was the only human in the establishment; all of the patrons were stout, broad-faced halflings.

It’s not visible here, but the script pronounces the given word too.

The script uses the API of, so you’ll need to ask an API key (free). More info here.

Don’t use sudo with graphical applications

March 29, 2012 Leave a comment

This post is based on a comment of one of my readers called gourgi.

You want to launch a graphical application with administrator privileges. Shall I use “sudo”?

No. In the case of graphical applications, you should use “gksudo” instead. “You should never use normal sudo to start graphical applications as root. You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=~root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by root.” [1]

More info:


Download files with wget from sites that verify your user-agent

March 28, 2012 2 comments

You want to download a file from a given site with your favourite wget utility but you get a “403 Forbidden” error in your face. Of course, everything works from your browser. What to do?

If it works from the browser but it fails with wget, then the site must check your user-agent. If it sees “User-Agent: Wget/1.12 (linux-gnu)” (version may vary), then it simply blocks you.

But don’t fear for a second. Simply fake a different user agent with wget and continue downloading.

Solution 1:

wget --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0" http://host/file.jpg

Solution 2:
If you don’t want to provide a user agent each time, put the following your ~/.wgetrc file:

# custom .wgetrc file
user_agent = Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0


wget http://host/file.jpg

Audio pronunciation of words from Google

March 27, 2012 Leave a comment

Amit Agarwal has a nice post entitled “Download the Audio Pronunciation of Words from Google“.

In short
Take the following template URL:

And replace WORD with the word you want to hear pronounced. With mplayer and vlc I couldn’t play them directly, first I had to download them with wget.


This is implemented in my jabbapylib library, see here.

Categories: google Tags: ,

RUIN – An animated short set in a post-apocalyptic universe

March 25, 2012 Leave a comment

RUIN – An animated short set in a post-apocalyptic universe.


Thanks Jeszy for the link.

Categories: Uncategorized Tags: , ,

mc problem: cannot chmod target file, operation not permitted

March 25, 2012 Leave a comment

With mc, you want to copy lots of small files to an NTFS partition. However, for every file it drops a warning: “cannot chmod target file”. Either you switch to root or you sit next to the keyboard and press Skip for every single file. WTF?

When you press F5, untick the option “Preserve attributes“. Done.

Minitube – a YouTube desktop application

March 22, 2012 Leave a comment

Minitube is a YouTube desktop application. With it you can watch YouTube videos in a new way: you type a keyword, Minitube gives you an endless video stream. Minitube is not about cloning the original YouTube web interface, it aims to create a new TV-like experience.


sudo apt-get install minitube
Categories: ubuntu Tags: , ,