Cool Duplo Project #27 – Trebuchet

We are dangerously entering the realm of projectiles.

IMG_3134

I MacGyver’d a sling with rubber bands & a rubber balloon.

IMG_3140

I’m helping the counterweight a bit since Duplos don’t have much mass; there is definitely room for improvement in other regards, the sling release specifically. currently it takes a few trials to get a good trajectory.

[mejsvideo mp4=”http://ben.akrin.com/videos/trebuchet.mov.mp4″ ogg=”http://ben.akrin.com/videos/trebuchet.mov.ogv” webm=”http://ben.akrin.com/videos/trebuchet.mov.webm” poster=”http://ben.akrin.com/videos/trebuchet.mov.jpg” width=”360″ height=”640″]
Medieval warfare? More like Medieval fun times.

Resilient SSH Tunnel

[bash]#!/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[/bash]