Monday, January 30, 2012

Adding Recent File List Plugin to VIM


MRU (Most Recently Used) Plugin

How to add on unix:
On vim enter:
:help add-plugin


mkdir ~/.vim
mkdir ~/.vim/plugin
wget -O mru.vim

To Use:
While working on vim, enter the command:

1. :MRU
2. Select a file, press enter, thats it.

ProcessBuilder Runtime Redirecting Output and Exec uting

The following discuss details of the problem:

ProcessBuilder redirecting output

Shell redirection operators are unknown to ProcessBuilder. Put your command in a shell script and execute it, as shown here. Alternatively, use bash -c, as shown here.

Or prepending "bash -c" to the exec

How to use OutputStream for output redirection

Split a string containing command-line parameters into a String[] in Java
Wonderful answer here:

Here is a pretty easy alternative for splitting a text line from a file into an argument vector so that you can feed it into your options parser:
This is the solution:
public static void main(String[] args) {
    String myArgs = Commandline.translateCommandline("-a hello -b world -c \"Hello world\"");
    for (String arg:myArgs)

Git User Manual, Looks Very Good

Git, how to diff a file with its previous commits

git diff HEAD 0d82 --

Git, How to revert to a previous commit?

Best on this is:

I like this way:

git checkout 0d1d7fc32 .
git commit
Also you can do the following if you have some local modifications:
git stash
git checkout 0d1d7fc32
git stash pop
git commit

Friday, January 27, 2012

Saturday, January 14, 2012

Display files modified in the last 10 minutes on linux

find /var/log -type f -mmin -10

Wonderful command.