Skip to content

Instantly share code, notes, and snippets.

@seiketkm
Created November 3, 2016 12:26
Show Gist options
  • Save seiketkm/fa1fcc999e860c4e2c4476d94dcda544 to your computer and use it in GitHub Desktop.
Save seiketkm/fa1fcc999e860c4e2c4476d94dcda544 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
TWEET=$(echo "$*"|cut -c -140)
curl -X POST --silent --data "_t=${STREWGATE_TOKEN}" --data-urlencode "msg=${TWEET}" http://stewgate-u.appspot.com/api/post/ > /dev/null
@seiketkm
Copy link
Author

seiketkm commented Nov 3, 2016

export STREWGATE_TOKEN=xxxxxxxxxxx

in /etc/environment, .bash_profile, .bashrc or etc.

@seiketkm
Copy link
Author

seiketkm commented Nov 3, 2016

tweetmyips on boot

#/bin/sh
sleep 10
GIP=`curl --silent http://ieserver.net/ipcheck.shtml`
LIP=$(hostname -I) || true
NOW=`date +%H:%M:%S`
. /etc/environment
TWEET="LocalIPaddr=${LIP} GlobalIP=${GIP} ${NOW}"
curl -X POST --silent --data "_t=${STREWGATE_TOKEN}" --data-urlencode "msg=${TWEET}" http://stewgate-u.appspot.com/api/post/ > /dev/null

and

/etc/network/interfaces

    up /home/pi/bin/tweetmyips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment