Earlier in the year, when I builtSpamWatch, I put it together by cobbling together lots of different scripts and hoping that it worked together. Thinking that this wasn't very reliable, I decided to see if there was a better way.
What I'm effectively trying to do is count the number of lines in a log file between a set date range. Given that my log files seem to rotate at any time they want, it's a bit of a challange to get a list of log lines for a particular time period. Then it occurred to me: the best way of querying a large set of data using different criteria is a database. All I had to do was find a way of shoving my exim4 logs into a database, then I could query it and get stats more reliably.
Syslog is the obvious answer here. Exim can happily send logs off to various different places and by dumping it on syslog, I can pretty much do whatever I want. I stumbled across rsyslog, a syslog daemon that can throw log entries into a database, so I set that up on a new VM and flicked the switch. So far, it seems to be working. It's been a couple of days and my syslog table is 50,000 lines long. Now I need to get some numbers out of it and compare them to what I'm getting from the old fudge-and-gaffer-tape way.
Well, the inevitable happened. I bought a bike. Not one with pedals, oh no. This one's got an engine.
It all started when I moved to Ealing and found out that I had to get to Old Street and back every day. This is a long way. On the tube, it takes over an hour to do the journey in rush hour and that's something that I'm paying £116 a month for. I bought a new mountain bike recently, mostly because my old one was stolen and part of me wondered if cycling would be a feasible option. Doing several journey planners indicated that the route would be a fairly simple 12 mile run each way.
I decided to test out my cycling theory a few weekends ago. From my house, I got as far as Shepherd's Bush before deciding that the combination of London pot holes, the unsuitability of a mountain bike to road riding and my general level of unfitness made this idea a non-starter. As I waited by some traffic lights next to about 3,000 scooters, I had an idea.
I could buy and run a 125cc motorbike for a lot less money per year than I was spending on the tube. And my commute would be a lot faster. I did some research - I was looking to be spending about £100 on the CBT, £2000 on a bike, £400 on clothing and £300 on insurance. For something that would last me at least 2 years and give me a significant return on the bike sale at the end (should I want to), this was a lot better than going on the tube.
I booked and passed my CBT. It was a lot of slightly confusing fun - once I'd got my head around the notion of braking with my right foot and delicate clutch control with the left hand, I greatly enjoyed driving around Ealing at a blistering 18mph. Amusingly, I was the only person on the session other than the instructor, a trainee instructor who was observing and the DSA man doing a spot-check on the instructor.
I decided I wanted a Honda CBF125. This is quite a recent bike, so the used market is rather thin. After hunting through autotrader, I did find a private ad for what seemed to be a perfect deal, but after phoning the guy was told that I had missed it by about 10 minutes. I found a new one at a dealer about 20 miles away, so went for a test and liked it. Paid just over £2k.
Now I just need to get it insured and then I go to pick it up on Thursday. A new era involving not being depressed by the tube awaits.