前幾日去開王府井書店，見到有本書叫《Debian Linux系统配置与管理》。云云 Linux 書海裏有本專門寫 Debian 的實屬少見，所以特別易搵。二話不說，梗係第一時間拎嚟睇吓，睇書我好留意作者，一睇，原來作者係信息产业部软件与集成电路促进中心 (CSIP)，喺北京搞過 Linux 的人都知道 CSIP 係信息產業部下面嘅一大 linux player，個 linux lab 人就唔係好多，但喺 server 就多到用唔晒。講眞，睇見作者係 CSIP 我就即刻打咗個突，心唸既然佢哋都寫到 Debian admin 嘅書，咁我都可以寫 kernel hacking。內容就唔多講喇，想學 Debian 的話都會有用嘅，不過唔該搞清楚個 distribution 個名先好寫書，係 Debian GNU/Linux，唔係 Debian Linux 呀，大佬。
公司需要在北京找一個 data center 放 server，最後通過 agent 決定在位於中關村科技發展大廈的電信通數據中心（前身中關村數據）租了一個 2U 100M shared 的地方。Agent 說能保證 bandwidth 最少 1Mbps，最多也不會超過 1.2Mbps。但基於 sales 的不可信性，還是有自己去測試一下 bandwidth 的必要的。這裡給大家一個簡單的 poor man’s way 來測試 bandwidth，一般人會用 HTTP/FTP 傳送 file 的方法來看一下速度有多快，但是需要先裝好 HTTP 或 FTP daemon。我喜歡用 netcat，因為使用非常簡單。除了 netcat，你亦需要一個用來 monitor network bandwidth usage 的軟件，用來查看實際的網絡流量，推薦使用 munin 和 ntop。
- 假設我的 server 叫電腦 A，你需要再多找一台電腦，叫電腦 B（我就找了一台在香港 data center 的 server）
- 在電腦 B 執行命令：
netcat -l -p 10000 > /dev/null。意思就是用 netcat 監聽 port 10000，而且接收到的所有 data 都當成是垃圾扔到 /dev/null 這個黑洞裡。
- 在電腦 A 執行命令：
netcat [電腦 B 的 IP] 10000 < /dev/urandom。意思就是連接到電腦 B 的 port 10000， 並且不斷 send data。 Linux 會為
就這樣，便可以測試電腦 A 的 outbound bandwidth 了。再多找兩三台電腦（當然是在不同的 network 的）同時 send 和 receive，差不多就能把可用的 bandwidth 用盡了。如果要測試 inbound bandwidth，把 A 和 B 的身份對換就可以了。
P.S. 測試後發現，bandwidth 比想像中的要好，深夜的時候可以達到 3Mbps，連到國內的 server 更可以達到 10Mbps！到白天基本上 bandwidth 就回落了。
Ben’s article about Beagle gave me confidence to try out Beagle once again. Beagle recommends you to make two changes to your system so that it can have the best performance. One is to use an inotify-enabled kernel. Good, as I’m already using 126.96.36.199, which has the inotify feature merged in. The other is to enable extended attributes to your filesystem. I thought I can’t be luckier, my filesystem is XFS and extended attributes is a default feature. It was time to apt-get install beagle and waited for all related packages (25MB in total) to be downloaded.
My overall experience to beagle is very positive, the setup is smooth and search speed is very fast. Below is a screenshot of the Beagle search tool,
Beagle can also index the webpages that you have visited in Firefox, but you have to install the Firefox extension found here. As usual, the extension was installed like a breeze. Having restarted Firefox, you will have a brand-new dog-head icon on the lower-right corner of your browser (see right), indicating that it is now working with Beagle.
Best, the search UI, can report any new search results in real-time. Start up
best and key in a search string, then in Firefox browse a web page that matches the search string you just entered, then go back to
best. See? The page you just visited is now showing up in
best. Sweet, isn’t it?
I was having a strange feeling that I was suddenly swapped out from China to an English-speaking world. I seldom have this kind of feeling before since I’ve been living in Beijing for 2.5 years.
Tonight I represented my company, Sun Wah Linux, to talk about Linux in China in Beijing GNU/Linux User Group (BLUG) meeting. Frankly I was having a hard time feeding myself with how Linux is doing in China because my work does not focus on Linux specifically. Anyway, I tried my best to learn about the trends and issues as much as I could before I attended the meeting. Since I went to the meeting place (a restaurant called Steak and Eggs) from China World Hotel after the first day of JavaChina Conference and the two places are very close to each other, I arrived there at 6:30pm while the meeting was scheduled to start at 7pm. The meeting did not start at 7pm exactly because basically we all wanted to fill our stomach first 🙂 The president of BLUG, Mike, who is a foreigner, so are most of the other members/attendants, they all came from different parts of the world. The moment we ate at Steak and Eggs reminded me of the moments when I was staying in hostels with foreigners as a backpacker in Europe. This kind of sudden cultural change is mind-boggling. I’ve met a lot of cool guys in this meeting. I have not imagined that there are so many Linux guru expats who are living and working in Beijing. It’s really a very good experience.
Thanks Mike for the BLUG T-shirt, it’s nice and I will wear it tomorrow during the 2nd day of JavaChina conference. 🙂