Thursday, November 8, 2007

Vim logo, vim.svg vim.png


I didn't find a good-look logo for VIM, so I changed the original one a little bit.

It's a red flower on green leaf.
keywords: gvim logo. gvim.png

svg file:
can not be attached. leave comments here.

Wednesday, October 17, 2007

Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card

HP Compaq Presario F730

Solution

http://ubuntuforums.org/showthread.php?t=405990

Sunday, September 16, 2007

Microphone does not work in Skype?

My laptop is Thinkpad T60, using Ubuntu 7.04.

What's more, both arecord and Sound recorder do not work. Double click the volumn icon in notification area. Open Edit->Preference and check Capture. You will find the Capture is muted in Recording tab. Uncheck it. Now it works! Have fun!!

Monday, August 27, 2007

Making a backup of the partition entries

Making a backup of the partition entries

We will save all the partitions entries (both primary and logicial ones which appear in the extended partition). In this example, we'll be assuming that hda (the first IDE hard disk) is to be backed up.

First, we will save the MBR with DD (GNU convert and copy)
# cd /root
# mkdir partition-backup
# cd partition-backup
# dd if=/dev/hda of=backup-hda.mbr count=1 bs=512



It will produce a very small, but very important file: 512 bytes of data. Now, we will save entries of the extended partitions:
# sfdisk -d /dev/hda > backup-hda.sf


sfdisk is a tool provided with the util-linux package.

IMPORTANT: You should now put these files somewhere safe - copy them to a floppy disk (and take a copy of it!), or burn them onto a CD. Keep these files safe. Do not leave them on your hard drive - if there is a problem with th drive, you may not be able to access these files, and while your partition images won't be wortheless, it will certainly be a lot harder to restore your data.
[edit]
Restoring partition entries from the backup

Be careful, restoring is a dangerous action - it can destroy data! First, we will restore the Master Boot Record:
# dd if=backup-hda.mbr of=/dev/hda


Then, here is how to restore extended partitions entries:
# sfdisk /dev/hda < backup-hda.sf


# # dd if= sda-mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446


To finish, you will have to reboot your computer.

Sunday, August 26, 2007

Do you hate ubuntu's color and themes

Honestly, I don't like it. That's why I did not start it for a long time.

But, we can change it. I like blue as on Fedora. So, let's do a little work to make it eye-candy.

1. Login theme
download this theme, which is best in gnome-look site :
http://www.gnome-look.org/content/show.php/macbuntu?content=64266
Open
Start->System->Administration->Login Window
click local tab, add the themes you just downloaded.
Don't close now, change the background color to dark blue, just under the themes.

2. Splash theme
Splash is just a picture. Choose whatever you like in
Start->System->Preference->Splash Screen
I like this one


3.gnome themes and icons
Actually, I like the MacOS theme.
http://www.gnome-look.org/content/show.php/MacOS-X+Aqua+Theme?content=13548


Probably you notice the laucher bar on the right, it looks nice. How to get it? Install gdesklets and search the widget startbar. Good luck

Alias in Linux

Are you tired with long command when you install package by apt-get. There are ways to make it easy.

Yes, use alias in your .bashrc file.

here are some of my .bashrc :

--------------------------------------



1 # .bashrc
2
3 # Source global definitions
4 if [ -f /etc/bashrc ]; then
5 . /etc/bashrc
6 fi
7
8 alias pg='ps -A |grep '
9 alias df='df -h'
10 alias du='du -h'
11 alias ls='ls --color=always'
12 alias lt='ls -lt'
13 alias ll='ls -l'
14 alias l.='ls -d .*'
15 alias mn='matlab -nodesktop'
16 alias mn7='matlab7 -nodesktop'
17 alias pp='ps -e -o pid,ppid,command'
18 alias gi='gvim'
19 alias rg='rpm -qa |grep '
20 alias lc='locate '
21 alias as='apt-cache search'
22 alias ai='sudo apt-get install '
23
24 # User specific aliases and functions
25 export PATH=$PATH:/sbin/:~/bin:/usr/local/texlive/2005/bin/i386-linux
26 if [ -f /etc/bashrc ]; then
27 . /etc/bashrc
28 fi
29 PS1="[\u: \w]$ "
30 #export LC_ALL="zh_CN.GB18030"
31
32 LC_CTYPE="zh_CN.UTF-8"
33 #export LANG="zh_CN.GB18030"
34 #export LANGUAGE=zh_CN.GB18030:zh_CN.GB2312:zh_CN
35 #export LC_CTYPE=zh_TW.UTF-8
36 #export XMODIFIERS=@im=SCIM
37 #export GTK_IM_MODULE=scim-bridge
38 #export QT_IM_MODULE=scim-bridge #使 SCIM 能够输入中文
39 #export XMODIFIERS=@im=scim
40 xset -b
41
42 export PATH=$PATH:/home/kekegg/SBW/bin
43 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/kekegg/SBW/lib"
44
45 export SBW_HOME="/home/kekegg/SBW"
46 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/local/lib":"/usr/local/Matlab74/bin/glnx86/":"/usr/local/Matlab74/sys/os/glnx86/":"/usr/lib/":"/usr/local/lib/"
47
48 if [ -f /etc/bash_completion ]; then
49 . /etc/bash_completion
50 fi

