Sunday, 19 June 2011

Three URL Shorteners that don't need authentication, XML or JSON

Here's three URL shorteners that will allow you to get a shortened link without needing authentication, and with very simple APIs. These are useful if you're writing blogging or microblogging (twitter-style) applications.

All three take a simple HTTP GET request. As you have to include the URL you want shortened in the request, you have to HTTP encode it (you know, all that %20 stuff). All of them return one line of text, which is the shortened version of the URL.

You should be able to test them by simply using a webbrowser and going to the link. Don't forget to replace the line phrase <url goes here> with an http-encoded url.

Cli.gs http://cli.gs/api/v1/cligs/create?appid=autoblog-0.1&url=<url goes here>

Linkee http://api.linkee.com/1.0/shorten?format=text&input=<url goes here>

Is.gd http://is.gd/create.php?format=simple&url=<url goes here>

Saturday, 18 June 2011

Howto Change Blogger Settings with the GData API

I've just discovered an undocumented (or I couldn't find any docs for it anyways) way to change the settings of your Blogger/Blogspot blog via the GoogleData API.

I discovered this as a result of the recent 'breakage' of my API client. I was using a blog-posting 'endpoint' URL that wasn't supposed to work, but had been working until recenty.

Geeky Groups near Birmingham UK

I've recently been getting more into meeting like-minded people, which is to say 'geeks'. After years of trying to pretend that I'm not one (in the same way that I tried to pretend my eyesight wasn't failing when I was a kid) I've finally decided to come out.

This new sociability probably started when I visited the c-base hackerspace in Berlin,



where I got horribly drunk and threw up in their loos. It wasn't all my fault though, I didn't pour all that Jager down my own throat. Well, okay, literally speaking I did, but someone kept filling the glass, so I feel there's shared responsiblity.

Anyways, since then I've been to the Nottinghack hackerspace in Nottingham. They did a frankly wonderful lockpicking workshop, and if they ever do another of these and you can go to it, I'd urge you to do so. You'll learn a lot (most of it alarming).

How to fix your broken Blogger client program

For about a month now I and other people have been unable to use the blogger api to update our blogs. This is one of a raft of problems caused by a recent update of the blogger system, and some other ones (including the fact my OpenID is broken) are still outstanding. However, the OpenID thing isn't a big deal, whereas the api blog posting is something I use a lot.

I can happily report that the Blogger/Google people have come through for us and found the problem. I had been losing hope, because as a linux user I'm used to having people break stuff, and then say the problem is that I'm running linux. But, though it's admittedly taken them a while, google's blogger team have dug to the bottom of the problem and found the cause. Maybe I should have more faith in future, we'll see.

If you've found that your blogger API client program has stopped working in the last month, then what follows is what you need to do to get it working again.

Friday, 27 May 2011

Google's Blogger Service is Broken

Since about 2011/05/22 google's "Blogger" service (where this blog is hosted) has been experiencing serious problems. You can see a list of increasingly irate people here . It's a weird fault that hits different people in different ways. Some can't log in, some can't log out, some can log in but can't post.

I've not been as heavily affected as some, I can still log in to the website and post to my blog. However, I can't use the 'blogger api' to post from applications. Other people using blogging applications like MacJournal or ScribeFire are having the same problem.

The amazing thing is how long it's taking google to fix this, days. Also it seems to me (though I may be wrong) that this is linked to a recent decision by google to turn on 'Spam Checking' on everyone's blog comments. They didn't ask us if we wanted this turned on, they didn't suggest we turn it on, they just went and turned it on for us. They did this a while back with 'google buzz', turning it on and in the process revealing users gmail contacts to the whole world. I conclude from this (assuming I'm right about the cause) that google learns nothing from history.

But there's a bigger issue there. We're told that everything is moving into 'the cloud', that big competent companies will 'look after our data' and make thing effortless for us. You know, big competent companies like BP, or Toyota, or Enron, or Sony, or Google, or any bank, or...

These big companies aren't exactly covering themselves with glory these days. Would you really trust them with your business critical data?

Tuesday, 10 May 2011

Things I wish people had told me about 1: Bind Mounts

Stuff I wish people had told me about No. 1

Bind Mounts

Quite often I find myself wanting to run processes in a chroot. This is especially true for file services being served up by ftp or http. Unfortunately I often find that files I want people to get access to are outside the directory that I want to chroot them into.

Now, symbolic links won't work across chroot, and though you can use a hard-link to make files individually available within a chroot, it becomes a lot of work for a lot of files.

Just recently though, I discovered that you can do this:


mkdir /home/PublicData
mount --bind /home/PublicData /home/chroot/PublicData

These 'bind mounts' allow you to 'mount' a directory onto another directory. So, you create an empty directory with a particular name, then call the mount command to mount another directory onto your empty directory, so that when people enter the 'empty' directory, they are teleported to the other directory.

This means that you can choose which directories to make available to people who are in some kind of chroot jail. Very useful!

I wish someone had told me about this earlier.

Tuesday, 12 April 2011

Root's bash profile not working when su

A reaccuring annoyance for me is getting root's bash_profile to work, and everytime I fix it, I promptly forget what I did, so here's a post for me to refer to if noone else!


Things like the users PATH and other environment variables can be set up in a file in their home directory called .bash_profile. If they're using the Bourne Again Shell then this file gets read when they login, and any commands in it are run to set up their environment. But in my experience it never works for root.

There's a difference between root and other users though, I almost never login as root, I login as another user and then 'su' to root. Turns out that an 'su' doesn't count as a login, and '.bash_profile' only gets read and run for login shells. If other types of shell get started up, say by being launched from a program or whatever, then another file '.bashrc' is read instead. So, if I put the same commands in /root/.bashrc that I normally would in /home/user/.profile, then they will work when I 'su'.

Finally there are 'global' bashrc and profile files that can be put in /etc, and these will be run for all users before any profile or bashrc in their home directory is run. Note that these files don't have the leading '.', so instead of /home/user/.bashrc, it's /etc/bashrc. And for the profile, it's /etc/profile instead of /etc/bash_profile as you might expect! Oh, and finally, these global files don't seem to work for /root.

So, to get the PATH and prompt etc set for everyone, create /etc/profile for all users but root, and then copy it to /root/.bashrc, and /root/.bash_profile and that should cover 'su' and 'login' shells for root too.

Monday, 4 April 2011

Nvidia drivers fail without 'smp_lock.h'

If you install a very recent kernel from www.kernel.org, and then try to install the NVIDIA graphics drivers, you may find that the driver install fails. The NVIDIA installer actually compiles the drivers against your kernel source tree, but recent kernels seem to have dropped a file that's called 'smp_lock.h'. Unable to find this file that it expects to have, the NVIDIA driver compile process fails.

A quick and dirty solution that worked for me was to simply locate 'smp_lock.h either under /usr/include/linux, or in an old kernel source tree, and drop it into the include/linux directory of your new kernel source tree. If you can't get a copy of a the file, then try making an empty file with the same name, I think even that will probably work. You should then find that the NVIDIA install process gets by that hurdle at least. It worked for me!

Monday, 7 February 2011

I'm up on "Daily Science Fiction"



Well, on Friday my story "Imaginary Enemies" went out on the Daily Science Fiction mailing list. My first pro-paying publication. What feed-back I've seen from readers is good, no one hated it, many people are saying they liked it. I'd like to thank my friends and family, and Sainsbury's for doing the catering. I'm sure my sudden success won't change me.

Actually, I was kinda hoping it would change me, but no signs yet.

Anyways, in a week or so it's apparently going to get posted to the Daily SF website for everyone to see, even those who aren't on the mailing list, and no doubt then the bidding war for film rights will start!!

Friday, 28 January 2011

Broadband speedtests that don't need flash or java

Look, I don't want to install flash or java just to find out how fast my internet connection is. I just want something that downloads a file and gives me a result. Here are some websites that do this basic thing.
1) Tracert.org
http://www.tracert.org/bandwidth_meter/

For me the best one, almost magical in fact. You just click 'start test', and it works. Works in old versions of firefox without flash, and seems to produce results that agree with other tests.

2) Ten Meg
http://tenmeg.myby.co.uk/

Yes, it requires you to watch a couple of images downloading and click a button when they're done, but it works in browsers without flash, java, activex, siverlight, perl, ruby, php, gtk, etc, etc, etc, etc.


3) ISP GEEKS
http://www.ispgeeks.com/wild/modules.php?name=Bandwidth_Meter_DSL

Described as their 'Mobile Speed Test', doesn't seem very accurate (perhaps because they're in the USA and I'm in the UK), but it gives a rough idea and doesn't need flash etc.

4) Broadband speed checker
http://www.broadbandspeedchecker.co.uk/

Seems to work in I.E. without flash, though it says it would like to have flash 8. Unfortunately seems to be broken in earlier versions of firefox.

5) Toast.net
http://performance.toast.net/

Again, not massively accurate, but simple and kinda fun waiting for the picture to download!

6) Mobile test
http://i.dslr.net/iphone_speedtest.html

Aimed at mobile phone browsers, but if you click the 'wifi' option, it seems to give a fairly accurate result (but that could be a co-incidence).