David Morris – brassedoff.net

Family outings, Geographing, Linux, Java, RC boats, work…

Justice meted out

Filed under: rant, travel — david at 4:24 pm on Saturday, January 30, 2010

I love it when someone gets their comeuppance. It happened earlier today in spades…

We were outside Morrisons on Meadowhead in Sheffield (here on google maps) in a queue of traffic going down the hill. Behind me was a young woman in a black Audi TT. Down the inside (the bus lane) appears a well-heeled respectable looking bloke in a large silver Mercedes who proceeds to try and get in front of me. Now, I’d been queueing for some time and quite frankly, wasn’t really disposed towards letting someone who’d just come the inside of quarter of a mile or more of almost stationary traffic push in, so I held my place on the road. Mr Merc then proceeded to try and shove in behind me in front of the lass in the Audi. She obviously felt the same as I did, but Mr Merc clearly felt she was a pushover compared with me, so kept pushing, despite the girl making it quite plain she wasn’t going to give way. Eventually, the poor lass ended up half way over the white line in the face of oncoming traffic with Mercman millimetres off my back bumper.

Seeing what was happening, and fancying a bit of fun, I waited until the coast was clear and I waved the Audi girl in front of me to get her out of the awkward situation she found herself in. As she drove around, I could see she was on the phone. My assumption was that she was phoning the other half to recount the incident. As she drew alongside me, she wound down the window and shouted that she’d been ringing the police.

Within a minute, the police car came up the hill looking at the line of traffic… I took great delight in pointing out our protaganist behind me. Myself and Audi-girl pulled in down the road as requested by the police and they took details. The lass in the Audi was in a terrible state – very badly shaken by the whole experience and she’d got her two young daughters in the car – both younger than Dan – both of whom she said had been frightened silly.

If Mr Merc and his (I assume) wife and other friend in the back of the car had been in a hurry, it was a bit unfortunate for them, because the policeman must have given them a right old grilling, because it was fully another 25 minutes before they got under way again; I’d been in the brew shop on Abbey Lane and done my buying as he drove in front of the shop.

Hopefully it taught him and his passengers a lesson and next time, he wont be so much of a road hog and outright bully. The roads are everyones to share. Just ‘cos you’ve got loads of money and a big car doesn’t mean to say you have any more right over any bit of road than anyone else. Kudos to Audi-girl for phoning the police and making sure the bully got what he deserved.

If you see a gent in his 50’s, curly greying hair, big Silver Merc, DV08, give him a wave from me.

Currentcost energy monitoring – SQL tweaks

Filed under: computer — david at 12:59 pm on Saturday, November 7, 2009

Conscious as I have been for a while that I’ve been collecting a lot of records in my CurrentCost energy log table, I thought I’d better do something to tidy it up a bit as I had a bit of spare time this morning.

A quick check showed a gnats over 1.4million records in the log file (one record every six seconds since July) so something needed to be done! My collector script doesn’t add the per-record cost to the data, so I have to run a quick query first to update the ’slice_cost’:

update energy_user set slice_cost = watts * 0.0016667 / 100 * 0.175

(yes, I know I should cancel some of the zeroes out)

I wanted a table summarised by hour showing total watts and cost per hour. My base table is this:

mysql> describe energy_use;
+-------------+----------+------+-----+---------------------+-------+
| Field       | Type     | Null | Key | Default             | Extra |
+-------------+----------+------+-----+---------------------+-------+
| recordtime  | datetime | NO   | PRI | 0000-00-00 00:00:00 |       |
| temperature | float    | YES  |     | NULL                |       |
| watts       | int(11)  | YES  |     | NULL                |       |
| slice_cost  | double   | YES  |     | NULL                |       |
+-------------+----------+------+-----+---------------------+-------+
4 rows in set (0.00 sec)

I’m not really interested in temperature, so I wanted this for a summary table…

mysql> describe total_energy;
+-------------+---------+------+-----+---------+-------+
| Field       | Type    | Null | Key | Default | Extra |
+-------------+---------+------+-----+---------+-------+
| rdate       | date    | YES  |     | NULL    |       |
| rhour       | int(11) | YES  |     | NULL    |       |
| total_watts | int(11) | YES  |     | NULL    |       |
| total_cost  | double  | YES  |     | NULL    |       |
+-------------+---------+------+-----+---------+-------+
4 rows in set (0.00 sec)

Now let me point out here, I’m not an SQL expert by any stretch of the imagination, so forgive me if this is obvious to some people. An aggregate query on the energy_use table would give me the summarised data I wanted, and wrapping that up with an insert query would summarise and build the total_energy table in one fell swoop:

insert into total_energy (rdate, rhour, total_watts, total_cost)
 select  date(recordtime) as rdate, hour(recordtime) as rhour,
  sum(watts) as total_watts, sum(slice_cost) as total_cost
  from energy_use
  group by date(recordtime),hour(recordtime);

…which appears to do the job quite nicely.

All I have to do now is decide how much data I want toremove from the detail table. Realistically, I don’t need anything before October now I have a summary table, so

delete from energy_use where date(recordtime) < '2009-10-01'

…which removed 989000 records (or thereabouts).

