前陣子提到了 Zebra-crossing,這兩日又見得 Tom Gibara 的一個有趣的計畫 Moseycode。Moseycode 也是針對 Google Android 平台所開發的二維條碼讀碼軟體,不過他重新開發了一種新的條碼規格,特意在條碼中間留了空白,雖說如此可以攜帶的資訊變少,但是卻可以置入人眼可以識別的圖樣。也因此這種條碼的規格或許會更適於作為廣告用途。

目前只能在 Android SDK 上執行,但是見來幾個示範影片,Moseycode 才剛完成基礎的演算法。接下來是必須克服移植到實際硬體上的最佳化了。

方才試著在 iPhone 上裝了 iMatrix。根據關於網頁,iMatrix 是由 Sergey Odinokov 所開發,這些條碼辨識的技術是在工業國家立陶宛(Lithuania) 所研發出來的。

目前的 iMatrix 4.0 已經可以支援三、四種條碼,根據同時開啟 QRCode, DataMatrix, ShotCode 的辨識狀態下,使用者經驗還是相當不錯。

除了可以支援開放規格的 QRCode 與 DataMatrix 外,尚預計支援 ShotCode, EZCode, BeeTagg 等私有規格條碼,這點倒是非常有趣。安裝方式非常簡單,只要在 Installer.app 中鍵入 iMatrix 的軟體庫位址 http://www.iMatrix.LT/repo/repository.plist,然後於套件分類表的 2D Code 中選擇 iMatrix 即可。


IPhone QR-code Reader !

除了 iMatrix, Google Code 上也有另外一個自由軟體版本的 iPhone QRCode 讀碼軟體開發計畫,作者djMaxM 試著移植 FUKUCHI Kentarolibqrencode 到 iPhone 上,目前已經釋出可以編譯的版本。至於效果如何,晤…..客官請自行斟酌使用。

上一篇提到可以透過 debconf 的無交互介面的軟體安裝,其實你尚可以用 debconf 來做 preseeding (sarge 的中文手冊也提到 preseeding)的設定檔。Preseeding 是一種製作「無人值守」安裝光碟的方法,基本上就是以預先設定回答所有安裝過程中會詢問的問題,因此你可以先做好一片預定安裝的軟體與設定的安裝光碟/設定檔,然後使用該設定自動安裝機器。透過 debconf 的幫忙,你可以先架設一台 Debian 主機作為「種子」,然後以該種子的設定複製到其它的新安裝機器上。作法相當容易,你可以使用 debconf-get-selections 取得種子機器的所有設定,透過參數程式會吐出一段樣本,再依據需求校改即可。

# debconf-get-selections --installer

相關的語法同手冊描述,修改完成的 preseed.cfg 可於置於網路或磁碟中,再於一般的 Debian 安裝光碟中指定路徑即可。雖說相關的指令不難,但是若要修改到可以順利安裝與調整的程度,還是需要相當多時間調校,相關說明不妨參考 Automating new Debian installations with preseeding

AndrewLee 利用 preseeding 做了一組 Debian for Beginners,內容整合了中文相關的套件與常用的軟體。陸陸續續也校修了不少問題,有興趣使用 Debian 的人不妨試用安裝。至於想偷學技巧人,請往 http://debian.org.tw/d-i/etch/preseed.cfg 挖寶去吧。

Once you have many Debian servers, maintenance would be a problem. I just counted that I have more then 30 etch servers running in several vserver machines. Sometimes, I would like to install Debian package in all of these servers. However, it takes too much time to ssh /vserver enter into every hosts, and answer the installation questions one by one.

Thanks for the debconf(1), it’s quite easy to do non-interactive installation, since debconf already provide a noninteractive frontend. All you need to do is set the configuration before you install the package. It can be done by debconf-set-selections.

First, you have to install the package in one hosts. It would be better if you install/test the package on the same distribution version and package version. Here is an example for install localepurge. localepurge is a software for superfluous locale data, that will save you some disk space. As a Chinese, I usually don’t need Spanish, Franch and any other hundreds of different locale data.

Once you install the localepurge, you can use debconf-get-selections to dump the configuration you did.  The debconf-get-selections is part of the debconf-utils. The command would look like

# debconf-get-selections |grep ^localepurge
localepurge	localepurge/quickndirtycalc	boolean	true
localepurge	localepurge/remove_no	note
localepurge	localepurge/mandelete	boolean	true
localepurge	localepurge/showfreedspace	boolean	true
localepurge	localepurge/verbose	boolean	false
localepurge	localepurge/nopurge	multiselect	en, en_US.UTF-8, zh, zh_TW, zh_TW.UTF-8
localepurge	localepurge/dontbothernew	boolean	false
localepurge	localepurge/none_selected	boolean	false

So, these are the questions the debconf will ask you. (Since the questions has different priorities, you might not be asked for all the questions) The localepurge/nopurge line is the locales data we want to keep, so we also want to let the other servers have the same settings. You can use debconf-set-selections to set the values in the other servers.

# echo "localepurge localepurge/nopurge multiselect en, en_US.UTF-8, zh, zh_TW, zh_TW.UTF-8"|debconf-set-selections

Then you can now install the package, it will use the default value you just gave. If you need to install many servser, and do not want to see the question dialogs. You can use noninteractive fronetend to bypas the questions.

# DEBIAN_FRONTEND=noninteractive dpkg-reconfigure localepurge

This is a Tips for Debian system.

Thanks clkao (高大師) for the great svn-mirror tool. I am using svn-mirror 0.68-3 on Debian Etch for mirror svn repository from the damn far and slow European svn server, so I can enjoy the super faster checkout and show the log messages on local server.

However, since the the svn server is slow and connection is not stable (otherwise I don’t need svn-mirror anyway). The connection might be dropped or the process could be killed by accident in the long mirroring process. The problem is once the program is killed (Ex: by Control+C), then it will run into a dead lock situation. You will keep seeing this messages, and never get the mirror work again.

Waiting for sync lock on /mirror/remote: openwrt:25221.

In order to fix the problem, I wrote a simple script svn-mirror-unlock.pl. It’s for clean the dead lock.

$ svn-mirror-unlock.pl
svn-mirror-unlock.pl: unlock SVMREPOS path
$ perl svn-mirror-unlock.pl unlock /home/svn mirror/remote

This is a tip for Debian.

身為網管,時常需要計算統計網路位址,雖說計算不複雜,一隻鉛筆加腦袋也可以算出需要的網域,但是使用工具輔助總是較為方便。先前是使用 ipcalc,每次計算都要下達指令總是不太方便,最近改用 gipgip 是以 GTK2 為基礎開發的圖形介面 IPv4 位址計算機,拿來做規劃網路的小工具還算實用。(其實通常只用到 IPv4 Address Analyzer)

IPv4 Address Analyzer

IPv4 Range to Prefix Converter.

這是一篇 Debian Tips.