Thinkpad Second hard drive adapter

When you want to backup your files regularly, or you want to install many systems, you may need more space on hard disk. Backup can be done on USB storage, while it's not so convenient. If you are using Thinkpad laptop, there is a better solution.

That is, removing your DVD drive and inserting another hard disk. Of course u need a bay adapter. Search eBay. U will find it.
Caution : there are two kinds of adapter, for sata and hdd.

Why this method? The second hard disk is as fast as the first one because they have the same type PCI bus.

How to replace a string in all files

For instance you move all your source from Fedora to Ubuntu. The include file change from to

you need do this in the src directory
perl -pi -e "s/glpk\/glpk\.h/glpk\.h/g" *


General form is :
perl -pi -e "s/original/newpattern/g" *

Wednesday, August 22, 2007

Opera browser!

I recommend opera. It is easily to move from one system to another, All your staffs : E-mails, bookmarks, shortcuts, fast laucher, rss news.

Snapshot the screen.

install imagemagik

run
import xxx.png

Now, the mouse changed, you can select the region you want to take a snapshot, only a small region.

btw, window snapshot : Alt-PrintScreen

From Fedora to Ubuntu

Why have I transterred from Fedora to Ubuntu?
First, I can't fix the scim in QT program like opera, amsn, skype. I stand it for as long as more than half a year.
Secondly, I didn't install openafs properly.
Another reason is I can not login secure wireless network. I hope I can fix it in Ubuntu.

Why I did not transfer earlier?
I have already try it. But there were something I did not like.
1. The default vim do not have GUI. And I can not install it(long time ago)
2. Most important thing. I don't like the color and the themes. I like blue more.
3. There are even not l. and no default ll alias.

It took me one day to do the transfer. The chance come when I got a sencond hard disk bay adapter for Thinkpad T60 from eBay. Now I have two hard disk inside, and I prefer another system. I failed in hacking a MacOS on x86 first.
Since there is no more cdrom, I install Ubuntu from hard disk. Copying the system from existing system failed. Then I try to install it from hard disk. It took much time because I do not know it requires special iso image. Yes, you need alternate version.

The difference and difficulties:
I mount the home partition to ubuntu, so the configuration could be conserved.
1.fstab : ubuntu use UUID rather than /dev/sda(b). It identify the hard disk in different order every time. Google UUID you can get the solution.
2.gnome-terminal : No color theme of the text. It bother me a lot. I tried the gconf-editer first and even deleted the config folder in .gconf. It won't work. Finally, it because ls command don't have --color option. Do a alias in .bashrc can solve that.
3.Gvim : can open file from nautilus. E37 error. Config file problem. delete some terms.

The theme conserved from fedora. I use MacOS theme. And changed the login screen to blue ones and the background color the blue and splash pic to the one I like. Now you can not see ubuntu. It is fast, probably because it's new. I like it.

Wednesday, August 15, 2007

Partition table recovery

Use TestDisk.

http://www.cgsecurity.org/wiki/TestDisk_Download

You can backup the partiton table by dd. Google it to get the answer.

Wednesday, July 25, 2007

Flux balance Analysis(FBA) under linux

Considering you may find this page by google. I announce here my Software for FBA and MetaTOOL under frame of gtk.

Currently, the features are listed as following,
1. interface for linear programming
2. read reaction file in plain text
3. build model by hand in the form of work sheet
4. Layout the model and highlight the flux
i, generate network from model
ii, spring algorithm for layout
iii, highlight the modes and futile cycle
5. MetaTOOL
i, Output MetaTOOL input from FBA model
ii, run MetaTOOL
6. Other our utility unpublished for my poor English skills.
7. MOMA
8. Phaseplane
9. viability
10. subset of enzymes
11. Erase futile cycle

Go with a library handing FBA.

If you are interested, leave message here. I will read it some time.

Monday, April 16, 2007

Get the SBMLToolbox worked under the Linux

After several days work, I finally figured out the problem that the TranslateSBML function fail to work and you got a Segmentation violation.

The original aim for me is to install COBRAToolbox-1.1 in Linux and Matlab 2006b.

SBMLToolbox 2.0.2
libsbml 2.3.4
fedora core 6
gcc-4.1.1-51.fc6
matlab 7.3 (2006b)

1. Install libsbml-2.3.4 following the instructon in the package

2. Build the TranslateSBML.mexglx using the following arguments in the Makefile
Do not forget to change the matlab root directory.

