WARNING!!! As this site contains some arts' photos such as Michelangelo's David statue which were classed as Indecent Articles by the Government of Hong Kong Special Administrative Region, people who under 18 are not allowed to enter this site.
警告!!!由於本站含有香港特別行政區政府評級為不雅物品之藝術品照片(如米開羅之大衛像),未滿18歲之人士,不得進入本站。

28 May, 2008

Ubuntu英文介面下用scim輸入中文

Filed under: Computer, Debian, Linux — wanleung @ 12:45 am

不知何解, 最近常有人問, 如何在非中文介面下用scim輸入中文.

本人亦是用英文介面, 因為習慣了, 改不到.

由於系統預設scim只會在中日韓介面時才會啟動, 因此若要在英文介面下要輸入中文, 就需要手動設定一下.

ubuntu和debian的作法都是一樣的,

首先, 看一看有沒有安裝scim及輸入法的packages和im-switch.

然後用im-switch去設定.

先打locale看看自己在用英文的哪一個語系, 如en_HK.UTF-8, en_US.UTF-8, en_GB.UTF-8等.

如語系是en_HK.UTF-8, 就打

im-switch -z en_HK -c

如語系是en_GB.UTF-8, 就打

im-switch -z en_GB -c

如此類推.

之後就會進入一個menu, 有一堆輸入法可供選擇,

選scim-immodule

就完成.

之後登出, 再重新登入, 現在就可以用ctrl-space去叫scim出來, 輸入中文了.

22 March, 2008

把Debian上lenny(testing)

Filed under: Computer, Debian, Life, Linux, Programming — wanleung @ 1:00 am

終於把家中的WORK STATION和LAPTOP上的DEBAIN, UPGRADE到TESTING VERSION。

GNOME的速度比以前快了些,而字體就比以前減了2個SIZE,應該FIX了上一個版本字體雖SET為同一SIZE,但在GNOME中字體比KDE大的問題。

另外TESTING VERSION中,多了開機動畫。

其他功能還在測試中。

19 March, 2008

CloudBook

Filed under: Computer, Life, Linux — wanleung @ 1:08 am

終於買了部cloudbook, 因其輕巧, 只有2磅重, 而且用linux, 用linux的產品一定要支持一下. 在美國賣us$399, 香港要賣hk$4000. cloudbook 用via 的C7-M1.2G的cpu, 512MB RAM, 30GB Hard DISK, 雖然ram少了點, 慢了點, 勝在輕巧, 而且design值得一贊, mouse pad是分別在機身2旁, 比傳統的放在中間下方更方便. OS是由Ubuntu7.10延伸出來的gOS. 現時我那部CloudBook所用的gOS是用GNOME的最新版本,現在還不能下載到,而舊版gOS是用E。

cloudbook.pngthumb_img_2871.JPGthumb_img_2870.jpgthumb_img_2869.jpg

2 January, 2008

PHPBB3終於release

Filed under: Computer, Linux — wanleung @ 10:07 pm

等了很久的phpbb3終於release.

http://www.phpbb.com/

本人覺得今次release最重要的是, 終於support utf8.

之前phpbb2, 若要支援多個語系, 如繁體, 簡體和日文, 就要轉utf8,

要把code內hard code了charset的地方全轉成utf8,

轉完後還要試試有沒有地方用了utf8的function, 要把其刪除, 之後再試, 比較麻煩.

另外. php3把admin, user等的control panel全都modulize了. 要修改的話比以前方便.

phpbb3亦支援無限層級的討論區, 不過這個對本人沒什麼用就是了.

1 September, 2007

HSBC網上銀行不支援iceweasel(Debian)?

Filed under: Computer, Debian, Linux, News — wanleung @ 12:52 am

今日再用firefox嘗試登入HSBC的網上銀行,

終於能成功登入. 證明HSBC弄好了firefox的登入問題.

但在Debian中, 用iceweasel仍不能登入,

經看過登入頁面的source後, 看到在一個variable,

在用debian的iceweasel時, 會程現false的狀態,

這個variable是由server generate出來的.

但用user agent switcher把agent轉成ie後, 發現那個variable會成為true.

之後試一下把default agent的iceweasel轉成firefox. 再reload登入page, 那個variable成了true,

並能正常登入.

那就證明在8月29日晚至30日早上期間, 匯豐更新了系統, 而更新過程中,

加入了一段只會認某些user agent的code入去其cgi以及javascript.

但加入過程有些出錯, 引至30日不能用firefox登入.

雖然現修理好, 但因加了識別某些user agent的code,

現在令debian的iceweasel不能登入HSBC的eBanking.

還好, HSBC不是封殺firefox. 只不過, 現時用debian比較麻煩些,

要用user agent switcher把iceweasel轉成firefox.

30 August, 2007

匯豐HSBC的網上銀行不支援FIREFOX?

Filed under: Computer, Debian, Life, Linux, News — wanleung @ 10:35 am

昨日還能用Iceweasel(Firefox in Debian)登入HSBC的網上銀行服務。

豈料今日早上登入時,

出現這句

We regret that HSBC Internet Banking must be viewed by either Internet Explorer 6.0 (or later versions) or Netscape Navigator 7.1 (or later versions). You may visit http://www.microsoft.com or http://home.netscape.com to download a compatible browser.

hsbc

本人用DEBIAN,因此沒有辦法,立即下載NETSCAPE9。

怎料下載完成後,在執行時出現

