The other daywhen i  was compiling some code in java,I had a doubt regarding the java packages installed on my ubuntu desktop i have both the Sun java and the GNU libgcj versions installed on my system. The problem here is, how to easily tell which java compiler to use, the sun version or other?On googling ive found the “alternatives system”.I thk itz really a great feature of Debian.

Now let us get into the topic.Check whether which version ur using…

# java -version
java version “1.6.0”
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

Now letus inspect the java binary

# which java
# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2007-11-25 16:57 /usr/bin/java -> /etc/alternatives/java
so we can see that java command is being executed from the /usr/bin path,and it links to /etc/alternatives/java,where all the alternatives are configured.


# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 36 2008-01-08 15:51 /etc/alternatives/java -> /usr/lib/jvm/java-6-sun/jre/bin/java
so we find another link,referring to /usr/lib/jvm/java-6-sun/jre/bin/java and it is linked to real executable.This way the alternatives system works..its very confusing to have all these links pointing to other links and so on.The alternatives system  will link the executable in the default path to the relevant file in /etc/alternatives and this will link to the executable.So it becomes really easy to just update the link in alternatives directory and ink it to the executable we want to use. A nice tool for managing these links is “update-alternatives”.

# /usr/sbin/update-alternatives –display java
java – status is auto.
link currently points to /usr/lib/jvm/java-6-sun/jre/bin/java
/usr/bin/gij-wrapper-4.1 – priority 41
slave java.1.gz: /usr/share/man/man1/gij-wrapper-4.1.1.gz
/usr/lib/jvm/java-6-sun/jre/bin/java – priority 63
slave java.1.gz: /usr/lib/jvm/java-6-sun/jre/man/man1/java.1.gz
Current `best’ version is /usr/lib/jvm/java-6-sun/jre/bin/java.

I think u can understand evrything easily now..acc to the priority the best version is decided,as in this case is Sun java….and as the  java – status is auto..the best version is your default compiler…now if u want to change it to other for any personal reasons

#sudo /usr/sbin/update-alternatives –config java
There are 2 alternatives which provide `java’ Selection    Alternative
1    /usr/bin/gij-wrapper-4.1
*+        2    /usr/lib/jvm/java-6-sun/jre/bin/java
Press enter to keep the default[*], or type selection number:
choose the version u like to use….i choose GNU let us see where the link points to:

# /usr/sbin/update-alternatives –display java
java – status is manual.
link now points to /usr/bin/gij-wrapper-4.1

So uve Sucessfully changed it to GNU version as in my case.Verify it by java -version

PS 1:plz note that there are two hyphens b4 config and display

This Post is completely dedicated to those who havent succeded in configuring webmail for the same
which is described here..So we use Ypops(as an alternative) as it acts as a Yahoo server,and gets messages from Yahoo.
use the PGP public key: kranny.gpg. Save this to a file (say kranny.gpg). And then use the following command to add the key:

root@kranny-desktop:$ sudo apt-key add kranny.gpg

Add the following line to the bottom of your /etc/apt/sources.list file:
deb ubuntu main

now its time for a update
root@kranny-desktop:$ sudo apt-get update
root@kranny-desktop:$ sudo apt-get install ypops

Now configure Ypops with ur yahoo account details.type in the command
root@kranny-desktop:$ sudo dpkg-reconfigure -fgnome ypops

now enter basic information like Max no of emails,yahoo domain,connection timeout etc
and dont check connect to net via http proxy server and enable proxy authentication…
Important:put the bind address as and POP3 port no as 5110…Enable SMTP and its port must be 5025 and the rest inf u can give…now its time to reflect the ports inf in thunderbird
open thunderbird edit–>account settings–>server settings…enter the port numbers…

Now start Ypops with $ sudo /etc/init.d/ypops start

Voila u can access ur yahoomail from thunderbird now……

PS 1:i’m writing blogs very frequently…3rd blog of the day….
PS 2:i thk Part 2 will be much useful than part 1…

