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
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
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
Using Unix domain sockets from Python
Using Unix domain sockets from Python's socket module is prettyeasy, but underdocumented. Since I've done it (and I may want to doit again sometime):
- you need to create the socket with an explicit family of
AF_UNIX.I usually go whole-hog and explicitly specifySOCK_STREAMas well. - the address argument to
.bind()and.connect()is the path ofthe Unix socket file. For.bind(), the file can't already exist
Things I did not know about until recently: Ethernet splitters
Real cat-5 wiring, such as what they run through the walls of buildings,has eight wires; 100 Mbps and 10 Mbps Ethernet use four wires. If youhave fixed cat-5 runs that you can't afford to add to, and you reallyneed additional ports in places that already have one, and you can'tafford to buy switches, you can take advantage of this to double uptwo Ethernet ports onto a single cat-5 run.
That's an Ethernet
Things I have learned about effective sysadmin meetings
We've recently started having some regular meetings at work, which hasgiven me an opportunity to look back at past meetings and reflect onwhat I think does and doesn't work in meetings for system administrators.(Note that I am pretty sure that some of these do not generalize toother sorts of meetings.)
Meetings can be an efficient way of holding discussions, but you needsomeone to corral the digressions. They are not usually an effectiveway of giving status reports, unless the status reports are really
Ordered lists with named fields for Python
I periodically find myself dealing with structures that are basically ordered lists with namedfields, where elements 0, 1, and 2 are naturally named 'a', 'b', and'c' and sometimes you want to refer to them by name instead of havingto remember their position. This pattern even crops up in the standardPython library, often with functions that started out just returningan ordered list and grew the named fields portion later as peoplediscovered how annoying it was to have to remember that the hour
How CSLab currently does email anti-spam stuff
The Computer Science department is strongly against rejecting email justbecause it might be spam (at least by default); enough people wouldrather sort through spam than risk rejecting legitimate email. Peopleare willing to have known viruses removed from their email (althoughnot executables in general).
(For clarity: the weekly spam summaries I do are not for CSLab's mailsystem.)
I once summarized CSLab's general rule is 'thou shalt not reject emailjust because it smells bad'. We can reject email
Weekly spam summary on February 24th, 2007
This week, we:
- got 15,188 messages from 253 different IP addresses.
- handled 21,573 sessions from 1,281 different IP addresses.
- received 238,853 connections from at least 71,848 different IPaddresses.
- hit a highwater of 10 connections being checked at once.
Connection and session volume is down a bit from last week . Day to day volume fluctuated up anddown through the week:
| Day | Connections | different |
Some things to remember when implementing __getitem__
I've recently been doing some work on classes derived from list and tuple that fiddle with the behavior of __getitem__ , and ran intoa couple of surprises that I am going to write down so that I rememberthem in the future:
- for the simple '
obj[i:j]' case,__getitem__is not called ifthe class has a__getslice__method.listandtupleboth do,despite the method being labeled as deprecated since Python 2.