Thursday, September 24, 2009

Kutta, Sher Aur Bandar

Buzz this
Ek din ek kutta jungle main raasta kho gaya. Tabhi usane dekha ek sher uskii taraf aa raha hai. Kutte ki saans rookh gayi. "Aaj to kaam tamaam mera!" usne socha. Phir usne saamane kuchh sookhi haddiyan padi dekhi. Woh aate hue sher ki taraf peeth kar ke baith gaya aur ek sookhi hadii ko choosne laga aur zor zor se bolne laga, "wah! Sher ko khaane ka mazaa hi kuch aur hai. Ek aur mil jaaye to poori daawat ho jayegi!"

Aur usne zor se dakaar mara. Is bar sher soch mein pad gayaa. Usne socha "ye kutta to sher ka shikar karta hai! Jaan bacha kara bhago!"

Aur sher wahan se jaan bachaa ke bhaaga.

Ped par baitha ek Bandar yeh sab tamasha dekh raha tha. Usne socha yeh mauka achha hai sher ko saari kahani bata deta hoon - sher se dosti ho jayegi aur usse zindagi bhar ke liye jaan ka khatra dur ho jayega.. Woh phataphat sher ke pichhe bhaaga. Kutte ne Bandar ko jaate hue dekh liya aur samajh gayaki koi locha hai. Udhar Bandar ne sher ko sab bata diya ki kaise kutte ne use bewakoof banaya hai. Sher zor se dahada, "chal mere saath abhi uski leela khatam karta hoon" aur Bandar ko apani peeth par baitha kar sher kutte ki taraf lapka.

Can u imagine the quick management by the DOG...

-
-
-
-
-
-
-
-
-


Kutte ne sher ko aate dekha to ek baar phir uskii taraf peeth karke baith gaya aur zor zor se bolne laga, "Is Bandar ko bhej ke 1 ghanta ho gaya, saala ek sher phaans kar nahi la sakta!" You think rest of what would have happened.

Wednesday, September 23, 2009

SSL ISSUe :-javax.net.ssl.SSLHandshakeException: Received fatal alert: decrypt_error

Buzz this
I spent almost three days to figure out that why my code is throwing

-javax.net.ssl.SSLHandshakeException: Received fatal alert: decrypt_error

I tried all possible solution provided on Google , no help . finally one of my colleague told me a solution.If u face similar problem try following steps:-

1)Download latest certs from website u trying to connect over ssl

2)generate new cacerts.bin and replace new cacaerts.bin with old one and restart your app.

3)It must solve you problem

4)If u still face same issue

Go to :- cd /opt/jdk1.5.0_12/jre/lib/security

open java.security file

replace

security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.sun.rsajca.Provider

with

security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider

and this must fix your problem.

Good luck !!

Thursday, September 10, 2009

Buzz this
A) File Management Unix Commands

Creating a File

1. $ cat > test

Now hit the ENTER and start writing and then press CTRL + D to end the file.Your file is created whose name is test.

Creating an empty File

2. $ touch file1

It will create an empty file named file1.

Displaying the Contents of the File

3. $ cat test

It will display the contents of the file named test.

Concatenating the two Files

4. $ cat file1 file2

It will concatenate the file1 and file2

Copying a File to another File

5. $ cp file1 file2

It will copy the contents of file1 into a new file named file2

Moving a File to another File

6. $ mv file1 file2

It will move the contents of file1 into a new file named file2. Now file1 does not exists. This command is also indirectly used to rename a file. To move a file on parent directory we can use $ mv file1 ..

Deleting a File

7. $ rm file1

It will delete file1. But always use $ rm -i file1. It will prompt you a message that you are sure to delete this file. If you press ‘y’, then it will delete it otherwise not.

Appending a File to another File

8. $ file1 >> file2

It will append the contents of file1 at the end of the file2.

Displaying the type of a File

9. $ file file1

It will display the type of file1 that is whether it is Binary File, Empty File, English Text or Binary Text. If you write $ file *, then it will display the type of all files in the current directory.

B) Directory Management Unix Commands

Displaying the current working directory

10. $ pwd

It will display the current directory in which you are working.

Creating a Directory

11. $ mkdir dir1

It will create a new directory named dir1.

Removing a Directory

12. $ rmdir dir1

It will remove the directory dir1.

Changing a Directory

13. $ cd dir2

It will take you to dir2 directory from your previous directory dir1.

C) File and Directory Listing Unix Commands

14. $ ls * : lists all directories and files.

15. $ ls t* will display all the files starting with t and also the files of directories whose name starts with t.

16. $ ls [tT]* will display all the files starting with t or T and also the files of directories whose name starts with t or T.

17. $ ls [m-t]* will display all the files whose first alphabet of name lies in the range of m and t and also the files of directories whose first alphabet of name lies in m and t.

