Press "Enter" to skip to content

Richy's Random Ramblings

TV: Have I Got News For You Filming

Just a quick note as quite tired.

Today, we went to watch the filming of the first episode of the new series of Have I Got News For You (filmed at the ITV London Studios). The free tickets from Hattrick (HIGNFY’s production company) said that the doors open at 6.45pm : we were there for 4.30pm and were around 30/40th in the queue. By the time 6.30pm came round (and we had been standing in the cold wind and rain outside), the queue stretched out the “Audience Queue” area, past the side of the building, round the corner on the pavement and further still(!). Spoilers may be ahead…

Car Costs: Buy and replace or just hire?

It appears our 9 year old Fiat Punto is on its way out – after buying it a new battery (£40) and putting it in, we checked it worked. White smoke started coming out the exhaust. We then checked the oil dipstick and it looked like chocolate milk – a sign the head gasket has allowed anti-freeze to enter the engine. Research on the internet showed a new head gasket would cost between £300 and £450, but since anti-freeze has already entered the engine, it might need to be stripped down which would cost a lot more.

So, we decided to see if it was economical to replace it with another car (2nd hand or brand new) or whether to use hire cars/car clubs: we make around 14 trips a year (6 trips to Yorkshire @ 200miles each way, 6 trips to Leicester @ 100 miles each way, 4 trips to see friends @ 40miles each year = 3920 miles total: say 4,000miles for “spare”) and we live close to London so it might be worth it…. Here’s our figures:

Yearly running costs for the car
Road Tax £130.00
Insurance £304.00
M.O.T. £50.00
Breakdown cover £30.00
Total fixed yearly costs
(exc Petrol and repairs)
£414.00
Petrol on 4,000 miles a year based on 5.7litres/100km at 116.8p/litre [4000 miles= 6437km/100= 64.37*5.7litres= 367 litres per year * 116.8] £428.66
Repair costs (guestimated average) £250.00
Total costs £1,092.66

Ouch! But how much would it cost for a hire car for the same sort of period?

Well, the journeys to Yorkshire and Leicestershire are typically weekend ones, so we’ll need to hire a car on Saturday morning and returning it Monday morning (as car hire places usually close at 5pm on Sundays – if they are open at all – and that’ll be too early). Avis has cars at £75.47 per weekend. The friends trips are same day, during the week, and that’s £110.00 from Avis – although I found another local company offering car hire for a single day at £40.00 and Streetcar offers £49.50 – so we’ll say £50 for a day).

So that’s

6 * 2 (14) weekend trips @ £110 each £1,540
4 one day trips @ £50 each £200
Total hire costs £1,740
Petrol on 4,000 miles a year based on 5.7litres/100km at 116.8p/litre [4000 miles= 6437km/100= 64.37*5.7litres= 367 litres per year * 116.8] £428.66
Total costs £2168.66

Even without adding petrol on top (most hire car places want you to pay for the petrol as well) – it’s already more expensive then owning a car (even taking into account repair costs!).

If we were to buy a second hand car for £1,500 (we’re actually looking at a third of this) and taking into account this “capital expenditure” the prices per year would be:

Running costs Year 1 Year 2 Year 3 Year 4 Year 5 Year 6 Year 7 Year 8 Year 9
Buying 2nd hand* 2592 3685 4777 5870 6963 8028 9121 10214 11306
Buying new car* 8902 9685 10617 11600 12583 13565 14548 15531 16513
Hiring a car 2168 4337 6505 8674 10843 13011 15180 17349 19517

* = Second Hand card purchase price estimated at £1,500
* = New Cars do not need an MOT for the first 3 years of their lives. We’re looking at a Toyota Aygo which costs £8,220 “on the road” price, is taxed at “B” rate (which is £20), does not need any tax paying for the first year (this is included in the “on the road price”) and includes 1 year breakdown cover. Repair costs are estimated at £50 for the first year, £100 for the next year and then £250 for each consecutive year.

So as long as the car lasts us more than 1.5 years, it is more economical for us to have a car that sits idle for over 91% of its life than it is just to hire cars “as and when needed”. Even buying a new car is cheaper than hiring over 7 years.

Quite shocking and saddening really….

Funny: Funny Linux Commands

Shamelessly stolen from Frank Mash (or, as UK news organisations will probably argue, “this orphaned content found was at …”):

% cat “food in cans”
cat: can’t open food in cans

% nice man woman
No manual entry for woman.

% “How would you rate Quayle’s incompetence?
Unmatched “.

% Unmatched “.
Unmatched “.

% [Where is Jimmy Hoffa?
Missing ].

% ^How did the sex change operation go?^
Modifier failed.

