Tuesday, April 01, 2008

A gujarati boy!!

One day many years ago at a school in South London a teacher said to the class of 5-year-olds,
"I'll give $20 to the child who can tell me who was the most respected man,whom people consider God, who ever lived."

An Irish boy put his hand up and said, "It was St. Patrick." The teacher said, "Sorry Alan, that's not correct."

Then a Scottish boy put his hand up and said, "It was St. Andrew." The teacher replied, "I'm sorry, Hamish, that's not right either.

Finally, a Gujarati boy raised his hand and said, "It was Jesus Christ." The teacher said, "That's absolutely right, Jayant,
come up here and I'll give you the $20."

As the teacher was giving Jayant his money, she said, "You know Jayant, since you are Gujarati,
I was very surprised you said Jesus Christ." Jayant replied, "Yes, in my heart I knew it was Lord Krishna, but business is business!"

Mangers!!!

Once during a Management training program, a team of Senior Managers were given an assignment to measure the height of a flagpole.
So these Managers went out to the flagpole with ladders and tape.

They're falling off the ladders, dropping the measuring tape - the whole thing is just a mess.

An Engineer comes along and sees what they're trying to do, walks over, pulls the flagpole out of the ground,
lays it flat, measures it from end to end, gives the measurement to one of the managers,

Re-erects the flagpole and walks straight-away.

After the Engineer has gone, one Manager turns to another and laughs …

"Isn't that just like an engineer? We're looking for height and he gives the length!"

Moral : No matter what good you do, Managers can always find fault in you.

Friday, March 28, 2008

Dumbest kid!!!!!!!!

A young boy enters a barber shop and the barber whispers to his Customer,
"This is the dumbest kid in the world. Watch while I prove it to you."

The barber puts a dollar in one hand and two quarters in the other,

then calls the boy over and asks, "Which do you want, son?"

The boy takes the quarters and leaves.

"What did I tell you?" said the barber. "That kid never learns!"

Later, when the customer leaves, he sees the same young boy coming out of the ice cream store.
"Hey, son! May I ask you a question? Why did you take the quarters instead of the dollar?"

The boy licked his cone and replied, "Because the day I take the dollar, the game's over!"

~~~~~~~~

Thursday, March 27, 2008

Handling of signals in Shell scripting..

trap [-lp] [arg] [sigspec ...]

The command arg is to be read and executed when the shell receives signal(s) sigspec। If arg is absent or -, all specified signals are reset to their original values (the values they had upon entrance to the shell)।
If arg is the null string the signal specified by each sigspec is ignored by the shell and by the commands it invokes।
If arg is not present and -p has been supplied, then the trap commands associated with each sigspec are displayed।
If no arguments are supplied or if only -p is given, trap prints the list of commands associated with each signal number।
Each sigspec is either a signal name defined in <signal.h>, or a signal number।
If a sigspec is EXIT (0) the command arg is executed on exit from the shell। If a
sigspec is DEBUG, the command arg is executed after every simple command (see SHELL GRAMMAR above)।
If a sigspec is ERR, the command arg is executed whenever a simple command has a non-zero exit status।
The ERR trap is not executed if the failed command is part of an until or while loop, part of an if statement, part of a && or || list, or if the command's return value is being inverted via !. The -l option causes the shell to print a list of signal names and their corresponding numbers। Signals ignored upon entry to the shell cannot be trapped or reset। Trapped signals are reset to their original values in a child process when it is created। The return status is false if any sigspec is invalid; otherwise trap returns true.

Wednesday, March 26, 2008

To Take Backup of Files in Linux/+

cpio - copy files to and from archives

cpio {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message] [-O [[user@]host:]archive] [-F [[user@]host:]archive] [--file=[[user@]host:]archive] [--format=format] [--message=message] [--null] [--reset-access-time] [--verbose] [--dot] [--append] [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet] [--force-local] [--rsh-command=command] [--help] [--version] <> archive]

cpio {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H format] [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive] [-F [[user@]host:]archive] [--file=[[user@]host:]archive] [--make-directories] [--nonmatching] [--preserve-modification-time] [--numeric-uid-gid] [--rename] [-t|--list] [--swap-bytes] [--swap] [--dot] [--unconditional] [--verbose] [--block-size=blocks] [--swap-halfwords] [--io-size=bytes] [--pattern-file=file] [--format=format] [--owner=[user][:.][group]] [--no-preserve-owner] [--message=message] [--force-local] [--no-absolute-filenames] [--sparse] [--only-verify-crc] [--quiet] [--rsh-command=command] [--help] [--version] [pattern...] [< archive]

