Tuesday, July 28, 2009

 

Fedora 11 下如何安装配置 fcitx

  1. 下载、编译、安装,不赘述
  2. 在启动配置中取消 ibus 和 IMSettings Applet
  3. sudo yum install gtk2-immodule-xim
  4. 在英文环境下使用fcitx:
    vim /etc/gtk-2.0/i386-redhat-linux-gnu/gtk.immodules
    "xim" "X Input Method" "gtk20" "/usr/share/locale" "en:zh" # 前面加上一个en
  5. 建立文件 /etc/X11/xinit/xinput.d/fcitx.conf
    XIM=fcitx
    XIM_PROGRAM=/usr/local/bin/fcitx
    XIM_ARGS=""
    GTK_IM_MODULE=fcitx
    QT_IM_MODULE=fcitx
    XMODIFIERS="@im=fcitx"
  6. sudo alternatives --install /etc/X11/xinit/xinput.d/fcitx.conf xinputrc /etc/X11/xinit/xinput.d/fcitx.conf 70
  7. alternatives --config xinputrc
  8. 重启 Xwindow

Sunday, July 26, 2009

 

Vim 如何删除符合给定模式的所有行


删除包含“something”的所有行:

:g/something/d
也可以使用regex:

:g/^\s*$/d
反过来,也可以删除不符合给定模式的所有行:

:g!/^\s*"/d

g! 等价于 v,所以也可以这样删除不符合给定模式的所有行:

:v/^\s*"/d


Saturday, July 25, 2009

 

如何设置 Linux 使得在 DHCP 下自动发送机器名称

Ubuntu:

修改文件 /etc/dhcp3/dhclient.conf添加这一行:

send host-name "loongson";


==============


Fedora:

修改文件 /etc/sysconfig/network,添加这一行:

DHCP_HOSTNAME=loongson



Thursday, July 23, 2009

 

如何解决 Debian / Ubuntu 更新源时的GPG问题

如果你在 Debian / Ubuntu 中添加了新的apt源,那么经常会遇到如下的错误信息:

smartkenny@loongson:~$ sudo apt-get update
............
W: GPG error: ftp://ftp.uni-kl.de testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907
W: GPG error: ftp://ftp.uni-kl.de unstable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907
W: You may want to run apt-get update to correct these problems

可以运行下面两个命令来解决这个问题:
smartkenny@loongson:~$ gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 07DC563D1F41B907
smartkenny@loongson:~$ sudo apt-key add .gnupg/pubring.gpg

This page is powered by Blogger. Isn't yours?