Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python2.7
''' This script will download the detailed energy usage from dominion power and insert it into InfluxDB which you can then visualize with Grafana
https://www.dominionenergy.com/company/electric-projects/smart-meters/detailed-energy-usage
'''
import mechanize
import cookielib
import csv
import pytz
@gitrc
gitrc / sendiMessage.applescript
Created November 18, 2013 20:47
send iMessages from command line. Useful for Nagios and other things.
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run
@gitrc
gitrc / tivostream.sh
Created November 18, 2013 20:40
Watch recorded programs from your TiVo using curl, tivodecode, and mplayer.
#!/bin/bash
#
# tivo stream before tivostream was.
#
MAK=YOUR_MAK
/usr/bin/curl --cookie sid=abc -k --digest -u tivo:${MAK} -c /dev/null $1 | /usr/bin/tivodecode -m ${MAK} -- - | /usr/bin/mplayer -vf pp=lb -cache 64768 -
# end.
@gitrc
gitrc / remoteshark.sh
Last active December 28, 2015 17:19
Don't bother with copying PCAP files, just pipe tcpdump over SSH into wireshark! Great for embedded system work.
#!/bin/sh
#
# from your workstation run below where <expression> is your tcpdump expression
# works great on OSX
#
ssh root@destination.host "/path/to/tcpdump -s 0 -U -w - -i ethX <expression>" |wireshark -i - -k