Monday, August 18, 2008

A Small Touching Story!!!

A small touching story mainly for professionals. ..

A man came home from work late, tired and irritated, to find his 5-year old son waiting for him at the door.

SON: "Daddy, may I ask you a question?"
DAD: "Yeah sure, what is it?" replied the man.

SON: "Daddy, how much do you make an hour?"
DAD: "That's none of your business. Why do you ask such a thing?"
the man said angrily.
SON: "I just want to know. Please tell me, how much do you make an
hour?"
DAD: "If you must know, I make Rs.100 an hour."
SON: "Oh," the little boy replied, with his head down.

SON: "Daddy, may I please borrow Rs.50?"
The father was furious, "If the only reason you asked that is so you
can borrow some money to buy a silly toy or some other nonsense, then you march yourself straight to your room and go to bed. Think about
why you are being so selfish. I work hard everyday for such this childish behavior."

The little boy quietly went to his room and shut the door.
The man sat down and started to get even angrier about the little
boy's questions. How dare he ask such questions only to get some money?
After about an hour or so, the man had calmed down, and started to
think: Maybe there was something he really needed to buy with that Rs.50 and he really didn't ask for money very often. The man went to
the door of the little boy's room and opened the door. "Are you asleep, son?" He asked.

"No daddy, I'm awake," replied the boy.
"I've been thinking, maybe I was too hard on you earlier" said the
man.
"It's been a long day and I took out my aggravation on you.. Here's the
Rs.50 you asked for."
The little boy sat straight up, smiling. "Oh, thank you daddy!" He
yelled.
Then, reaching under his pillow he pulled out some crumpled up bills. The man saw that the boy already had money, started to get angry
again. The little boy slowly counted out his money, and then looked up at his father.

"Why do you want more money if you already have some?" the father grumbled.

"Because I didn't have enough, but now I do," the little boy replied.
"Daddy, I have Rs.100 now. Can I buy an hour of your time?

Please come home early tomorrow. I would like to have dinner with you."

The father was crushed. He put his arms around his little son, and he begged for his forgiveness.

It's just a short reminder to all of you working so hard in life. We should not let time slip through our fingers without having spent some
time with those who really matter to us, those close to our hearts.
Do remember to share that Rs.100 worth of your time with someone you love.
If we die tomorrow, the company that we are working for could easily replace us in a matter of days.
But the family & friends we leave behind will feel the loss for the rest of their lives. And come to think of it, we pour ourselves more into work than to our family.

How to find lost Mobile???

Simple to find Lost Mobile!!!
After reading this post please preserve the IMEI number in a notepad and send to your mail box so that it will be permanetly with u.
An IMEI number-The International Mobile Equipment Identity (IMEI) number is an international identity number used to uniquely identify a mobile phone. The 15-digit IMEI number is an electronic fingerprint transmitted every time a phone is used, which reveals the identity of the mobile handset.
How can I find out my IMEI number?
IMEI numbers are independent of the phone number and are usually written underneath the battery or on the back of the handset. Mobile phone users can also check their 15 digit IMEI number by dialling *#06# on their mobile handset. Mobile phone owners should make a note of their IMEI number and keep the details in a safe place.
If u lost your mobile, send an e-mail to cop@vsnl.net with the following info.
Your name:
Address:
Phone model:
Make:
Last used No.:
E-mail for communication:
Missed date:
IMEI No.:
"No need to go to police station"

Source: THE HINDU, 13.5.06

Sent this message to other friends..........

Thursday, August 14, 2008

Good Use Of Mobiles!!!

Would you like to know if your mobile is original or not ?????
Press the following on your mobile *#06# and the-international mobile equipment identity number appears. Then check the 7th and 8th numbers:

1 2 3 4 5 6 7th 8th 9 10 11 12 13 14 15
Phone Serial No. x x x x x x ? ? x x x x x x x

IF the Seventh & Eighth digits are 02 or 20 this means your cell phone was assembled in Emirates which is very Bad quality
IF the Seventh & Eighth digits are 08 or 80 this means your cell phone was manufactured in Germany which is fair quality
IF the Seventh & Eighth digits are 01 or 10 this means your cell phone was manufactured in Finland which is very Good
IF the Seventh & Eighth digits are 00 this means your cell phone was manufactured in original factory which is the best Mobile Quality
IF the Seventh & Eighth digits are 13 this means your cell phone was assembled in Azerbaijan which is very Bad quality and also dangerous for your health

THINGS YOU NEVER KNEW YOUR CELL PHONE COULD DO