How reliable it wud be to have access to email from your yahoo/gmail account locally in your Thunderbird client.Actually me thinking this upgraded my thunderbird from 1.5 to 2.0 coz webmail 1.3.1 works on thunderbird 2.0….Btw webmail is an thunderbird extension used to integrate web site based email accounts like yahoo and gmail..Actually Y!mail disabled its POP3 access to free accounts, only premium accounts can download messages from Yahoo. Webmail fixes this by acting like a Yahoo server, and getting the messages from Yahoo….U can get Webmail 1.3.1 here …save this on ur desktop and go to thunderbird–>tools–>addons–>install and browse for the xpi file saved on desktop and restart thunderbird…
set the SMTP and POP3 ports above 1024 coz many of the linux distros doesnt allow anything below 1024…ive set 5110 for POP3 and 5025 for SMTP.(Set this here edit–>account settings)
Now create ur account.when u open thunderbird it insists u to create an pop for incoming server and type localhost in incoming server dialogbox..preferably check the globalbox option…next enter ur username and account name and finish…so ur done with….if it prompts for password,evrything went off fine or else webmail has some problems….

PS 1:dont worry if webmail dint worked for you….my next post will guide u thru using Ypops instead of webmail….

PS 2:took me 45  mins to configure webmail & ypops…

The other day when i was on some mailing list someone posed me a question.He wanted to add a line at the end of his emails telling about what song was currently playing on his XMMS. Something like “Currently listening to Pink Floyd-Comfortably Numb”. This is what I did

First create a file with the following lines
echo Now listening to $@ > mysong.txt

Put it in your home directory and then do a chmod a+x on it so that everyone has execute permissions on it. Next, start XMMS, goto Preferences, and in the Effect/General Plugins tab, select the Song Change plugin’s properties. Specify ~/ %s in the properties box. What happens now is that whenever a song changes, its name is put in the mysong.txt file (in your home directory).

The next part is dependent on your email client. In most good mail clients (like Mozilla Thunderbird) you can attach a file as a signature. Use mysong.txt as your  signature file and ur done with.

PS 1:Me listening to  Iron_Maiden-Brave_New_World

Actually the idea of this post comes from My friend kulbir saini .But his post much implied configuring on thought of to make lyf easier 4 Ubuntu users…To start off with Vsftpd stands for very Secure FTP Daemon.Before configuring vsftpd itself, you must decide whether to run it as a standalone dæmon or by way of a super-server, inetd or xinetd. In previous versions of vsftpd, its developer recommended using it with xinetd due to xinetd’s logging and access-control features. However, vsftpd versions 1.2 and later have native support for most of those features. For this reason, I recommend u to run it as a standalone daemon.Now to install vsftpd just type:

sudo apt-get install vsftpd

and ur done  with….

Now its time to configure ur vsftpd.conf file present in etc directory.actually default configuration is a little bit we have to tweak with it…u can use my vsftpd.conf available here…Don’t forget to backup before you use my configuration.
sudo cp /etc/vsftpd.conf  /etc/vsftpd_backup

Now  make a writable directory for anonymous user.

cd /home/ftp
sudo mkdir uploads                                             sudo chmod 777 uploads

With this configuration I can log into ftp server with anonymous user ( without username and password ). After logging in, the anonymous user jailed in /home/ftp directory ( pointed by anon_root ). I can’t go outside. I can download files from /home/ftp directory but not create, delete anything from this directory. But I can write and delete files in uploads.If I write files in uploads or upload files in uploads, the files automatically belong to ‘kranny’ user.
To run this server:
sudo /etc/init.d/vsftpd start

To stop it:
sudo /etc/init.d/vsftpd stop

To restart it:
sudo /etc/init.d/vsftpd restart

you can mount your required folders to the ftp directory with a mount -bind command…..but each time the system restarts you should do the same thing again n again…Instead run my evrytime u restart ur computer…

PS 1:Time is 1.00 am n 4m 1 hr mom is shouting 4m the back to shutdown the sys.I thk shez cmg 2 break it  …

PS 2: The look of ftp listing in firefox 3 beta 2 is really awesome….u can chk it out here


Erased previous installation and installed Ubuntu 7.10 afresh. When I tried to check the blog stats in, which uses Flash for the chart, it gave me a missing plugin error. It also showed me a little pop up to install the plugin, but unfortunately it did not work. So I decided to try the alternative Gnash plugin, but it too didn’t seem to work.

