Command line mp3 player in Linux

This post is after about a month long hibernation from my blog.
I made my mind up to listen songs as i usually do (it contributes to my hobby). In fact, i was suffering with a headburst headache, so i thought songs might be the stress buster and good entertainer too. What striked my mind was why couldn’t i play the tracks on command line rather playing’em in traditional RhythmBox or Amarok etc. The way i thought, the way i found…some googling let me find such a tool named mpg123, which is nothing but a command line player cum MPEG streamer.
Installation on Ubuntu/Debian: sudo apt-get install mpg123
Installation on RedHat/Fedora/Cent OS: For this, we have to first enable the rpmforge repo and try
yum install mpg123
and you are done.

Go to the shell; Move into your songs folder; and type in mpg123 * as below:
neeraj@nee-pc:/media/LEISURE/fun/songs$ mpg123 *
Just press Ctrl+C , if you want to switch onto the next song in the folder.
Have a glimpse of the mpg123 on my UbuntuBox:


Play files on the shell itself

Type man mpg123 and you will see what else can you do with this versatile thing.
Thanks GNU.


proftpd: A unique ftp server on my UbuntuBox

This was basically a novice step by me to setup an ftp server locally, but i succeed! Proftpd is the professional FTP daemon. It can be found in Synaptic package of Ubuntu or can be downloaded via apt-get. Just install it and use standalone server.

Launch it through console (see manual pages for documentation):

neeraj@nee-pc:~$ proftpd

and check through your browser whether it’s running or not. Type ftp://localhost/ in the address bar and assign username and password (the same you use to login into your system)there in the dialoguebox. You must see a window like this:

Local file transfer protocol
Local file transfer protocol

I tried to access it on other computer on my LAN through my ip:


and it was working perfectly fine. So..are you gaming to set up your own ftp?? what say??

Turned my Ubuntu’s desktop as Fedora’s!

I always had a willing to turn my desktop as fedora’s desktop. In my UbuntuBox, the desktop doesn’t show the computer’s icon, the Home folder or the trash. But now, all are there in one go. Have a look:

All icons

All icons

What say?? All you have to do is to install Ubuntu Tweak. Launch it from Applications-> System Tools-> Ubuntu Tweak.

Tweak your Ubuntu

Tweak your Ubuntu

Go under the tab Desktop->Icons and do whatever you want. That’s it! It has so many other features, explore as much as you can! Cool na! 🙂

LAMP installation on Ubuntu 9.04

Last night, i was thinking of configuring LAMP on my UbuntuBox. LAMP is an open source Web development platform that uses Linux as the operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language. (Sometimes Perl or Python is used instead of PHP.) Because the platform has four layers, LAMP is sometimes referred to as a LAMP stack. Stacks can be built on different operating systems. Developers that use these tools with a Windows operating system instead of Linux are said to be using WAMP; with a Macintosh system, MAMP; and with a Solaris system, SAMP.

I tried the following and got success:

Open terminal and typed:

neeraj@nee-pc:~$ sudo apt-get install lamp-server^

The total size downloaded was 43 mb approx and took about 20 minutes.
let us see, whether the installation succeeded??
open Firefox and type http://localhost/ . If the browser displays "It Works", means the installation is successful.

PHP test:

type in the terminal the following

neeraj@nee-pc:~$ sudo gedit /var/www/testphp.php

and type in the following code:


Save and close the file and restart Apache by:

neeraj@nee-pc:~$ sudo /etc/init.d/apache2 restart

Open the browser and put http://localhost/testphp.php in the addressbar, hit enter and if you see the following, php has been successfully installed.

php info
php info

Next is the turn of MySQL:

MySQL has to be bound with the localhost so type in the following to check whether the bind-address is

neeraj@nee-pc:~$ gksudo gedit /etc/mysql/my.cnf

I also installed phpMyAdmin which is optional:

open terminal and type

neeraj@nee-pc:~$ sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

After this type in:

neeraj@nee-pc:~$ sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin

