Subscribe to RSS Subscribe to Comments Blog of Roy Chan

Blog of Roy Chan

Progress dialog box of Zenity

Zenity is the tool to display different types of GTK+ dialog box. It is very useful if you want to write a simple GUI shell script.

Apart from those simple yes-no/ok-cancel dialog box, zenity also provide interesting dialog box like the progress dialog box. The dialog box can be show with the commend “zenity --progress“. To make it meaningful, you may need to add more options of it.

The option “--text=string” control a short description show above the progress bar in the dialog box and “--percentage=num” set the percentage show in the progress bar.

You must not miss the following 4 options which applicable to all zenity dialog box. “--title=string” set the title of the dialog box and “--window-icon=path” set the window icon show beside the title. “--width=num” and “--height=num” control the size in pixels of the window. For example:

zenity --progress --title='Waiting...' --window-icon='/usr/share/pixmaps/gnome-about-logo.png' --text='Waiting for you to press Cancel' --percentage=50

Zenity progress dialog box

Sure, you won’t happy with the above functions. Let make the dialog box moving. Option “--pulsate” can make the progress bar beating right and left:

yes | zenity --progress --pulsate

Zenity pulsating progress box

Not satisfied? Me too! So, when will the Ok button press-able. Can the progress bar grow to show the progress of a task? Yes, it can. During the zenity show the progress dialog box, it also listen to the STDIN. If you type an number and press ENTER in the terminal you run zenity, you will see the number become the percentage show progress bar of the dialog box. If you start and line with “#”, type few words after it and press ENTER, the words will replace the description above the progress bar. In short, zenity --progress received the following format from STDIN:

num1
# description1
num2
# description2
...
# ...

Where num percentage of the progress bar and description change the progress description. The following script demo and explain more clear about the progress dialog box:

for x in 10 20 30 40 50 60 70 80 90 100
do
    echo $x
    echo "# Count to $x"
    sleep 1
done | zenity --progress --title='Counter'

Zenity progress box

You see that when the progress bar become 100%, the Ok button is activated.

Besides, you will found that if you press the “Cancel” button during the script working. The dialog box will disappear but you won’t see the prompt while script still running and not affected. You should expect the “Cancel” button will stop the script but it’s not. Option “--auto-kill” should be added to make it happen. It make the “Cancel” button kill parent process of zenity - the shell. Beware that if you type zenity on the command line, it will kill the shell and close the whole terminal. If you run zenity in a shell script, the script will be killed.

The last option you shall not missed is “--auto-close” which close the dialog automatically when the progress bar reach 100.

Many people demonstrate zenity progress with wget which show a progress dialog to show the progress while wget downloading file. But it seems the output format of wget was changed and all script I found online didn’t work. Here is my fix of the demo.

wget "$url" 2>&1 | \
     sed -u 's/^.* \+\([0-9]\+%\) \+\([0-9.]\+[GMKB]\) \+\([0-9hms.]\+\).*$/\1\n# Downloading... \2 (\3)/' | \
     zenity --progress --title='Download' --auto-kill --auto-close

It refine the wget output:

11550K .......... .......... .......... .......... .......... 21%  304K 2m51s
11600K .......... .......... .......... .......... .......... 21%  296K 2m50s
11650K .......... .......... .......... .......... .......... 22%  321K 2m50s
11700K .......... .......... .......... .......... .......... 22%  475K 2m49s

to zenity --progress format.


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


在 EeePC 加入速成輸入法

早一陣子有朋友買了部 EeePC 901 回來,因為不慣用速成,但 eeepc 又無 速成輸入法,問我點搞。我都知 lazyeeepc 亦可以加速成輸入法,但因為朋友不想加 lazyeeepc, 所我就手動搞搞佢。

注意: 本文已放上 OSWikiHK, 請到 在 EeePC 加輸入法 一文看最新最完整的版本。

