Older blog entries for barryp (starting at number 57)

I was intrigued by Bram's Python code for analyzing spam, and have been studying Paul Graham's article and raph's comment to it, but am still a bit perplexed at the significance of the values +-4.6, -1.4 and 2.2. Do they really mean something or are they just pulled out of thin air? 4.6 = log(100) makes a small bit of sense, but the other two I don't quite get.

Anyhow, had the idea that a possible way to have users submit mail for analysis/training would be to have them copy messages into special IMAP folders - which gave an excuse to play around with Python's imaplib library. Created folders named "Learn-Spam" and "Learn-OK" and had a script pull messages from there and remove when finished.

One thing I see is that you're gonna have make sure to do base64 and quoted-printable decoding of message parts, otherwise spammers could easily obscure their stuff from scanning.

For persistant storage of tokens, scores and such - tried PostgreSQL and found that inserting hunderds of small records per message took a *lot* of time. Tried a PyBSDDB dbshelve, which was smoking fast by comparison for this type of job.

6 Jul 2002 (updated 6 Jul 2002 at 20:43 UTC) »

Ugh..my TV just died this afternoon. I was watching it, and heard a short "squee" sound, and the picture collapsed to the lower-left half of the screen, about an inch wide. Must have lost something with the deflection coils.

Was vaguely hoping it would die, so I'd have an excuse to buy a nice new hi-def box, but was thinking in terms of maybe around christmas, when I was guessing the Samsung I'd been eyeing at Best Buy would be maybe under $1000. Be careful what you wish for I guess...

And it had to go just when the Tour de France was starting. I missed it last year when it went to OLN, but was psyched because they added that channel to our cable lineup last winter. Got to see the prologue this morning, LA sure didn't waste any time taking charge of the race.

2 Jul 2002 (updated 2 Jul 2002 at 17:38 UTC) »
jonathon :

How about a cube case for a mini-itx mboard. Haven't got one myself, but it's about the size you mention. I went with the super-slim ITX case that's even smaller (not really any room for a PCI card)


The boards are about $98 US, the guys I linked to above for the case also sell the motherboard. Another source for those boards and cases is www.caseoutlet.com, but haven't purchased anything from them myself.

26 Jun 2002 (updated 26 Jun 2002 at 18:38 UTC) »
chakie :

I got one of those mini-ITX motherboards running FreeBSD 4.6-Release.

The video shows up as: <Trident model 8500 VGA-compatible display device> Seems to work ok with XFree86 4.2.0

Don't know about switching to TV-out though - but did notice that it detects at boot-time if something is plugged into the composite-video output, and uses that (at least in text mode - don't know what would happen if you ran X)

Ethernet is: <VIA VT6102 Rhine II 10/100BaseTX> I've been having some trouble with that hanging on large samba uploads, but I think it's more of a driver problem (been fooling with it and getting better results)

Audio is: <VIA VT82C686A>, and got that working on FreeBSD too (listened to music with XMMS).

Got something plugged into the USB; works fine. Overall it seems to be a regular computer - just small, cheap, and quiet.

21 Jun 2002 (updated 21 Jun 2002 at 04:29 UTC) »

Been poking around on my little FreeBSD firewall/server box - think I have Samba to the point where it doesn't hang the network interface (vr0) when sending it big files from a Win2k box. Had to do a "sysctl -w net.inet.tcp.recvspace=32768" and in smb.conf added "SO_RCVBUF=8192 SO_SNDBUF=8192" to the socket options. But even so, it doesn't seem very fast, and still gapped out twice so far.

Seems kind of silly in this day and age to have to futz with things like that - it should just work (at least it has for me on older FreeBSD/Samba combinations). Maybe there's something more deeply wrong somewhere - and the setting changes I made just sort of mask/workaround the problem.

Anyhow, got an iMac at work today - OS X seems very cool. A monkey could set it up and start using it - but open up a terminal window and you see pretty much the same stuff you see on FreeBSD. Kind of a schizo experience. Wish Steve Jobs would get off his hardware obsession and do an x86 MacOS X - sure would like to run that software on hardware that costs 1/3rd as much as that Sharper-Image type stuff that silly graphic artists get all hot for (yes it is nice hardware - but so's a Mercedes, and we can't all drive those)

