Thursday, April 26, 2007

Xen 3.0.3 on Debian 4.0 Etch

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

Tuesday, April 17, 2007

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

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

Monday, April 16, 2007

Debian 香港聚會

為慶祝DEBIAN 4.0 released,Debian HK今日下午3時在又一城辦了一個聚會,

本人今日有幸能抽空出席。在聚會中,認識了不少LINUX的愛好者,

大家彼此交流了不少LINUX的經驗和知識, 是一個很好的聚會。

Saturday, April 14, 2007

上邪

漢樂府 上邪

上邪,

我欲與君相知.長命無絕衰.

山無陵,江水為竭,

冬雷震震夏雨雪,

天地合,乃敢與君絕.

Tuesday, April 10, 2007

Debian GNU/Linux 4.0 released

Debian Etch finally released on 8th April, 2007.
Here is the notice from debian-announce@lists.debian.org.
Debian GNU/Linux 4.0 released

The Debian Project is pleased to announce the official release of Debian
GNU/Linux version 4.0, codenamed "etch", after 21 months of constant
development. Debian GNU/Linux is a free operating system which supports
a total of eleven processor architectures and includes the KDE, GNOME
and Xfce desktop environments. It also features cryptographic software
and compatibility with the FHS v2.3 and software developed for version
3.1 of the LSB.

Using a now fully integrated installation process, Debian GNU/Linux 4.0
comes with out-of-the-box support for encrypted partitions. This
release introduces a newly developed graphical frontend to the
installation system supporting scripts using composed characters and
complex languages; the installation system for Debian GNU/Linux has now
been translated to 58 languages.

Also beginning with Debian GNU/Linux 4.0, the package management system
has been improved regarding security and efficiency. Secure APT allows
the verification of the integrity of packages downloaded from a mirror.
Updated package indices won't be downloaded in their entirety, but
instead patched with smaller files containing only differences from
earlier versions.

Debian GNU/Linux runs on computers ranging from palmtops and handheld
systems to supercomputers, and on nearly everything in between. A total
of eleven architectures are supported including: Sun SPARC (sparc), HP
Alpha (alpha), Motorola/IBM PowerPC (powerpc), Intel IA-32 (i386) and
IA-64 (ia64), HP PA-RISC (hppa), MIPS (mips, mipsel), ARM (arm), IBM
S/390 (s390) and -- newly introduced with Debian GNU/Linux 4.0 -- AMD64
and Intel EM64T (amd64).

Debian GNU/Linux can be installed from various installation media such
as DVDs, CDs, USB sticks and floppies, or from the network. GNOME is
the default desktop environment and is contained on the first CD. The K
Desktop Environment (KDE) and the Xfce desktop can be installed through
two new alternative CD images. Also newly available with Debian
GNU/Linux 4.0 are multi-arch CDs and DVDs supporting installation of
multiple architectures from a single disc.

Debian GNU/Linux can be downloaded right now via bittorent (the
recommended way), jigdo or HTTP; see <http://www.debian.org/CD/> for
further information. It will soon be available on DVD and CD-ROM from
numerous vendors <http://www.debian.org/CD/vendors/>, too.

This release includes a number of updated software packages, such as the
K Desktop Environment 3.5 (KDE), an updated version of the GNOME desktop
environment 2.14, the Xfce 4.4 desktop environment, the GNUstep desktop
5.2, X.Org 7.1, OpenOffice.org 2.0.4a, GIMP 2.2.13, Iceweasel (an
unbranded version of Mozilla Firefox 2.0.0.3), Icedove (an unbranded
version of Mozilla Thunderbird 1.5), Iceape (an unbranded version of
Mozilla Seamonkey 1.0.8), PostgreSQL 8.1.8, MySQL 5.0.32, GNU Compiler
Collection 4.1.1, Linux kernel version 2.6.18, Apache 2.2.3, Samba
3.0.24, Python 2.4.4 and 2.5, Perl 5.8.8, PHP 4.4.4 and 5.2.0, Asterisk
1.2.13, and more than 18,000 other ready to use software packages.