A bit of googling took me to some Ubuntu Help Forum post where it was advised to get the Flash Player from the Adobe site and install it. This involves downloading the tar.gz file, extracting it out and running the flashplayer-installation script which installs the player. But this is to be done in the command line, followed by answering some simple questions. It asks to specify where the mozilla plugin directory is, which is /usr/lib/mozilla (and the plugin directory within), but this step kept failing.

This is where the hacker jumped out of me and made me to look into the source code of flashplayer-installation script to find out where it was going wrong and what I rather need to do to install. This script is accompanied by the actual plugin file ``. The scripts just performs some checks and copies this file to the mozilla plugin folder with a permission 755 for root:root. Then it checks for the existence of an environment variable `MOZ_PLUGIN_PATH pointing to the plugin directory for Firefox to detect the plugin.

This is the manual step to install the Flash Player plugin for Mozilla Firefox in Ubuntu 7.10

  1. tar xvzf install_flash_player_9_linux.tar.gz
  2. cd install_flash_player_9_linux
  3. sudo cp /usr/lib/mozilla/plugins
  4. sudo chmod 755
  5. vi ~/.bashrc and add `export MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins` (i.e. the command within the “)
  6. Run Firefox (all opened Firefox windows should be closed before doing this installation)Adobe site

Thus, we have added the export command to .bashrc of the user so whenever he logs in, the environmental variable gets set and thus his Firefox can detect the Flash player plugin.

When things like installation script fails do not give up. A true geek looks into the script and does what the installer does. This is what that is awesome about GNU/Linux and FOSS, even when one door is locked there is surely another door which can be opened. What needs is an effort to search for the door and try opening it )

Update: Trying to file a bug lead me to the solution. The md5sum mismatch has been fixed in the package, but uploaded into Hardy repository rather than Gutsy. But we can get the .debs from here and install with dpkg

ive found this to be a problem for every new-bie and thought of to share with u guys.Actually i’m using ubuntu 7.04 at present.this post doesnt assume that your Linux distro recognises your modem.

So first connect your modem and start off with lsusb and see the output if you see there your mobile’s manufacture name.
then execute “sudo wvdialconf”This tries to detect the baud rate of your modem and writes it to /etc/wvdial.conf

and also you have to make some manual changes to wvdial.conf,like update the username and password options…so execute the command sudo gedit /etc/wvdial.conf if you are using Gnome
or sudo kate /etc/wvdial.conf if you are using KDE

our wvdial.conf should look like

[Dialer Defaults]
Modem = /dev/ttyUSB1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
stupid mode = 1
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Username = a
Password = b
Baud = 460800

now if ur using ubuntu then voila ur done with …..coz it automatically updates DNS server in resolv.conf.If u use any other distro open file:/etc/resolv.conf and enter following setting service named start
and save it…..

thats it u are done with…..just type wvdial and ur connected to net…….just type ctrl+c to disconnect……or type Killall pppd to kill all active connections……

Some common problems 1. Internet connected successfully but page is not opening

fire up following command
gedit /etc/resolv.conf

and enter this
nameserver nameserver
Now u will be able to open web page without any problem.

2 when ever i try to connect internet i get this error (Device or Resource busy)
This is the common problem with dialup connection via dial up.
Possible solution.
1. remove usb cable from the port and reinsert it. If that not help than.
2. run following command
wvdialconf /etc/wvdialconf
it will remap ur usb port to ttyACMO1or 2

Life is much better in ubuntu. ubuntu automatically update the dns server detail in resolv.conf whenever user dial dialup connection. and ubuntu automatically update the wvdial.conf file with dialup/phone setting whenever user fireup this command
sudo wvdialconf
but on other distro user have to enter following command to update wvdial.conf file
wvdialconf /etc/wvdial.conf
as root

Updates for the Comments::::::::::::::::::::

f you use Idea GPRS then your string will be like
init1 = AT+CGDCONT=1,”IP”,”internet”,””,0,0

if you use BSNL gprs in south zone of India then string will be like
init1 = AT+CGDCONT=1,”IP”,””,””,0,0

and use the following username & password if you use bsnl gprs
Username = ppp
Password = ppp123

for hutch use
init1 = AT+CGDCONT=1,”IP”,”www”,””,0,0

If u have ny other problems regarding connecting net then feel free to bug me…..

Blog Stats

  • 16,980 hits