./navigator-bin: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory

真是……

最後是,用了一個FIREFOX的PLUGIN, user agent switcher去扮IE,

於是成功進入到HSBC的EBANKING系統,並能正常使用,沒有任何問題。

問過其他同事及朋友,他們都同樣地出現Firefox不能登入,

但IE和NETSCAPE能正常使用的問題。

不明白的是, 原本他們的網上銀行系統一直都支援FIREFOX,

今日突然話不支援,但轉了USER AGENT後就能正常進入,

而且沒有任何問題。

經投訴,HSBC回覆是因他們銀行系統發生故障,正在修理中。

希望正如他們所言,真的只是故障,而不是封殺FIREFOX。

21 August, 2007

Stable kernel 2.6.22.4 released

Filed under: Computer, Linux — wanleung @ 10:26 pm

From: Greg Kroah-Hartman
To: linux-kernel@vger.kernel.org, Andrew Morton , torvalds@linux-foundation.org, stable@kernel.org
Subject: Linux 2.6.22.4
Date: Mon, 20 Aug 2007 21:43:07 -0700
Message-ID: <20070821044307.GA13852@kroah.com>
Archive-link: Article, Thread

We (the -stable team) are announcing the release of the 2.6.22.4 kernel.
It contains one security fix and all users of the 2.6.22 series are
encouraged to upgrade to it.

I’ll also be replying to this message with a copy of the patch between
2.6.22.3 and 2.6.22.4

The updated 2.6.22.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.22.y.git
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2….

thanks,

greg k-h

——–

Makefile | 2 +-
fs/exec.c | 13 +++++++++—-
2 files changed, 10 insertions(+), 5 deletions(-)

Summary of changes from v2.6.22.3 to v2.6.22.4
==============================================

Greg Kroah-Hartman (1):
Linux 2.6.22.4

Marcel Holtmann (1):
Reset current->pdeath_signal on SUID binary execution (CVE-2007-3848)

14 August, 2007

SCO的黑暗日子

Filed under: Computer, Linux, News — wanleung @ 11:24 am

這個是舊聞, 本人是在8月11日lwn上得知這個消息, 現在筆錄一下.

SCO和IBM 為了unix 版權問題的官司,

法官最後得出結論是, novell 沒有轉移任何unix及unixware 的版權給SCO,

因此判SCO敗訴.

詳細新聞: http://lwn.net/Articles/245202/

26 April, 2007

Xen 3.0.3 on Debian 4.0 Etch

Filed under: Computer, Debian, Linux — wanleung @ 9:52 am

Here is the instruction for running XEN on Debian Etch on Core2Duo 6300 with 2GB Ram.

First, install all the packages that related to XEN.

apt-get install  libc6-xen linux-headers-2.6-xen-686
linux-headers-2.6-xen-vserver-686 linux-headers-2.6.18-4-xen
linux-headers-2.6.18-4-xen-686 linux-headers-2.6.18-4-xen-vserver
linux-headers-2.6.18-4-xen-vserver-686 linux-image-2.6-xen-686
linux-image-2.6-xen-vserver-686 linux-image-2.6.18-4-xen-686
linux-image-2.6.18-4-xen-vserver-686 linux-image-xen-686
linux-image-xen-vserver-686 linux-modules-2.6.18-4-xen-686
linux-modules-2.6.18-4-xen-vserver-686 xen-hypervisor-3.0.3-1-i386
xen-hypervisor-3.0.3-1-i386-pae xen-ioemu-3.0.3-1 xen-tools
xen-utils-3.0.3-1 xen-utils-common bridge-utils iproute sysfsutils

Then, boot reboot the machine and choose the pae kernel to boot.

Next, add the following into /etc/network/interface for the Xen Bridge neteork.

auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
# optional
bridge_maxwait 0

To build a new debian domain:

Configurature /etc/xen-tools/xen-tools.conf collectly such as kernel version and initrd.

Then, run

xen-create-image --hostname=<name_of_DomU> --dir /home/xen/images/debian

Next, configurature

/etc/xen/<name_of_DomU>.cfg

to make sure all the Tag are correct.

Finally, run

xm create test.cfg -c

to run the VM.

As Core2Duo 6300 support VT, we could run Windows under Xen.

To run Windows in Xen,

first, build an image file for windows.

dd if=/dev/zero of=/home/xen/images/WinXP.img bs=1M count=4096

Next, copy the Windows XP install CD in to an iso format

dd if=/dev/cdrom of=/home/xen/cds/winxp.iso

Then, build a winxp config file in /etc/xen as the following. eg:

vi /etc/xen/winxp
kernel = "hvmloader"
builder='hvm'
memory = 512
name = "winxp"
vif = [ 'type=ioemu, bridge=xenbr0' ]
disk = [ 'file:/home/xen/images/WinXP.img,ioemu:hda,w',
'file:/home/xen/cds/winxp.iso,hdc:cdrom,r' ]
#cdrom = '/dev/hda'
device_model = 'qemu-dm'
boot="dc"
sdl=1
vnc=0
nographic=0
localtime=1

Run

xm create winxp -c

to boot up the VM and install XP.

After finished installing the XP, turn off the VM and

change the

boot="dc"

to

boot="c"

in

/etc/xen/winxp

xen1xen2xen3
xen4xen5

17 April, 2007

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

Filed under: Computer, Debian, Linux — wanleung @ 12:48 am

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 $@ -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