Upgrades to Debian GNU/Linux 4.0 from the previous release, Debian
GNU/Linux 3.1 codenamed "sarge", are automatically handled by the
aptitude package management tool for most configurations, and to a
certain degree also by the apt-get package management tool. As always,
Debian GNU/Linux systems can be upgraded quite painlessly, in place,
without any forced downtime, but it is strongly recommended to read the
release notes for possible issues. For detailed instructions about
installing and upgrading Debian GNU/Linux, please see the release notes
<http://www.debian.org/releases/etch/releasenotes>. Please note that
the release notes will be further improved and translated to additional
languages in the coming weeks.

About Debian
------------

Debian GNU/Linux is a free operating system, developed by more than
a thousand volunteers from all over the world who collaborate via the
Internet. Debian's dedication to Free Software, its non-profit nature,
and its open development model make it unique among GNU/Linux
distributions.

The Debian project's key strengths are its volunteer base, its dedication
to the Debian Social Contract, and its commitment to provide the best
operating system possible. Debian 4.0 is another important step in that
direction.

Contact Information
-------------------

For further information, please visit the Debian web pages at
<http://www.debian.org/> or send mail to <press@debian.org>.

Wednesday, April 04, 2007

hesitation

hesitation


歌:林原めぐみ
詞:MEGUMI
曲:矢吹俊郎


うれしい時には 君が笑ってて
悲しいときいつでも 僕がそばにいて

沢山の経験 重ねていく度
理想と現実との 距離が近付く

いつか君は 教えてくれた
思いやりと 涙のわけを

振り向けば君はそこにいて
受けとめてくれた
今度は誰かに
この気持ちかえそう
何もできないなんて言わない
何か出来ること
ひとつでもいいから
手をのばすんだ
届く日まで



悩んでる君に 何が出来るだろう
立ち尽くしてしまうよ 言葉届かずに

信じているけど とても苦しくて
希望と絶望とが 交差している

君自身が 君の力で
歩けるまで 待っていなくちゃ

素直とわがままは全然 違うものなのに
なぜだろう時々 わからなくなるんだ
抱きしめたい気持ち押さえて
黙って見ている 切ない勇気で
少しでもいい 近付きたい


振り向けば君はそこにいて
受けとめてくれた
今度は誰かに
この気持ちかえそう
何もできないなんて言わない
何か出来ること
ひとつでもいいから
手をのばすんだ
届く日まで

Saturday, March 31, 2007

MAKING LOVE OUT OF NOTHING AT ALL

MAKING LOVE OUT OF NOTHING AT ALL (Air Supply)

I know just how to whisper
And I know just how to cry
I know just where I find the answers
And I know just how to lie
I know just how to fake it
And I know just how to scheme
I know just when to face the truth
And then I know just when to dream
And I know just where I touch you
And I know just what to prove
I know when to pull you closer
And I know when to let you loose

And I know the night is fading
And I know the time’s gonna fly
And I’m never gonna tell you everything I gotta tell you
But I know I’ve got to give it a try

And I know the roads to riches
And I know the ways to pain
I know all the rules and then I know how to break’em
And then I always know the name of the game

But I don’t know how to leave you
And I’ll never let you fall
And I don’t know how you do it
Making love out of nothing at all

Making love
Out of nothing at all
Making love
Out of nothing at all
Making love
Out of nothing at all
Making love
Out of nothing at all
Making love
Out of nothing at all
Making love
Out of nothing at all

Everytime I see you, well the rays of the sun are all
Streaming through the waves in your hair
And every star in the sky is taking aim at your eyes
Like a spotlight
The beating of my heart is a drum and it’s lost
And it’s looking for a rhythm like you
You can take the darkness from the deep of the night
And turn it to a beacon burning endlessly bright
I gotta follow it ‘cause everything I know
Well, it’s nothing ‘till I give it to you

I can make the runner stumble
I can make the final block
And I can make every tackle at the sound of the whistle
And I can make all the stadiums rock

I can make tonight forever
Or I can make it disappear by the dawn
And I can make you every promise that’s ever been made
And I can make all your demons be gone

But I’m never gonna make it without you
Do you really wanna see me crawl ?
And I’m never gonna make it like you do
Making love out of nothing at all

Making love
Out of nothing at all...

保護產權=保護創意?

Friday, March 16, 2007

Blue Tooth on Debian

