老歌還是比較好聽!這首可是戀上另一個人的前身。
戀上一個人
作詞:游鴻明 作曲:游鴻明
戀上一個人 就容易失了神
曾經為愛流的淚 乾了又為愛心疼
我的痴 我的真 要給多少才完整
只怕你不懂 我這樣的人
非要等到愛遠走 分兩頭
才知道 多不捨你走
留在午夜夢迴醉 掏了心
傷心對自己說
非要等到愛遠走 分兩頭
才知道 誰都怕寂寞
一直有句話要說 你是我
今生今世的守候
戀上一個人 等到愛遠走
戀上一個人 捨不得你走
戀上一個人
http://www.youtube.com/watch?v=rD5z7YA9hVU
應該是因為版權的問題,所以不能貼在這裡。Anyway 還是貼上了歌詞。
歌名:戀上(另)一個人
作曲:游鴻明, 編曲:洪敬堯
監製:Peter Wong, 填詞:李焯雄
忽然一場陣雨 世界縮為屋簷
你熟悉的側臉 回頭就在眼前
一分神 丟了手裡煙 墜落了 燃燒的歲月
讓畫面 再接回從前 省略了 昨天的昨天
後來的你好嗎 有比較快樂嗎
我應該高興吧 卻又說不上話
雨打濕 你右邊的肩 淚滑過 我左邊的臉
這就是 唯一的關聯 當愛是 倉促的句點
你曾是 我吻過 我愛過 也傷過 擁有過 卻錯過 的情人
這樣太殘忍 你現在 總是刻意 保持陌生
你吻過 你愛過 也恨過 擁抱過 卻犯錯 的情人
我不能過問 沒權利再問 他是否對的人
後來的你好嗎 有比較快樂嗎
我應該高興吧 卻又說不上話
我們是 兩條平行線 再沒有 任何交叉點
只留下 心酸的感覺 當愛是 倉促的句點
你曾是 我吻過 我愛過 也傷過 擁有過 卻錯過 的情人
這樣太殘忍 你現在 總是刻意 保持陌生
你吻過 你愛過 也恨過 擁抱過 卻犯錯 的情人
我不能過問 沒權利再問 他是怎樣的人
非要等到愛遠走 分兩頭 才知道 多不捨你走
留在午夜夢迴醉 掏了心 傷心對自己說
非要等到愛遠走 分兩頭 才知道 誰都怕寂寞
一直有句話要說 你是我 今生今世的守候
你曾是 我吻過 我愛過 也傷過 擁有過 卻錯過 的情人
這樣太殘忍 你現在 總是刻意 保持陌生
你吻過 你愛過 也恨過 擁抱過 卻犯錯 的情人
我不能過問 是我先轉身 愛上了 錯的人 戀上一個人
Monday, 19 October 2009
Tuesday, 16 June 2009
用Perl來寫演算法
今天無聊,看到這樣的演算法。
程式出來的結過,雖然醜了一點,不過還算有模有樣。
1 * 8 + 1 = 9
12 * 8 + 2 = 98
123 * 8 + 3 = 987
1234 * 8 + 4 = 9876
12345 * 8 + 5 = 98765
1 23456 * 8 + 6 = 987654
1234567 * 8 + 7 = 9876543
12345678 * 8 + 8 = 98765432
123456789 * 8 + 9 = 987654321
心血來潮,想說用Perl寫寫看,看看會不會有一樣的結果。
for($i = 0; $i <9; $i++)
{
$Y = $Y + 10**$i;
$b = $b + $Y;
$k = ($i + 1);
$s = ($b * 8) + $k;
print "$b * 8 + $k = $s\n";
}
程式出來的結過,雖然醜了一點,不過還算有模有樣。
1 * 8 + 1 = 9
12 * 8 + 2 = 98
123 * 8 + 3 = 987
1234 * 8 + 4 = 9876
12345 * 8 + 5 = 98765
123456 * 8 + 6 = 987654
1234567 * 8 + 7 = 9876543
12345678 * 8 + 8 = 98765432
123456789 * 8 + 9 = 987654321
Monday, 15 June 2009
許冠傑 ﹣《半斤八兩》
分享一首很寫實,但不失搞笑的歌與大家共勉之。
《半斤八兩》
曲:許冠傑
詞:許冠傑
我哋呢班打工仔
通街走糴直頭系壞腸胃
揾嗰些少到月底點夠使(奀過鬼)
確系認真濕滯
最弊波士喐啲發威(癲過雞)
一味喺處系唔系亂嚟吠
噏親加薪塊面嗱起惡睇(扭吓計)
你就認真開胃
(半斤八兩)做到只積噉嘅樣
(半斤八兩)濕水炮仗點會響
(半斤八兩)夠薑呀摣槍走去搶
出咗半斤力
想話攞番足八兩
家陣惡揾食
邊有半斤八兩咁理想(吹漲)
我哋呢班打工仔
一生一世為錢幣做奴隸
嗰種辛苦折墮講出嚇鬼(死俾你睇)
咪話冇乜所謂
(半斤八兩)就算有福都冇你享
(半斤八兩)重慘過滾水淥豬腸
(半斤八兩)雞碎咁多都要啄
出咗半斤力
想話攞番足八兩
家陣惡揾食
邊有半斤八兩咁理想(吹漲)
翻譯:
《半斤八兩》
曲:許冠傑
詞:許冠傑
我們這班打工族 到處走得快真的是折磨腸胃
賺點些許錢,到了月底怎夠用 (少得很)
確實真的很倒霉
最慘的是老板動不動就亂發脾氣 (瘋過雞)
一天到晚不管對不對都在亂吠
說到到加薪他的那張臉就變難看。(常刁難)
你就想得美了
(半斤八兩) 做到每個都是這樣
(半斤八兩) 濕掉的鞭炮怎麼點得響
(半斤八兩) 夠嗆就拿槍去搶
出了半斤的力氣, 想說拿回足八兩
現在混口飯吃很難,那裡有半斤八兩這麼理想 (你能奈我何)
我們這班打工仔 一生一世為錢幣做奴隸
各種辛苦淒涼說出來嚇到鬼 (死給你看)
不要說無所謂
(半斤八兩)就算有福都沒你的份去享
(半斤八兩)慘過豬腸兩頭縮水
(半斤八兩)那怕雞碎米這樣多都要去搶
出了半斤的力氣, 想說拿回足八兩
現在混口飯吃很難,那裡有半斤八兩這麼理想 (你能奈我何)
參考:
粵語協會
百度1
百度2
Wednesday, 6 May 2009
用Perl寫台灣樂透的演算法
這是我為了統計課所寫的台灣樂透的遊戲. 雖然不是很完整, 不過足夠讓學生玩得樂不開支.以下是台灣樂透的演算法(Algorithm), 希望大家可以幫我改進, 謝謝.
基于作者乃Free Software Foundation與GNU的支持者, 所以你可以自由的使用我的程式碼, 修改我的程式碼.
#!/usr/bin/perl
$length = 47;
$round = 6;
for($i = 0; $i < $length; $i++)
{
$a[$i] = $i + 1;
}
print "\n";
for($j = 0; $j < $round; $j++)
{
$k = int(rand(($length) - $j));
$num= $a[$k];
$num_1 = $j + 1;
print "Round $num_1 draws: $num\n";
for($t = $k; $t < $length + 1; $t++)
{
$a[$t] = $a[$t + 1];
$a[$length] = 0;
}
}
$d = int(rand($length - ($round + 1)));
$spec = $a[$d];
print "\n";
print "The special number is: $spec\n";
print "\n";
基于作者乃Free Software Foundation與GNU的支持者, 所以你可以自由的使用我的程式碼, 修改我的程式碼.
Tuesday, 5 May 2009
Perl script to block the mac address using iptables
If you want to block an IP address, the simplest way that you can do with iptables is:
What if the IP address for an internal network is not static i.e. DHCP server assigned IP address? The best way to block the user's activity is by Mac Address. The script published below is a Perl script that joins all the efforts in configuring iptables rules to block a MAC address of the user's computer.
The script's below the iptables rule is used to check if you have blocked the IP address successfully. Before you execute this script, make sure that you have tcpdump installed on your computer. (note: FYI, tcpdump is a sniffer that used by system administrator to track user's activity on the gateway. Please do not use tcpdump in a illegal way.)
If you are not to sure how to find the IP address and MAC address on your gateway or linux firewall, you can use the following command:
By sending an ICMP packet to the IP address, you will be able to collect the info of his/her computer from the respond packet that received by your gateway if user's IP address responds. Then do an arp search by:
This will show all the IP address the gateway collects. It takes longer for nmap to do a portscan and send the user's MAC address back to you. This method does not make any sense since you are the system administrator. If your firewall is using DHCP server, the best way for you to find the info of an IP address is by reading the leases info of DHCP server in:
You can find the MAC address easily of an user by reading dhcpd.leases file using text editor on the unix or GNU/Linux operating system or you can use the following command line
Have Fun!
iptables -I INPUT -s < your gateway's ip address > -d the < IP address you want block > -j REJECT
iptables -I INPUT -s < IP address you want to block > -d < your gateway's ip address > -j REJECT
What if the IP address for an internal network is not static i.e. DHCP server assigned IP address? The best way to block the user's activity is by Mac Address. The script published below is a Perl script that joins all the efforts in configuring iptables rules to block a MAC address of the user's computer.
#!/usr/bin/perl
print "Input IP that violates network rules:";
$ip= < stdin>;
print "\n";
print "Input Mac Address:";
$mac = < stdin>;
print "\n";
print "Input Gateway's IP:";
$gw = < stdin>;
print "\n";
`iptables -A INPUT -s $gw -m mac --mac-source $mac -j REJECT`;
`iptables -I INPUT -s $gw -m mac --mac-source $mac -j REJECT`;
`iptables -A INPUT -d $gw -m mac --mac-source $mac -j REJECT`;
`iptables -I INPUT -d $gw -m mac --mac-source $mac -j REJECT`;
`iptables -A FORWARD -d 0.0.0.0/0 -m mac --mac-source $mac -j REJECT`;
`iptables -I FORWARD -d 0.0.0.0/0 -m mac --mac-source $mac -j REJECT`;
`iptables -I FORWARD -s 0.0.0.0/0 -m mac --mac-source $mac -j REJECT`;
`iptables -A FORWARD -s 0.0.0.0/0 -m mac --mac-source $mac -j REJECT`;
#Check if the IP address is been blocked:
`tcpdump dst $ip > test.txt`;
open(FILE, "< test.txt");
$line = < FILE >;
$find = "unreachable";
if ($line =~/$find/)
{
print "The following IP address $ip is blocked successfully!\n";
}else{
print "The following IP address $ip is blocked UNSUCCESSFULLY!\n";
}
close(FILE);
The script's below the iptables rule is used to check if you have blocked the IP address successfully. Before you execute this script, make sure that you have tcpdump installed on your computer. (note: FYI, tcpdump is a sniffer that used by system administrator to track user's activity on the gateway. Please do not use tcpdump in a illegal way.)
If you are not to sure how to find the IP address and MAC address on your gateway or linux firewall, you can use the following command:
ping < the ip address that you want to block>
By sending an ICMP packet to the IP address, you will be able to collect the info of his/her computer from the respond packet that received by your gateway if user's IP address responds. Then do an arp search by:
arp -a
This will show all the IP address the gateway collects. It takes longer for nmap to do a portscan and send the user's MAC address back to you. This method does not make any sense since you are the system administrator. If your firewall is using DHCP server, the best way for you to find the info of an IP address is by reading the leases info of DHCP server in:
/var/lib/dhcp/db/dhcpd.leases
You can find the MAC address easily of an user by reading dhcpd.leases file using text editor on the unix or GNU/Linux operating system or you can use the following command line
cat /var/lib/dhcp/db/dhcpd.leases | less
Have Fun!
Monday, 4 May 2009
Friday, 23 January 2009
很好聽的歌 - 小小蟲
小小蟲
作曲: 方大同 作詞: 方大同
我從小不會說話 總會說些不該說的話也沒辦法
我知道我是傻瓜 我不是說情話的專家
別怪我
我搞不懂 要不是這條小小的蟲
嚇得你跳進了我的懷中 可不可這樣跟你相擁
我真的很沒用
要感謝這小小蟲給我機會
這是我初次嘗到戀愛滋味
感覺好奇怪 好像 傷害了誰
或許我太壞 把小蟲摔下來
去換你的愛
小蟲也有牠用途 牠用自己摔下的痛苦
換我幸福
也許相愛是這樣 有人快樂就有人受傷
別緊張
像我這樣 那麼平凡一張大眾臉
從來沒人願意多看我一眼 可是在人來人往之間
卻有小蟲還我心願
要感謝這小小蟲給我機會
這是我初次嘗到戀愛滋味
感覺好奇怪 好像 傷害了誰
或許我太壞 把小蟲摔下來
去換你的愛
謝謝你心意 我會好好待你
保護著你 帶你看天地
下次如果看見女孩子 別再猶豫
你趕快跑到她外衣 讓我表現自己
Subscribe to:
Posts (Atom)