Saturday, May 20, 2006

Vim tip: arrow keys print ABCD?

VIM 方向键在编辑状态下是ABCD?

I have just build vim7 and found weird when i pressed arrow keys in the Insert mode, the cursor didn't move but printed A, B, C and D. And the -- INSERT -- doesn't show up.

As soon as I introduced the ~/.vimrc, although with no contents in this file, the problem disappeared (under ubuntu).

for more information:
Arrow keys/cursor movement prints A B C D letters


del.icio.us Tags:

Saturday, May 13, 2006

How to port uClinux kernel to MicroBlaze

MicroBlaze uClinux Project by John Williams, University of Queensland
Mailing list

Now I have successfully boot uclinux kernel on my Spartan3E-Starter-Kit (XC3S500E-4FG320C) with EDK 8.1 sp2.
A useful tutorial by Jason Wu: uClinux ready Microblaze design. However, the information in the tutorial and on John Williams' Website is not updated for new boards and new tools.

Here is my steps for spartan 3E:

1. Getting uClinux BSP

2. Build an EDK project

... to be continued...

Wednesday, May 10, 2006

Strange gmail address

古怪精灵的Gmail地址

1. Suffix
abc@googlemail.com=abc@gmail.com
这个很早就发现了,最初申请的google帐号是gmail.com后缀,后来申请的后缀是googlemail.com,(据说gmail商标在欧洲被注册了?), 但实际上这两个邮箱地址是通用的。

2. plus
abc@gmail.com=abc+123@gmail.com=abc+abc@gmail.com
在邮箱地址后可以用加号加上仍和英文或者数字。这样可以便于邮件分类。不过有些地方认为+是非法邮件地址,不能被用于注册。

3. dot
abc.xyz@gmail.com=abcxyz@gmail.com
万一少打或者错加了几个点也毫无关系。handy

Any more tips or tricks? Tell me please!


del.icio.us Tags:

Monday, May 08, 2006

Install Firefox 1.5 on Ubuntu

在ubuntu上安装或升级Firefox

Firefox不能用apt-get install来安装(bt, 为什么不行)。所以要从Mozilla.com上下载Firefox. 由于编译的gcc版本不同,导致这个Firefox和中文输入法SCIM有冲突。wiki.ubuntu.com上推荐下载源码并重新编译Firefox。我试过之后发现启动Firefox的时候,提示缺少一个库,有错误产生。

在Ubuntu中文wiki上倒是有很好的解决方法
译注:由于scim可能导致使用libstdc++5的GTK程序出现"段错误",如果出现新装的firefox1.5无法运行,可修改 export GTK_IM_MODULE="scim"为GTK_IM_MODULE="xim" 来绕过,这句一般在/etc/X11/Xsession.d/95xinput中.(catinsnow)

安装完后的配置极其方便,只要把windows里的配置文件(C:\Documents and Settings\user_name\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default)直接复制到Linux里就可以了(~/.mozilla/firefox/profiles)。所有的收藏夹、扩展、及其配置全部都有了,甚至包括原先保存的密码。当然复制之前可以先清除cookie减小体积。



del.icio.us Tags:

用MEMS来冷却芯片

用MEMS来冷却芯片

Source: eetimes

基于MEMS的微型冷却器件,推动冷却液,小到可以蚀刻在芯片上。恩,不错的想法。


del.icio.us Tags:

Sunday, May 07, 2006

getting CVS Emacs 23

If you don't have CVS installed, install one:
$ sudo apt-get install cvs

Checkout the latest cvs version, the unicode-2 branch:
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co -r emacs-unicode-2 emacs

Preparing for compile. Install all dependencies:
$ sudo apt-get build-dep emacs21
Compile:
$ cd emacs
$ ./configure --enable-font-backend --with-xft --with-freetype --with-gtk
$ make bootstrap

Try to run src/emacs, if there is no problem,
$ sudo make install
That's all.

I've encounted such error during the ./configure:

checking for gtk+-2.0 >= 2.4 glib-2.0 >= 2.4... no
Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found
configure: error: Library requirements (gtk+-2.0 >= 2.4 glib-2.0 >= 2.4) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

Solution:

$sudo apt-get install libidl-dev
$sudo apt-get install libgtk2.0-dev
Now there's no conflict to use scim in Emacs under gnome.
However, if emacs is started with --enable-font-backend I still can't use scim.