This instruction is for Gnome in Debian etch on kernel 2.6.18.

apt-get install bluetooth bluez-cups bluez-gnome bluez-hcxidump bluez-pcmcia-support bluez-utils libblurtooth2 obexfs obexftp obexpushd ussp-push

Send File to another device:

hcitool cc <address>

hcitool auth <address>

hcitool key <address>

obexftp -b <address> -p <file>

アシタノキミ(明日的你)

在整理舊歌時,找到櫻井智的專輯,

內裡有一首99年的歌 ,アシタノキミ,

是動畫 スーパードール★リカちゃん(超級娃娃戰士)的主題曲。

Wednesday, March 14, 2007

卒業 Next Graduation

已經有好幾年停了玩純愛系列的GAME,

最近在GAME舖看到這隻,

Next Graduation

卒業 Next Graduation,就買了回來。

卒業,相信各位對這GAME並不陌生,

卒業可以說是在PC上最早期的純愛GAME之一,

1992年6月在日本發售,之後翻譯成中文版,

相信各位在DOS年代應曾努力過去執行這GAME,

因為這GAME需要580K以上的MEMORY才能執行,

當年DOS上限是640K,玩這GAME前,要花不少功夫改CONFIG,

不過本人是沒成功執行過卒業這GAME就是了。

對卒業的認識,是看動畫吧了。

卒業其後亦出過2代3代等的延續,不過由於太早期關係(94年及98年),

亦沒有玩過其後的作品。

(本人正式開始玩純愛GAME是1999年會考後,第一隻是初戀,第二隻是青澀之戀,第三隻才是心跳回憶,其後亦開始迷上了動畫。)

卒業 Next Graduation,這隻是最新作,

主人公已由第一代的新入行教師,成為這代的校長,

而今次5位問題學生女主角,正是一代那5位主角的女兒,

果然10年人事幾番新,

不經不覺卒業已有10幾年的歷史。

卒業 Next Graduation這GAME,對本人最大吸引在於配音,

女主角的母親,由卒業動畫版原班人馬配音,

分別是鶴ひろみ,島方淳子,芳野日向子,冬馬由美 及 久川綾。

由於本人是比較算是ACG早期的人,

因此只對一些舊的配音員比較熟識,

新角色,除了配助手的滿仲由紀子(青澀之戀中的夏穗)是所認知之外,

其他的配音都是本人所不認知的。

Monday, March 12, 2007

絕望真相

剛問同事借了戈爾的<絕望真相>回來看,發覺地球溫室效應加劇,令地球氣候環境改變的情況,比自己原本所認知的嚴重,而且若我們還在坐視不理的話,地球很有可能會在我們這一兩代變成不適合人類居住。

地球只有一個,是我們在這宇宙中唯一的家,
地球會否毀在我們手上,就要看我們現在決定。

earth3

earth1

Monday, March 05, 2007

信

信

唱︰翁倩玉
曲︰林敏怡
詞︰鄭國江
編︰林敏怡

雲與清風可以常擁有
關注共愛不可強求
不強求不強求永遠等候
如必需苦楚 我承受

誰會珍惜當你還擁有
將要逝去總想挽留
想挽留想挽留看似荒謬
求今天所得 永遠守

命運是對手永不低頭
從來沒抱怨半句 不去問理由
仍踏著前路走青春走到白頭
成功只有靠一雙手

誰會珍惜當你還擁有
將要逝去總想挽留
想挽留想挽留看似荒謬
求今天所得 永遠守

命運是對手永不低頭
從來沒抱怨半句 不去問理由
仍踏著前路走青春走到白頭
成功只有靠一雙手

命運是對手永不低頭
從來沒抱怨半句 不去問理由
仍踏著前路走青春走到白頭
成功只有靠一雙手

命運是對手永不低頭
從來沒抱怨半句 不去問理由
仍踏著前路走青春走到白頭
成功只有靠堅守信心奮鬥

http://www.youtube.com/watch?v=DPGe3qlOzJk

Enneagram

The Enneagram is a personality system which divides the entire human personality into nine behavioral tendencies.













Main Type



Overall Self







