Monday, September 20, 2010

[Level 2] How to display GUI to remote host.

If you want to display GUI from remote host to local host.
You can enable it as following steps:
1. enable gdm tcp listener.

local# vi /etc/gdm/gdm.schemas
<key>security/DisallowTCP <key>
PS. default is true.

2. restart local gdm.

local# pkill -HUP X

3. enable remote session.

local# xhost +

4. setting remote display

remote# export DISPLAY=local_ip:0.0
or login remote server with ssh -X
local# ssh -X remote-host

5. try with xclock

remote# xclock

Wish this helps.
Stanley Huang

Setting vim with press "tab" key as 4 spaces in VIM.

How to let vim to type "tab" as 4 spaces?
Add following setting in ~/.vimrc

set smartindent                                                                                           

set tabstop=4                                                                      

set shiftwidth=4                                                                                           
set expandtab                                                                                          

Wish this helps.
Stanley Huang

Friday, September 10, 2010

[Level 2] Use ffmpeg to record desktop in Ubuntu.

You can use ffmpeg to record your desktop.

1. install ffmpeg first.
# atp-get install ffmpeg

2. use command to record.

# ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg

3. play it

# vlc /tmp/out.mpg

with this helps.


Stanley Huang

[Level 1] How to flush memory cache in Ubuntu?

How to use command to flush memory cache?

#echo 1 > /proc/sys/vm/drop_caches  ## flush by command
#echo 0 > /proc/sys/vm/drop_caches  ## restore to system default value

Wish this helps.

Stanley Huang

[Installation] Chrome auto reload extension.

If you need to refresh your chrome periodically,
you can install chrome reload extension.

Wish this helps.
Stanley Huang

Thursday, September 9, 2010

[Level 1] How to get the package file list which is installed by apt-get

If you want to get the file list of package which is installed by apt-get.
You can use "dpkg" command,
# dpkg -L memcached

Wish this helps.
Stanley Huang

[Level 2] Repication in Cassandra 0.7 Beta

In Cassandra 0.7, it supports online change schema.
So, when you want to create a keyspace, the steps are as following:
1. Connect to Cassandra
 # ./bin/cassandra-cli 
2. Create keyspace
# create keyspace keyspace_name with replication_factor = n
PS. In here, 'n' is integer, and the number of cassandra node must great or equal than 'n'.

You can set replication factor

Wish this helps.
Stanley Huang

Wednesday, September 8, 2010

[Level 2] Use apt-get to Install VritaulBox from official repository

If you want to use apt-get command to install VirtaulBox from official resposity.
The steps are as following:

1. Use browser to connect official website:
2. Click the left side menu bar with item "download"
3. Select "VirtualBox 3.2.8 for Linux hosts"
4. Then you can see a section call "Debian-based Linux distributions"
5. add respository to your system. (modify /etc/apt/sources.list)
Ex. lucid version
# echo "deb lucid non-free" >> /etc/apt/source.list
6. get keys by wget
# wget -q -O- | sudo apt-key add -
7. update your apt
# sudo apt-get update
8. install by apt-get
# sudo apt-get install virtualbox-3.2

Wish this helps.
Stanley Huang

Monday, September 6, 2010

[Level 1] Install openvpn in Ubuntu

How to setup openvpn client in Ubuntu?
The steps as following:
1. Install openvpn package:
# apt-get install openvpn
2. Setup client configuration:
# vi ./my.ovpn
3. Run openvpn with root permission:
# sudo openvpn --config ./my.ovpn

Wish this helps.
Stanley Huang

[Level 1] ntpclient in Ubuntu

If you want to sync system time.
You can use command ntpdate.

# sudo ntpdate

Wish this helps.
Stanley Huang

[Info] Riptano Cassandra Summit 2010 Vedios

Good for you to reference.

Wish this helps.
Stanley Huang

Sunday, September 5, 2010

[Level 1] Widget on Ubuntu

If you like the widget of Mac, and you want your Ubuntu has widgets too.
You can try the following widgets.
1. screenlet:
# sudo apt-get install screenlets screenlets-doc
# screenlets
2. gdesklets:
# sudo apt-get install gdesklets gdesklets-data
# gdesklets
3. google gadgets:
# sudo apt-get install google-gadgets-gtk
# ggl-gtk

Wish this helps.
Stanley Huang