Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, December 17, 2011

Install software from source on a shared Linux server

It's a very common task that installing a software from source on a shared Linux server. If you have root privilege, it suffice to install the package by "sudo apt-get install package_name" on Ubuntu or Fedora, or "yum install package_name" on redhat or centOS. However, the common case is that we do not have root privilege and do not have write access to folders other than $HOME. To install a software or package in this situation, we have to build it from source as follows.

$ mkdir -p ~/tmp      # create a temp folder for installation process
$ export TEMP=~/tmp   # set it to be the sys tmp folder
$ wget url            # get the package source from URL, or you can upload it to the server by sftp
$ unzip file          # if the package is .zip
$ tar xf file         # if the package is a tar ball
$ cd source           # source should be replaced by the folder you just unpacked from .zip or .tar
$ ./configure --prefix=$HOME
$ make
$ make install
$ make clean

Tuesday, November 29, 2011

Arrow keys not working in Vim on Cygwin

Installed Cygwin today on my machine (ThinkPad, XP SP3). The arrow keys in Vim always bring me out from insert mode. And there is no syntax highlight at all.

The quick fix is copy /usr/share/vim/vim73/vimrc_example.vim to ~/.vimrc. Then everything works perfectly now.

Sunday, August 21, 2011

Install Google Pinyin (拼音) in Ubuntu 10.10

Install git/aptitude/scim module
$ sudo apt-get install git-core
$ sudo apt-get install aptitude
$ sudo apt-get install scim
Download google pinyin engine for scim
$ sudo git clone https://github.com/tchaikov/scim-googlepinyin.git
If you failed to do this, please go to https://github.com/tchaikov/scim-googlepinyin to download the zipped source file by yourself. Extract it to a folder, e.g., scim-googlepinyin.
Install google pinyin
$ cd scim-googlepinyin
$ sudo aptitude install libtool autotools-dev libgtk2.0-dev libscim-dev
$ sudo ./autogen.sh
$ sudo make
$ sudo make install
Run google pinyin
First, go to System->Administration->Language Support and choose "scim" as the "Keyboard input method system". Second, restart scim using following commands:
$ sudo pkill scim
$ scim -d

Useful Linux Commands

Write a file to standard output or another file
$ cat file
$ cat file1 > file2
$ cat > file
hello world!
Create a short cut for folder on desktop
$ ln -s /host/Users/Owen/Documents/Study /home/owen/Desktop/Books
Create/Delete files and directories
$ touch new.file
$ mkdir cooking
$ rm -r new.file cooking
Count the number of lines/characters/words in Linux
$ wc -[l/c/w] file