18. $ ls [!a-b]* will display all the files whose first alphabet of name don’t lies in the range of a and z and also the files of directories whose first alphabet of name don’t lies in a and z.

19. $ ls -l : long lists all directories and files with some extra information.

20. $ ls -p : lists all directories and files but will attach slash with the name of directories. But if you use $ ls -F, it will also list all directories and files but will attach slash with the name of directories and * with the name of executable files.

21. $ ls -a : lists all files on your directory.

22. $ ls -d : displays data about directories.

23. $ ls -t : lists files in order of their last modification time.

24. $ ls -lu :lists files in order of their last access time.

25. $ ls -r : lists files in reverse alphabetical order.

26. $ ls -Cs : lists all the files on your directory with a columnar format along the size of each file.

27. $ ls -lR : lists all the files on your directory in a recursive manner.

28. $ ls -ld t* : lists all directories and files starting the name with t.

D) Unix Date Commands

29. $ date : Fri Feb 14 11:00:12 IST 2009

In order to customize date you can use following switches along with date command

+%D = mm/dd/yy
+%H = hour (0 - 23)
+%M = minute (0 - 59)
+%S = second (0 - 59)
+%T = HH:MM:SS
+%w = Day of the week, sunday = 0
+%a = abbreviated week day
+%h = abbreviated month (jan - dec)
+%r = time in AM /PM
+%y = last two digits of a year

E) Unix General Command

30. $ logname : displays your user name.

31. $ who : displays information about all users sitting online like their user name, terminal name and date and time

32. $ who -H : displays information about all users sitting online like their user name, terminal name and date and time with proper headings

33. $ who am i : displays information only about you like your user name, terminal name and date and time

34. $ finger : displays information about all users sitting online like their user name, terminal name and date and time and much more.

35. $ tput : clears the screen

36. $ cal : displays the calendar

37. $ bc : calculator

38. $ echo Learning unix is fun : displays the string “Learning unix is fun”

39. $ banner Learning unix is fun : displays the string “Learning unix is fun” in a stylish way.

40. $ man pwd : displays the mannual of pwd command.

41. $ uname : displays the system on which you are working.

42. $ uname -a : displays more info about the system on which you are working like name of the operating system, node and the version of the unix.

43. $ uname -X : displays detailed listing of info of unix.

44. $ id : displays id of the user

45. $ tty : displays name of the terminal of the user

46. $ sleep 5 : the system will sleep for 5 seconds

47. $ spell file1 : will display all the words which are misspelt in the file file1.

48. $ copy dir1 dir2 : copies the content of one directory to another directory. This command is usually used to backup the data.

F) Unix Security Commands

49. $ passwd : used to change your password

50. $ passwd -s : displays status about password like its length and expiry date.

51. $ passwd -d : used to delete your password

52. $ passwd -x 120 user1 : 120 is the minimum number of days up to when the password is valid for user1.

53. # passwd -l bb7 : this command is used by super user to lock account of the user bb7.

54. # passwd -u bb7 : this command is used by super user to unlock account of the user bb7.

G) Unix Command Grouping

Grouping of commands allow us to use more than one command at a time.

55. $ cal ; date : it will show first calendar and then date

56. $ ls file1 && cat t* : if file1 exists then it will show the content of all files whose name begins with t otherwise the whole command will fail.

57. $ ls file1 || cat t* : if file1 exists or not, it will show the content of all files whose name begins with t.

58. $ cat file1 file2 > file3 : it wil concatenate the contents of the two files file1 and file2 and store it in file3. If file3 does not exists, it will create one and if it already exists, it will overwrite it. To avoid overwriting we can use $ cat file1 file2 >> file3 . It will not not overwrite the file3 but appends it.

59. $ cat < file1 : cat will take the input from file2 and displays it.

H) Unix Communication Commands

60. $ mesg y : enables your terminal to receive messages from other terminals.

61. $ mesg n : disables your terminal to receive messages from other terminals.

62. $ who -T : displays all the terminals who have enabled the write permission on their terminal. The + sign in front of the terminal no. will show you have the write permission on that terminal and - shows you have no write permission.

63. $ who -TH : displays all the terminals who have enabled the write permission on their terminal. The + sign in front of the terminal no. will show you have the write permission on that terminal and - shows you have no write permission but in this case heading will appear on the top of each column.

64. $ write bb8 : enables you to write on the terminal bb8. Write this command and then type your message and then press CTRL + D. Your message will be sent to bb8.

65. # wall : this command is used by superuser to make an announcement to all the users.

66. # news : this command is used by superuser to deliver a news to all the users.

67. # motd : this command is used by superuser to give message of the day to all the users.

68. $ mail bb8 : this command is used for sending mail to a user bb8.

69. $ mail : this command will display all the mails you have received.

70. $ reply bb8 : this command is used for replying to the sender bb8.