Skip to content

Instantly share code, notes, and snippets.

@tricker
Created December 17, 2013 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tricker/8010393 to your computer and use it in GitHub Desktop.
Save tricker/8010393 to your computer and use it in GitHub Desktop.
Raspberry Pi Image capture and upload shell script
#!/bin/bash
NOW=$(date +"%m/%d/%Y %H:%M")
THIS_PATH="/home/pi/src"
CITY="NYC"
raspistill -o $THIS_PATH/$CITY-cam-in.jpg -q 50 -w 1000 -h 700
convert $THIS_PATH/$CITY-cam-in.jpg -background black -fill white label:"$CITY Raspberry Pi Cam - $NOW" \
+swap -gravity Center -append $THIS_PATH/$CITY-cam.jpg
scp $THIS_PATH/$CITY-cam.jpg someone@foo.com:/home/foo/foobar.net/www/cam
rm -f $THIS_PATH/$CITY-cam-in.jpg $THIS_PATH/$CITY-cam.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment