Welcome to maniacmartin, the personal site of Martin Smith.
I'm listening to Delta Goodrem – Throw It Away

23 November 2007

Integrate NHS computer systems

Filed under: Blog — martin @ 5:07 pm

For all you foreigners, the NHS is Britain’s free state-funded health system.

A lot of people are opposed to the NHS’s ongoing computerization of patients’ records, because it is seen as a waste of taxpayer’s money. Whilst I agree that our government has a history of badly-implemented IT projects that have gone vastly overbudget, the NHS should have been centralized years ago. Surgeries all have their own systems, and most parts of the NHS rely at least partly on paper records. When you move house, you change your registered doctor, and your old surgery sends your records in a bundle to your new surgery.

At St. John’s College and, presumably, many other Oxford colleges, there is a policy whereby you must be registered with an Oxford doctor. This means you cannot be registered with a doctor in your home town. Last summer, when I wanted something as routine as a repeat prescription, my home surgery initially refused because I wasn’t “on their books”. After persevering, I had to fill a temporary resident form (or something to that effect.), which needed my NHS number, something I don’t carry around on me.

Of course now I’m old enough to have to pay for my prescriptions, the amount dispensed seems to have reduced. (You pay pertype of medication, no matter how much of that particular drug you are dispensed). Now I’m back in Oxford, I’ll have to make sure I top up my supplies before going home. But the doctors here have never prescribed me that medicine. Will they issue a repeat prescription when given an old repeat prescription from another surgery? I’ll probably have to book an appointment with one of the doctors, wasting a slot, just to get them to do some paperwork.

This is 2007. Virtually every other sizable organisation has integrated computer systems. Why should the NHS be any different? And why do I need to get a new repeat prescription printed for every instance of the repeat prescription. Surely that can make a form that says “Repeat prescriptions every 60 days until 01/01/2008″ that is stamped every time you make a claim off it, or something similar? The current system wastes everybody’s time and causes unnecessary inconvenience.

20 October 2007

Hyperlinking to Piracy Sites is against UK law?

Filed under: Blog, E-petitions — martin @ 5:15 pm

Slashdot and The Guardian recently reported about the arrest of the owner of tv-links.co.uk and the sites subsequent closing down. TV Links was a site which linked to videos on other sites (like Youtube and Veoh) where users could see TV series. The arrest was made by officers from Gloucestershire County Council trading standards in conjunction with investigators from Fact and Gloucestershire Police.

The biggest use of TV links that I know of was people watching sci-fi series that had been released in North America, but that the industry wouldn’t make available to UK viewers. So these series-followers had no legal route to get the series in the UK when it was released in America. Maybe the industry should look at why people are using TV links and provide a legal route for them to get the programmes, without making them wait weeks after it’s been aired in America. No-one wants to wait to see programmes that have been aired.

The big concern to me is the americanization of our country. It seems it is now illegal to link to a site which could be used for piracy. In effect this makes merely distributing information on how to copy copyright material illegal. Websites like BBC seem to have covered themselves by not linking to any of the sites in question when reporting news stories about piracy, but is there any difference in telling people they can get movies from The Pirate Bay, than telling them they can get movies from The Pirate Bay? An interesting question would be whether telling someone they can buy pirate DVDs at a certain place at Hemswell market also counts as “facilitation of copyright infringement”.

18 October 2007

Fixing File Uploads after upgrading to PHP5

Filed under: Computer — martin @ 1:21 pm

As some of you may know, I upgraded from PHP4 to PHP5 recently. And it went smoothly - or so I thought. Now, it seems I overlooked the fact that the reference $HTTP_POST_FILES has been phased out. This has been replaced with $_FILES. This is great, since Zen Cart, custom scripts, old phpBB installations and other old php scripts where users can upload a fail now fail spectacularly as they access an empty array.

First I wanted to write a perl script which I fed a list of files, but with 10GB of websites, this would take ages (and given a list , the number of arguments exceeded perls limit). So instead I ran this command from /var/www/vhosts
find . -name '*.php' -exec perl -p -i -e 's/\$HTTP_POST_FILES/\$_FILES/g' {} \;
find . -name '*.inc' -exec perl -p -i -e 's/\$HTTP_POST_FILES/\$_FILES/g' {} \;

to spawn a new perl instance per file, without checking jpegs and stuff.

11 October 2007

Cycling from Rasen to Oxford

Filed under: Blog — martin @ 10:33 am

First, let me apologise for neglecting my trusty readers. But I’m back, back my magical journey.

