Posts

Showing posts from June, 2013

GUN Parallel quick start

GUN Parallel is a nice job management tool in Linux system. Detail usage of the tool can be found here . Below will give a quick start for using this tool, which took me 2 hours to figure it out. It is easy to install it in linux system. -Download the parallel (eg.  parallel-20130622.tar.bz2 )  here . You can choose the latest version. -Unzip the tar.bz2 file -Copy the parallel perl file in path parallel-20130622/src to linux /bin/ file. Then parallel is installed. An example to use parallel instead of  bash "for" loop. Specifically about the array usage. Loop #! /bin/bash group=(a b c) for $i in  $group do       bash test.sh $i done #!/bin/bash group=(a b c) parallel --header : bash test.sh {group} ::: group ${group[@]} #use --header parallel bash test.sh {1} ::: ${group[@]} #not use --header explanation: --header is used to define the name of the variable which is helpful if there are more variables for the parallel. Note: space before and after &qu

eclipse can not detect the wrong functions

Today, when I use php function "fputs" and I made a typo as "fput", and did not get an red cross for this wrongly usage, I thought I hit a bug in the eclipse php error detection plug-in. After searching for 30 mins, I found no people talking about this. And after a test, I found, seems misspelling standard functions in php is actually not an "error", though I thought it should be. I think that is because functions can be customized, like class. Thought seems it is simple, but I still think it is a good idea to add the typo error to the standards functions.

Ctrl+Z to run cmd on background in Linux system

Control + Z   is really a nice function in linux system. It helps to suspend and dose good management of the running cmds in a terminal. Here is a good explanation of the usage of  Control + Z A simple summary: Control + Z   to suspend the cmds in the terminal. You must use "bg" to re-run the suspend/stoped cmds. F + G  (fg) to bring the output of the cmds back. B + G  (bg) to run the cmds in the background jobs : to checks all the running jobs in a terminal, if you have several jobs running there, then they will be listed with a job number kill (-9) %1 : to kill the running  jobs of number 1. If it can not be killed, use kill -9 %1 .

open a file in the remote server in local emacs

In emacs version GNU 23,  we can use tramp mode (which is contained in emacs package since version 22) to open a file in the remote server in local emacs by 2 steps: 1. Add the setting below in the local .emacs file: (setq tramp-default-method "ssh") 2. Open emacs locally, and use the cmd of opening a file: C-x C-f /remoteusername@remotehost :filename RET or C-x C-f /ssh :remoteusername @remotehost :filename ) Reference http://www.emacswiki.org/emacs/TrampMode