MEX = /usr/local/Matlab74/bin/mex
XCFLAGS = $(CFLAGS) -g
XLDFLAGS = $(LDFLAGS) -L/usr/local/lib
XCPPFLAGS = $(CPPFLAGS) -I/usr/local/include -I/usr/local/include/sbml/
LIBS = -lsbml

3. sudo cp /usr/local/lib/libsbml.so /usr/local/Matlab74/bin/glnx86/
This is required by the matlab. But the glpkcc.mexglx worked without this operation. I don't know what happend.

Anyway, the TranslateSBML function should work now. Though I spent much time on the source code, it ends up only copying a file. :)

Thursday, March 29, 2007

VPN connection in IUPUI

http://pptpclient.sourceforge.net/howto-fedora-core-6.phtml

First , install pptconfig as following,

# rpm -Uvh http://pptpclient.sourceforge.net/yum/stable/fc6/pptp-release-current.noarch.rpm
# yum --enablerepo=pptp-stable install pptpconfig

Yum will help you to install other programs.
1.
sudo route add -host 134.68.107.67 gw 10.235.96.100
2.
sudo pptconfig
name: any
server: pptp.iupui.edu
domain: ads
username: any
passwd: some

then add start
in log window 'connected' should be shown.

Finally,
3.
sudo route add default ppp0

It should be OK now!

Sunday, February 25, 2007

写点心得

其他的我的笔记 http://ctb.pku.edu.cn:40005

程序方面的,关于perl

以前学习C的时候,提到过解释性的语言(?),脚本就是解释性的吧,所以一直很不屑

原来为了处理字符方便,用C++,不过后来师弟们写的程序还是C,所以一直头疼字符(文本)处理

赴美之后,正儿八经的用perl,因为简历上吹嘘会用,现在每天几乎都是在写perl程序中度过的,以前因为字符处理的不方便造成了很多时间的耽误

今天终于学会用perl画图了,竟然还是非常的漂亮,比R和matlab都要方便很多(脚本画图方面,一次处理几十幅甚至几百幅图的情况)

perl对我最大的用处
就是数组和映射,正则表达式;如果你要处理文本,从中需要挑出一些符合条件的字符串,只需要写出合理的正则表达式,这些表达式在各种脚本语言和vim中都是通用的

如果是不停的做重复工作,可以把模板写到右键菜单里,点一下就新建新的程序就有个框架了

最后,推荐大家用linux,觉得特别亲切,原因是所有的源代码都是C写的;感觉当年学习C的时候要知道这些那个小论文根本不在话下,而且可以为开源社区做出很多贡献(每人一个程序)。linux下的C程序很简单的就和系统融为一体了(因为是命令行的)

最近还发现了很多贴心的功能,比如自动连接网络(甚至是无线,以前这个服务被我关了,让我痛苦了很长时间)。

另外就是推荐vim了,用ctags,按两个键就自动跳到函数定义的地方去了,利用这种机制甚至可以浏览非C文件,只要你自己生成了ctags文件;比如我浏览代谢反应时,只要按两个键ctrl+]就可以跳到代谢物的名字文件去了,ctrl+T就可以跳回来,根本感觉不到是在不同的文件中,它们实际甚至在不同的目录中

如果你稍微了解一下一些程序的机制,你就会发现它们的拓展用处,比如,我的文件夹下的一些图是依赖与当前文件夹的数据文件的,当数据文件改变时,需要重新执行画图脚本,可是文件很多,你可能记不清是不是运行过了;这其实可以用make程序来作,平时make是用来执行编译程序的命令的,这对于那些熟悉make和ctags的人不是大发现,但是我自己有所需求,然后思考解决后,就觉得有无比成就感,坚持了效率至上(不写代码的原则)

然后是窗口管理器,虽然有些小功能慢于win,但是现在是越来越好了,而且是好的越来越快,一个例子就是gaim来了消息,tab处不停的闪光;虽然是小事,但是都是紧要的事,因为错过了女朋友的消息不是什么好玩的事;

桌面环境:genome,fvwm,kde,enlightenment,xgl-compiz,xvfc;这些是我用过的,换个桌面环境就是换个程序而已,多有诱惑力;好多感受是不好形容的,第一次用e16感觉是科幻小说,到了e17反而去掉了那个眩的效果;3d的就更不用说了,之是我的高级ati卡没她妈的驱动,真是浪费了

上面的看起来是没有多少内涵,深层次点的;搞个加密系统弄到u盘上只是几个小时的活,你能干的事情就是到win下面去杀毒,手工杀毒;这个系统很安全,没有密码高手也没多少办法

最后,不能忘记被迫用linux的原因,因为当时我的显示器是1280x1024的,浏览网页时ie字太小,而linux下字体可以无限放大;另外一个小原因就是当时被一个德国老头b4了

哥们们试试linux吧,你可以用两个显示器,奇数窗口显示在a上,偶数窗口显示在b上;拍下显示器就切换桌面等激动人心的事到处都是