There are a few things that can be done in times of grave emergencies.
Your mobile phone can actually be a life saver or an emergency tool for survival. Check out the things that you can do with it: -
(1 )
EMERGENCY
*The Emergency Number worldwide for **Mobile** is 112 ..* If you find yourself out of coverage area of your mobile network and there is an emergency, dial 112 and the mobile will search any existing network to establish the emergency number for you, and interestingly this number 112 can be dialed even if the keypad is locked. **Try it out.**
(2)
Have you locked your keys in the car? Does you car have remote keys?
This may come in handy someday. Good reason to own a cell phone: If you lock your keys in the car and the spare keys are at home, call someone at home on their cell phone from your cell phone. Hold your cell phone about a foot from your car door and have the person at your home press the unlock button, holding it near the mobile phone on their end. Your car will unlock.
Saves someone from having to drive your keys to you. Distance is no object. You could be hundreds of miles away, and if you can reach someone who has the other 'remote' for your car, you can unlock the doors (or the trunk). Editor's Note: *It works fine! We tried it out and it unlocked our car over a cell phone!'*
(3)
Hidden Battery power
Imagine your cell battery is very low , you are expecting an important call and you don't have a charger. Nokia instrument comes with a reserve battery. To activate, press the keys *3370# Your cell will restart with this reserve and the instrument will show a 50% increase in battery. This reserve will get charged when you charge your cell next time. AND
(4 )
How to disable a STOLEN mobile phone?
To check your Mobile phone's serial number, key in the following digits on your phone: * # 0 6 # A 15 digit code will appear on the screen. This number is unique to your handset. Write it down and keep it somewhere safe. when your phone get stolen, you can phone your service provider and give them this code. They will then be able to block your handset so even if the thief changes the SIM card, your phone will be totally useless. You probably won't get your phone back, but at least you know that whoever stole it can't use/sell it either. If everybody does this, there would be no point in people stealing mobile phones..

Please spread this useful information around

Wednesday, August 13, 2008

India has an online Grievance forum.

Dear Friends,

Government of India has an online Grievance forum at http://darpg-grievance.nic.in/

Can you imagine this is happening in INDIA? The govt. wants people to use this tool to highlight the problems they faced while dealing with Government officials or departments like Passport Office, Electricity board, BSNL/MTNL, Railways etc. I know many people will say that these things don't work in India, but this actually works as one of our colleague in CSC found. The guy I'm talking about lives in Faridabad. Couple of months back, the Faridabad Municipal Corporation laid new roads in his area and the residents were very happy about it. But 2 weeks later, BSNL dug up the newly laid roads to install new cables which annoyed all the residents including this guy. But it was only this guy! Who used the above listed grievance forum to highlight his concern. And to his surprise, BSNL and Municipal Corporation of Faridabad were served a show because notice and the guy received a copy of the notice in one week. Government has asked the MC and BSNL about the goof up as it’s clear that both the government departments were not in sync at all. So use this grievance forum and educate others who don't know about this facility. This way we can at least raise our concerns instead of just talking about the ' System ' in India.

Invite your friends to contribute for many such happenings.

PLEASE SPREAD THIS MESSAGE IF U WANT OUR INDIA TO CHANGE.

Now RTI is online!!!

Good news for the indian people,now you can file your RTI (Right To Information) online through this site http://www.cic.gov.in and check your request status also.
Atleast this Government have done something good for the indian people.
Now what are you waiting for go and get what you want.
Jai Hind!!!

Friday, August 8, 2008

The following are the basic commands used in Linux

1.1 Access to the system and logout
Let's start with something wrong.

login: redio[Enter]

Even if the account doesn't exist you'll be asked for a password

Password: radio2001[Enter]

Login incorrect

Let's start again

login: radio[Enter]
Password: 2001[Enter]

Last login: Sun Nov 11 10:45:11 on tty1

You get information about your last access

The prompt shell means the system is ready to receive your commands.
$

1.1.1 Switching account

logging out and then logging in with a different account
using su.

$ su root[Enter]

Password: smr1301[Enter]

If it is the right password you get identity and the rights of the typed user.

1.1.2 Who am I?

When you have more then one account may be necessary to check which account you are using.

$ whoami[Enter]

root

whoami let you know under which identity you are working on.

$ logname[Enter]

radio

logname allows you to know what account you used when you first entered in the system (login).

1.1.3 Ending a session

Just need to end the shell, that is the program that shows the prompt.

$ whoami[Enter]

root

$ exit[Enter]

In case we had used su

$ whoami[Enter]

radio

This exit closes last shell, and logs the user out of the system.

$ exit[Enter]
1.1.4 Shutting down

login: root[Enter]

Password: smr1301[Enter]