Next job is to write some graphs to display the cost profiles…

Music editing and printing

Filed under: Uncategorized — david at 10:49 am on Saturday, October 24, 2009

Ok, so I’ve got Rosegarden working now and I can play back the music I’ve entered using a soft synthesizer (QSynth) and everything’s working just fine.

I’ve spent a few minutes knocking together a quick two-part arrangement of a Christmas Carol for Dan and myself to play for the Santa  Publicity Day in Retford (there’ll be more, but I have to start somewhere!).

Rosegarden will happily create a multi-line score, but it’s not Dan-friendly. Fortunately, Rosegarden will export Lilypond files. Lilypond is a GNU command-line application for music typesetting and will spit its output out in PDF or postscript format.

So, a few key presses later and this is the result:

O Little Town

Rosegarden should be able to preview and print direct using Lilypond, but for some reason, it isn’t. Not the end of the world because I just exported the file in Lilypond format and processed it on the command line:

david@server:~/Documents/Music> lilypond –pdf Little-Town-1.ly  Little-Town-2.ly

(I had two files to process – one for each part and could combine them on the same command line).

So, concept to hard copy music and not a commercial pay-for bit of software in the loop anywhere.

Rosegarden in full flow

Time for a bit of phishing

Filed under: computer — david at 10:51 am on Tuesday, October 13, 2009

One of our French users received an email regarding a tax issue with the UK tax authorities (HMRC). The URL started off ok, but turned out to be a little nasty:

(Please don’t click it)

http://online.hmrc.gov.uk.nyyyyase.com/SecurityWebApp/httpsmode/statement.php?{other id stuff redacted}

nyyyyase.com turns out to be a cluster of machines

dmlinux2:/home/david # host nyyyyase.com
nyyyyase.com has address 222.113.210.163
nyyyyase.com has address 61.73.96.212
nyyyyase.com has address 67.164.7.67
nyyyyase.com has address 79.175.103.228
nyyyyase.com has address 83.4.187.5
nyyyyase.com has address 89.134.5.8
nyyyyase.com has address 93.172.209.217
nyyyyase.com has address 110.13.183.155
nyyyyase.com has address 114.180.190.76

nyyyyase.com has address 121.174.9.100
nyyyyase.com has address 121.183.6.137
nyyyyase.com has address 190.139.220.38
nyyyyase.com has address 195.56.205.192
nyyyyase.com has address 210.116.200.91
nyyyyase.com has address 221.165.170.71

…and when you try to browse to the IP address, you’re redirected to microsoft.com, presumably in an attempt to cover tracks. The few that I’ve traced all seem to be Eastern Europe (Poland and Hungary)

Browse a little deeper though and you get a site not dissimilar to the HMRC web site in layout and colour.

Be warned!

Bi-xenon headlights?

Filed under: boating, canal, seth ellis — david at 8:33 pm on Sunday, August 30, 2009

I’ll freely admin I’ve become an intermittent blogger since I discovered Twitter. I’m more likely to tweet several times a day than I am to update my blog which is sad, but some things really need a blog post.

After the car got stolen recently, it was a relatively easy decision to go for another Mini. I know some will probably throw their hands up in horror, but it’s me that’s driving it…

The last Mini was an 06 Cooper S. There’s no doubting that the MCS is a cracking car, fun to drive and goes live the brown stuff off a shovel, but to my cost I’ve also found out it’s quite nickable. After much reflection, I decided that something less nickable was probably in order, so I decided to go for a S Clubman. It’s still fun to drive and being that little bit bigger (it really does have boot space!) it’s a bit more practical.

There wasn’t anything I fancied in the second-hand market so I was nearly ready to bite the bullet and go for a brand new build. Unfortunately, the lead time was two months for a new factory build. As I’ve been driving Mrs Woolforbrain’s car for the last three weeks and she woudl need it once the school holidays were over, I had to come up with an alternative solution. Fortunately, the nice people at Sytner Mini Sheffield had an ex-demonstrator, registered less than four months ago in black. It nearly met my ideal spec, but was missing the bi-xenon headlights that my previous MCS had and were on my shopping list, but did have the MFSW (multi-function steering wheel) which incorporates the cruise control and radio remote which was also on the shopping list. The car also had the sports Chili pack. The dealers kindly agreed to fit the Mini approved iPod interface kit free of charge, so we shook on it. I’m now the proud owner of a 09 plate Cooper Clubman and it’s fun again! The bi-xenon headlights would have been nice, but they’re a £420 option. The iPod interface is around £250 and will probably get used more, so we’ll put it down as a result!

I seem to be getting more and more involved with activities centred around the Canal Trust, but even so, it was a pleasant surprise to receive an email from the Chairman inviting me to become a member of Trust board with pretty much immediate effect. Needless to say, I will be accepting. It’s a great honour to be involved in such a campaign I feel so strongly about. The Trust has brought me into contact with some really nice dedicated people and has given me the opportunity to play with some great toys! After all, I get to play with a nice narrowboat taking people out on trips, and today, I’ve been talking to members of the public about the work that the Trust has put in to an 80-year-old ex British Waterway working boat. It’s great for me as well. Most of the time I spend doing volunteer work for the Trust gets me out in the fresh air which is a major departure from my day job, and I get all the positive vibes that result from being involved with a charitable organisation that does so much for the community and the environment. Plus, I get chance to put something back from an IT perspective.

