Sunday, November 22, 2009

Google Chrome on Fedora

Yes, Now its available on Linux. The much waited Google Chrome on Linux. Its still an unstable version available on Linux, but is worth a try.


Create a file /etc/yum.repos.d/google-chrome.repo with the contents below

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=0


Install chrome

yum install google-chrome

Enjoy

Saturday, November 21, 2009

I'm There with FC12 (Fedora Core 12) and IBM desktop apps :)

Well it was a journey of a Linux freak . I lost the data in my entire TP. Thank heavens, I had my backup done in my USB HDD.

It all started up with FC12 The installation went fine, I didn't take a chance with putting ext4 file system on /boot partition as it was not working on FC11. The installation went fine and I got the IBM layer installed on it. Thanks to Grant Williamson for making appropriate packages available in the IBM yum repo. He was too good with his support. I was happy except that the mouse pointer was slow after the installation of the IBM layer. I tuned it through the Gnome preferences. Thanks Srini for the autoten repo to make the nonfree stuff working . Everything was set up and I was ready to click the Lotus notes icon. To my surprise nothing really happened. I tried the command line notes85.sh and it failed telling that the libnotes.so is not able to create a stack.

Phew!! the entire work has gone on a toss. I checked the logs and it showed that the Selinux is giving some permission errors. I turned the Selinux policy to permissive and then restarted notes. It worked like a charm!! :).

Now came the next issue. The Clearcase client which was running fine on FC11 has started giving me some errors. It started telling me that the libswt-mozilla-gtk-3236.so has some undefined symbol _ZN4nsID5ParseEPKc. Hmm.. I know what it means :-P. I got the xulrunner-devel package installed and made clearcase happy.

I haven't tried KDE yet. I want to keep up suspense and excitement, and gift me a surprise.

Here are my favourite apps, Being a hardcore KDE fan some of the apps below may not work well with Gnome.

Chat/IM - empathy/pidgin/sametime
IRC - Konversation
Password management - Kwallet
Personal Finance - kmymoney
Email - Lotus Notes / thunderbird
Twitter Microblogging - choqok
Notes - Tomboy/Kjots
Editor - vim/gedit/kate
Browser - Firefox/chrome/seamonkey
Music - amarok/rhythmbox
Other tools- rsibreak,digikam,gimp,picasa
IDE - Rational Application Developer/Eclipse

Using DVD as your Yum repo - FC12

Its as simple as this

vi /etc/yum.repos.d/dvd.repo

Put the following entries

[dvd]
name=Fedora DVD
baseurl=file:///media/Fedora\ 12\ i386\ DVD/
enabled=1
gpgcheck=0


Save and start using it :).

If you have a DVD image, them loop mount it to some location and modify the dvd.repo file as below

To Loop mount

mount -o loop /path/of/DVD.iso_file /path/to/your/mount_poin
t

dvd.repo file

[dvd]
name=Fedora DVD
baseurl=file:///path/to/your/mountpoint
enabled=1
gpgcheck=0

Friday, March 6, 2009

A beautiful thought!

This was a fortune tumbled down by my /usr/bin/fortune at my bash prompt. I liked it very much

The highest good is like water.
Water give life to the ten thousand things and does not strive.
It flows in places men reject and so is like the Tao.
In dwelling, be close to the land.
In meditation, go deep in the heart.
In dealing with others, be gentle and kind.
In speech, be true.
In ruling, be just.
In daily life, be competent.
In action, be aware of the time and the season.
No fight: No blame.

Monday, January 5, 2009

Positional Paramters at bash

The positional parameters or command line parameters are those which are passed as arguments to the script

eg: #myscript.sh arg1 arg2 arg3 arg4

Here arg1, arg2, arg3, and arg4 are positional or command line parameters. Now lets look at how these command line parameters can be used in the script. Bash keeps some internal variables in which the positional parameters are saved. They are as below

$0 Filename of script
$1 - $n Positional parameters #1 - #n
$# Number of positional parameters
"$*" All the positional parameters
"$@" All the positional parameters (why two of them ???)
${#*} Number of command-line parameters passed to script
${#@} Number of command-line parameters passed to script

Now let us see some examples using the positional parameters.

Check the script below


#!/bin/bash
if [[ $# != 11 ]]
then
echo "Usage `basename $0` arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11"
exit 1
fi
echo -e "first argument is $1"
echo -e "second argument is $2"
echo -e "Third arguement is $3"
echo -e "Fourth argument is $4"
echo -e "Fifth argument is $5"
echo -e "Sixth argument is $6"
echo -e "Seventh argument is $7"
echo -e "Eighth argument is $8"
echo -e "Nineth argument is $9"
echo -e "Tenth argument is $10"
echo -e "Eleventh argument is $11"
echo -e "The complete list of arguments are $*"
echo -e "The complete list of arguments are $@"
echo -e "The number of command line parameters are ${#*}"
echo -e "The number of command line parameters are ${#@}"


Executing the above scripts gives the following output.

[sijo@CyBerJiNX bash]$ ./posparams.sh 1 2 3 4 5 6 7 8 9 10 11
first argument is 1
second argument is 2
Third arguement is 3
Fourth argument is 4
Fifth argument is 5
Sixth argument is 6
Seventh argument is 7
Eighth argument is 8
Nineth argument is 9
Tenth argument is 10
Eleventh argument is 11
The complete list of arguments are 1 2 3 4 5 6 7 8 9 10 11
The complete list of arguments are 1 2 3 4 5 6 7 8 9 10 11
The number of command line parameters are 11
The number of command line parameters are 11
[sijo@CyBerJiNX bash]$


Now rerun script as below.

[sijo@CyBerJiNX bash]$ ./posparams.sh one two three four five six seven eight nine ten eleven
first argument is one
second argument is two
Third arguement is three
Fourth argument is four
Fifth argument is five
Sixth argument is six
Seventh argument is seven
Eighth argument is eight
Nineth argument is nine
Tenth argument is one0
Eleventh argument is one1
The complete list of arguments are one two three four five six seven eight nine ten eleven
The complete list of arguments are one two three four five six seven eight nine ten eleven
The number of command line parameters are 11
The number of command line parameters are 11
[sijo@CyBerJiNX bash]$


See the way in which the tenth and eleventh argument is printed. Is this a bug.. No, so what is wrong with the script. Let us recheck the lines which prints tenth and eleventh args.

echo -e "Tenth argument is $10"
echo -e "Eleventh argument is $11"

The bash prints them as $1 followed by a 0 and $1 followed by a 1.So how to print the arguments $10 and $11. Rewrite the lines as

echo -e "Tenth argument is ${10}"
echo -e "Eleventh argument is ${11}"

The curly braces {} acts as the delimiter for the variable name to be printed. This is the right way in which any variables in a shell script should be printed.

Now check the lines

echo -e "The complete list of arguments are $*"
echo -e "The complete list of arguments are $@"

Are these lines one and the same?... No, they are not

The first line $* will store the entire command line parameters as a single string where as the second one $@ stores the elements in an array.


}}}