# shutdown -h now[Enter]

System is going down NOW!!

...
System halted

When this happens it is possible to reboot the system.

---------

You can use su to become root and shutdown the system.
1.2 Password management

1.2.1 User root changes password to regular user

# passwd radio[Enter]

New UNIX password: 123[Enter]

The password is too short, the system advises you but it doesn't stop you from using it.

BAD PASSWORD: it's a WAY too short

Retype new UNIX password: 123[Enter]

passwd: all authentication tokens updated successfully

1.2.2 Regular user changes its password

$ passwd[Enter]

You'll be asked for the old password.

Changing password for radio

(current) UNIX password: 123[Enter]

New UNIX password: elpoep[Enter]

BAD PASSWORD: it is based on a (reversed) dictionary word

passwd: Authentication token manipulation error

$ passwd[Enter]

Changing password for radio

(current) UNIX password: 123[Enter]

New UNIX password: I cannot understand PCs[Enter]

Retype new UNIX password: I cannot understand PCs[Enter]

passwd: all authentication tokens updated successfully

1.3 Moving around directories

The filesystem is organizated in directory and subdirectory.

1.3.1 Current Directory

$ cd /usr/bin[Enter]

$ pwd[Enter]

/usr/bin

1.3.2 Absolute and relative path

The absolute path starts from the root directory while the relative one starts from the current directory.

$ cd /usr/local[Enter]

This is an absolute path since it starts with /.

$ pwd[Enter]

/usr/local

$ cd bin[Enter]

This is a relative one: it starts from the local directory moving downward to bin.

$ pwd[Enter]

/usr/local/bin

1.3.3 Moving backward

Every directory holds two references to special subdirectory:

single (.) that is a reference to the current directory.
double (..) that is a reference to the previous directory.

These symbols are effective directory names.

$ cd ..[Enter]

$ pwd[Enter]

/usr/local

$ cd ../bin[Enter]

$ pwd[Enter]

/usr/bin

You may go backward for more then one level.

$ cd ../../var/tmp[Enter]

$ pwd[Enter]

/var/tmp

$ cd /usr/bin/../local/bin/..[Enter]

$ pwd[Enter]

/usr/local

1.3.4 The precise reference to the current directory

The current directory can be seen as a single dot. In practice all relative paths can start with the prefix ./.

$ cd ./bin[Enter]

$ pwd[Enter]

/usr/local/bin

1.3.5 Home Directory

Every user has his own personal directory, known as home, it keeps all the data owned by the user. Typing just cd the user can reach his home directory.

$ cd[Enter]

$ pwd[Enter]

/home/radio

Some shells replace tilde (~) at the begging of a path with the path of the home directory of the working user.

$ cd ~[Enter]

$ pwd[Enter]

/home/radio

In the same way if tilde is set before a user account it will be replaced with the path of user's home directory.

$ cd ~ftp[Enter]

$ pwd[Enter]

/home/ftp

Going back to home directory.

$ cd[Enter]

1.4 File content

1.4.1 Directory content


To list the directory content command ls is used

$ ls /bin[Enter]

…..
……

The command ls /bin lists the content of /bin/.

A more expressive listing can be obtened using option -l.

$ ls -l /bin[Enter]
-rwxr-xr-x 1 root root 2612 Mar 7 11:29 arch
-rwxr-xr-x 1 root root 60592 Feb 3 20:12 ash
-rwxr-xr-x 1 root root 263064 Feb 3 20:12 ash.static
-rwxr-xr-x 1 root root 9968 Feb 3 19:04 aumix-minimal
lrwxrwxrwx 1 root root 4 Apr 13 23:28 awk -> gawk
-rwxr-xr-x 1 root root 5756 Mar 7 12:15 basename
-rwxr-xr-x 1 root root 316848 Feb 27 18:44 bash
... many lines ...
-rwxr-xr-x 1 root root 4320 Mar 7 12:15 true
-rwsr-xr-x 1 root root 26608 Feb 3 15:14 umount
-rwxr-xr-x 1 root root 6196 Mar 7 12:15 uname
lrwxrwxrwx 1 root root 14 Apr 13 23:49 userconf -> /bin/linuxco
nf
-rwxr-xr-x 1 root root 16252 Mar 8 17:26 usleep
-rwxr-xr-x 1 root root 346352 Mar 7 18:18 vi
lrwxrwxrwx 1 root root 2 Apr 14 00:00 view -> vi
-rwxr-xr-x 1 root root 362 Mar 7 18:18 vimtutor
lrwxrwxrwx 1 root root 8 Apr 13 23:51 ypdomainname -> hostname
-rwxr-xr-x 3 root root 46384 Feb 15 17:04 zcat

