2008年10月27日星期一

linux(ubuntu)下,firefox 3 不能启动 "Could not find compatible GRE between version 1.9.0 and 1.9.0. "

问题解决:https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/248493/comments/2

我的ubuntu是8.04版本的,后来换成8.10的源了。很久没有升级,昨天用"aptitude dist-upgrade"升级了一下,启动不了firefox了!在命令行启动firefox命令,发现只提示下面一句信息:

"Could not find compatible GRE between version 1.9.0 and 1.9.0.*."

我的系统是有xulrunner-1.9的:

"ii xulrunner-1.9 1.9.0.3+nobinonly- XUL + XPCOM application runner"

在google上搜了个底朝天,也许是满眼的英国老鼠让我头晕,总之没有找到解决办法。今天尝试搞清楚xulrunner和firefox的关系,用“xulrunner --help”命令竟然发现了一个用法:

" --register-global register this GRE in the machine registry"

用“xulrunner --register-global”一试,firefox就能启动了!

问题解决,内部的细节待研...

增补:在 https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/248362 有人给出了一个细节


Cooper wrote on 2008-07-15: (permalink)

you are missing some configuration file at /etc/gre.d


正是这个配置问题!

2008年10月20日星期一

有趣的“病毒”

youku上看见一个“超级强悍的电脑病毒”视频,

http://v.youku.com/v_playlist/f534738o1p5.html

2008年10月14日星期二

我的 sawfish 配置

~/.sawfishrc

;;; Jian Lee 的 Sawfish 配置文件,
;;; 参考很多网上资源,这里先 表示感谢

;; 建议了解 elisp 语法后再用 emacs、sawfish 之类使用 lisp 语法扩张的程
;; 序。

;; 关于文中的一些自定义的说明,我放在配置文件最后了。

;; sawfish扩展和emacs一样多,同样通过load-path来加载,一般放到
;; ~/.sawfish/extensions 里面吧
(setq load-path (cons "~/.sawfish/extensions" load-path))