EeePC 900/900A/901 使用 gcin 作為輸入法引擎。雖然預設只有幾個輸入法,但其實 gcin 提供了很多其他輸入法 (包括速成) ,只是沒有開啟罷了 (可能華碩怕太多輸入法選擇會很亂)。要開啟這些隱藏了的輸入法,需要手動改變設定。

先 Ctrl-Alt-T 開啟終端機 (Terminal), 在 /home/user> 提示符下輸入以下命令檢查您的 EeePC 使用的輸入法引擎是否 gcin:

echo $XMODIFIERS

如果顯示 @im=scim,您的 EeePC 應該仍是舊版 (700/701) ,還使用 scim 。您應該跟 SCIM一節的方法在 SCIM 安裝速成等輸入法或在終端機打 sudo apt-get autoremove scim; sudo apt-get install gcin gcin-qt3-immodule 安裝 gcin 取代 scim 。

如果顯示的是 @im=gcin,則表示您確實是 gcin ,可以按以下指示安裝速成等輸入法。先在終端機打以下命令把系統預設的 gcin 輸入法清單複製至目錄 ~/.gcin 中:

cp /usr/share/gcin/table/gtab.list ~/.gcin/gtab.list

輸入以下指令用文字編輯器 Kate 開啟 ~/.gcin/gtab.list:

kate ~/.gcin/gtab.list

並把檔案編輯成以下:

繁體倉頡 1 cj.gtab cj.png
繁體簡易 2 simplex.gtab simplex.png
繁體注音 3 - juyin.png
繁體詞音 6 - tsin.png
繁體大易 7 dayi3.gtab dayi3.png
簡體五筆 8 wubi.gtab wubi.png
簡體拼音 5 pinyin.gtab pinyin.png
#內碼 0 - intcode.png
#倉頡五代 2 cj5.gtab cj5.png
#標點倉頡 4 cj-punc.gtab cj-punc.png
#繁體行列 8 ar30.gtab ar30.png
#日本式 =  kana-nippon.gtab kana-nippon.png
#Greek ` greek.gtab greek.png
#拉丁字母 [ latin-letters.gtab latin-letters.png
#帶調粵拼 ] jyutping.gtab jyutping.png

