Thursday, August 20, 2009

Crazy Microsoft

This is just a simple article. Here I am trying to give some kind of bugs which are not already being solved by the Microsoft developers. It is they are pretty cool. Just try them out by yourself.


An Indian discovered that nobody can create a folder anywhere on the computer with the name of "CON". This is something pretty cool ...and unbelievable... At Microsoft the whole Team, couldn't answer why this happened!


Magic goes here........

1. Open the note pad
2. Simply type "Bush hid the facts" without quotes
3. Save it as what ever you wish
4. Just close it and re-open it

Hope you enjoyed with the article.

Wednesday, August 19, 2009

Shell Scripting

Here I am trying to give kind of a basic idea for people who are interested in shell scripting. Today in computer world Linux is the most famous topic therefor I thought of writing something which is very helpful for Linux users.

What do you need to write Shell Scripts?
Simply you need only the Linux OS and it's bash shell (Available with almost all Linux Distributions. By default bash is default shell for Red Hat Linux Distribution).

What is Linux Shell?
Computer understand the language of 0's and 1's and this is called binary language. Shell is a user program which helps user to interact with the kernel. Simply it takes user's commands in English and if it is a valid command it is passed to the kernel. Commands which were mentioned above are Linux Commands.

What is a Shell Script?
Shell script is a series of commands which are written in a plain text file. Shell script something similar to MS-DOS batch file but it is more powerful than the MS-DOS batch file.

How to write your first Shell Script?
1. Use any editor like 'vim' to write the shell script.
2. After writing the script set the execute permit ion to your
shell script as follows,

chmod 755 your_shell_script_name

Note: This will set read write execute (7) permit ion to owner and for group and other permition is read and execute(5).

3. Here we go...Now the script can be run by using one of following three ways,

Assume your shell script name is "myFirstScript"
2)bash myFirstScript
3)sh myFirstScript

following are some examples for shell scripts.
example 1

prints "Hello World" on the screen.
echo "Hello World"
example 2
Script to print user information who currently login,current date& time
echo "Hello $USER"
echo "Today is ";date
echo "Number of user login :";who | wc -l
echo "Calender"
exit 0
#end of script
example 3
This read your name from the key board and print it.
echo "Your name please :"
read name
echo "Hello $name, lets be friend!"

If else in Shell Scripting
if condition
condition is zero (true - 0)
execute all commands up to else statement
if condition is not true then
execute all commands up to fi
example 4
if [ $# -eq 0 ]
echo "$0 : You must type one integer"
exit 1
if test $1 -gt 0
echo "$1 is a positive number"
echo "$1 is a negative number"
Run the above script as follows,
./script_name integer_number

assuming sript name is "test"
./test 10

output is as follows,
10 is a positive number

Detailed explanation
First script checks whether command line argument is given or not, if not given then it print error message as "./test : You must type one integer". if statement checks whether number of argument ($#) passed to script is not equal (-eq) to 0, if we passed any argument to script then this if statement is false and if no command line argument is given then this if statement is true.

Those are few examples for you to get an idea what shell script is. Hope you would enjoy with note. Finally there are lot more about Shell Scripts. Here hoped to give you a brief introducion.

Sunday, August 16, 2009

Who is responsible for this?

It was a bright sunny day. I got up early in the morning with heaps of hopes. It was my 5th birth day. I thought my father was there to wish me but... it was hopeless he was not there in my room and even in my home. I searched for some thing under my pillow,under my bed and on top of my cup board, for my birth day gift. But it was also hopeless because I could not find anything. Even though it was a bright sunny day . I felt that I was alone. I could remember that my father told me i would bring you a bicycle for your birth day. I don't want a bicycle dad please come to visit us. After few days there was a ceremony in our home and there was a huge black box in our veranda. There were lot of people in our place lot of them ware crying. I could see my mother was also crying near that box. I did not want to cry but.... I had to cry just because others were crying. Then after two days that black box was taken away from my home to a place called cemetery. Since I could not understand what was really happening there I asked from my mother "mother what was going on" so she said me that "your dad left all of us. he never come Just say good bye! to your dad " but I wonder what she was telling. And I didn't say good bye! because I knew for sure If my dad was there definitely he would talk to me. He never wanted hide from me. After four years time I really could understood what was happened to my dad. It's the war who took my father away. It's the war who is responsible for thousand of lives. It's the war who is responsible for millions of refugees. It's the war who took my father away.
This is based on a real story. As Sri Lankans we were lucky to defeat the war. Today all of us breathing freely under one a flag but there are thousands of people who are still suffering because of cruel war. Let's stand against war.