NHS and car

Filed under: general — david at 11:29 am on Friday, August 14, 2009

With all the current hoo-ha about the Amerians slagging of f the NHS, I felt obliged to share this excellent blog post: http://potentialandexpectations.wordpress.com/2009/08/13/this-americans-experience-of-britains-healthcare-system/

Also, I’ve just had the insurance company on the phone. They’ll come up with a settlement within 2-3 working days based on the private sale value of my Mini. Having just had a look at Autotrader, there’s not a hell of a lot of difference between private sale and dealer sale prices which is very good news for me. I’ve just seen a lovely white Cooper S, one lady owner…

CurrentCost power graphs now online

Filed under: computer, gadgets, linux, technology — david at 8:37 am on Saturday, July 25, 2009

I’ve got my CurrentCost php graphs to a point where they’re suitable for a wider audience. The graph takes data from the mySQL database that’s holding the load data coming in from the CurrentCost sensor and display, does a little bit of massaging (all statistically acceptable!) and generates a dynamic graph.

Currently, the graphing routine is automatically scaling. I’m not sure long term whether this is the best option or not. It would probably be better to take a long term maximum and stick with that, but as the scaling rounds up to the nearest 1000 watts above the daily maximum, it should cope with all eventualities except the kettle AND the microwave AND the oven all on at the same time (and the electricity meter going in to overdrive!).

I’ve also added a tweak that allows me to go backwards and forwards a day at a time on the graph.

If you want to see the current load graph, look here. As this isn’t linked to the date or time of this blog posting, depending on when you look at it, there may not be much data on it. A better view would be to look at yesterday (which is always yesterday relative to YOUR today).

There are still a few more things needed, and a proper wrapping page would be nice, when I can get around to it. I’ve also still got the cost calculations to add in (daily cron job just after midnight and results going to another table perhaps?). Also, I’ve not yet given a lot of thought to what’s going to happen when we go into / out of daylight savings, but that’s not for a couple of months yet!

If you want the PHP that’s producing these graphs, it’s available here. (It comes with a  full Government health warning).

Scarey gadgets: CurrentCost

Filed under: computer, gadgets — david at 2:44 pm on Tuesday, July 14, 2009

It’s official. I have in the house now the scariest gadget imaginable for something of a gadget freak. It’s this little gem – a CurrentCost CC128.

It tells us how much electrickery we’re using and worse, how much it costs. So far, we’ve knocked about £10/month off the bill by being a bit more careful about what we leave switched on. £10/month payback on a £40 investment. That’s a bit of a no-brainer.

There’s more though. This gadget as a serial interface. And there’s a USB serial cable available for it. And it squirts data out in XML format.

There are already several people writing open source software for it, and when I get back from my latest business trip, guess what I’m going to be doing?!

I sense a little bit of Java or PERL as a daemon process, a mySQL table or two and a bit of PHP on the horizon.

For the record, the device has a little battery-powered sensor that clamps around the output from the domestic meter and communicates with the base station using 433MHz wireless. The base station itself is mains powered, estimated at a couple of pence per week to run and in ideal circumstances will pick up up to 30m away from the sensor.

I can’t wait.

Just how sustainable is this?

Filed under: computer, technology — david at 10:07 am on Thursday, July 2, 2009

No, it’s not a green or environmental post. It’s a techie post. I’ve been exchanging tweets recently with my ISP over their record bandwidth usage lately. The cause of these records? Tennis. Well, indirectly, tennis. In actual fact, BBC iPlayer. The Murray quarter final match yesterday afternoon accounted for a massize 25% of Plusnet’s bandwidth at something like 1.8Gb/s. It’s probably a good job they brought another 155Mb pipe on recently.

There’s a lot of discussion going off in the press at the moment about who should pay. Some advocate pushing charges back to the content provider, but they’re arguing that they’ve paid their whack in getting their server farm connected to the Internet in the first place with the necessary high capacity pipes.

As we look more to Internet delivered services, this argument is going to rumble on and on and users like thee ‘n’ me are going to want to make sure we’re using an ISP that can make the necessary investments in bandwidth to ensure consistent delivery of service. The situation is only going to get worse. Virgin will sell you a 50Mb fibre connection to home. Plusnet and others are trialling or have already rolled out ADSL2+ with up to 20Mb on copper.

Is, therefore, the current charging model the right one moving forward? Commentators more skilled than me will probably be having that argument for years to come. In the meantime, I’ll be catching up with TopGear from the weekend tonight on iPlayer and I hope there’s no tennis on to pinch the bandwidth!

Struck a chord

Filed under: Uncategorized — david at 12:11 pm on Thursday, June 18, 2009

Ok, it’s been over a month since I last blogged and this is only a quick update, but this article on the BBC Magazine site struck a chord with me. Sorry it’s a bit morbid.

http://news.bbc.co.uk/1/hi/magazine/8106747.stm

Next Page »