cpio {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]] [--null] [--reset-access-time] [--make-directories] [--link] [--quiet] [--preserve-modification-time] [--unconditional] [--verbose] [--dot] [--dereference] [--owner=[user][:.][group]] [--no-preserve-owner] [--sparse] [--help] [--version] destination-directory < name-list


cpio copies files into or out of a cpio or tar archive, which is a file that contains other files plus information about them, such as their file name, owner, timestamps, and access permissions. The archive can be another file on the disk, a magnetic tape, or a pipe. cpio has three operating modes.

In copy-out mode, cpio copies files into an archive. It reads a list of filenames, one per line, on the standard input, and writes the archive onto the standard output. A typical way to generate the list of filenames is with the find command; you should give find the -depth option to minimize problems with permissions on directories that are unwritable or not searchable.

In copy-in mode, cpio copies files out of an archive or lists the archive contents. It reads the archive from the standard input. Any non-option command line arguments are shell globbing patterns; only files in the archive whose names match one or more of those patterns are copied from the archive. Unlike in the shell, an initial `.' in a filename does match a wildcard at the start of a pattern, and a `/' in a filename can match wildcards. If no patterns are given, all files are extracted.

In copy-pass mode, cpio copies files from one directory tree to another, combining the copy-out and copy-in steps without actually using an archive. It reads the list of files to copy from the standard input; the directory into which it will copy them is given as a non-option argument.

cpio supports the following archive formats: binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar. The binary format is obsolete because it encodes information about the files in a way that is not portable between different machine architectures. The old ASCII format is portable between different machine architectures, but should not be used on file systems with more than 65536 i-nodes. The new ASCII format is portable between different machine architectures and can be used on any size file system, but is not supported by all versions of cpio; currently, it is only supported by GNU and Unix System V R4. The crc format is like the new ASCII format, but also contains a checksum for each file which cpio calculates when creating an archive and verifies when the file is extracted from the archive. The HPUX formats are provided for compatibility with HPUX's cpio which stores device files differently.

The tar format is provided for compatability with the tar program. It can not be used to archive files with names longer than 100 characters, and can not be used to archive "special" (block or character devices) files. The POSIX.1 tar format can not be used to archive files with names longer than 255 characters (less unless they have a "/" in just the right place).

By default, cpio creates binary format archives, for compatibility with older cpio programs. When extracting from archives, cpio automatically recognizes which kind of archive it is reading and can read archives created on machines with a different byte-order.

OPTIONS

-0, --null
In copy-out and copy-pass modes, read a list of filenames terminated by a null character instead of a newline, so that files whose names contain newlines can be archived. GNU find is one way to produce a list of null-terminated filenames.
-a, --reset-access-time
Reset the access times of files after reading them, so that it does not look like they have just been read.
-A, --append
Append to an existing archive. Only works in copy-out mode. The archive must be a disk file specified with the -O or -F (--file) option.
-b, --swap
In copy-in mode, swap both halfwords of words and bytes of halfwords in the data. Equivalent to -sS. Use this option to convert 32-bit integers between big-endian and little-endian machines.
-B
Set the I/O block size to 5120 bytes. Initially the block size is 512 bytes.
--block-size=BLOCK-SIZE
Set the I/O block size to BLOCK-SIZE * 512 bytes.
-c
Identical to "-H newc", use the new (SVR4) portable format. If you wish the old portable (ASCII) archive format, use "-H odc" instead.
-C IO-SIZE, --io-size=IO-SIZE
Set the I/O block size to IO-SIZE bytes.
-d, --make-directories
Create leading directories where needed.
-E FILE, --pattern-file=FILE
In copy-in mode, read additional patterns specifying filenames to extract or list from FILE. The lines of FILE are treated as if they had been non-option arguments to cpio.
-f, --nonmatching
Only copy files that do not match any of the given patterns.
-F, --file=archive
Archive filename to use instead of standard input or output. To use a tape drive on another machine as the archive, use a filename that starts with `HOSTNAME:'. The hostname can be preceded by a username and an `@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's `~/.rhosts' file).
--force-local
With -F, -I, or -O, take the archive file name to be a local file even if it contains a colon, which would ordinarily indicate a remote host name.
-H FORMAT, --format=FORMAT
Use archive format FORMAT. The valid formats are listed below; the same names are also recognized in all-caps. The default in copy-in mode is to automatically detect the archive format, and in copy-out mode is "bin".