If you are under Windows and so lazy as me, download the latest Emacs23 for win32 (binary and/or source) from here:
http://ntemacs.sourceforge.net/

last update on 2006-11-01
del.icio.us Tags:

Friday, May 05, 2006

干掉和重建Grub

干掉和重建Grub

装了ubuntu,Grub是装在MBR的。有一次从Windows XP休眠,再次开机后就无法进入Windows,情况是:在Grub list 选择Windows,然后回到Grub list。进入ubuntu没有问题。

当时手头有张Win XP恢复盘(德语),比较土,以前没有用过。从光盘启动后,没有任何停顿,没有任何选项,开始嘎叽嘎叽地安装了。新的Windows是装在D盘的。我不想有两个XP,安装过程中强行关机了。再次开机后只有windows自己的boot list了。选了老的那个,直接把D的windows目录删除,再把C盘下的boot.ini改成只有C盘的Windows。重启后一切正常,只不过开机过程中的语言成了德语。比较郁闷,这个语言是在哪里改的?

用ubuntu安装盘重装Grub。没有Suse的recovery那么简单。
  • 在boot提示行输入rescue
  • 之后就好像要重新安装ubuntu一样,选择语言、地区、键盘等。
  • 然后是配置网络,设置主机名,这些都可以随便设。
  • 然后出来一个分区表,选择原先的ubuntu分区,格式是 dev/discs/disc0/partX. X是1到n,可以一个个试过来,如果不是linux分区,会有错误提示,然后返回。选择linux分区之后进入# 命令行。
  • 输入 # grub-install /dev/sda 重装Grub,有些机器是/dev/hda (?)。
  • 之后有个警告,可以去 /boot/grub/device.map 查看原先是把grub装在哪里的。
  • 最后 # exit,重启,Grub菜单又回来了。
整个过程不到10分钟。

后来又重试了几次,发现windows休眠后的重启仍然正常。又试了一下fdisk /MBR,对于windows启动来说是绝对安全的。比较BT的是,用XP安装盘的恢复模式进入DOS命令行(实际上不是dos?)没有fdisk这个命令。要fdisk /MBR 只能用其他的dos启动盘。
del.icio.us Tags:

Thursday, May 04, 2006

一些Linux应用程序

一些Linux应用程序

