Handling lines with something-separated fields for Python

As a system administrator, I spend a bunch of my time dealing withfiles made up of lines that are composed of fields separated by somecharacter. A classical example is /etc/passwd , with colon-separatedfields. These file formats are ordered lists with named fields, whichshould sound familiar , but they don't showup as Python lists, they show up as lines of text and they want tobe output as text; that we use lists to represent them is just animplementation detail.

This


Weekly spam summary on March 3rd, 2007

This machine had a planned twelve hour power outage today, so many ofthese statistics are really only for six days. Having said that, thisweek we:

  • got 16,376 messages from 272 different IP addresses.
  • handled 20,396 sessions from 1,270 different IP addresses.
  • received at least 212,857 connections from at least 63943different IP addresses.
  • hit a highwater of 5 connections being checked at once.

This


盛世之外,總有悲歌:談陳惜姿《天水圍12師奶》



一、媽媽,父親節快樂


她叫雲姐。訪問當日是父親節,她的女兒在家中一塊白板寫上:“媽媽,父親(母親)節快樂!”在這家中,母親就是父親。

雲姐一共有四個兒女,家住天水圍天逸。她的丈夫九七年拋妻棄子離開家庭,

On useful front-panel LEDs

I moved up to ADSL recently and it's quite nice, but I miss one thingabout my old Supra modem: I've been spoiled by its luxurious front paneldisplay. The front panel of my ADSL modem is somewhat of a letdown andI've been missing information that I used to be able to get at a glance,in particular how saturated my link is.

The ADSL modem has four front-panel LEDs, all equally prominent:

Power ADSL DATA LAN

(DATA is on if the DSL


我的林夕字傳

讀中學的時候,我很喜歡兩位作者的散文,一位是亦舒,另一位,是林夕。

亦舒的散文,單是文字的簡潔已值得學習,林夕吸引我的,是他看世事世情時的外冷內熱,還有變化多端的表達手法。當年他出過三本散文集,分別是《
Continue reading...

A story of network weirdness

We have a number of internal networks here . One of them is a port-isolated subnet forgeneral user machines (such as Windows laptops), where the port isolationmakes sure that user machines can't talk to each other and thus can'tinfect each other. One day, an alert user on the port isolated networkreported to us that his machine was seeing packets from the outsideworld destined for a completely different machine.

(One of the cool things about working in a Computer Science departmentis that


12個鐘頭裡面,

我已經屙o左33次。

妖。

條撚屌開乜鳩o野藥俾我o架,

都唔鳩work。

納博科夫《幽冥的火》


新年期間,朋友介紹我讀納博科夫的《幽冥的火》,我馬上買來讀了,不能自拔,那是我近十年來讀小說少有的震撼。

《幽冥的火》是一本謎宮一樣的書,全書分為“引言”、“序”、“詩”、“評注”、“索引”五部分,在形

An irritating limitation of listening sockets

Traditional sockets implementations have an irritating limitation, atleast for TCP sockets: it is impossible to gracefully and cleanly shutdown listening (server) sockets.The problem is that kernels accept new TCP connections for listeningsockets without asking your server; accept() doesn't actually accept the connection, it just gives you the next one that the kernel hasalready accepted on your behalf.

This means that to shut down cleanly,you need a two-stage process: first you tell the kernel to stop acceptingnew connections


20070301網摘 – 空歡喜

空歡喜

篤vs督