Monday, 30 July 2012

Makey-makey Raspberry PI Soundboard

I recently ordered a Makey-Makey and thought it would be fun to create a pencil-drawn soundboard with it. However it seemed limiting to drag around a computer to play the sounds. So why not use my raspberry pi?

The makey-makey isn't going to arrive until next month, but I've created the kiosk style setup for it on the pi already.

Hopefully when it arrives I'll be able to plug it in and go!

Starting from a base install of 2012-07-15-wheezy-raspian, logged in as 'pi':

$ sudo apt-get install git
$ cd /home/pi
$ git clone https://github.com/dalethatcher/piboard.git
Edit /etc/inittab:

$ sudo nano /etc/inittab
Make sure two is the default runlevel:

# The default runlevel.
id:2:initdefault:
Then replace the line:

1:2345:respawn:/sbin/getty --noclear 38400 tty1
with:

1:2345:respawn:/sbin/getty -a pi -l /home/pi/piboard/run.sh 38400 tty1
Reboot and verify that, after start up, the program is running on the first screen.

Tuesday, 4 October 2011

London Clojure Dojo Robot Tournament

I ran a session at the London Clojure Dojo recently using Matt Wynne's rather excellent robot_tournament server. It wasn't too hard to get things up and running on my laptop. Had to learn some new stuff about Ruby bundles but once I had I could get all the required gems down and the server was up and running. I ran into a couple of other wrinkles:
  • curl on the mac seemed to require a mime type to be explicitly referenced like this:
    curl http://localhost:3000/players --header 'Content-Type: application/octet-stream' --data-binary @someone.zip
  • as we were using clojure I had to up the rock-paper-scissors game timeout as JVM startup was too long
The session went really well and people seemed to be up and running much faster than at the Software Craftsmanship conference where I first tried it. I'm guessing that possibly had something to do with practising dojo style coding? I got lots of good feedback and we're planning to run some similar sessions in the future.

Tuesday, 5 October 2010

iTunes Connect Report Download

I dabble a little in iPhone development and Apple collects lots of interesting information about downloads on my behalf which is really useful. It's a real shame that they provide no automated way of retrieving this information. No API and no option to have it emailed which is slightly inconvenient.

Although there are some paid and free options to obtain the data (or at least there were until Apple updated their website a while ago) as far as I know they all have to manually scrape it from the iTunes Connect website.

As I've been learning Clojure recently I thought it was a great opportunity for a mini-project to automate this process. The financial reports are the easiest to get as they are on 'real' pages.

Anyway if you'd like to automate the retrieval of the financial reports then give my script a go.

You can download it from:

http://github.com/dalethatcher/itunes-connect-download

Let me know how you get on.

Sunday, 8 November 2009

Erlets - Easier Erlang-Java interfacing

I've been helping a friend of mine out with an Erlang project and we needed to interface with Java. JInterface is a great start but it wasn't the easiest to figure out and start using. So I've created 'erlets' a simpler way to create a Java node that erlang can call:
public class MyErletServer {
   @ErlangFunction(module="pinger", function="ping")
   public OtpErlangObject ping(OtpErlangObject arguments) {
       return new OtpErlangString("pong");
   }

   public static void main(String args[]) {
       Erlets server = new Erlets("java@127.0.0.1");
       server.addFunctions(new MyErletServer());
       server.start();
   }
}
This can then be called from Erlang:
$ erl -name 'erl@127.0.0.1'
Eshell V5.7.3  (abort with ^G)
(erl@127.0.0.1)1> rpc:call('java@127.0.0.1', pinger, ping, []).
"pong"
It's available here: http://bitbucket.org/dale.thatcher/erlets

Saturday, 31 May 2008

Silly Mii

My talk for barcamplondon4 was "Silly Mii". It's a few ideas I had for silly things to do with the wii-mote. The program includes a simple persistence of vision LED message bar and an 'invisible instrument'. The invisible instrument supports up to four IR sources to play sounds.
Presentation
Program

Wednesday, 21 May 2008

Ruby: Debugging backticks

I needed to knock up a Ruby script recently that orchestrated some external processes using backticks. However something was going wrong and I need to temporarily peek into the inputs and outputs of the external programs. Ruby bend-ability to the rescue:
module Kernel
  alias_method :real_backticks, :'`'

  def `(cmd) 
    puts "`#{cmd}` => #{output = real_backticks(cmd)}"
    output
  end
end

Wednesday, 23 April 2008

Four pixel high font

I needed a font that was four pixels high for a project I'm working on and this is what I came up with. Capital B and E and lower case s and z are really difficult but it's just about readable. Free for all commercial or non-commercial use but I'd appreciate a credit if you find it helpful.