March 19, 2010

Serial Terminal Emulator on Linux/Ubuntu

Minicom, PuTTY, picocom, gtkterm, or cutecom

Console based:

1. minicom: the grand master and the one most people use
2. picocom: a mini minicom
3. some others not very well used such as: microcom, nanocom

GUI based:
1. cutecom (Qt based), able to dispaly and send HEX
2. gtkterm (GTK based, last release 2005), able to set serial port pin, and read pin status, and display and send HEX
3. PUTTY for linux (GTK based)

I recommend minicom, picocom and gtkterm.

March 7, 2010

Sichua Earthquake and Three Gorges Dam

From the following article, this Dam most likely have contributed to the Sichua earthquake. You use use Google Translate to read it in English.

  中国地震界制定了可能产生水库诱发地震的七项定性标准:①坝高于100米,库容大约10亿立方米;②库坝区有活动断裂;③库坝区为中新生代断陷 盆地或其边缘,近代升降活动明显;④深部存在重力梯度异常;⑤岩体深部张裂隙发育,透水性强;⑥库坝区曾有地震发生;⑦库坝区有温泉。上述七项,符合数越 多,该水库蓄水后诱发地震的可能性就越大。



March 5, 2010

ctags for matlab on Windows

1. create a environment variable called HOME, and pointed it to whatever directory you like. On vista, I pointed to c:\Users\MYNAME

2. create file ctags.cnf under HOME directory you just pointed to with the following 3 lines:

--regex-matlab=/^function([] A-Za-z0-9,_[]+=[ ]?|[ ]+)([^.(]+).*$/\2/f,function/

And done. Now you can run Ctags -R * on top of your project to create matlab tags file.

a short guide to enable samba server on Ubuntu

1. sudo apt-get install samba
2. sudo vi /etc/samba/smb.conf, look for [homes] and uncomment the following lines starting with [homes], change browserable to yes and readonly to no
comment = Home Directories
browseable = yes

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no

3. give samba user a password by doing:
sudo  smbpasswd -a USERNAME

4. reload samba conf file by doing:
sudo /etc/init.d/samba reload

On Windows Explorer, type \\UBUNTU_IP_ADDRESS\USERNAME to see the share.

ssh file system mount

1. sudo adduser USER fuse
2. mkdir destdir
3. sshfs USER@REMOTEHOST:. destdir


March 4, 2010

Setup Ubuntu to be a remote desktop server,_installing

1. sudo apt-get install xrdp

2. run as your user (not root) this:
"vncserver :1

3. vi /etc/xrdp/xrdp.ini and make sure you have this section. You can have one session for each user.

name=Your Name

4. comment any line about twm or xterm and add this line to your local ~/.vnc/xstartup file:
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

5. restart xrdp sevice: /etc/initrd/xrdp restart

6. vi /etc/rc.local to add this line for each user (vncserver :number should be different for each user):
su USER1 -c "cd && vncserver :1"
su USER2 -c "cd && vncserver :2"