BBC B running 2048 I’ve recently been experimenting at the Hackspace with UPURS and UPURSFS. These unfriendly strings of letters amount to a cable that links the BBC’s User port to my laptop via a USB to serial converter, two ROMs that go in the Beeb and some Perl code that runs on my laptop. The upshot of which is that I can access parts of the filesystem of my laptop as if they were floppies on the BBC.
Read more
I recently bought a string of 50 individually addressable RGB LEDs from Embedded Adventures and so had to decide what to do with them. I decided it would be festive if they could reflect Twitter’s current feeling about Christmas.
So I started Googling sentiment analysis and quickly discovered that Stanford University’s Natural Language Processing Group has released the source and data for their sentiment analyser. When fed a sentence it outputs one of “Very negative”, “Negative”, “Neutral”, “Positive” or “Very positive”. It’s pretty good but it’s trained on movie reviews so it’s not quite so accurate on tweets about Christmas. For example “Christmas time is defo the best time of the year !!” is classed as very negative.
Read more
Almost exactly a year ago I got married, just before Halloween. It seems to be fairly typical these days to have a photobooth at the reception so that guests can take photos of themselves for you. We decided ours should have a Halloween theme.
What Happens Guests enter a cubbyhole and sit on the chairs at one end. The space is lit by a lamp and there’s a camera on a tripod pointing at them. Scary props are provided, the background is decorated with spiders and bats. They press the big illuminated red button in front of them. The button flashes five times. The lamp goes out, a strobe starts flashing, the middle spider on the background drops down and in front of them. The camera takes a photo. The spider goes back up, the strobe switches off and the lamp comes back on. How It Works The control box.
Read more
Dancing In The Street - Martha Reeves And The Vandellas Papa’s Got A Brand New Bag - James Brown You Can’t Hurry Love - Diana Ross And The Supremes Going To A Go Go - Smokey Robinson Think - Aretha Franklin In The Midnight Hour - Wilson Picket Knock On Wood - Eddie Floyd Needle In A Haystack - The Velvelettes Itchycoo Park - Small Faces Brown Sugar - The Rolling Stones Lola - The Kinks Paperback Writer - The Beatles Ride A White Swan - Marc Bolan & T Rex Rebel Rebel - David Bowie Heart Of Glass - Blondie In Between Days - The Cure This Charming Man - The Smiths Dancing Queen - ABBA Jumpin’ Jack Flash - The Rolling Stones (Edited Wayne Carr intro to Motherbanger from Chris Morris’ Radio 1 Music Show) Here Comes Your Man - Pixies Something Changed - Pulp Friday I’m In Love - The Cure Blister In The Sun - Violent Femmes Panic - The Smiths Queen Bitch - David Bowie Debaser - Pixies Seether - Veruca Salt Razzmatazz - Pulp Hey Hey 16K - MJ Hibbett & The Validators Lipgloss - Pulp Shut Up And Let Me Go - The Ting Tings Babies - Pulp Disco 2000 (Nick Cave Pub Rock Version) - Pulp Buy Nothing Day - The Go! Team Where It’s At - Beck How Soon Is Now - The Smiths All carefully edited together in Audacity to remove gaps. Our attempt to side-step the first dance thing with Dancing In The Street failed. The song says “every guy grab a girl” but everyone was too busy ogling us. I had thought people would be danced out by the final track, but no. It had to be skipped in favour of something more up beat.
Read more
TwitBeeb Photo by John Honniball TwitBeeb is a BBC B microcomputer (vintage 1981) from which you can Tweet.
The Beeb itself was my main computer until 1994, I taught myself to program on it. A few years ago I pulled a rather scuffed up BBC out of a skip at Sussex University and took it home. Inside it had an add-on ROM board with several programs in ROM chips including a serial terminal emulator called Termulator. This allows it to connect to other computers via its serial port and for everything typed on the BBC’s keyboard to be sent to the other computer which sends responses back to be displayed on the BBC’s screen. It acts as what used to be called a “dumb terminal”, just handling the input and output while a more powerful computer does the actual work. This was quite a common way of doing things back when computers were room-sized. Several terminals would connect to a large shared computer, possibly over phone lines using modems.
Read more
Bus Pirate and SCP1000 I decided to learn how to use my Bus Pirate (v3) by getting it to talk to an SCP1000 chip that I’ve had for a while but not got round to using. The SCP1000 is a very accurate barometric pressure sensor with an SPI interface, mine is on a handy breakout board and came from Sparkfun. The datasheet has the details.
For the first step I found it pretty much vital to label each of the connectors on the end of the Bus Pirate cable as tracking down which is which was taking too long.
Read more
Here’s a script I wrote a while ago for checking a bunch of domains to see if their certificates have expired using openssl. Just add your domains to the @domains list. At work we have a cronjob that does this every day:
checkcerts -d 31 | mail -e -s"SSL Certificates Expiring Within a Month" systems@...
#!/usr/bin/perl -w # checkcerts # Barney Livingston 2008-11-18 use strict; use Date::Parse; use Date::Format; use POSIX qw(floor); use Getopt::Long; my $days = 9999999999; #about 27 million years should be enough my $help; GetOptions( "days=i" => \$days, "help" => \$help ); if ($help) { print <<"END"; Usage: checkcerts [options] --days -d <days> Only show certificates due to expire within <days> days. END exit 0; } my @domains = ( "example.com" ); # Your list of domains goes here. my $time = time; foreach my $domain (@domains) { my $tries = 3; my $date = ""; my $cn = ""; my $expdays = 0; my $x509 = ""; while ($tries > 0) { $x509 = `echo Q | openssl s_client -connect $domain:443 2>&1 | openssl x509 -noout -text`; $date = "ERROR"; if ($x509 =~ /Not After : (... .. ..:..:.. .... ...)\n/) { $date = str2time($1); } $x509=~ /Subject:.+CN=(.*?)[\/\n]/; $cn = $1; if ($date eq "ERROR") { $tries--; } else { $tries = 0; } } if ($date eq "ERROR") { print "Failed to get a useful response from $domain\n"; } else { $expdays = floor(($date - $time) / (3600 * 24)); my $expired = ""; $expired = " EXPIRED" if ($expdays < 0); if ($expdays < $days) { print time2str("%Y-%m-%d %T", $date) . " -$expired $expdays days - $cn\n"; } } }