Category Archives: linux


Generally when you try opening any X application, say xclock or xterm, as a root user on a remote system, It gives an error saying “Can’t open display”. To get rid of this message what you can do is,

– First ssh with -X into remote system
$ ssh -vX

– Export a variable
$ export XAUTHORITY="~/foo/.Xauthority"

– Start X app (I am assuming user “foo” has a superuser privileges on remote system)
$ sudo xterm


ii aka IRC It – the tiniest IRC Client

Today I came across a wonderful IRC Client

Install II
Download it from above URL and RTFM to install.

ii -help



Use any empty directory name on the place of IRCDIR
“&” will background the process

Now you will get “out” files in IRCDIR . Use “tail -F out” on those files to check what’s going on.

Logging In (for freenode irc)
echo "/j nickserv identify SOMENICK SOMEPASSWD" > IRCDIR/

Join Channel

Talk in Channel

Send Private Message

Part / Leave Channel
echo "/l bye" > IRCDIR/

Thanks to drewid[rogue] on #ii

easily creating name based virtual hosts in apache

Check if your /etc/apache2/ports.conf has following two lines

NameVirtualHost *:80
Listen 80

Create two directories in /var/www
# mkdir /var/www/{foo,bar}

These two directories in /var/www/ will serve as a document root for our two test sites and respectively

Create index.html file in each of these two directories and put some html code in it.
I am
I am

Put entries in /etc/hosts
You need to also put 2 entries in your /etc/hosts file since we are testing it on localhost. If you are doing it on a server then make sure you have respective A records in DNS.
Open /etc/hosts in your favourite editor and put following two entries at the bottom of the file without disturbing original contents of file foo bar

Just make sure that above IPs are not already in use in same file …if any of them is in use, then for your entries you can
use any IP in 127.x.x.x range.

Create virtual hosts
Now create two files, “” and “” in /etc/apache2/sites-available/
Contents of

DocumentRoot /var/www/foo/

Similarly create with following content

DocumentRoot /var/www/bar/

Enable newly created sites
# a2ensite

Reload Apache
# service apache2 reload OR # /etc/init.d/apache2 reload

Open your browser and put “” in address bar .. you should be able to see the contents of /var/www/foo/index.html file
Repeat same step for “” as well to confirm that your setup is working


ktorrent country flags

How to get country flags in Ktorrent

I love to see country flags in Ktorrents peers tab. Though the database is not much accurate, the flags look nice. 🙂

I upgraded the KDE few months back and came to know that flags are no more shown in Ktorrent. After some googling I found that one should have `kdebase-data` and `libgeoip1` packages installed. Also in Ktorrent ,`infowidget` plugin should be active.

I had both packages already installed and the plugin was also enabled, but still flags were not visible.

The reason behind this is mentioned in README.Debian provided with KTorrent package. So after reading it, I read README.Debian for libgeoip1 package and solved the problem. 🙂 Enjoy.

Install libgeoip1 package
# aptitude install libgeoip1

Create a directory
# mkdir /usr/share/GeoIP/

Run script provided with libgeoip1 package
# cd /usr/share/doc/libgeoip1/examples/
# ./
# ./