本人在App Store上的第一隻APP: Cangjie Traditional Chinese Input

因SERVER有問題及無時間,無寫幾個月BLOG了。一寫,就要賣一賣廣告。
小弟第一隻IPHONE APP:Cangjie Traditional Chinese Input上了APP STORE了,是一隻實際上寫給自己用的,可在IPAD上用倉頡打傳統中文的APP。不過既然寫了出來,安裝入IPAD上亦要買US$99的DEV ACCOUNT,那麼不如順手放上APP STORE做福人群。

經過1個月的等待,APPLE終於在9月16日APPROVE,經歴一星期在香港區下載第一位的寶座後,現在已跌落三十幾位,但在工具區仍是第一位。
而在9月28日APPLE亦APPROVE了1.1版,這個版本加入了速成輸入法。

其實這個Cangjie Traditional Chinese Input的打字方式,我刻意做到和我平時在電腦用英文KEYBOARD打字的情況一樣,都是按下空白鍵後才會選時,這個APP用藍牙或USB KEYBOARD上打字是一流的,因為在選字是可直接打數字去選。

本人因打倉頡是用第五代的倉頡碼,而WINDOWS用的倉頡碼是第三代的,所以本APP支援第5代和第3代的倉頡碼。
由於只是自己用,所以功能簡單,做到覺得夠用就完了。

寫這APP,輸入法的核心,認碼,其實只用了一小時就完成了,而最困難的地方是UI和收集KEYBOARD的EVENT,那裡花了2晚時間。而因為UIKeyboard這個CLASS,APPLE SDK沒有提供header file,所以不能修改KEYBOARD的字做中文字,因此只能顯示英文(雖然我習慣打英文KEYBOARD和英文倉頡碼)。

而隨著11月IOS4.2的來臨,本APP亦將會完成其歴史任務了。

Source: https://github.com/wanleung/Cangjie-iPad

How to generate a self-signed certificate for apache2 in Debian

The source is now on Github: https://github.com/wanleung/self-signed-certificate-generator

While the Debian apache2 package was in Apache version 2.0, there was a tool called “apache2-ssl-certificate” for the users to use that script to gererate their own self-signed cert themselves. However, the script was removed since the apache2 package had been upgraded to Apache v2.2.

I had modified the old script so that it can generate a suitable self-signed cert for the new apache2(Apache v2.2) in Debain.

Here is the code:

 #!/bin/sh -e DAYS="365" CERTPATH="/etc/apache2/ssl" CERTNAME="apache" KEYBIT="1024" FORCE="0"; usage(){ echo "This is a program for the users to gernate their own self-signed certificate." echo echo "Usage: $0 [[OPTION] [VALUE]]..." echo echo "OPTIONS:" echo " -h | -help | --help -- To Show This Help" echo " -f | --force -- Force to generate the cert" echo " -d | -days | --days -- cert to expire after x days, default is 365" echo " -p | -path | --path -- Path of the cert will be stored," echo " default is /etc/apache/ssl" echo " -n | -name | --name -- the name of the cert, default is apache" echo " -b | -bit | --bit -- length of the key, default is 1024" echo } createcert() { if [ "$FORCE" != "1" -a -f $CERTPATH/$CERTNAME.pem ]; then echo "$CERTPATH/$CERTNAME.pem exists! Use \"$0 --force.\"" exit 0 fi echo echo creating selfsigned certificate echo "replace it with one signed by a certification authority (CA)" echo echo enter your ServerName at the Common Name prompt echo echo If you want your certificate to expire after x days call this programm echo with "--days x" mkdir -p "$CERTPATH/" export RANDFILE=/dev/random openssl req [email protected] -new -x509 -days $DAYS -nodes -newkey rsa:$KEYBIT -out $CERTPATH/$CERTNAME.pem -keyout $CERTPATH/$CERTNAME.pem chmod 600 $CERTPATH/$CERTNAME.pem } case $1 in -h|help|--help) usage exit 0 ;; esac until [ -z "$1" ] # Until all parameters used up . . . do case $1 in --force|-f|-force) FORCE="1" shift ;; --days|-d|-days) DAYS=$2 shift shift ;; --path|-p|-path) CERTPATH=$2 shift shift ;; --name|-n|-name) CERTNAME=$2 shift shift ;; --bit|-n|-bit) KEYBIT=$2 shift shift ;; *) usage exit 0 ;; esac done createcert

Here is the file.
apache2-ssl-certificate.tar.gz

MD5SUM: 6fb69eb0d63a683e73461f4f682e13e5

You could get the project from github.

The source is now on Github: https://github.com/wanleung/self-signed-certificate-generator