note; I have all my scripts setup so that the lwt (last will and testament) publishes 'offline' if the scripts die.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>Test subcriber</title> | |
<head> | |
<script src="vendor/mqttws31.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
//mqtt broker setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add this first part to the top of the functions file | |
#for reversegeo | |
import time | |
#import logging | |
from urllib import urlencode | |
from urllib2 import urlopen | |
#this filter will reverse geo the address for you | |
def OwnTracksConvertWithAdd(data): |
How Far 2 Home
This function was designed as a proof of concept and will return the estimated driving distance the device (using owntracks here) is from the GPS coordinates specified in the functions file
For example;
2014-03-24 15:45:00,484 INFO [log] matthew iphone is 38mins away from home
Requiements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Historical Temperature Data</title> | |
</head> | |
<style type="text/css"> | |
#bubbles { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from urllib import urlencode | |
from httplib import HTTPSConnection, HTTPException | |
from ssl import SSLError | |
pushalot_authorizationtoken = 'xxxxxxxxxxxxxxx' | |
pushalot_title = 'title' | |
pushalot_body = 'body' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# uses tweepys/twitter api, using the cursor method here | |
# http://tweepy.readthedocs.org/en/latest/cursor_tutorial.html | |
import tweepy # pip install tweepy | |
# Consumer keys and access tokens, used for OAuth | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' | |
access_token_secret = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#uses tweepys/twitter streaming api, problem with using this is that you dont always get ALL the tweets. | |
#https://dev.twitter.com/streaming/overview/request-parameters#follow | |
from __future__ import absolute_import, print_function | |
from tweepy.streaming import StreamListener | |
from tweepy import OAuthHandler | |
from tweepy import Stream | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import urllib2 | |
import time | |
import datetime | |
import paho.mqtt.publish as publish | |
# Show's the last 10 episodes that have been downloaded using sickbeard recently |
OlderNewer