*NIX tricks

Posted in 1 by kousik on November 25, 2009

TQMB6P9NCADW

[wordpress] Insert source codes in your blog with automatic syntax highlighting

Posted in wordpress by kousik on November 23, 2009

In order to do language specific syntax highlighting of your source code, replace “your code goes here” by your actual code:

[sourcecode language="css"]
Your code here
[/sourcecode]

See an example here.

For available language options refer to the link below.

Reference: WordPress Support.

Reference

[cli] Find out success status of a command in BASH/ CSH

Posted in bash, cli, csh by kousik on November 20, 2009

To know the return value of a command, in BASH run
$ echo $?
and in CSH/ TCSH run
$ echo $status
which will give you the return value (0 or 1) of the last command (the one issued just before the echo).

In both the shells, if the above spits out 0 (zero), it means the previous command was successfully completed, otherwise it’ll give rise to 1 (unsuccessful!) — quite contrary to our concept of 0 being false and 1 being true, eh!

Credit: Oracle Spin.