来源:王垠的《完全用Linux工作& 处理日常事务的 Linux 程序和它们的配置
  • Shell: bash。它结合了 csh 和 ksh 的优点,并且有 readline 功能,你可以随意绑定自己的键盘。
  • 编辑器: VIM, Emacs。
  • 程序开发: GCC, make, ld, Scheme48, j2sdk, Perl, Python, Tcl/Tk ...
  • 论文,幻灯工具:LaTeX, ConTeXt
  • 绘图工具:MetaPost。这个语言太强了,以至于我只用它了。你不熟悉的话可以用xfig, dia 来画一些流程图之类的图片。
  • 图像处理:ImageMagick。其中的 import 程序可以屏幕抓图,convert 程序可以转换图像格式,display 可以显示图片和简单编辑(缩放,换质量,转格式,简单绘图,简单虑镜)。通常我就这么点需要。如果你要更强大的图像工具可以用 Gimp, 它几乎和Photoshop差不多。
  • 自动管理工具:make。我可以用make来自动编译程序,自动编译文档,自动更新插图…… 全自动,而且不会重复劳动。
  • 数值计算程序:SciLab。这个程序基本上可以代替 Matlab。
  • 代数计算程序:MAXIMA。这个程序基于世界上最老的计算机代数系统之一: 由美国能源部(DOE)发行的 MIT Macsyma 系统。它是用 Common Lisp 实现的。很多现在的符号计算程序比如 Maple 都从 MAXIMA 身上学到很多东西。它现在经过 DOE 批准以GPL发行,永远是一个自由软件。
  • 加密程序:GnuPG。我的 PGP 密钥就是它搞出来的。
  • 打包,压缩程序。什么都有: tar, gzip, bzip2, zip, rar, ...
  • 虚拟光驱程序。Linux 不需要虚拟光驱程序,直接 mount 就行了。
  • ftp 服务器:proftpd, vsftpd。proftpd 功能很强,但是我只用了最简单的一种设置。
  • WWW 服务器:apache。(我一般没有开)
  • ftp 客户程序:lftp,ncftp。它们都是文本方式操作的,但是比起图形界面的方便的多。比如 lftp 几乎具有 bash 的所有方便功能,Tab 补全,bookmark, queue, 后台下载,镜像…… Linux 也有图形界面的 ftp 客户程序,但是大多不稳定,有很多问题。这就是很多人抱怨 Linux 不如 Windows 的一个小原因。还有很多人用 Wine 模拟 Windows 的leapftp,其实 lftp 比 leapftp 好很多,你需要的只是适应一下。
  • 自动下载工具:wget。它非常稳定,有一次我下载一个程序,用 IE 和 Mozilla 下载回来的文件都是坏的,最后还是 wget 可靠的传输了数据。用它甚至可以镜像整个网站,比起WebZip 这样的 Windows 程序强多了,而且不会因为你不付钱就在下载回来的网页里强制插入广告。
  • 虚拟终端:rxvt, xterm, gnome-terminal, mlterm, ...
  • X server: XFree86
  • 窗口管理器:FVWM。编译加入了 libstroke。
  • 中文输入:XSIM。被我修改过以适应 FVWM 的需要。另外推荐你还可以用 SCIM。
  • email 处理:Mutt + Postfix + fetchmail
  • 看 PDF, PS, DJVU 文件:Acrobat Reader, xpdf, GhostScript, gv, djvu工具包和netscape 插件。
  • 看CAJ文档。我从来不看CAJ之类的文档,如果找不到PDF或PS,直接去图书馆借最好。
  • 看网页:Mozilla, Phoenix, lynx。Mozilla-Xft 的显示效果比IE 好很多。
  • 英汉字典:IBM智能词典,星际译王。
  • 编辑网页:我用VIM 直接写 HTML。你如果想要图形方式的可以用其它的比如screem, BlueFish。
  • 登录其它 UNIX, Linux 机器:openSSH, telnet。 我喜欢用 openSSH 把其它机器的X 程序通过 ssh 加密的隧道传到我机器上显示。
  • 登录 Windows2000 server 的 display service: rdesktop,...我有一天试了一下,不错。后来就没有用过了。
  • 同步程序:rsync。我用 rsync 通过 ssh 来跟某些机器同步数据,或者做自己机器上不同目录间的同步。
  • 上BBS:rxvt(或任何一种终端) + telnet + chatbot(helloooo 机器人的程序)
  • QQ, ICQ: 我没有 QQ 或 ICQ。不过你可以用 Gaim, 它同时支持 QQ, ICQ 和很多其它的即时通信方式。ICQ 用户也可以用 Licq。
  • 放录像:MPlayer, RealPlayer。MPlayer 太好了,直接就可以放 VCD, DVD, divx, wma, wmv ... 用 Windows 的同学都很羡慕我,说 Windows 要放这个需要大堆插件。rm 最好还是用 realplayer 放,它也是免费的。
  • 放音乐: xmms(mp3,ogg都可以), mpg321(放mp3), ogg123(放ogg)。mpg321 不如xmms管理音乐文件那么方便,但是有时我还是用 mpg321 放 mp3 作为背景音乐,因为懒得开一个xmms窗口:-)
  • 游戏:我觉得 KDE 的那个 ksokoban(推箱子),很好玩 :-)
  • 看 Word 文档。请 Word 用户把文档全部转为 PDF 或 PS 再给我,文档里没有特殊的格式干脆就用文本吧,何必那么麻烦。以前很奇怪的是,通知里本来没有什么特殊的格式居然还要发doc附件的email。现在好 了,我们系发通知都用文本,PDF,甚至图片了。
  • 其它程序:还有很多我需要用而你不一定用得着的。比如,Doctor Scheme,
  • Scheme48, Scsh, kawa...这些程序只有 Doctor Scheme 有Windows版本。还有很多幕后工作但是你一般不察觉的:xinetd, telnetd, sshd, crond, atd, lpd, ... 他们都比 Windows 的对应者强的多,或者根本没有对应者。
后续
del.icio.us Tags:

Tuesday, May 02, 2006

Proxy setting for ubuntu 5.10 GUI Update Manager

Proxy setting for ubuntu 5.10 Update Manager:

Set proxies in Gnome "Network Proxy Setting", or in /etc/bash.bashrc, or /etc/wget.rc won't apply to Update Manager.
You had to put a line like this in /etc/apt/apt.conf

Acquire::http::Proxy "http://proxy.mydomain.com:8080"


In "Breezy Badger" you must edit apt.conf as follows:

Acquire
{
http::proxy "http://proxy.mydomain.com:8080"
}
del.icio.us Tags: