Convert a CentOS 5 HVM domU to PV

I just added a guide on how to convert a fully-virtualized (HVM) Xen instance running CentOS 5 to a paravirtualized (PV) instance.

Convert a CentOS 5 HVM domU to PV with pygrub

Happy converting!

More Uses for Generic Apache Logging

In my last post, I showed how it was possible to fix Apache logging so that it would properly log client IPs accessing a back-end through a reverse proxy. It turns out that logging request headers in that fashion can be handy in other contexts as well. Last night, while debugging a vexing and time-sensitive software issue, we found the need to figure out how large the payload of a POST operation was. The normal combined log format only shows the amount of data returned to the client, so I needed to start hacking again. It turns out that the Content-Length header that’s set during POSTs was just what we needed. I just added the following to our LogFormat directive, and we started getting the data we were looking for.


Note that the “CL:” bit is just to make a distinction between the Content-Length size and other arbitrary numerical fields I’ve added to on to that logging format. It’s just a label, and not necessary to make things work.

How to fix logging of proxied IP addresses in Apache

Are your apache application server logs showing the IPs of your reverse proxy instead of the requesting client? This should help!

Fix Logging of Proxied IPs in Apache


Capacitor Plague

As part of our completely overkill home network, I’ve got a couple of managed Linksys business-class switches (one SRW2016 and one SRW2048). They allow for me to do helpful things like VLANs, spanning tree, pretty graphs from SNMP data, and the like. Their web interfaces are crap, but aside from that, they’re fairly capable devices, and work well for the most part.

Well, let’s just say I had two switches. Now I’ve got, say, 1.25 switches. The SRW2048 has recently descended into uselessness, spending a good 20% of its time rebooting, locked up, and in other states where packets are not properly forwarded. It started occurring last week, and has accelerated in the past two days:

# zcat messages.1.gz | grep dist1 | grep "Cold Startup" | wc -l
# cat /messages | grep dist1 |  grep "Cold Startup" | wc -l

This makes me mildly annoyed, to put it mildly. The affected switch provides connectivity to most of my house. It services pretty much everything except for the server gear, which utilizes the SRW2016. Thinking that the switch might have been having issues with dust/animal hair clogging things up, making it overheat, or perhaps shorting something out, I opened the case up to see if I could give it a good cleaning. I was somewhat surprised to see a generally clean interior (nothing in our house is free of pet hair). What I did see was a fair number of bulging capacitors, and at least three or four that had visible signs of leaking dielectric compound. Lame.

If I had to guess, I’d say that my switch is infected by the capacitor plague, a rash of electronics issues caused by poor-quality components from a set of capacitor manufacturers. It’s been a general pain in the butt for almost a decade now, and it seems as though it’s now affected me as well.

The switch is valuable enough to me that I am thinking about purchasing a whole new set of the various capacitors present in the switch and attempting to replace them. They’re all fairly large, so I may actually be able to pull it off without melting the board or any other components attached to it.

EDIT: Of capacitors displayed in the following picture, 13 are either visibly leaking dielectric or have bulged. There are 33 capacitors visible on the board.

Capacitor ICU

WordPress Network

For shits and giggles, I tried setting up a WordPress network, to see if it could ease the hassle of setting up other WordPress sites. It looks as though it’s a bit overkill for my needs. I had thought it could be useful if I wanted to import my old blog into WordPress and resume posting there, but I’m not sure it’s worth the effort. The lack of file duplication and a shared database would be neat, but not really necessary.

Moving Day

So I’ve gone and done it… I’ve started yet another WordPress blog. Why? Mainly because I want a place to talk about things I’ve discovered, built, assembled, mangled, broke, repaired, or perhaps things that I just find interesting. My previous blog was a general train of thought, and while it contained a lot of nerdery and information, it also contained plenty of personal cruft. I wrote the software for my old blog, and while it did a pretty good job at what it was written to do, it is pretty limited in features and ease of use. Hence my decision to use WordPress. My intent with this site is to stay more focused on making, breaking, and fixing things, and not how I might have felt about it at the time or what the weather was like that day (unless I’m talking about a home weather station :))

Step one is to figure out how this WordPress thing works. I’m making progress with that, slowly. Thankfully, my wife has been blogging with WordPress for a while, and she’ll be able  to provide a lot of guidance.

Step two is to import some of the content that’s still worth publishing from my old site. A lot of it is outdated and covered with cobwebs, but plenty of it is still useful.

Step three is to find some way of actually organizing everything. Tags, categories, menus… oh my!

Step four is … write stuff? Create a legion of loyal and devoted readers? Who knows. I’ve got plenty of things that could use a proper write up to demonstrate their awesomeness, but oh so little spare time.

And of course… Step five – PROFIT!!