type in http://localhost/phpMyAdmin in the addressbar of your browser and you get the following homepage:


Log in with the MySQL accoun and you are done. I forgot the password and hence tried the following:

sudo dpkg-reconfigure mysql-server-5.0

to reset the MySQL Password.

Now, everything’s peachy. 🙂

neeraj@nee-pc:~$ gksudo gedit /etc/mysql/my.cnf

Redundant entries in GRUB menu: Solved

When you are not trying, you are not gaining anything!
That’s what i found to be authentic when i risked to change my GRUB menu in my UbuntuBox. I upgarded my hardy to jaunty a month ago, which left my system’s Grub list to show 3 copies of Ubuntu 9.04 including their failsafe modes and memtests options. I was certainly annoyed with this thing. But i recovered my original startup grub menu by following these simple steps:
#1: press alt+f2, write gksu gedit /boot/grub/menu.lst
it will show the menu.lst file in gedit.
#2: search for the string “#howmany=all”
make it “#howmany=1”
#3: save the file close it and go to terminal
#4: write ‘sudo update-grub’
it will update the menu.
restart the computer and see your previous grub!

Live desktop sharing through Yuuguu

Certainly, i was thinking about the desktop sharing on windows, i used to do this with what is called “Netmeeting” wayback in 2006.
Now when i am using Linux, why can’t i do the same on my UbuntuBox. It is possible and today i installed Yuuguu
It requires jre (Java runtime environment) to be installed on the system and the browser must be java enabled. It took about 15 minutes to install all these along with Yuuguu on my system. Now it’s working fine.
Have a look on my Yuuguu:

Yuuguu works!

Yuuguu works!

The Desktop sharing thing is very very cool. There are other things which are yet to explore. I send my thanks to my colleague Narendra for online help in testing. I will surely recommend it to the project managers.
I am waiting for the Yuuguu release which supports IRC account also.

There is something about “Vim”!

Vim offer several functionalities that improve our editing and saves time. Here are some of them.

1. Copying a whole line

yy or shift y or :ny

where n is the number of line if n is not specified then copy the current line

2. Copying from current position to end of line.


3. Copying 3 lines after the current position


4. Copying a range of line

:1,5y or :1y 5

The above example copy 5 lines, from 1 to 5

5. Deleting a whole line (Deleted line is copy to the registers)

dd or :nd

Where n is the number of line if n is not specified then delete the current line

6. Deleting from current position to end of line (Deleted text is copied to the registers)

d$ or shift d

7. Deleting a range of line

:1,5d or :1d 5

The above example remove 5 lines, from 1 to 5 and copy them to a register

8. Put n times a text, previously copied, after the cursor

: np

9. Put n times a text, previously copied, before the cursor

n Shift p

10. Word completion, works in insert mode

1. Ctrl n search forward for next matching

2. Ctrl p search backward for previous matching Very useful in programming (perl, bash, java, other)

11. Put vim in replace mode

Shift r

12. Undo


13. Redo

Ctrl r

14. Getting help about a topic

:help topic

Note: previous commands work in command mode except 10.

Saturday panic:lost my Desktop icons!

I was just working on my UbuntuBox this morning and just a copy paste from home folder to one of my drives let me loose my desktop icons at once…even the right clicking won’t work!
What happened exactly as i remember that there was a massage of force quitting the window which got freezed while copying. (My mouse is little faulty or sensitive you can say, a single left-click makes two or more left-clicks at that time..probably this might be the cause of frozen window, i know but i am not gonna change it since most of the time i use my keyboard) I simply clicked on ‘Force Quit’ option and stuck. All icons were gone, only the panels were showing. I thought it’s not a problem, after some time it would fix it up itself or a simple relogin would fix it, and thereafter i went to take my lunch. But in vain…! i tried a little Google right then and found that the Nautilus (the file manager of Gnome) had crashed. Took a deep breathe, press alt+f2 and put nautilus -n, and hit ‘enter’. My desktop was alright as previously.