RSS

Cycling Bling

Chain Bracelet

I had an urge to make a very metal bracelet out of a used bicycle chain.

Initially I’d dismissed the idea, thinking that keeping a chain tool in my bedside cabinet, for whenever I wanted to put it on or take it off, might be a bit inconvenient. But then I remembered that KMC chains, my usual choice of flexible power transfer system purveyor, come with a reusable link, and the problem was solved.

Possibly not suitable for the office, but I think it’s a must for the next Motörhead gig. \m/

 
Leave a comment

Posted by on Thursday 22 July 2010 in Uncategorized

 

Blogging by email

I wanted to see what happened if I submitted a blog entry with pictures by email.

Is it clever enough to do something sensible with the attachments? It’d be nice if it at least did a basic layout, which could then be edited later.

Let’s see what happens, shall we?

The picture? That’s a couple of Hungarian chilli plants (I’m not sure of the exact variety), which are sitting on my desk at work, waiting for me to figure out how to carry them home in a tank bag without trashing them. Answers on the back of a postcard, please.

 
Leave a comment

Posted by on Thursday 22 July 2010 in Uncategorized

 

Worn-out Worm

After behaving itself impeccably the weekend before last, on my trip to the NABD Rally and other places, my Elefant disgraced itself last week by deciding that it no longer wanted to let me know how fast I was going.

Initial suspect was the speedo cable, since that’s normally the cause of this kind of problem.  I phoned up Venhill shortly after I got to work, but (fortunately, as it turned out) they denied knowing the details of this cable, despite me having ordered one previously, so I’d have to send my old one in so I could make a copy.

I never got round to checking the cable until the weekend, when the front wheel was off anyway to get new tyres put on (as well as chain and sprockets, and fitting the Öhlins-spring equipped shock that I’d had lying around for ages) . The cable’s fine: spinning it by hand makes the speedo needle flick. Next thing to check was the speedo drive, which turned out to be very stiff. A bit of cleaning revealed that a stone had got caught and jammed the mechanism.

Problem solved… but when I rode away from getting the work done, I did so at an indicated 0 mph. Bugger.

Further investigation this evening reveals that the metal drive ring in the wheel has worn down the tangs on the plastic ring in the speedo gearbox. I’ve bodged it for now, but who knows how long it’ll last… looks like I’ll have to get a new one, but where from?

 
Leave a comment

Posted by on Monday 17 May 2010 in Motorbikes

 

Tags: ,

Ventura Rack and the Fast Fasteners

I’ve got to say something about the quality of service from Inox Fasteners

I’m trying to fit a set of second-hand Ventura L-brackets to my Aprilia Falco. Ventura were good enough to supply a set of fitting instructions, but I’ve got a feeling that they’re for a later revision of the L-brackets than the ones that I’ve got.

The instructions say that the centre bracket, which fits under the pillion seat between the grab handles, has threaded bosses to accept the original grab handle bolts… the one I’ve got doesn’t. I’m guessing that there should be some longer bolts for the grab handles, to go through the un-threaded bosses, with a nut on the end.

So, late last night (actually, early this morning), I placed an order via Inox’s website for some suitable bolts, expecting to get a confirmation and payment request before lunchtime today. Sometime after lunch, I realised that I hadn’t heard anything, so I sent an email expressing my concern, with the hope that I could get the parts tomorrow.

I was slightly horrified at myself when I got a response apologising for the delay due to a family bereavement… and then a further message saying that the bolts had been put in the post without waiting for payment! The normal payment confirmation email didn’t turn up until this evening, and I’m fully confident that I’ll get the bolts tomorrow and the Ventura rack will be nice and secure, well before the weekend.

So, for all your stainless steel fasteners requisites: Inox Fasteners.

 
Leave a comment

Posted by on Tuesday 13 April 2010 in Motorbikes

 

Tags: , , ,

Wot no widget?

Curses. I wanted to put my Nike+ widget on my blog to show off my lowly running achievements, but wordpress.com doesn’t allow Flash (amongst other things).

Mind, the Nike+ website seems to be so flaky that it probably wouldn’t work half the time. Or maybe it just doesn’t like Google Chrome, or trying to run the Flash components on Linux. It’s so broken at the moment that I can’t even get to my profile page to find the correct URL to add in here somewhere. Pffft.

Edit: I’m pretty sure the problem with the Nike+ website is a combination of issues with Google Chrome (it often doesn’t render at all correctly the first time it’s loaded, whatever the operating system), exacerbated by problem with Flash on Linux. Something to investigate when I get a chance, although there are plenty of people on the Nike+ forums complaining about problems with Chrome.

 
Leave a comment

Posted by on Monday 1 March 2010 in Geeky stuff

 