$ cd[Enter]

$ ls[Enter]

To list hidden files

$ ls -a[Enter]
. .bash_history .enlightenment .mc
.. .bash_logout .gnome .tcshrc
.ICEauthority .bash_profile .gnome-desktop .xsession-errors
.Xauthority .bashrc .gnome-help-browser
.Xdefaults .cshrc .gnome_private

1.4.2 File Content

In order to analyse the file content cat,less and more ca be used (it doesn't make sense if it is a binary file).

$ cat /etc/issue[Enter]

Red Hat Linux release 6.2 (Zoot)
Kernel 2.2.14-5.0 on an i586

1.4.3 Find out the file type

file is command the uses the so called magic number (Unix tradition) to figure out the file type..

$ file /etc/*[Enter]

/etc/CORBA: directory
/etc/DIR_COLORS: English text
/etc/HOSTNAME: ASCII text
/etc/X11: directory
/etc/adjtime: ASCII text
/etc/aliases: English text
...many lines...
/etc/shells: ASCII text
/etc/skel: directory
/etc/smb.conf: English text
/etc/smrsh: directory
/etc/snmp: directory
/etc/sound: directory
/etc/sysconfig: directory
/etc/sysctl.conf: English text
/etc/syslog.conf: English text
/etc/termcap: English text
/etc/up2date.conf: can't read `/etc/up2date.conf' (Permission denied).
/etc/vga: directory
/etc/yp.conf: English text
/etc/ypserv.conf: English text

This method is not realible but can be useful.

1.4.4 Used and free space

In order to check the free space on disk you can use df.

$ df[Enter]

The result maybe something similar to this one.
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 1511968 805300 629860 56% /
/dev/hda1 99521 2482 91900 3% /boot
To check the directory used space: du.

$ du /bin[Enter]

5240 /bin

In this case the /bin/ directory holds files for a total amount of 5240KB.

1.5 File creation, copy and deletion

1.5.1 File creation


There are different ways to create a file. The easiest way to create an empty file si to use touch. First move to the home directory, the best place where to play.

$ cd[Enter]

$ touch myfile[Enter]

$ ls -l myfile[Enter]

-rw-rw-r-- 1 radio radio 0 Dec 23 10:49 myfile

The file was created..

You can use cat too:

$ cat > myfile2[Enter]

there are better ways to write[Enter]

text.[Enter]

This is a oneway writing.[Enter]

[Ctrl+d]

$ cat myfile2[Enter]

1.5.2 File copy

$ cp myfile2 myfile3[Enter]

Group copy is possible only if the last file is an existing directory.

$ cp myfile myfile2 myfile3 /tmp[Enter]

$ cp myfile* /tmp[Enter]

1.5.3 File deletion

Becareful when you delete something as root!!

$ rm myfile myfile2[Enter]

There is noway to recover deleted files.

You can use the wild chars:* and ?.

$ ls myfile*[Enter]

myfile3

$ rm myfile*[Enter]

1.6 Working with directory

1.6.1 Directory creation


$ cd[Enter]

$ mkdir mydir[Enter]

Let's check with ls.

$ ls -l[Enter]

...
drwxr-xr-x 8 radio radio 1024 Dec 23 12:11 mydir
...

The d character at the beginning of the string tells has that the file is a directory.

1.6.2 Directory copy

cp with option -r or-R.

$ cp -r mydir mydir2[Enter]

1.6.3 Directory deletion

You may delete an empty directory using rmdir.

$ rmdir mydir2[Enter]

Let's try with something more complex.

$ mkdir carbon[Enter]

$ mkdir carbon/hydrogen[Enter]

$ mkdir carbon/oxygen[Enter]

$ mkdir carbon/hydrogen/helium[Enter]

$ rmdir carbon[Enter]

rmdir: carbon: Directory not empty

$ rm -r carbon[Enter]

1.7 Moving around directories

In Unix environment rename and moving a file are the same thing.

1.7.1 Moving and renaming

The command used is mv.

$ touch white[Enter]

$ touch green[Enter]

$ mkdir purple[Enter]

Let's check.

$ ls -l[Enter]

...

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 white

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 green

drwxrwxr-x 2 radio radio 1024 Dec 25 12:46 purple

...

Let's rename white file to make it brown.

$ mv white brown[Enter]

$ ls -l[Enter]

...

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 brown

...

To move more file all in once the destination must be a directory.

$ mv brown green purple[Enter]

$ ls -l purple[Enter]

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 green

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 brown

$ mv purple /tmp[Enter]
1.8 The shell

The shell is the way to interact with the operative systme. The shell bash is the one used in our exercises.

1.8.1 Automatic fulfilling

The shell can fulfill a command using [Tab], this feature is particularly useful when you have file with long names.

$ touch microprocessor[Enter]

$ touch microscopic[Enter]

$ touch supersonic[Enter]

$ ls sup[Tab]

$ ls sup[Tab]ersonic[Enter]

$ ls mic[Tab]ro

$ ls mic[Tab]rop[Tab]rocessor[Enter]

1.9.2 Substitution: wild char

This is an alternative way to fulfill a command, it is the the shell that changes symbols with the right information.

1.8.2.1 Asterisk *

That symbol can be replaced with a sequence, from 0 to infinity, of symbols.

$ ls[Enter]

$ ls *[Enter]

This command is different, the shell changes the * with the list of files and directory held in the current directory. This means that if there is any subdirectory its content
would be displayed.

$ ls micro*[Enter]

microprocessor microscopic

* can be changed with null string:

$ touch millimicro[Enter]

$ ls *micro*[Enter]

microprocessor microscopic millimicro

8.2.2 Question mark ?

The question mark ? can be change with just one symbol

Let's create some files.

$ touch xy123j4[Enter]

$ touch xy456j5[Enter]

$ touch xy789j111[Enter]

$ touch xy78j67[Enter]

$ ls [Enter]

xy123j4
xy456j5
xy789j111
xy78j67

$ ls ?????j?[Enter]

xy123j4
xy456j5

We would have a different result using *

$ ls *j*[Enter]

xy123j4 xy456j5 xy789j111 xy78j67

1.8.2.3 Square brackets [ ]

The square brackets are used to have a range of symbols from which to choose the substitution symbols. Just one symbol from the one listed is used.

$ ls xy????[4567]*[Enter]

xy123j4 xy456j5

$ ls xy????[4-7]*[Enter]

1.8.2.4 Escape

For some special symbols you need to use escape

$ touch six\*height[Enter]

$ ls[Enter]

...

six*height

If you create a filename with a space inside

$ touch my\ letter[Enter]

$ ls[Enter]

...

my letter

six*height

1.8.3 Input/Output redirection and pipeline

The shell allows you to redirect command output from the standard output (usually the screen). The same for the input.

1.8.4 Redirection

$ ls -l > mylist[Enter]

$ cat mylist[Enter]

For the input .. instead of using the standard input (keyboard).

$ cat < mylist[Enter]

Appending to a file.

$ ls -l /tmp >> mylist[Enter]

$ cat mylist[Enter]

1.8.5 Pipeline

The pipeline is a way of redirecting input and output commands.

$ cat mylist sort[Enter]

$ cat < mylist sort[Enter]

Make it easier but without using pipeline.

$ sort < mylist[Enter]

1.8.6 Alias

Aliases allows you to create an alternative name to an existing command.

$ alias ll='ls -l'[Enter]

$ ll[Enter]

This alias take options as an ordinary command.

$ ll micro*[Enter]

It's the same as ls -l micro*.

-rw-rw-r-- 1 radio radio 0 Dec 26 10:19 microprocessor

-rw-rw-r-- 1 radio radio 0 Dec 26 10:19 microscopic


This are the aliases that are usually created to avoid mistake

$ alias rm='rm -i'[Enter]

$ alias cp='cp -i'[Enter]

$ alias mv='mv -i'[Enter]

Now try to remove a file.

$ rm microprocessor[Enter]

rm: remove `microprocessor'?:

n[Enter]

In this way the file was not removed.

1.9 Searching

Searching files or directories it's an important task in a filesystem as complex as the Linux (or Unix) one.

1.9.1 Find

Searching a file or directory using its name or other external feature find command is used.

$ find / -name bash -print[Enter]

This command search for files and directory named bash inside all the directory starting from the root directory (/).

/bin/bash

...

find: /var/run/sudo: Permission denied

find: /var/spool/at: Permission denied

find: /var/spool/cron: Permission denied

...

You can use wild chars, in this case it will be the find command that will have to manage them, without using shell.

$ find / -name \*sh -print[Enter]

The escape char \ tells the shell not to translate the * as wild char.

/bin/bash

/bin/ash

/bin/sh

...
1.9.2 Grep

To search inside the content of a file grep is used.

$ grep radio /etc/*[Enter]

/etc/group:radio::500:radio

/etc/passwd:radio:Ide2ncPYY1234:500:500:radiolab:/home/radio:/bin/bash

grep: /etc/skel: Is a directory

grep: /etc/sudoers: Permission denied

Thanks!!!