;(require 'sawmill-defaults)
;(setq menu-program-stays-running t)

;; 改变字体(setq default-font (get-font
;"-misc-simsun-medium-r-normal-*-*-120-*-*-*-*-iso10646-1"))
; (setq default-font (get-font
;"xft:simsun:encoding=iso10646-1:pixelsize=15"))

(require 'sawfish.wm.menus)
(setq my-menu
'(("终端 Urxvt" (system "urxvt -tn xterm &"))
("浏览 Firefox" (system "firefox &"))
("邮件 Thunderbird" (system "thunderbird &"))
("聊天 Pidgin" (system "pidgin &"))
("编辑 Emacs" (system "emacs -bg rgb:16/48/64 -fg white &"))
("网页 Bluefish" (system "bluefish &"))
("管理 rox-filer" (system "rox &"))
("图像 Gqview" (system "gqview &"))
("音乐 XMMS" (system "xmms &"))
("字典 Stardict" (system "stardict &"))
("文本 leafpad" (system "leafpad &"))
("阅读 PDF" (system "acroread &"))
("远程 tsclient" (system "tsclient &"))
("实验 VMware" (system "vmware &"))
("取色 Gcolor2" (system "gcolor2 &"))
("运行 gmrun" (system "gmrun &"))
))


(defun popup-my-menu ()
(interactive)
(popup-menu my-menu))

(bind-keys global-keymap "Button1-Click1" 'popup-my-menu)
(bind-keys global-keymap "Super-F1" 'popup-my-menu)
;;(bind-keys global-keymap "Button2-Click1" 'popup-root-menu)
;;(bind-keys global-keymap "Button3-Click1" 'popup-window-menu)


;(defun one-instance-exec (prog)
;(interactive)
;(if (= (ash (system (concat "ps -C" prog)) -8) 0)
;()
;(system (concat prog " &"))
;))


;; jump-or-exec
;; 如果程序在运行,就调到当前桌面,如果没有运行,就运行它。
(require 'jump-or-exec)
(bind-keys global-keymap
"Hyper-e" `(jump-or-exec "^yang@"
,(lambda ()
(system "emacs &"))
,(lambda (wind)
(display-window wind))))
(bind-keys global-keymap
"Hyper-t" `(jump-or-exec "~"
,(lambda ()
(system "urxvt -tn xterm &"))
,(lambda (wind)
(display-window wind))))
(bind-keys global-keymap
"Hyper-f" `(jump-or-exec "Firefox"
,(lambda ()
(system "firefox &"))
,(lambda (wind)
(display-window wind))))
(bind-keys global-keymap
"Hyper-r" `(jump-or-exec "Rox"
,(lambda ()
(system "rox &"))
,(lambda ()
(display-window wind))))
(bind-keys global-keymap
"Hyper-p" `(jump-or-exec "Pidgin"
,(lambda ()
(system "pidgin &"))
,(lambda (wind)
(display-window wind))))
(bind-keys global-keymap
"Hyper-g" `(jump-or-exec "GQview"
,(lambda ()
(system "gqview &"))
,(lambda (wind)
(display-window wind))))

;; 定义窗口行为,我一般使用 Super 键
; 按住 Super和q键,安全关闭窗口
(bind-keys window-keymap "Super-q"
'(delete-window-safely (current-event-window)))
; 按住 Super和x 键,关闭当前窗口
(bind-keys window-keymap "Super-x"
'(delete-window (current-event-window)))

; 移动窗口到(0,0)处
(bind-keys window-keymap "Super-l"
'(move-window-to (current-event-window) 0 0))
; 返回当前窗口名字
(bind-keys window-keymap "Super-n"
'(display-message (window-name (current-event-window))))
; 最大化
(bind-keys window-keymap "Super-w"
'(maximize-window-vertically (current-event-window)))
(bind-keys window-keymap "Super-a"
'(maximize-window-horizontally (current-event-window)))
(bind-keys window-keymap "Super-s"
'(unmaximize-window (current-event-window)))

; 最大化
;(bind-keys window-keymap "Super-m"
; '(move-resize-window-to (current-event-window) 0 0 1024 768))
; 右半边
;(bind-keys window-keymap "Super-r"
; '(move-resize-window-to (current-event-window) 512 0 512 768))

; 隐藏窗口
;(bind-keys window-keymap "Super-s"
; '(hide-window (current-event-window)))

;;; 本配置文件自定义的说明

;; 1。Super、Hyper 键绑定
; 我用xmodmap修改了键盘按键的keycode,我的~/.Xmodmap文件如下:
;keycode 37 = Control_L
;keycode 64 = Alt_L
;keycode 108 = Super_R
;keycode 105 = Hyper_R
;clear control
;add control = Control_L
;clear mod1
;add mod1 = Alt_L
;clear mod3
;add mod3 = Super_R
;clear mod4
;add mod4 = Hyper_R
;keycode 66 = Escape
;keycode 9 = Caps_Lock

;; 2。jump-or-exec 在网上down的

我的 emacs 配置文件




~/.emacs

;;======================
;; emacs 设置
;;======================

;; 将emacs作为server使用,目前我给mutt使用
(server-start)

;; Tab = 4 spaces
(setq default-tab-width 4)

;; 是配置文件立即生效
;M-x eval-current-buffer

;; 禁用工具栏
(tool-bar-mode nil)

;; 禁用滚动栏,用鼠标滚轮替代
; 滚动条的值可以是 nil 'left 'right
; (set-scroll-bar-mode 'left)
(scroll-bar-mode nil)

;; 禁用菜单栏,F10开启或关闭菜单
(menu-bar-mode nil)


;; 禁用启动画面
(setq inhibit-startup-message t)


;;====================
;; 键绑定
;;====================
;; 绑定键设置时注明键对应的命令是个好习惯

;; C-z 设置标记 ;; C-z: M-x iconify-or-deiconify-frame: C-z,C-x C-z
(global-set-key (kbd "C-z") 'set-mark-command)

;; F10 显示/隐藏菜单 ;; M-x menu-bar-open
;;(global-set-key (kbd "F10") 'menu-bar-mode)

;; 语言环境和字体设置
(set-language-environment 'utf-8)
(prefer-coding-system 'utf-8)

;;(set-fontset-font "fontset-default" 'gb18030 '("Microsoft YaHei" . "unicode-bmp"))
;(set-default-font "Monospace-12")
(set-default-font "WenQuanYi Zen Hei-13")
(set-fontset-font (frame-parameter nil 'font)
'unicode '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'han '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'symbol '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'cjk-misc '("WenQuanYi Zen Hei" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'bopomofo '("WenQuanYi Zen Hei" . "unicode-bmp"))


;; 指针颜色设置为白色,seems not working, add it at the bottom
(set-cursor-color "white")
;; 鼠标颜色设置为白色
(set-mouse-color "white")
; 设置光标
; (set-default 'cursor-type 'bar)
(setq-default cursor-type 'box)

;; 设置背景颜色和字体颜色
(set-foreground-color "#FDFF00")
(set-background-color "#343434") ;;增强对比度
;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
(set-face-foreground 'highlight "white")
(set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
;;设置日历的一些颜色
(setq calendar-load-hook
'(lambda ()
(set-face-foreground 'diary-face "skyblue")
(set-face-background 'holiday-face "slate blue")
(set-face-foreground 'holiday-face "white")))

;;hilights grammer
(global-font-lock-mode t)


;;时间显示设置
;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)
(display-time-mode 1)
;;时间使用24小时制
(setq display-time-24hr-format t)
;;时间显示包括日期和具体时间
(setq display-time-day-and-date t)

;;所有的问题用y/n方式,不用yes/no方式。
(fset 'yes-or-no-p 'y-or-n-p)

;;鼠标自动避开指针,如当你输入的时候,指针到了鼠标的位置,鼠标有点挡住视线了
(mouse-avoidance-mode 'animate)
;;允许自动打开图片,如wiki里面
(auto-image-file-mode)
;;可以操作压缩文档
(auto-compression-mode 1)
;;在minibuffer上面可以显示列号
(column-number-mode t)
;;显示默认的文档的宽度,看起来比较舒服?
(setq fill-column 72)
(setq default-fill-column 72)
;;设置文本的行距
(setq default-line-spacing 1)
;;指针不要闪
(blink-cursor-mode -1)
(transient-mark-mode 1)
;;当指针到一个括号时,自动显示所匹配的另一个括号
(show-paren-mode 1)
;;是用滚轴鼠标
(mouse-wheel-mode t)
;;去掉烦人的警告铃声
(setq visible-bell t)
;;滚动页面时比较舒服
(setq scroll-step 1
scroll-margin 3
scroll-conservatively 10000)

;;不产生备份文件
(setq make-backup-files nil)

;;开启图片浏览
(auto-image-file-mode t)

;在标题栏显示目前在什么位置
(setq frame-title-format "yang@%b")

;Emacs fill设置
(setq adaptive-fill-regexp "[ \t]+\\|[
\t]*\\([0-9]+\\.\\|\\*+\\)[ \t]*")
(setq adaptive-fill-first-line-regexp "^\\* *$")

(put 'upcase-region 'disabled nil)

(put 'erase-buffer 'disabled nil)

;;Emacs-muse的配置部分
(require 'muse-mode)
(require 'muse-html)
(require 'muse-wiki nil t)
(require 'muse-project)
; 设置编码方式为 utf-8
(setq muse-html-meta-content-type (concat "text/html; charset=utf-8"))
; 新建一个 wiki 工程
(setq muse-project-alist
'(("wiki"
("~/doc/wiki/muse" :default "index")
(:base "html" :path "~/doc/wiki/publish"))
("linux"
("~/doc/wiki/muse/free" :default "index")
(:base "html" :path "~/doc/wiki/publish/free"))
("文学"
("~/doc/wiki/muse/文学" :default "index")
(:base "html" :path "~/doc/wiki/publish/文学"))
("健康"
("~/doc/wiki/muse/健康" :default "index")
(:base "html" :path "~/doc/wiki/publish/健康"))))
; 在设置图片位置的时候,以当前编辑文件将要发布到的目录为基准
(setq muse-colors-inline-image-method 'muse-colors-use-publishing-directory)
; 增加 tag ,它使用source-highlight高亮muse中的代码
(defun muse-publish-source-tag (beg end attrs)
(let ((lang (cdr (assoc "lang" attrs)))
(style (muse-style-element :base))
hcodes)
(if (string-equal style "pdf") (setq style "latex"))
(if lang
(progn
(muse-publish-command-tag
beg end
(cons (cons "interp" (format "echo \"

$(source-highlight -s %s -f %s)
\"" lang style))
attrs))
(muse-publish-mark-read-only beg (point)))
(error "No lang attribute specified in tag"))))

(add-to-list
'muse-publish-markup-tags '("source" t t nil muse-publish-source-tag))

;; 农历
;(add-to-list 'load-path "~/.emacs.d/")
;(require 'chinese-calendar)


;; 用标签显示打开的文件
;(require 'tabbar)
;(tabbar-mode)
;(global-set-key (kbd "S-") 'tabbar-backwark-group)
;(global-set-key (kbd "S-") 'tabbar-forward-group)
;(global-set-key (kbd "S-") 'tabbar-backward)
;(global-set-key (kbd "S-") 'tarbbar-forward)

;; color-theme
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
(require 'color-theme)
(color-theme-select)
(color-theme-robin-hood)
;(color-theme-gnome2)

;; sdcv 翻译单词
;; author: pluskid
;; 调用 stardict 的命令行接口来查辞典
;; 如果选中了 region 就查询 region 的内容,
;; 否则就查询当前光标所在的词

; 使用tooltip方式显示结果,必须在 X 下
;(global-set-key (kbd "C-c d") 'kid-star-dict)
;(defun kid-star-dict ()
; (interactive)
; (let ((begin (point-min))
; (end (point-max)))
; (if mark-active
; (setq begin (region-beginning)
; end (region-end))
; (save-excursion
; (backward-word)
; (mark-word)
; (setq begin (region-beginning)
; end (region-end))))
; ;; 有时候 stardict 会很慢,所以在回显区显示一点东西
; ;; 以免觉得 Emacs 在干什么其他奇怪的事情。
; (message "searching for %s ..." (buffer-substring begin end))
; (tooltip-show
; (shell-command-to-string
; (concat "sdcv -n "
; (buffer-substring begin end))))))

; 打开一个buffer显示查询结果
(global-set-key (kbd "C-c d") 'kid-sdcv-to-buffer)
(defun kid-sdcv-to-buffer ()
(interactive)
(let ((word (if mark-active
(buffer-substring-no-properties (region-beginning) (region-end))
(current-word nil t))))
(setq word (read-string (format "Search the dictionary for (default %s): " word)
nil nil word))
(set-buffer (get-buffer-create "*sdcv*"))
(buffer-disable-undo)
(erase-buffer)
(let ((process (start-process-shell-command "sdcv" "*sdcv*" "sdcv" "-n" word)))
(set-process-sentinel
process
(lambda (process signal)
(when (memq (process-status process) '(exit signal))
(unless (string= (buffer-name) "*sdcv*")
(setq kid-sdcv-window-configuration (current-window-configuration))
(switch-to-buffer-other-window "*sdcv*")
(local-set-key (kbd "d") 'kid-sdcv-to-buffer)
(local-set-key (kbd "q") (lambda ()
(interactive)
(bury-buffer)
(unless (null (cdr (window-list))) ; only one window
(delete-window)))))
(goto-char (point-min))))))))


;; Org mode 设置
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(canlock-password "2fb8ea64b90bfcccc6e15b08800687d00c610af3"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)


;; 绑定 F11 到emacs窗口全屏
(global-set-key [f11]
(lambda ()
(interactive)
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0))
)
)

我的 screen+urxvt 的配置文件


urxvt的配置文件: ~/.Xdefaults

! urxvt color set
URxvt.background: #0E0E08
URxvt.foreground: #CBCB7A

!Black
URxvt.color0: #000000
URxvt.color8: #555753
!Red
URxvt.color1: #CC0000
URxvt.color9: #EF2929
!Green
URxvt.color2: #4E9A06
URxvt.color10: #8AE234
!Yellow
URxvt.color3: #C4A000
URxvt.color11: #FCE94F
!Blue
URxvt.color4: #3465A4
URxvt.color12: #729FCF
!Magenta
URxvt.color5: #75507B
URxvt.color13: #AD7FA8
!Cyan
URxvt.color6: #06989A
URxvt.color14: #34E2E2
!White
URxvt.color7: #D3D7CF
URxvt.color15: #EEEEEC

! font set
!URxvt.font:xft:dejavu sans mono:pixelsize=12:antialias=false,xft:wenquanyi zenhei:pixelsize=13
URxvt.font:xft:dejavu sans mono:pixelsize=14:antialias=false,xft:wenquanyi zenhei:pixelsize=14
!URxvt.boldFont:xft:wenquanyi zenhei:pixelsize=13:Bold

! Input Method set
!URxvt.inputMethod:fcitx
!URxvt.imFont:Liberation Mono
!URxvt.preeditType: Root

! window geometry set
URxvt.geometry: 100x25
URxvt.title:Rxvt-Unicode

! bg transparent set
!URxvt.inheritPixmap: true
!URxvt.tintCddolor: white
!URxvt.shading: 80

! Tab set
!URxvt.perl-ext-common: default,tabbed
!URxvt.tabbed.tab-fg: 12
!URxvt.tabbed.tab-bg: 0
!URxvt.tabbed.tabbar-fg: 4

!Rxvt.menu:/etc/X11/rxvt.menu
!Rxvt.preeditType:Root
!Rxvt.transparency:255

! 开启标签功能
!URxvt.perl-ext-common: default,tabbed

!与screen结合
URxvt.secondaryScroll: true
URxvt.scrollTtyOutput: False
URxvt.scrollTtyKeypress: True
URxvt.scrollWithBuffer: True

!定制
!URxvt.termName:aybh
URxvt.title:jian
! scroll set
!URxvt.scrollBar:false
URxvt.scrollBar_right:True
URxvt.scrollBar_floating:True
URxvt.scrollstyle:plain
!URxvt.scrollWithBuffer:false
URxvt.saveLines:20000


screen的配置文件:~/.screenrc

escape ^J^J
#caption always "%?%F%{-b 4w}%:%{-b bb}%? %H | %l | %m-%d %c |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"
startup_message off

#
## ~/.screenrc
##
#
## 启动时不显示欢迎屏幕
#startup_message off
#
## 定义screen的功能键为Ctrl-Z。向终端输入Ctrl-Z时应按 Ctrl-Z z。
#escape ^Zz
#
## 屏幕缓冲区 1024 行。
defscrollback 1024
#
## 在最下一行显示窗口列表和时钟
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "
#
## 关闭错误提示
vbell off
#
## 按 Ctrl-j w 或 Ctrl-j Ctrl-W 显示窗口列表
bind w windowlist -b
bind ^w windowlist -b


我的GNU/Linux环境

目前,我的GNU/Linux环境大体是这样的。

环境:zh_CN.utf8
输入发:fcitx

窗口管理器:sawfish
虚拟控制台:我用urxvt+screen
Web浏览器:firefox 3
聊天:Pidgin (QQ,MSN)

其他:Emacs (编辑器;BBS;Email;...)

具体的配置在其他的文章中。