重點在於增加了第二行,令 gcin 有 簡易 (即是速成輸入法) 可以選。您亦可以刪除上文字一些輸入法前的井號 (#) 啟用該隱藏了的輸入法。儲存後, 將 gtab.list 複製至幾個語系 (locale):

cd ~/.gcin
cp gtab.list gtab_en.list
cp gtab.list gtab_tw.list
cp gtab.list gtab_cn.list

完成後,先關閉了所有正在運行中的軟件,然後按 Ctrl-Alt-Backspace 重新啟動 X-Window (會中止所有執行中的 X-Window 程式) 就可以正常使用速成輸入法了。

其他 gcin 設定可以打 gcin-setup 跑 gcin 個設定程式。

您亦可以到 /usr/share/gcin/table 找到其他 eeepc 個 gcin 無用到既輸入法檔 (*.gtab) 可同樣用以上方法加入。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Upgrade to Diablo (Maemo 4.1)

Ok, you won’t believe that I haven’t upgrade my N800 to the lateast OS2008, Diablo (Maemo 4.1) until today. I even unaware it til bunny tell me few weeks ago.

2 Major things that diablo delights me are the Chinese support on RSS reader and the new mail client Modest. Ok, it also shipped with the Chinese font MHei18030C5.ttf. But I used the Chinese font provided by Google’s Android SDK which is much better then AR PL UMing since I upgrade to OS2008 beta. I have never got a problem on reading Chinese in N800. However, the broken Chinese support in RSS reader in Maemo 4.0 really make it useless for me. It is great they really fix it in Diablo. Besides, the long waiting Modest is pretty great. I had try the beta version of it last year in OS2008 beta and found it is much better then the old mail client. However the beta version didn’t integrated well with Task applet. I haven’t use the N800 to read mail since I upgrade to the official OS2008 (Maemo 4.0) coz it didn’t ship with Modest. Now, n800 can really become the Internet Tablet instead of only an E-Book reader or Podcast player for me. Wow!!!!!


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


GNU/Linux HSDPA (3.5G) 上網!?

早一陣子,有人問我 GNU/Linux 可不可以 HSDRA (3.5G) 上網。現在香港 HSDPA 計畫都頗貴,我沒有錢使用,所以亦答不到。不過研究一下亦無況。

Google 搜索一下,Tuxmobil 有一專頁收集了有過 GNU/Linux 3G 上網的資料。似乎上 Smartone-Vodafone 最新那個 HSDPA USB stick 有 GNU/Linux 驅動器,有 Debian、Fedora 8 和 OpenSuSE 10.3 等 distro 的套件預備。但見討論區有不少人投訴驅動器有問題。

有機會要找個有 Smartone-Vodafone USB stick 的朋友備來試試。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Feodra 9 中 KDE4 的中文支援問題

KDE4 的介面有很多吸引人的支援,不過多個使用 KDE4 的 distribution 在中文支援都問題多,繼 Kubuntu KDE 4 Remix 後,Fedora 9 中的 KDE4 也是沒有搞好中文支援。在 VM 試了幾次,亦在些簡介一下修正中文支援問題的方法 (本文最新版本已拼入 OSWiki 中的 安裝 Fedora 9使用 LiveCD 安裝 Fedora 9 桌面中):

首先需要自行自行安裝下以套件(Package):

  • kde-l10n-Chinese - KDE 簡體中文支援
  • kde-l10n-Chinese-Traditional - KDE 繁體中文支援
  • im-chooser - 讓您設定輸入法引擎的圖形介面工具。
  • scim-tables-chinese - SCIM 的中文輸法表,包括香港人常用的倉頡、速成、港式廣東話、行列、五筆等。安裝此套件時 YUM 自動會安裝其他所需的 SCIM 套件。
  • scim-pinyin - SCIM 智能漢語拼音輸入法。安裝此套件時 YUM 自動會安裝其他所需的 SCIM 套件。
  • scim-chewing - SCIM 酷音輸入法 (一種智能注音輸入法)。安裝此套件時 YUM 自動會安裝其他所需的 SCIM 套件。

即是使用倉頡、速成或港式廣東話的使用者可以打命令:

yum install kde-l10n-Chinese-Traditional im-chooser scim-tables-chinese

即是使用漢語拼音的使用者可以打命令:

yum install kde-l10n-Chinese im-chooser scim-pinyin

即是使用的使用者可以打命令:

yum install kde-l10n-Chinese-Traditional im-chooser scim-chewing

安裝完成後,執行 im-chooser。勾選 Enable input method feature,選擇 “Use SCIM”

使用 LiveCD 安裝的朋友需要在 K 選單中選 應用程式(Application) -> 設定(Settings) -> 系統設定(System Settings)。在系統設定(System Settings)中選擇地區與語言(Regional and Language),並在新增語言 (Add Language) 中選擇『繁體中文』(Chinese)後按套用(Apply)。

再重新登入後,您需要在 SCIM 輸入法設定中的 介面(前端) -> 全域設定中的以下三個快速鍵:

  • 作用鍵: Control+space
  • 下一種輸入法: Shift+Control+KeyRelease+Shift_L

設定後,按『確定』。

相關連結:


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


GDM 佈景主題: 用 Google/Windows/Mac 登入

GDM Google GDM

我一向都喜歡使用有人像的 GDM 登入畫面,近來最想使用的 tobain 設計的 Avio-GDM,不過今天看見 feuc5766 設計的 GDM Google English GDM 登入佈景,覺得很有趣。這個佈景主題把登入畫面裝扮成 Google 搜尋網頁,暗喻 Google 在當世電腦世界的地位。

當然,Gnome-look.org 還有模仿其他 OS 的登入畫面佈景:


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Ubuntu 上的圖形介面 PPPoE 連接程式!? Gnome System Tools 2.22

慣性教人在 Ubuntu 或 Debian 連上 xDSL 都是使用文字模式的 PPPoE 設定程式 pppoeconf 。不過跟據多年教人使用 GNU/Linux 的經驗,很多人對就算遇然打一兩句命令或文字模式的程式都很抗拒的。號稱人性化的 Ubuntu 多年來仍只用文字模式的 pppoeconf 來設定 xDSL 連線,似乎有點說不過去。

不過令天倒留意到 GNOME System Tools 2.22 中的 network-admin 似乎有了 PPPoE 的支援。翻查 changelog ,PPPoE 和 GPRS/UMTS 是在 2.21.4 時加入。(去年 12 月推出)

只要選取 系統 -> 管理 -> 網路 執行 network-admin ,雙擊 “點對點連接” (Point-to-Point connection) 。

GNOME System Tools 的 network-admin

在 ppp0 的屬性中,勾選啟用這個連線 (Enable this connection),就在連線類型 (Connection Type) 中,選擇 序列數據機 (Serial Modem)、 PPPoE 或 GPRS/UMTS 。

PPPoE 設定

因為本人的寬頻供應商不使用 PPPoE ,所以未能測試這個新功能。如果有人可以幫手測試一下,並郵寄一兩個 screenshot 給我, 我會感激不盡。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


OpenOffice.org 也加入超炫聯盟!! 3D Impress 轉畫面動畫

當 KDE4 和 Compiz Fusion 帶 GNU/Linux 進入超炫的國度,OpenOffice.org 似乎略為遜色。不過最近進出的 OpenOffice.org 2.4 也多了個 Fancy 元件。只要您安裝 OpenGL transitions 元件,在 Impress 就多了幾個超炫的 3D 轉畫面動畫。Ubuntu 8.04 或 Debian Sid/Lenny 使用者可以安裝套件 openoffice.org-ogltrans :

  sudo apt-get install openoffice.org-ogltrans

我個人最喜歡 Rochade 和 Turn Over 動畫。不過當然,Draw 的功能可以再強化點更好。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


堅強的鷺展翅! Ubuntu 第二個長期支援版 8.04 登場

Ubuntu 8.04 (Hardy Heron) 終於在最幾天正式進出。跑了幾天,似乎比 7.10 穩定很多。因為事前已把 OSWikiHK中的 Ubuntu 安裝手冊更新得七七八八,也在正式進出後幾個小時正式貼上 8.04 的桌面伺服器的安裝手冊。結果反應不錯,單計 8.04 桌面安裝手冊,兩天裡每天都有近 700 個 hits 。Mobile01 一個 post 就貢獻了百多個 hits。不過 server 就有點辛苦了。

留意這版本中 Edubuntu 不成有獨立的安裝光碟 ,反而變會 Ubuntu 的一個 extension 。而 Kubuntu 也分別有 KDE 3 和 KDE 4 兩個版本的光碟,KDE 4 版未能輸入中文。這個版本另一大賣點是收錄了著名 Wubi , Windows 使用者可以不分割硬碟安裝 Ubuntu。原理並不新鮮,只是在 Windows 上建立一個大的檔案作為 Ubuntu 的 virtual partition,Boot 入 Ubuntu 時, Ubuntu 自然會使用該檔案佔據的位置作為 / ,速度不會比平常安裝出來 Ubuntu 慢。更好的時,Windows 使用者可以像移除普通 Windows 軟件般在 Windows 上移除 Wubi 安裝出來的 Ubuntu。此舉加大了打破 Windows 使用者心理障礙的機會。找台 Windows 機來試,稍後再加上桌面安裝手冊中。

更新: 《使用 Wubi 在 Windows 安裝 Ubuntu/Kubuntu/Xubuntu》已完成了。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


修正 Ubuntu 在安裝其他 Distribution 後不能休眠問題

這個問題解決了差不多半年,不過近日安裝 Fedora 8 在 Ubuntu 7.10 的電腦上,又要修正一次。所以順道寫下來記錄一下。

Ubuntu 預設使用 UUID 辯認不同的分割區。格式化 swap 分割區會重新產生一個新的 UUID ,令 Ubuntu 不能找不到 swap 分割區。由於系統休眠 (Hibernation) 要將系統狀態儲存入 swap 分割區。找不到會令 swap 分割區會令休眠和回復失敗。所以我們需要告訴 Ubuntu swap 分割區的新 UUID 才能修正休眠功能。

先用 blkid 找出 swap 分割區的新 UUID :

# blkid  
/dev/sda1: TYPE=”ntfs” 
/dev/sda2: UUID=”b8a89b69-f090-4012-94f6-a243014d1184″ SEC_TYPE=”ext2″ TYPE=”ext3″ 
/dev/sda5: LABEL=”SwapSpace” UUID=”62a19d18-5c43-4df8-9df0-70353bf7dc5d” TYPE=”swap” 
/dev/sda6: UUID=”6357e627-dea6-418f-8735-14ddc377ff66″ SEC_TYPE=”ext2″ TYPE=”ext3″ 
/dev/sda7: UUID=”02c44f5b-d41e-42d3-9dfa-9517be310d3f” SEC_TYPE=”ext2″ TYPE=”ext3″ 
/dev/sda8: UUID=”0a22b594-f2ce-4183-8aa3-ea3a7b9a371d” SEC_TYPE=”ext2″ TYPE=”ext3″ 
/dev/sda9: LABEL=”/” UUID=”bc101f56-e391-4022-b280-d29eb7cf76a5″ SEC_TYPE=”ext2″ TYPE=”ext3″ 

現在我們可以得知 Swap 分割區的 UUID 是「62a19d18-5c43-4df8-9df0-70353bf7dc5d」。先修正 /etc/fstab 中的 Swap 分割區位置:

# /dev/sda5
# UUID=e5113b30-3c4c-4ddc-9c14-e4ecd0374886 none          swap    sw              0       0
UUID=62a19d18-5c43-4df8-9df0-70353bf7dc5d none            swap    sw              0       0

接著要改變休眠回復的分割區 UUID 。先修正 /etc/initramfs-tools/conf.d/resume上的 UUID:

RESUME=UUID=62a19d18-5c43-4df8-9df0-70353bf7dc5d

然後打「update-initramfs -u」重建 initrd 檔。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Philips 220EW and Gutsy

Spent some time to configure the Gutsy (Ubuntu 7.10) to work with Philips’ 22-inch LCD monitor. Th mon suppose can display up to 1680×1050 pixels. However, it doesn’t work in Gutsy. The display shift to right and keep blinking. I try to configure the X Window with displayconfig-gtk and editing xorg.conf manually but no luck.

xvidtune doesn’t help and Google show that some people also suffer same situation on Gutsy but fixed in Fedora 8. I haven’t try to install Fedora 8. But at least, I found the mon work well in 1440×900@60Hz. Anyway, lazy to make a further study. 1440×900 is fine for me. p

Update: Hardy (Ubuntu 8.04) fixed it and able to display 1680×1050.


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


N800 用後一週

R&D mode

之前提過 Maemo 的 R&D mode ,終於提到一點資料。做法頗煩複,要在 flash 時在 flasher 加上選項 “--enable-rd-mode“。啟用了 R&D mode 主要可以用 “sudo gainroot” 進入 root 和按開關掣會立即開機 (平時要按數秒才開機)。

似乎還是用 becomeroot 套件比較方便。

自動掛載或卸載 SD

年頭看一些 N800 的評論,有人投訴 N800 的 status bar 沒有退出 SD 卡的工具,懷疑要手動在終端機打 “umount /media/mmc1“。N800 到手後,我實際觀察,發覺當你打開 External SD slot 的蓋時, N800 已感應到並自動 unmount SD。當你關閉 slot 蓋,N800 又會自動 mount 起 SD 卡。如果你打開 slot 蓋時有程式正使用 SD 卡上卡的檔案 (如終端機 cd 到 /media/mmc1 ) ,N800 會彈出警告訊息。

在 MicroB Browser 選擇文字

初用 MicroB Browser ,發覺不能選擇文字作 copy&paste ,在網頁上拖拉只會令網頁捲上下左右。早幾天用手指捲動網頁才發覺偶然可以選擇文字,再查看線上說明,才知道要快速點擊網頁,就可以拖拉選擇文字作 copy&paste。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Ubuntu 7.10 和 Fedora 8

這大半年的時間都很懶寫 blog, 一來忙 MSc, 二來也多花時間去整理 OSWikiHK。順帶提一提 Ubuntu/Kubuntu/Edubuntu/Xubuntu 7.10 (Gusty Gibbon) 的安裝手冊 (桌面伺服器)早在個多月前已完成了。也有份教人由 Ubuntu 7.04 (Feisty)升級至 7.10 的文章Fedora 8 (Werewolf)才完成了幾個星期 (LiveCD 倒時未正式動手)


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


How to login root in Nokia OS2008 (N800/N810)

Skype in OS2008

I have just upgrade my new N800 to OS2008 beta (Maemo 4.0). Most program run faster and more smooth in OS2008, including MicroB Browser and the PDF Viewer. Of course, you should aware that many application are not ported to OS2008 yet. (Compared that there is 191 apps in www.maemo.org for OS2007 but only 37 for OS2008 )

After upgraded to OS2008, I found that I can’t login as root as in OS2007. Different from the GNU/Linux embedded devices I used before, Maemo use a better security structure. It run most application in a common user “user” instead of “root” in other embedded platforms. Sudo is used to execute tasks needed system administrator right. And you will see many rules is defined in /etc/sudoers.

### Automatically added by update-sudoers start ###
user ALL = NOPASSWD: /etc/init.d/ke-recv start
user ALL = NOPASSWD: /etc/init.d/ke-recv stop
user ALL = NOPASSWD: /etc/init.d/alarmd start
user ALL = NOPASSWD: /etc/init.d/alarmd stop
user ALL = NOPASSWD: /etc/init.d/osso-hss start
user ALL = NOPASSWD: /etc/init.d/osso-hss stop
user ALL = NOPASSWD: /usr/bin/osso-product-info
user ALL = NOPASSWD: /bin/rm -f /tmp/.opi.tmp
### Automatically added by update-sudoers end ###

In OS2007, the root user was “protected” by a simple password “rootme”. It wouldn’t cause much problem until you install ssh server in it. The password of user “user” is locked. You can change it by “su” as root and change the password of user by “passwd user“. However, things changed in OS2008. They locked both the password of “root” and “user”. You can’t login root with “su” anymore.

It is said that you can use switch it to R&D mode or install a package becomeroot to get back your root again. I have no idea about R&D mode but found the becomeroot. Here is the procedure (Beware that the following step will introduce security risk to your tablet, make sure you know what you are doing and pick good passwords):

  • Open the web browser (MicroB browser)
  • Download the becomeroot package with the web browser, choose “Open” to install it.
  • After that you can login the root by typing the following command in the XTerm:
  sudo gainroot
  • Now you can change the password of “user” and “root” with “passwd user” and “passwd root“.

Warnning: Notice you again that the above action may allow people to take the control your tablet from wireless network. Choose good passwords for the both account.


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


New Gadget: Nokia N800

Nokia N800

Let see my new Gadget!!! It’s not iPhone! Not EeePC! Not even the latest N810 but the previous version of Nokia GNU/Linux Internet Tablet N810 which released nearly a year. Wow!!!!!


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


加快 Notebook 啟動 Ubuntu 速度: 取消開機自動啟動網絡

老方法,不過好像一直沒有記下來。

在 Notebook 啟動 Ubuntu 一般都會很慢。因為 Ubuntu 的圖像開機畫面令人看不到那裡出現問題。按 Alt-Ctrl-F8 就可以發現原兇。問題在於 Notebook 多會使用無線網絡,而開機時一般都還未連上無線網絡或插上網線。而和一般 GNU/Linux 一樣, Ubuntu 開機會自動啟動網絡。當 /etc/init.d/networking 未能找到網絡,自動需要等 timeout 才宣告啟動網絡失敗和繼續下一步。這一下 timeout 要浪廢十多二十秒的時間。

反正現時的網絡連接都交由 Network Manager 管理,我何大可以 rm /etc/rcS.d/S40networking 以取消開機自動啟動網絡,侍登入帳戶後, Network Manager 自動會動連幫我們連接網絡。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


防孤兒行動!!!!!

剛剛在 Planet.Compiz-Fusion.org 看到這段 xkcd 的漫畫:

orphaned_projects.png

P.S. Foka 剛提醒我漫畫有 title 有一小段故事,我懶得貼上來,請自己點去原站,把 mouse 放在漫畫上等數秒。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


How gnome-codec-install in Ubuntu work?

Ok, I know that I can ask people to install all GStreamer plugin to solve the codecs problems. But some people keep asking which package they need exactly. One thing in Ubuntu 7.04 that help me a lot is that is that it can detect the codec you need when you try to play a multimedia file and help you to install the packages. However, I still need to told people which package they really need on other distros.

I try to look around the gnome-codec-install and dig out how it know which package we need. First, gnome-codec-install is only a symbolic link of gnome-app-install. gnome-app-install put information of all available desktop applications in .desktop file under /usr/share/app-install/desktop. Those codecs package got the field “X-AppInstall-Codecs’ in their .desktop file. update-app-install will collect the information of all .desktop and build index in /var/cache/app-install/. The index file is in GDBM. I’m lazy to decode it. Therefore, I wrote a one-line shell command to build an index table from the .desktop files. Run the following command under /usr/share/app-install/desktop


grep  -l 'X-AppInstall-Codecs' * | while read file;
    do
        pkg=`basename "$file" .desktop`;
        grep 'X-AppInstall-Codecs' $file | \
            sed -e 's/^X-AppInstall-Codecs//' \
                -e 's/[=;]0.10:/\n'$pkg':/g' \
                -e 's/\.desktop$//'
    done | awk -F: '{printf "%s:%s\n", $2, $1}' | sort | less

Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


Beryl 在北京的”Wah” 電腦新體驗

Ubuntu 7.04 Beryl Cube

上星期在南京北京走了一趟,到現在才有時間寫寫這次出差的經驗。

為北京分公司做宣傳,這次北京短短兩天半的時間走訪了幾間北京的大學和高等學院介紹GNU/Linux和Computer Forensics。由於事忙,一直未有準備演講的內容,加上北京同事設提的壓力,隨手找了最簡單的Beryl作演示,結果反應好得令我出奇。Beryl獨有的火燒視窗環形視窗切換器(Ring Window Switcher)等固然引來哄動的徊響。然而,傳統的cube和橡皮糖視窗招來”Wah! Wah!”的驚嘆!

微軟在宣傳Vista時就用一系列所謂”Wow”體驗的故事和所謂”Wow”電腦新體驗的口號。三月時,我就曾和YPWong討論過利用Beryl製造一些”Yeah”/”Yo”體驗的故事和Vista打對台,後來因時間問題不了了之。但這次北京之旅,我們確實真的利用Beryl打造了”Wah”電腦新體驗的故事。


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]


606 和 610

看到這兩個數目字,我們想到的不是熊貓,而是野鴨和小蜥蜴 ;P。 那 704 和 710 會送到那裡?


Share It: [del.icio.us] [Technorati] [Google Bookmark] [Yahoo MyWeb] [Furl]