A peculiar change in Linux flock() and fcntl() behavior

Here is one of those fun issues that cause me to pull out my hair(although it can give me a peculiar sense of satisfaction to track itdown).

Suppose that you have two filenames, such as (not entirelyhypothetically) .vacation.dir and .vacation.pag . As it happens,these filenames are actually hardlinks, so there is only one actualfile involved. Now, suppose you have code that is like this C-oidpseudo-code:

fl = {F_WRLCK, SEEK

Thinking like a security paranoid: an example

There's been a bunch of commotion lately over OpenSSH and how perhapsthere's a 0-day exploit in an older version of it, and so on. Giventhis, clearly the thing to do is upgrade to a current version justin case, right?

If you think this, you're not thinking like a security paranoid.Allow me to illustrate.

Imagine that you are an attacker. You've found a vulnerability inthe very latest and most recent version of OpenSSH, and you want


楷模在遠,o靚模在近


近來報紙天天在追逐或炒作o靚模的消息,一批又一批年輕性感的女孩大力“銷售”自己的美貌和身材,讀者則不知不覺在“消費”這種袒胸露體或爭名奪利,也許有人覺得這也叫做“成功”,還足以令人羨慕。

真不知道這些o

逼老狐狸認錯: Frost/Nixon


Frost/Nixon(港譯《驚世真言》)是非常好看的政治電影。好看在簡單直接,好看在劇力逼人,好看在整齣電影為一場訪問而拍,而那場訪問又令人感到大快人心。

故事根據真人真事改編,因「水門事件」被彈劾下台的美國總統尼克

久石讓與宮崎駿的25年

與宮崎駿動畫走過的25年

八十年代,廟街的精美唱片,是我幾乎隔天便去打躉的地方。

那個時候,我剛上中學,開始迷戀在黑膠唱片上轉下轉下轉出來的美妙聲音。我甚麼都愛聽,古典、爵士、中外古今的流行音樂,通通都不放過。

精美唱片有位很好人

Continue reading...

Packages should not contain both tools and policies

If you install the Ubuntu mdadm package on a machine with nosoftware RAID arrays, it will 'helpfully' email you every dayto report:

checkarray: W: no active MD arrays found.
checkarray: W: (maybe uninstall the mdadm package?)

(The message comes from the /usr/share/mdadm/checkarray shell script.)

This is a terrible idea , forreasons beyond that it's not an error. (It might be an error if thescript bothered to check to see if


Minimalistic spam, another annoyance to worry about

I've started getting advance fee fraud spam which have as their entirecontents something like this:

You won Three Million Pounds.contact Anita Meyer :

At first I was amused by the minimalism and lack of effort on thespammer's part; it'd be hard to get an advance fee fraud attempt in lesswords. But the more I think about it, the more that I think this may bemore clever than it looks (whether or not it's deliberate).


迷幻蜜柑發爛渣


蜜柑經常抓癢, 抓到頸上結痂積厚. 例行公事帶他到獸醫診所篤一針(防疫針) 時, 診斷頸上的疤是皮膚發炎. 獸醫幫他剃毛清除傷口, 餵了藥. 藥力發作期間, 蜜柑整天陷入呆滯狀態,「口mak mak」, 貓鼻全日通紅. 蜜柑睡得不
Continue reading...

出遊

今晚機,出遊二星期,目的地南法、瑞士、布拉格。非常感謝今天沒有打風!

今次問弟借了部 iphone,不過不會用 3G,主要用 wifi,下載了一些地圖、貨幣兌換、天氣、gps log、鐵路地圖、旅遊用語等 app。如有機會也會上上 twitter。

兩星期


The importance of making an issue visible

One of the things that's started to help the program energy efficiencyissue on Linux is the developmentand popularization of programs like iotop and powertop . For thefirst time, people could conveniently get a simple overview of what wasgoing on with IO and power on their system and, not surprisingly, peoplereacted to what they saw.

This provides a handy illustration of the importance of making anissue or a behavior visible to people, both to users and especially toprogrammers. By and large, if things run well