On the Sunday at the start of freshers’ week I cycled from Middle Rasen to St John’s College, Oxford in 15 hours 59 minutes, including all stops. Unfortunately due to a dark start at 5.09am, I couldn’t set up my odometer to accurately measure the distance, but I’ll attach a map to show you. Note that I didn’t go as the crow flies (120 miles), but saught out backroads, so the distance is a bit more.

It was a nice cycle, because I wisely chose to carry virtually nothing and get my mum to bring it all in the car the following day. I wouldn’t say it was overly exerting, but I didn’t quite realise how hilly central England is, living in Lincolnshire and all. By two-thirds of the way there’s definitely only one possible speed.

Donov blogged this first. Here’s what he had to say:

Martin is INSANE
Mon, 01 Oct 2007
yesterday martin completed a 150 MILE cycle rids from his house in middle rasen to OXFORD, this journey took him 17 hours in total and has made me think that he is insane.


View Larger Map

4 October 2007

Wildcard Parsing in Linux Shells

Filed under: Computer — martin @ 10:11 pm

I have just discovered a quirk in linux shells.

When you issue a command with a wildcard, bash will replace the wildcard with a list of matching files. So when you type mogrify -resize 640x *.jpg
on a folder containing beach.jpg, pc.jpg and college.jpg, the shell will rewrite that as
mogrify -resize 640x beach.jpg college.jpg pc.jpg

and mogrify is given the options -resize 640x beach.jpg college.jpg pc.jpg (filenames in alphabetical order)

Now let us consider a folder with the following files: -r foo.bar foofolder barfolder
where foofolder and barfolder are folders. Issuing a rm *, might, at first glance just delete the files and not the folders. But alas this is expanded to
rm -r foo.bar foofolder barfolder
and rm recieves these options -r foo.bar foofolder barfolder
In fact, only the -r file will survive.

OK, you say, but who has files beginning with hyphens? Well, it could happen. And some commands, like tar, dont need a hyphen at the beginning of their arguments.

martin@xenon:~/tests$ ls
folder -r
martin@xenon:~/tests$ rm *
martin@xenon:~/tests$ ls
-r

24 September 2007

Andrew’s PHP unzip poem

Filed under: Computer — martin @ 11:22 am

When I thought I needed to recompile PHP 5 to get the unzip function for Installatron for Plesk Reloaded, Andrew helped me find yum install php-pecl-zip and everything all started to work.
Andrew made this poem to summarise [line breaks added]:

When PHP does not comply,
think for a moment, and try not to cry,
For if you see it needs a zip,
you better go get yum here quick,
Since compiling you really need not do,
if you can just simply use the ’su’,
And then when that command has run,
you can sit back well and call it done.

17 September 2007

SSH hangs accessing CentOS4 in VMware

Filed under: Blog — martin @ 9:30 pm

CentOS 4, VMware and SSH are three things that I cannot get to work together. Let me tell you the whole story and hopefully you’ll be able to spot a blindingly obvious mistake that I can’t.

I have a VMware install on my Kubuntu Feisty laptop. (The free edition that bugs you to get a free serial when you install, so they get another email to spam). This copy of VMware runs Debian, Windows XP, and if you’re feeling extremely patient, Windows Vista without any problems that I can see.

So, I decided to make a CentOS image so I can learn how it differs Debian (not having used Redhat-based distros before). That way I can break a vmware image and not my VPS. So northie and I installed CentOS 4 inside VMware from an ISO. Networking in VMware was set to Bridged, so the guest distro gets an IP from the router’s DHCP server. Everything installed without any errors, and the CentOS vm could wget things off the internet. I typed /etc/init.d/sshd start

On the VMware host, I typed ssh root@192.168.1.11
I was shown and accepted the vm’s key, and then ssh hung. It didn’t cut me off, or say connection closed and show a prompt. It just sat there for 2 minutes and then timed out. As if there was some major packet loss.

I remembered specifically disabling the firewall and SELinux at install time, but i peeked around /etc/selinux and other places to confirm this. I then tried other vmware networking settings, such as NAT. Then I copied /etc/ssh/sshd_config from my laptop to the vm. I added another user onto the vm and SSH into that. Finally I downloaded a pre-made CentOS 4 VMware image and tried that. But every time it would just hang. Occasionally it would ask for a password, then hang and time out. But I couldn’t get a prompt through SSH. I can ping the vm fine though

