Hubsan X4 H107C

Really a great little quadcopter. Much fun to be had with it, I’m almost ready to take it outside.

Duplogrifier

I’ve been wondering for a while if I could represent a picture with Duplo pixels in a way that would do it justice.

Introducing the Duplogrifier!

Duplogrifier will take any JPEG and turn it into an arrangement of 2×2 Duplo bricks. Now truth be told, the answer to my original question is “no”. There are not enough colors available and it would take a obscene amount of bricks to build something visually acceptable. However it leads to some fairly cool results.

2015-04-15: added 6 more “pixel” colors.

You can play with it here:

Resilient SSH Tunnel

#!/bin/bash

tunnel_entrance_port=13306
tunnel_end=username@re.mo.te.ip
destination=127.0.0.1
destination_port=3306

# Use netcat to connect to tunnel entrance port. If its exit code is not zero, the tunnel needs to be brought up
nc -w1 localhost $tunnel_entrance_port > /dev/null
if [[ $? -ne 0 ]]; then
        echo "creating new tunnel for MySQL"
        /usr/bin/ssh -f -N -L $tunnel_entrance_port:$destination:$destination_port $tunnel_end
        if [[ $? -eq 0 ]]; then
                echo "  tunnel to $destination through $tunnel_end created successfully"
        else
                echo "  an error occurred creating a tunnel to $destination through $tunnel_end"
        fi
fi