CentOS Linux: install desktop








After CentOS minimal installation, you may want to install desktop environment:
  1. sudo yum groupinstall "X Window System" Desktop Fonts
  2. edit /etc/inittab:
    id:5:initdefault
  3. init 5
    to start desktop mode



shell script: nested for loops in one line








for a in 1 2 3; do for b in 4 5 6; do echo "$a $b"; done; done
1 4
1 5
1 6
2 4
2 5
2 6
3 4
3 5
3 6



CentOS Linux: 安装中文输入法








  1.  sudo yum groupinstall "chinese support" 
  2. System -> Preferences -> Input Method



    • Tick "Enable input method feature"

    • Click "Input method preferences"
      • activate "Input method" tab
      • select "Chinese pinyin" and click Add button to add the pinyin input method



澳大利亚永居PR续签网址








澳洲PR续签网址:Resident Return Visa Online Application


JAVA_HOME on Mac OS X








To check where JAVA_HOME is:

/usr/libexec/java_home
or
/usr/libexec/java_home -v 1.6


To export it as env variable

export JAVA_HOME=$(/usr/libexec/java_home)
or
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)



postgreSQL: undefined symbol: PQconnectdbParams








Managed to compile and install postgresql under my own account, when running
createdb test
it gave this error: undefined symbol: PQconnectdbParams
the solution is:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/$PGSQL_HOME/lib
where $PGSQL_HOME is the directory that postgresql is installed into.


bash: for loop in one line








for ((i=0;i>5;i++)); do echo $i; done
for i in 1 2 3 4 5; do echo $i; done



GIT: show the commits in chronological order








git log --tags --date-order --pretty=format:'%ci %h %an %d %s'

git-log




GIT: list tags in chronological order








git log --date-order --graph --simplify-by-decoration --pretty=format:'%ai %h %d'

git-log




Mac OS X: clean up duplicated "Open with" context menu items by relaunching Finder








  1. Close all Finder windows
  2. Ctrl + Option + mouse left click (or Option + mouse right click) on the Finder icon in the dock.
  3. Click Relaunch