Tags: , ,

Knit your own Tweets

The Perl scripts that I was fiddling about with seem to be working the way I wanted them to (even if what’s calling them isn’t always), so here they are for anybody else who wants to use them.

queue_tweet.pl


#!/usr/bin/perl

use DateTime;
use Sys::Hostname;

my $time = DateTime->now()->strftime("%F %T");
my $tweet = "$time\n";
my $hostname = hostname;

$tweet .= "$hostname\n";

while(defined($line=<STDIN>)){
    $tweet .= $line;
}

$tweet .= "%%\n";

#print $tweet

$tweetqueuefile="/var/local/tweetqueue";

open(QUEUE,">>$tweetqueuefile") || die("Cannot open tweet queue");
print QUEUE $tweet;
close(QUEUE);

send_tweet.pl


#!/usr/bin/perl

use File::Copy;
use Net::Netrc;
use LWP::UserAgent;

$tweetqueuefile="/var/local/tweetqueue";

open(QUEUE,"$tweetqueuefile") || die("Cannot open tweet queue");

# Read lines of first tweet

my $tweet;

while(defined($line=<QUEUE>)){
    if($line eq "%%\n"){
        # Exit loop
        last;
    }
    $tweet .= $line;
}

if($tweet != ""){
#	print "Sending tweet:\n$tweet";
    $machine="twitter.com";
    $netrc = Net::Netrc->lookup($machine);
    my $ua = LWP::UserAgent->new;
    my $req = HTTP::Request->new(POST => 'https://twitter.com/statuses/update.xml');
    $req->authorization_basic($netrc->login, $netrc->password);
    $req->content('status='.$tweet);
    my $result = $ua->request($req)->as_string;
#	print $result;
}

$tempfile="/tmp/tweettmp";

open(TEMP,">$tempfile") || die("Cannot open temporary file");

while(defined($line=<QUEUE>)){
    print TEMP $line;
}

close(TEMP);
close(QUEUE);

copy("$tempfile", "$tweetqueuefile") || die("Cannot overwrite tweet queue");

(As I’ve mentioned before, it’s a long time since I’ve written any Perl, so I’ve probably made any number of schoolboy errors. Still, they seem to do the trick.)

queue_tweet.pl reads from stdin to queue a tweet, and send_tweet.pl reads and sends the first tweet from the queue each time it’s called. You’ll need your credentials for twitter.com in your .netrc file.

For example, I’ve got the following entries in my crontab:

# Send any pending tweets
*/5 * * * * /usr/local/bin/send_tweet.pl

# Log disk temperatures
30 */4 * * * /usr/sbin/hddtemp /dev/sda /dev/sdb | /usr/local/bin/queue_tweet.pl

# Motherboard temperatures
35 */4 * * * /usr/bin/sensors | /bin/grep Temp | /usr/bin/cut -c 1-21 | /usr/local/bin/queue_tweet.pl

Let me know if you use them for anything more interesting than tweeting your system temperatures, or if you’ve got any (constructive) criticisms of my Perl code…

 
1 Comment

Posted by on Tuesday 16 February 2010 in Geeky stuff

 

Tags: , ,

Perl before swine

It seems that I’ve forgotten everything I ever knew about Perl.

All I wanted to do was write a little Perl script that could be called to queue up informational tweets, and another to send queued tweets which would be called from a crontab every five minutes or so, but I’m having to look up almost every statement in the trusty Camel book. Programming, the slow way.

Update: Finally got the scripts working the way I wanted. I was going to use the Net::Twitter module, but trying to install it just resulted in errors relating to Compress::Zlib::gzopen, so it seemed easier to do things the long way round using LWP::UserAgent and HTTP::Request. Once I’ve got the scripts plugged in to my crontab and rcX.d scripts, I’ll post them here in case anybody’s trying to work out how to do the same thing.

 
Leave a comment

Posted by on Wednesday 3 February 2010 in Geeky stuff

 

Tags: , ,

Internet disappears; film at 11.

After some extensive network reconfiguration to get my Humax Foxsat HD hooked up to the Interweb, I thought I might as well upgrade the firmware on my router (Netgear DG834GT) while I was on. At this time of night? I should’ve known better…

I was downstairs, the router’s upstairs, so I couldn’t watch the blinkenlights, but the router’s web page got to the end of its progress bar and I tried to connect… nothing!

I found the router flashing its little “power” and “test” lights at me, but what are the chances of that meaning anything useful? A quick browse using my mobile phone (thank $DEITY for a backup Internet connection) revealed almost exactly nothing useful, so I went for the “power off, wait, power on” ploy. Works every time.

 
Leave a comment

Posted by on Friday 29 January 2010 in Uncategorized

 

Tags: , , ,