It is really frustrating when suddenly Vi Editor behaves strangely. While typing arrow keys, the output is A, B, C, D etc. Inserting in usual way doesn't work and backspace doesn't deletes characters in insert mode. Well after searching for a while on internet I found this cool solution:
In home directory, open file .vimrc (create one if not present) and write
"set nocompatible"
save and close the file. On command line enter the command
"source .vimrc"
voila!! life is back to normal!
Monday, October 10, 2011
Wednesday, April 13, 2011
Sunday, February 20, 2011
Java and XML binding in Netbeans
java and xml binding process link
Saturday, February 5, 2011
MySQL
Some command for MySQL
Command to shutdown mysql
C:\> mysqladmin -u -p shutdown
Check if mysql is running
command
Other commands
Command to shutdown mysql
C:\> mysqladmin -u
Check if mysql is running
command
Other commands
Friday, January 28, 2011
Thursday, January 27, 2011
Running Cygwin command from java
Lets take simple ls command to be run inside java code
Following are the steps
File workDir = new File("C:/cygwin/bin");
String cmd = "bash --login -i -c \" ls \"";
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(workDir+"/"+cmd, null, workDir);
int i = pr.waitFor();
if (i == 0){
Following are the steps
File workDir = new File("C:/cygwin/bin");
String cmd = "bash --login -i -c \" ls \"";
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(workDir+"/"+cmd, null, workDir);
int i = pr.waitFor();
if (i == 0){
BufferedReader input1 = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line=null;
while((line=input1.readLine()) != null) {
System.out.println(line);
}
}else{String line=null;
while((line=input1.readLine()) != null) {
System.out.println(line);
}
BufferedReader stdErr = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
// read the output from the command
String s = null;
while ((s = stdErr.readLine()) != null) {
System.out.println(s);
}
}// read the output from the command
String s = null;
while ((s = stdErr.readLine()) != null) {
System.out.println(s);
}
Subscribe to:
Posts (Atom)