Wednesday, August 29, 2007

Windows notepad bug!!!

Try this...

For those of you using Windows, do the following:

1.) Open an empty notepad file
2.) Type "Bush hid the facts" (without the quotes)
3.) Save it

4.) Close it, and re-open it.

Any explanation to the above?

Saturday, August 4, 2007

Recover root password in Linux

Recover root password


If you forgot your root password on Linux, recovering root password can be done
by booting Linux under a specific mode: single user mode.

This tutorial will show how to boot Linux in single user mode when using GRUB
and finally how to change root password.

Entering single user mode:

In GRUB select kernel you want to boot and hit 'e' to edit the line.
Select the kernel line and hit 'e' again to edit thet line.
Now add '1' or write 'single' to the end of line, and press enter
and then press 'b' to boot system.

This will make you the "root" user without asking for a password. Once the
system has booted, you can change the root password using the password
command.

Command to change password: passwd

Friday, August 3, 2007

Debugging Shell Script in Linux.


Bash shell offers debugging options which can be turn on or off using set command.

Execution Trace
set -x : Display commands and their arguments as they are executed.

Verbose Mode
set -v : Display shell input lines as they are read.

Syntax Checking
set -n : Reads all commands, but does not execute them.

You can use above commands in shell script itself:

#!/bin/bash
pwd
ls
# turn on debug mode
set -x
if [ -f "/home/user/file.txt" ]; then
echo "Error reading file: /home/user/file.txt"
exit 1
fi
# turn OFF debug mode
set +x
ls
# more commands.


You can replace standard

#!/bin/bash

with (for debugging)
#!/bin/bash -xv


Search About OpenSource

Google