bin
The obsolete binary format.
odc
The old (POSIX.1) portable format.
newc
The new (SVR4) portable format, which supports file systems having more than 65536 i-nodes.
crc
The new (SVR4) portable format with a checksum added.
tar
The old tar format.
ustar
The POSIX.1 tar format. Also recognizes GNU tar archives, which are similar but not identical.
hpbin
The obsolete binary format used by HPUX's cpio (which stores device files differently).
hpodc
The portable format used by HPUX's cpio (which stores device files differently).

-i, --extract
Run in copy-in mode.
-I archive
Archive filename to use instead of standard input. To use a tape drive on another machine as the archive, use a filename that starts with `HOSTNAME:'. The hostname can be preceded by a username and an `@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's `~/.rhosts' file).
-k
Ignored; for compatibility with other versions of cpio.
-l, --link
Link files instead of copying them, when possible.
-L, --dereference
Dereference symbolic links (copy the files that they point to instead of copying the links).
-m, --preserve-modification-time
Retain previous file modification times when creating files.
-M MESSAGE, --message=MESSAGE
Print MESSAGE when the end of a volume of the backup media (such as a tape or a floppy disk) is reached, to prompt the user to insert a new volume. If MESSAGE contains the string "%d", it is replaced by the current volume number (starting at 1).
-n, --numeric-uid-gid
In the verbose table of contents listing, show numeric UID and GID instead of translating them into names. Also extracts tar archives using the numeric UID and GID instead of the user/group names. (cpio archives are always extracted using the numeric UID and GID.)
--no-absolute-filenames
In copy-in mode, create all files relative to the current directory, even if they have an absolute file name in the archive.
--no-preserve-owner
In copy-in mode and copy-pass mode, do not change the ownership of the files; leave them owned by the user extracting them. This is the default for non-root users, so that users on System V don't inadvertantly give away files.
-o, --create
Run in copy-out mode.
-O archive
Archive filename to use instead of standard output. To use a tape drive on another machine as the archive, use a filename that starts with `HOSTNAME:'. The hostname can be preceded by a username and an `@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's `~/.rhosts' file).
--only-verify-crc
When reading a CRC format archive in copy-in mode, only verify the CRC's of each file in the archive, don't actually extract the files.
-p, --pass-through
Run in copy-pass mode.
--quiet
Do not print the number of blocks copied.
-r, --rename
Interactively rename files.
-R [user][:.][group], --owner [user][:.][group]
In copy-out and copy-pass modes, set the ownership of all files created to the specified user and/or group. Either the user or the group, or both, must be present. If the group is omitted but the ":" or "." separator is given, use the given user's login group. Only the super-user can change files' ownership.
--rsh-command=COMMAND
Notifies mt that it should use COMMAND to communicate with remote devices instead of /usr/bin/ssh or /usr/bin/rsh.
--sparse
In copy-in and copy-pass modes, write files with large blocks of zeros as sparse files.
-s, --swap-bytes
In copy-in mode, swap the bytes of each halfword (pair of bytes) in the files.
-S, --swap-halfwords
In copy-in mode, swap the halfwords of each word (4 bytes) in the files.
-t, --list
Print a table of contents of the input.
-u, --unconditional
Replace all files, without asking whether to replace existing newer files with older files.
-v, --verbose
List the files processed, or with -t, give an `ls -l' style table of contents listing. In a verbose table of contents of a ustar archive, user and group names in the archive that do not exist on the local system are replaced by the names that correspond locally to the numeric UID and GID stored in the archive.
-V --dot
Print a "." for each file processed.
--version
Print the cpio program version number and exit.

Tuesday, March 25, 2008

The Loyal Wife!!

There was a man who had worked all of his life, had saved all of his money, and was a real miser when it came to his money.

Just before he died, he said to his wife, "When I die, I want you to take all my money and put it in the casket with me.
I want to take my money to the afterlife with me."

And so he got his wife to promise him with all of her heart that when he died, she would put all of the money in the casket with him.

Well, he died. He was stretched out in the casket, his wife was sitting there in black, and her friend was sitting next to her.

When they finished the ceremony, just before the undertakers got ready to close the casket, the wife said, "Wait just a minute!"
She had a box her; she came over with the box and put it in the casket.

Then the undertakers locked the casket down, and they rolled it away.

So her friend said, "Girl, I know you weren't fool enough to put all that money in there with your husband."

The loyal wife replied, "Listen, I'm an honest loyal wife, I can't go back on my word.
I promised him that I was going to put that money in that casket with him."

"You mean to tell me you put that money in the casket with him!!!!?"

"I sure did," said the wife. "I got it all together, put it into my account and wrote him a check.. If he can cash it, he can spend it."

Monday, March 24, 2008

Some Fun!

Prospective husband : Do you have a book called 'Man, The Master of Women'?

Sales girl : The fiction department is on the other side, sir.



~~~~~~~~~



Said to a railroad engineer:
What's the use of having a train schedule if the trains are always late.

The reply from the railroad engineer:
How would we know they were late, if we didn't have a schedule?



~~~~~~~~~

~~~~~~~~~



I dropped a coin in sea and prayed for a smart & intelligent friend.

Then God gifted me you and said...
.
.
.
.
.
.
.
.
.
.
.

ITNE PAISE ME TO YAHI MILEGA.... :)



~~~~~~~~~



Boy & Girl in restaurant :
Boy:-I Love u
Girl:-I don't Love u
Boy:- Think again?
Girl:-I told u. No no & no
Boy:-Ok!!! Waiter,bring separate bills.

Girl:- ok ok....... I Love u too........



~~~~~~~~~

Way for a long life!!

Man : Is there any way for long life ?
Doctor : Get married.

Man : Will it help?
Doctor : No, but the thought of long life will never come.

3 detectives!!

A policeman was testing 3 Dumb brothers who were training to become detectives.


To test their skills in recognizing a suspect, he shows the first guy a picture for 5 seconds and then hides it. "This is your suspect, how would you recognize him?" The first guy answers, "That's easy, we'll catch him fast because he only has one eye!"


The policeman says, "Well...uh...that's because the picture I showed is his side profile."



Slightly flustered by this ridiculous response, he flashes the picture for 5 seconds at the second guy and asks him, "This is your suspect, how would you recognize him?"


The second guy smiles and says, "Ha! He'd be too easy to catch because he only has one ear!" The policeman angrily responds,"What's the matter with you two? Of course only one eye and one ear are showing because it's a picture of his side profile! Is that the best answer you can come up with?"


Extremely frustrated at this point, he shows the picture to the third guy and in a very testy voice asks, "This is your suspect, how would you recognize him?


He quickly adds, "Think hard before giving me a stupid answer." The guy looks at the picture intently for a moment and says, "The suspect wears contact lenses."


The policeman is surprised and speechless because he really doesn't know himself if the suspect wears contacts or not. "Well, that's an interesting answer. Wait here for a few minutes while I check his file and I'll get back to you on that."


He leaves the room and goes to his office, checks the suspect's file in his computer, and comes back with a beaming smile on his face.


"Wow! I can't believe it. It's TRUE! The suspect does in fact wear contact lenses. Good work! How were you able to make such an astute observation?"


"That's easy," the guy replied. "He can't wear regular glasses because he only has one eye and one ear."


********

I want a divorce!!

A married couple are driving along a highway doing 60mph, the wife behind the wheel.
Her husband suddenly looks over at her and says, "Honey, I know we've been married for 20 years, but I want a divorce."

The wife says nothing but slowly increases speed to 70 mph.

He then says, "I don't want you to try to talk me out of it, because I've been having an affair with your best friend,
and she's a better lover than you are."

Again the wife stays quiet but speeds up as her anger increases.

"I want the house," he insists, pressing his luck. Again the wife speeds up, to eighty mph.

He says, "I want the car, too," but she just drives faster and faster.

By now she's up to ninety mph. "All right," he says, "I want the bank accounts, and all the credit cards, too."

The wife slowly starts to veer toward a bridge.

This makes him a bit nervous, so he says, "Isn't there anything you want?"

The wife says, "No, I've got everything I need."

"Oh, really," he says, "so what have you got?"

Right before they slam into the wall at a 100 mph, the wife smiles and says, " The airbag."