Tuesday, July 24, 2012

"bash" command on Solaris machine.

Yesterday i had to connect to a Solaris machine through ssh. I faced some inconvenience when press 'tab' for generate rest of the file names, folder names etc.. Not like in Linux environment it push the cursor for 4 spaces to the right without generating the rest of the file name. hmmm.... I had to type the whole file names and folder names. :(   However I deside to find a solution for this headache, cause it becomes a real headache at the end of the day. ........... Thanks for Google.

That's a simple step. "bash". I just need to enter this command. Then its same as usual.


$ bash
bash-3.00$

Monday, June 11, 2012

How to add DNS entry in Windows 7

Open the note pad. (You have to run it as Administrator). Then open   C:\Windows\System32\ drivers\etc\hosts" file in the Note pad  [i assume your windows partission is 'C' ;)]. Add the ip address and the host name at the end of the file. The IP address should be placed in the first column followed by the corresponding host name.

Ex:
192.168.0.24     sec.office.hms

Save the file and close it.
That's all.

Tuesday, May 8, 2012

log4j common conversion pattern.



Yesterday, one of my friend asked about log4j xml file. She's new for development and wants to understand it line by line. How ever she has stuck on conversion line. hmmm... so my work starts from there.. Simply she needs to get the meaning of this line.

   <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d{DATE} %-5p [%t] %c{1} - %m%n"/>
   </layout>

This says the layout of the log lines in the log file. According to this pattern it writes a log line like this.

09 May 2012 10:50:14,125 INFO [WrapperListener_start_runner] MuleServer - Mule Server initializing...

Lets see the meanings...

%d{DATE} = %d means the date. The format goes in the {} brackets. DATE - DateTimeDateFormat. ( "dd MMM yyyy HH:mm:ss,SSS" for example, "06 Nov 1994 15:49:37,459"

%-5p = Type of the log entry. INFO, DEBUG, ERROR etc.. -5 means use 5 characters to mention it.

[%t] = Says the tread name. In hear the box brackets will cover the thread name.

%c{1} = The class name. {1} says to mention only the class name. %c will write "org.mule.MuleServer"

- = Simply add dash "-" between class name and message.

%m = The message.

%n = new line.

For quick reference.... http://www.daniel-hirscher.de/Java_files/Log4jQuickRef.pdf

Friday, April 13, 2012

How to recover MongoDB after an Unclean shutdown.

April 13th 10.48pm .... ;)

Sometimes my laptop switch off at once due to lack of battery power. It doesn't support for auto hibernate when it runs with fedora.. :(   So those times my mongod server also crashed. When i start it on the next time it ask to repair the db and direct to their help and support web site. According to that i found this command. It is a simple command to repair the db .. That's....

shell> ./mongod --repair --dbpath=<path_to_db>

I assume that you are in the mongodb bin folder... :)

Wednesday, March 21, 2012

How to find the MAC address on Windows phone. (Old versions)

My previous blog's method works for "Windows Phone 7 7.10.7720" version. But the old versions doesn't have this feature. So I found another two more methods to find out the MAC address on windows phones.

Method 1 (works on "Windows Phone 7 7.10.7720" version on LG at&t)

1) Go to phone dialer.
2) Type ##634# and press "call" button.
3) In the MFG screen enter 277634#*# as password.
4) In "Factory menu" select "Engineer Menu"
5) In "Engineer Menu" select "Device Test"
6) From "Device Test" select "WIFI Test"
7) From "WIFI Test" open "Net.Info."

You will see the MAC address... ;)

For Samsung phones. [I didn't test this method]

1) Go to phone dialer.
2) Type ##634# (might have been ##643#) and press "call" button.
3) In the MFG screen enter 277634#*# as password.
4) Go to Diagnosis.
5) enter *#1234#
6) It should bring up a menu that includes the WiFi Mac Address


Method 2 [I didn't test this one. :P]

1) Enable your router logs.
2) Then enable your phone wi-fi.
3) Select the router from your phone's wifi list and let it to connect.
4) Check the DHCP CLIENT LOG of the router.