Still fooling with my mini-itx firewall/server box. Found that the USB-Ethernet device has somehow "healed" itself - doesn't panic on shutdown or hang on boot anymore, so it should be able to handle an unattended boot. Don't quite like it when things mysteriously stop/start working - but happy that it's going now.

Went ahead and loaded X, KDE, sound drivers, Mozilla on the little box. So maybe somedays I won't even boot up the big noisy Athlon - and will just work on the little box in peaceful quiet. Would be good to be a bit less Windows-dependant. Posting this from FreeBSD/Mozilla :)

Only hangup now is that copying large files to the box via Samba does something funky to the network interface. It becomes "stuck" with no packets flowing - until I do a "tcpdump -i vr0" for a bit - then it starts working again.

Happens with both the samba and samba-devel ports - don't know if it's some new FreeBSD 4.6 problem, or something goofed on my particular machine. Maybe if I wish real hard, that'll "heal" too :)

Finally got a hold of the VIA mini-itx motherboard/cpu I was lusting after a while back - picked it up with a nice little black case from www.idot.com for $170. Stuck in a DIMM and a harddisk, and it was all set to go (video/ethernet/sound all included on the motherboard). Gonna make a little personal server/firewall/NAT box out of it.

The nice thing about it is that the HD is the *only* moving part in the whole works. No CPU fan, there was a case fan, but it doesn't seem necessary so I unplugged it. Power supply is an external transformer brick, with no fan. Very very quiet.

Loaded FreeBSD 4.6-Release on it - seems to work pretty well.

Only problem is that I needed another ethernet port (being a firewall and all), but the case is too small to use the single PCI slot, so I'm using a Linksys USB-Ethernet adapter. It's supported with the "aue" driver, but there are some glitches: it hangs on boot if the Linksys is plugged in (on dhclient I think). Plugging in after boot works better. And if it's plugged in during shutdown it panics after syncing the disks. It's not a real disaster since I'll leave it on all the time, but I'd feel a lot better if I knew it could make it through an unattended reboot - if the power goes out or something.

26 May 2002 (updated 26 May 2002 at 15:14 UTC) »

I can report that mineral spirits works very well for removing rubberized-undercoating from the inside of a computer case. It's just a matter pouring some on, letting it sit for a bit, and then wiping off the gunky mess with paper towels.

Of course, the smarter thing to do is don't spray rubberized undercoating on the inside of your case in the first place. If a co-worker plants the idea in your head that it might be a good way to muffle the noise your machine makes, because it seems to work well for cars, DON'T FALL FOR IT! :)

Rubberized-undercoating is really rubberized asphalt - a tar-like substance that makes an ugly mess, and is nasty stuff to have inside your case. Sure it quiets things down a bit, but it never really dries/solidifies, and stays semi-sticky, getting worse as things get warmer (and attracts dust).

This message has been brought to you as a public service from CTADSS (the Coalition To Avoid Doing Stupid Stuff).

21 May 2002 (updated 22 May 2002 at 00:00 UTC) »
effbot: Nice, but your attributes need to be double-quoted instead of single-quoted. How about:
def mktag(tag, data, **attrs):
    tag = tag.lower()
    attrs = "".join([' %s="%s"' % (k.lower(), v) for k, v in
    if data:
        return "<%s%s>%s</%s>" % (tag, attrs,
data, tag)
        return "<%s%s />" % (tag, attrs)

for tag in ("a", "ul", "li", "img"): # etc exec "%s = lambda d=None, **a: mktag(%r, d, **a)" % (tag, tag)

if __name__ == '__main__': print a("Google", href="http://www.google.com") print ul(li("item1") + li("item2") + li("item3")) print img(src="foo.jpg")

More XHTML-compliant (lowercase tags, empty tags) Too bad there's no easy way to HTML-escape data strings, but not the tags that are generated.

jonathon: Where'd you get the Via Eden board? I've been itching to get my hands on one of those.

Haven't done anything spectacular lately, just little stuff. Worked on testing a patch for cygwin-postgresql this morning to fix a bug that happens when restoring large objects (I love PgSQL, sure is nice to have the exact same db on my Win and FreeBSD boxes). Been doing some Zope, even cobbled together a pure-Python PostgreSQL DA - just have to test it now and see if the dang thing actually works.

48 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!