2011年1月25日 星期二

fix emesene 1.6.3 login error

一兩個月前開始,登入 emesene 1.6.3 版的時候都會跳出下列錯誤:
emesene error
Exception
You are using emesene 1.6.3 - "Uberlândia" so you're free to complain here:
http://forum.emesene.org/index.php/board,19.0.html
Check already existing tickets for duplicates first, please.
Traceback (most recent call last):

File "/usr/share/emesene/emesenelib/soap/manager.py", line 139, in process
return process()

File "/usr/share/emesene/emesenelib/soap/manager.py", line 76, in process
response.callback(response, *response.args)

File "/usr/share/emesene/emesenelib/ProfileManager.py", line 155, in onGetProfile
photo = response.body.split('</Photo>')[0].split('<Photo>')[1]

IndexError: list index out of range
接著 MSN 暱稱變成註冊信箱,個人狀態一片空白,在官方論壇看到討論說這是 MSN 傳回的內容有改變,造成 emesene 抓不到暱稱和狀態,只要更新到最新的 SVN 版本就可解決。

因為懶得再去找 SVN 版本下來安裝,就直接上 Repository 抓 ProfileManager.py 下來產生 patch,反正有問題再用 patch -R 就可以更改回來,目前使用起來一切正常,不知道 emesene2 什麼時候才會發佈 stable 版本?

diff -u /usr/share/emesene/emesenelib/ProfileManager.py ~/ProfileManager.py > emesene_profile.patch
patch -v /usr/share/emesene/emesenelib/ProfileManager.py emesene_profile.patch

2010年12月26日 星期日

幾個有趣的 Project 和文章

因為分頁開著放很久了,又沒時間去看,先紀錄下來,以後如果有空再...。

pep8
pep8 is a tool to check your Python code against some of the style conventions in PEP 8.

archery

Archey is a system information tool written in Python.

psutil :
psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalities offered by command line tools like ps, top, kill, lsof and netstat.

shellinabox
Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.

How to get your code into an open source project

2010年11月14日 星期日

讓 xpdf 能正常顯示無內嵌字型的檔案

之前有寫過一篇 讓 xpdf 能正常顯示中文 (Arch Linux);但是捐血中心寄來的檢驗報告一直都是亂碼,原本以為是捐血中心的問題,直到前幾天想下載 大家來學 Vim 一個歷久彌新的編輯器 的 pdf 才發現沒有內嵌字型的 pdf 也是亂碼,於是就用 shell 呼叫 xpdf 開檔案,再由錯誤訊息去 google ,找了一堆討論,發現 xpdf 的語言包可以解決這個問題;自己測試沒有問題後,再追到 Arch Linux 的 package 上面,發現最新的 PKGBUILD 沒有複製 Adobe-CNS1.cidToUnicode 到 /usr/share/xpdf/ 下面,丟了個 bug report ,隔天 trunk 的 PKGBUILD 就更新了,雖然不知道什麼時候才會移到正式版上面去,但是能貢獻自己小小心力,還有學到一丁點知識,有點開心 :)

Reference:
FreeBSD Chinese HOWTO - 6.9. 以 gs 觀看不內嵌的 pdf 檔
"資訊人權貴" 之家 - 字形/中文
Edward G.J. Lee 的 xpdfrc 範例檔
xpdf - Download
Arch Linux Package - xpdf-chinese-traditional
Arch Wiki - Creating Packages

2010年11月2日 星期二

mount /var to a new partition

當初安裝的時候沒有把 /var 獨立出一個分割區,最近發現 / 剩餘空間愈來愈少,利用
sudo du -h --max-depth=1 /
才發現 /var 就佔了超過 2G ,大部份都是被 Cache 這個目錄吃掉,這是 pacman 的暫存檔,雖然可以用
sudo pacman -Sc
清掉,但是身為一個懶惰的傢伙,加上不曉得什麼時候會需要 downgrade 某個套件,乾脆就另外準備一個分割區來放。


備份資料到隨身碟時,發現裡面中文目錄或檔案都變成亂碼,似乎是 xfce4 的問題,
修改 /etc/xdg/xfce4/mount.rc
在 [vfat] 下面增加一行
utf8=true
下次插入隨身碟時就可以正常顯示中文了。

使用 Gparted Live CD 以預設選項進入 X 時,螢幕會出現
Out of Range
無法顯示畫面,逼的我用 Alt + SysRq + [ U , B ] 來重開機,改手動設定解析度就可以正常進入 X,切好分割區並格式化後,mount 原本的 / 與 新切割給 /var 的分割區,複製舊資料,更改原本的 /etc/fstab 。
mkdir ~/rrt ~/new_var

mount /dev/real_root_partition ~/rrt
mount /dev/new_var_partition ~/new_var

# 複製原本 var 下的檔案到新分割區
# 重新命名原本的 var,避免重新開機後掛載到內有檔案的資料夾
sudo cp -ax ~/rrt/var/* ~/new_var/
sudo mv ~/rrt/var ~/rrt/var.old
sudo mkdir ~/rrt/var

sudo cp ~/rrt/etc/fstab ~/rrt/etc/fstab.old

# 利用 blkid 來查 uuid 資料並更新 fstab 資料
blkid > ~/uuid.txt
cat ~/rrt/etc/fstab ~/uuid.txt > ~/fstab.new
# 使用 vi 修改完畢後覆蓋回原本的 /etc/fstab
sudo cp ~/fstab.new ~/rrt/etc/fstab
# 重新開機,測試是否有成功掛載
# 自己重新開機後有碰到一個問題,blkid 顯示的還是舊的分割區資料
# 後來 man blkid 才知道是讀取 cache 的問題
# 使用 blkid -g 就可以清除 ( 但是要用 root 權限去跑,否則沒用 )
sudo blkid -g
sudo blkid

Reference:
ArchWiki:Xfce
Ubuntu Forums:I want to move /var to a new partition

2010年11月1日 星期一

Hide Opera system tray icon with Opera 10.63

過去都是使用
opera -notrayicon
來隱藏 Opera 的圖示,現在已經沒有這個 argument,改成直接在 opera:config 裡面設定



取消勾選 Show Tray Icon 就行了。