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.

http://www.zaobao.com/special/feature/pages/feature080706.shtml

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

  范晓说:“紫坪铺水库符合了上述七项标准中的前六项。”惟独没有的是,紫坪铺附近没有温泉。

  他根据本身进行的调查进一步指出,紫坪铺水库所处的地质结构位置相当令人担忧。“水库大坝下距龙门山主边界断裂在地表的出露迹线仅2公里,库尾淹没线上距龙门山中央断裂地表出露迹线仅约500米,库区还有与上述断裂平行的密集断层群通过。”


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:

--langdef=matlab
--langmap=matlab:.m
--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
[homes]
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
Done.

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

done.

March 4, 2010

Setup Ubuntu to be a remote desktop server

http://ubuntuwiki.net/index.php/Xrdp,_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.

[xrdp1]
name=Your Name
lib=libvnc.so
username=na
password=ask
ip=127.0.0.1
port=5901

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 &
/etc/X11/Xsession

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"



done