Thursday, May 26, 2011

vi editor command


When you use Linux vi editor above commands will help you.

Tuesday, March 29, 2011

Java script to get list box text

When you want to get list box selected text from your application using java script use the following js code.

var w = document.getElementById('picklistid').selectedIndex;
var selected_text = document.getElementById('picklistid').options[w].text;

selected_text variable will be returned the combo box selected text.

Wednesday, March 9, 2011

Mysql Date

Some useful SQL commands to get dates in Mysql server.

select curdate() 3/10/2011
select curdate()-1 20110309
select curdate() - INTERVAL 1 DAY 3/9/2011

Sunday, February 27, 2011

Mysql enable logging

mysql > tee output.log

Mysql has default built in function to logging transactions. In Mysql client, type above command. It will enabled logging in transaction. "output.log" file is created in Mysql bin directory.
 

Sunday, February 6, 2011

Find process id in linux

Use the below command to find the process id of your application. Here app name is "TestApp.jar".

ps -ef | grep TestApp

Run .jar file with log

Use the following command to run jar file for logging errors.

nohup java -jar -Xms1024m -Xmx2048m Test.jar &

Above command will run the "Test.jar" file in background and produce error file called "nohup" in same directory. ( All system out prints will be redirected into this file). So, developers can catch errors using the "nohup".

Wednesday, February 2, 2011

Mysql Current date & time

Use the Mysql server curdate() and curtime() functions to get current date & time values from the system.
Below SQL demos, the usage of the functions.

insert into test(cur_date,cur_time) values(curdate(),curtime());