I then decided to see if the VM could SSH itself:
ssh localhost worked, yet ssh 192.168.1.11 showed its certificate then hung. However, sshd was set to bind to all interfaces (and was listening, I checked) and ifconfig proved 192.168.1.11 was an IP of the vm

If anyone knows how to fix this, please tell me!

Running a command as a /bin/false user

Filed under: Computer — martin @ 9:07 pm

In case anyone else wants to run a command as a user whose default shell is set to /bin/false, type this:
su -s command username

If you want a shell:
su -s bash username

15 September 2007

Moving to CentOS

Filed under: Blog, Computer — martin @ 2:31 pm

I’ve finally decided that enough is enough with DirectAdmin. It’s haphazard way of downloading tar.gzs and compiling from source to random places that it only knows is a sure way to make a disaster in the future. Not only does this make applying updates a cumbersome process, as it doesn’t use any sort of repository or anything, it also means that when something does go wrong it can take ages to track down.

Amidst the ill-thought-out shell scripts, perl scripts and binary blobs, sometimes you can work out what its up to, sometimes not. And things being broken because of syntax errors (e.g. missing closing brackets) in a paid product is not something I really have time to sort out any more.

Now, for all of you screaming “Use SSH with webmin/virtualmin”, I would love to, but other server users would be less than pleased to lose their shiny control panel, so that leaves cPanel and Plesk. I’ve decided to go with Plesk, because it looks shinierâ„¢ and is rumoured to be more secure and manage things better behind the scenes, even if its interface isn’t as intuitive as cPanel’s.

Of course, control panel providers only truly support Redhat derivatives (the Debian etch build wouldn’t even install for me), so I’m moving my server to CentOS (even though I prefer Debian). At least it will work, which is the main thing.

16 August 2007

BBC iPlayer and Net Neutrality

Filed under: Computer — martin @ 1:22 am

I don’t know how closely you have been following the BBC’s controversial iPlayer that uses torrent-like peer-to-peer technology to distribute programmes aired on BBC TV to users over the internet, but a thorny issue was always the that 3rd-party production companies insisted on DRM being present to limit the number of days that the download will remain watchable to 30 days. That way they cash in on after-sales of DVDs.

The major problem that quickly arose was that the BBC deployed Microsoft Windows Media Player DRM, restricting the content to users of the Microsoft Windows OS. The BBC Trust agrees that this is against their Royal Charter and apparently Mac and Linux clients are in the works.

What I never got, is why they can’t release the content made in-house by the BBC themselves in a DRM-free format, and just apply 3rd-party produced content under DRM formats.

Now ISPs (specifically Tiscali) are moaning that the iPlayer will suck up all their bandwidth and want to charge an extra fee! This is totally uncalled for. BBC pay their internet bill just like everyone else and will pay for the bandwidth used in seeding the programs (to use the torrent term). However the peer-to-peer transfers between end-users will not pass through BBC servers, so how is it fair to charge the BBC for this bandwidth. By that logic, we should be billing the RIAA for bandwidth used by torrents of MP3s.

As we have started to see in USA, ISPs here are wanting to threaten net neutrality by cherry-picking which content they serve, and charging extra for other content (charging the consumer seems to be the American idea, whilst charging the provider seems to be what the British ISPs are pushing for).

People use the internet signed up for that - the internet. Not bits of the internet which the ISP can provide cheaply. We should not let ISPs threaten net neutrality by limiting or charging extra for traffic of a certain protocol or originating from certain IPs. Net neutrality is the reason for the internet’s success. Without it ISPs would be free to charge for traffic originating from overseas for instance.

ISPs should stop overselling bargain “unlimited” packages when they do not have the infrastructure to provide this for the advertised speed. (Just look at Orange and how much slower than advertised that runs at). Packages should be clearly advertised with the speed and bandwidth caps. If ISPs can’t make ends meet, they should charge per GB if needs be, but net neutrality must be kept. They can’t charge for traffic at both ends, then charge an extra fee to a company whose network the packets never go through (which is the case with all packets not from the seed server). Nor can they just traffic-shape it away, because unlike the majority of torrents, all BBC iPlayer content is completely legal.

One idea that would reduce bandwidth usage would be for ISPs to have BBC caches (ie mirrors) in strategic POPs that they own. With a clever client with more complete IP data, it could be made to favour connecting to nearby iPlayers (geographically and on the same ISP), thus reducing backbone usage. This would be particularly beneficial to Tiscali, becuase many of their customers are on LLU exchanges.

« Newer PostsOlder Posts »