Feb 25, 2009

auto login by expect


#!/usr/bin/expect

spawn telnet ptt.cc
expect "請輸入代號,或以[guest]參觀,以[new]註冊:"
send "{Your Name}\n"
send "{Your Password}\n"

send "\n"

interact timeout 90 {send "s"}
exit

Python, PyGTK & Glade

離上次使用PyGTK已經快二年的事了,最近自已有個計劃想試看看,還是一樣想使用PyGTK,今天發了一點時間,重新把回以前的感覺。

Feb 15, 2009

改變世界的12本書


作者簡介

梅爾文.布萊格(Melvyn Bragg)

   知名小說家、文化評論家、廣播與電視節目主持人。多年來領導並參與多項文化藝術文學機構,擁有十餘項榮譽學位,目前任里茲大學(University of Leeds)校長、英國國家藝術推廣協會(National Campaign for the Arts)主席及英國上議院成員。有三十餘本著作,包括十餘小說、文化評論及兩本童書。布萊格擁有深厚人文知識,推廣文學及藝術不遺餘力,數年來在英國的 廣播及電視上推廣知識、藝文教育,製作出很多令人激賞的節目。布萊格的出版品和影音作品早已在英國成為藝術推廣的知名招牌。


書中介紹的十二本書:

《數學原理》——揭示萬有引力,大開科學之門
《婚姻之愛》——兩性及婚姻寬細成為必修課題
《大憲章》——自由精神與人權法治的基礎
《足球比賽規章》——將運動與世界親密結合的經典
《物種起源》——重新定義了生命的起源
《廢除奴隸貿易》——各色人種升而平等的契機
《女權辯護》——婦女人權的首度顯現
《電的實驗研究》三卷——將黑暗與無知驅離的能源
《詹姆士王聖經》——確立英、美現代發展的精神基石
《國富論》——經濟與貿易命脈的寫實預言
《莎士比亞劇作第一個對開本》——改變全人類對故事的想像
序中,作者說明選擇這十二本書的理由
牛頓把人類帶上月球;法拉第把電帶給世界;達爾文挪走了人類自從開始有文明以來就一直存在的上帝和諸神;瑪麗.沃斯通克拉夫特開啟了女性尋求男女平權的濫觴;瑪麗.史托帕帶動了女性自身追求性愛滿足以及家庭生活辛福的風潮。有了韋爾白福斯畢生的努力,不同人種之間的懸殊地位始逐漸被拉近,而「大憲章」亦成了人類反抗暴政的基石。我們的市場依循著亞當.史密斯的諸律運作,我們的想像力被莎士比亞的著作鼓動到極致,我們的工作被阿克萊特所整合,我們的語言和宗教信念受到「詹姆士王聖經」塑造,我們今日雄踞天下的足球運動則奠基於「足球比賽規章」一書。

GARP, GVRP & GMRP

GARP
GARP defines the architecture, rules of operation, state machines and variables for the registration and de-registration of attribute values.
GVRP(GARP VLAN Registration Protocol)
GVRP provides a mechanism for dynamic maintenance of the contents of Dynamic VLAN Registration Entries for each VLAN, and for propagating the information they contain to other Bridges. This information allows GVRP-aware devices to dynamically establish and update their knowledge of the set of VLANs that currently have active members, and through which Ports those members can be reached. The main purpose of GVRP is to allow switches to automatically discover some of the VLAN information that would otherwise need to be manually configured.
GMRP(GARP Multicast Registration Protocol)
GMRP provides a mechanism that allows bridges and end stations to dynamically register group membership information with the MAC bridges attached to the same LAN segment and for that information to be disseminated across all bridges in the Bridged LAN that supports extended filtering services. The operation of GMRP relies upon the services provided by the GARP.

Feb 3, 2009

VMware Server

VMware Server 於二年多前已公告可以免費下載使用,我想,最主要原因還是 Microsoft Virtual PC, Xen .... 等競爭對手一一出現,今天本想在 WIndows 上使用 QEMU 安裝 CentOS5 測試一些東西,不知為何一直有問題,後來直接放棄改試試 VMware Server,安裝上沒問題難度,但一開始使用,有二個地方小卡了一下

  1. VMware Server 是利用web管理自已的系統(= =.這個該很久以前使用VMware Workstation的感覺剛全不一樣,不過那已經是五、六年前的事了),進入時會因為 ssl sing 的問題而被檔掉,需要自行加入例外
    Firefox : 工具 -> 選項 -> 檢視憑證清單 -> 伺服器 -> 加入例外清單
  2. 登入時,需要輸入帳號/密碼,這時指的是你電腦裡的帳號密碼

Feb 2, 2009

RADVD

前幾天測試使用RADVD來發送IPv6,只需 apt-get install radvd 但安裝時,/etc 下不會有config,需手動從 /usr/share/doc/radvd-doc/examples 中 Copy 到 /etc 下,起動 /etc/init.d/radvd start,此時可能會發生 IPv6 Forwoding 沒有設定,參考 Linux IPv6 HowTo 得知,echo "1" > /proc/sys/net/pv6/conf/default/forwarding 就可解決

以下是我使用簡單的 Config :
interface eth0
{
AdvSendAdvert on;

# This may be needed on some interfaces which are not active when
# radvd starts, but becomoe available later on; see man page for details.

# IgnoreIfMissing on;

#
# These settings cause advertisements to be sent every 3-10 seconds. This
# range is good for 6to4 with a dynamic IPv4 address, but can be greatly
# increased when not using 6to4 prefixes.
#

MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;

#
# You can use AdvDefaultPreference setting to advertise the preference of
# the router for the purposes of default router determination.
# NOTE: This feature is still being specified and is not widely supported!
#
AdvDefaultPreference low;

#
# Disable Mobile IPv6 support
#
AdvHomeAgentFlag off;

#
# example of a standard prefix
#
prefix 2001:db8:1:0::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};