Your main type is which ever behavior you utilize most and/or prefer. Your variant reflects your scoring profile on all nine types: so = social variant (compliant, friendly), sx = sexual variant (assertive, intense), sp = self preservation variant (withdrawn, security seeking). For info on the flaws of the Enneagram system click here.

Take Free Enneagram Personality Test







Enneagram Test Results


























































Type 1Perfectionism||||||||||||||||67%
Type 2Helpfulness||||||||||||||58%
Type 3Image Focus||||||||||||||59%
Type 4Hypersensitivity||||||||||||||||63%
Type 5Detachment||||||||||||||||66%
Type 6Anxiety||||||||||||||||||78%
Type 7Adventurousness||||||||||||||55%
Type 8Aggressiveness||||||||||||||57%
Type 9Calmness||||||||||||||||62%

Your main type is 6
Your variant is social

Take Free Enneagram Personality Test

Friday, March 02, 2007

水調歌頭

水調歌頭 蘇軾

明月幾時有,把酒問青天。

不知天上宮闕,今夕是何年。

我欲乘風歸去,又恐瓊樓玉宇,高處不勝寒。

起舞弄清影,何似在人間。

轉朱閣,低綺戶,照無眠。

不應有恨,何事長向別時圓。

人有悲歡離合,月有陰晴圓缺,此事古難全。

但願人長久,千里共嬋娟。

Sunday, February 25, 2007

A Life Among Whales

今晚National Geographic Channel做了2套有關鯨魚的記錄片,

內容值得我們反思。

第一個節目是談到Dr Roger Payne研究鯨魚時的發現,他的研究令世界對鯨魚的看法改變,以及世界對保護鯨魚的努力。另亦提及國際捕鯨協會(International Whaling Commission)在80年代禁止商業捕鯨,各捕鯨國,如丹麥,日本等國,如何用“科學”一詞來繼續無視地繼續捕鯨,以及對國際捕鯨協會(International Whaling Commission)在商討恢復商業捕鯨的無奈。

鯨魚的腦比人類大,而且皮層亦比人類厚,以現在生物學的觀念,是比人類聰明,
但科學家到現時,對鯨魚的智力仍所知甚少。Dr Roger Payne在研究座頭鯨時,發現鯨魚發出的聲音,
以人類的定義,那些聲音叫旋律,以15分鐘為一週期,不斷重複,而且旋律會押韻。
因此推斷,鯨類的智力,至少和人類不相上下。

節目中,Dr Roger Payne有2句話,非常發人深醒,
大意是“若我們連這些大型鯨類,我們有能力保護但都保護不了,我們憑什麼可保護自己”,
“不要以為自己一個就做不了什麼,要改變現在,正是要由自己做起”。

保護環境,救救地球。

Wednesday, February 21, 2007

正心修身

今日和同學去大嶼山吃齋。

山上寺院環境清幽,內心平靜了不少。

"菩提本無樹

明鏡亦非臺

本來無一物

何處惹塵埃"

Monday, February 19, 2007

終着駅

終着駅

唄:稲垣潤一
詞:秋元康
曲:松本俊明

いつもの街が
いつもと違う
僕たちの角度が
離れた分だけ

君の背中に
重なり合った
人込みは やさしい味方

出逢う時は 偶然でも
別れは 2人のせい

終着駅で
愛が終われば
再会できると
噂に聞いた
終着駅で
君を想えば
いつの日か きっと
もう一度

僕の言葉で
言い尽くせない
後悔は 誤解の痛み

淋しさなら 紛らせても
愛しさ 止められない

始発駅まで
1人歩けば
思い出ばかりと
すれ違うけど
始発駅まで
2人歩いた
なつかしい日々に
また逢える

終着駅で
愛が終われば
再会できると
噂に聞いた
終着駅で
君を想えば
2人折り返す
始発駅

Sunday, February 18, 2007

一切又歸於平靜

一切又歸於平靜,

原本開啟的大門,

現在又重新關閉;

為保那最珍貴的,

免再受的衝擊破壞,

現加裝更多鐵閘、門鎖。

大門現已深鎖,

這最珍貴的,

不會再受外間影響,

就讓其在屬於自已的世界生存吧,

讓一切再歸於平靜。

恭賀新禧

恭賀新禧.

祝大家豬年行大運, 事事順境, 心想事成.