% If I had a ( for every $ the Congress spent, what would I have?
Too many (‘s.

% make love
Make: Don’t know how to make love. Stop.

% sleep with me
bad character

% got a light?
No match.

% man: why did you get a divorce?
man:: Too many arguments.

% !:say, what is saccharine?
Bad substitute.

% %blow
%blow: No such job.

% \(-
(-: Command not found.

$ PATH=pretending! /usr/ucb/which sense
no sense in pretending!

$ drink matter
matter: cannot create

$ ddate
Today is Prickle-Prickle, the 69th day of Chaos in the YOLD 3176

and of course:

unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ; umount ; sleep

Some of these work, some of these don’t – it all depends on your OS version. ddate does work on Centos.

Varnish: Normalizing / Normalising the url

We’ve had a small issue with our installation of the Varnish Proxy Cache not working as efficiently as we hoped. This was tracked down to the fact we are using Google Adwords and Google Analytics for tracking and Google was adding query string items such as utm_source , utm_medium , utm_campaign and gclid to the URL. This caused Varnish not to cache the page (and/or treat them as separate urls) and just led to bad cache usage.

I’ve added this code to fix this which may be of use for others:

/* Normalize the url - first remove any hashtags (shouldn't make it to the server anyway, but just in case) */
if (req.url ~ "\#") {
set req.url=regsub(req.url,"\#.*$","");
}
/* Normalize the url - remove Google tracking urls */
if (req.url ~ "\?") {
set req.url=regsuball(req.url,"&(utm_source|utm_medium|utm_campaign|gclid)=([A-z0-9_\-]+)","");
set req.url=regsuball(req.url,"\?(utm_source|utm_medium|utm_campaign|gclid)=([A-z0-9_\-]+)","?");
set req.url=regsub(req.url,"\?&","?");
set req.url=regsub(req.url,"\?$","");
}

Techy: How I investigated Counterpath Bria’s licensing issue

On Saturday the 12th of February 2010, myself and many other users of the popular Counterpath Bria VOIP Software started getting the message “The data received from the license server appears to be corrupted. Please try again and if the problem persists, contact Counterpath Support.”, but without any idea of what caused it. Many people contacted Counterpath’s support forums, but as of the time of posting the only official status we have is “It is being investigated”. However, I took it upon myself to try and figure out what had gone wrong and then if I could “work around” the issue.

I knew from the error message that Bria was trying to contact the licensing server to validate the license, so the first step was to investigate what was being transmitted. Luckily, I had the very handy Charles Proxy and after installing its CA Certificate (so Bria didn’t complain about an invalid certificate authority when retrieving the data via Charles), I could see the communicaitons.

Bria made a post to https://secure.counterpath.com/Service/LicensePool.sv/RegisterClientBinding with my license key, a hash of something on my machine, the type of product I’m checking the license for (Bria), the time my computer thinks it is, and identifying hashes of my machine (in particular, hard disk, motherboard and Mac address) – this data is sent to try and reduce “license sharing”. In return, Counterpath sent back the same information, including an expiration date and duration of the license (30 days), instructions to recheck the license after 24 hours and then every 4 hours (+/- 30%), confirmation the license if valid and then they signed the response using an X509 digital signature. Why have they signed it? Well, otherwise it would be reasonably simple for somebody of about my technical knowledge to be able to intercept the SSL stream and modify the data to always have approved licences (and, no, I’m not going to say how I would do this – but I can think of 2 ways straight way).

As all the other data looked correct (Counterpath used descriptive XML tags which did really help in this process: although since it’s just communicating between their servers and their products, I would have personally obfuscation it just for a little more ‘security’: yes, I know “security by obfuscation” isn’t good security practice, but sometimes “every little helps”), I then investigated the X509 certificate. I copied and pasted it into a new text document, called it “x509.crt” and just let Windows’ certificate explorer show be the details – and it was immediately obvious what the fault was. The expiration date on the certificate was dated 2 days ago.

So about 5-10 minutes of investigation and I knew to roll back my computer clock to pre 12th February 2010. Run Bria to get it to reacquire a new license and viola everything working (well, hopefully for 24 hours until the license starts revalidating). I just wish Counterpath had actually provided the “roll back your clock” workaround on their forum: Bria is an excellent product and I’m just disappointed that because somebody dropped the ball and forgot to renew a 2 year old X509 certificate (which would be easily done as that length of time people would have left and the details would have just been forgotten to be passed on), their reputation and good product range may be tainted. I’m guilty myself of letting the SSL certificate on my online dance wear site expire for a couple of days (mainly because the certificate provider wouldn’t let me renew the certificate until after it had expired!) so I know how easily it can be done – I now have a 3 year certificate so it might again happen to me in 3 years time.

What has this taught us: If you use a secure certificate (for your website or code), keep a note of the date it is due to expire and set reminders. Your certificate provider might send you emails to remind you – but don’t rely on them. Communicate with your customers and if a problem could take more than a couple of hours to fix, propose a workaround (such as rolling back your computer’s clock) – they might not like it, but at least you are doing “something”. And signing license files with your own digital signature is a good idea (yep, I bet you weren’t expecting that!) as it stops people easily bypassing it – but just remember to keep your digital signature up to date!

[n.b. might just be worth mentioning that I investigated this all on my own – Counterpath or any third party did not ask me to investigate it. However, within an hour of me posting on their forums with the information I had found, the problem was fixed. Coincidence or were they already waiting for the new certificate to be approved/installed? I don’t know, but I like to speculate 😉 )