HAVE MOVED THE FILES TO a repo...
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 | |
# September 2013 | |
# by Matthew Bordignon, @bordignon on Twitter | |
# | |
# Simple Python script (v2.7x) that subscribes to a MQTT broker topic and inserts the topic into a mysql database | |
# This is designed for the http://mqttitude.org/ project backend | |
# | |
import MySQLdb | |
import mosquitto |
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
<?php | |
$conn = mysql_connect("thebeast.localdomain", "root", "") or die(mysql_error()); | |
mysql_select_db("mqtt") or die(mysql_error()); | |
?> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>Google Maps</title> | |
<style type="text/css"> |
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
<head> | |
<title>Testing Temp Gauge</title> | |
</head> | |
<body onload="init();"> | |
<canvas id=gaugeCanvas width=200 height=200>No canvas in your browser...sorry...</canvas> | |
</body> | |
<script type="text/javascript" src="mosquitto-1.1.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
<script type=text/javascript src=http://dl.dropbox.com/u/128855213/SteelSeries/tween-min.js></script> | |
<script type=text/javascript src=http://dl.dropbox.com/u/128855213/SteelSeries/steelseries-min.js></script> |
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> | |
<script src="http://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&sensor=false"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script> | |
<script src="mqttws31.js" type="text/javascript"></script> | |
<TITLE>MQTTitude - find my family & friends</title> | |
<style type="text/css"> |
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
import math | |
def distance_on_unit_sphere(lat1, long1, lat2, long2): | |
# by Matthew Bordignon @bordignon Oct 2013 | |
# | |
# handy example for finding distance between two sets of co-oridinates | |
# modified from http://www.johndcook.com/python_longitude_latitude.html | |
# Convert latitude and longitude to | |
# spherical coordinates in radians. | |
degrees_to_radians = math.pi/180.0 |
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
import math | |
def distance_on_unit_sphere(lat1, long1, lat2, long2): | |
# modified by Matthew Bordignon @bordignon Oct 2013 | |
# | |
# handy example for finding distance between two sets of co-oridinates | |
# modified from http://www.johndcook.com/python_longitude_latitude.html | |
# handy tool to chk calculations, http://www.johndcook.com/lat_long_distance.html | |
# Convert latitude and longitude to | |
# spherical coordinates in radians. |
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 | |
# | |
# October 2013 | |
# Subscribes to multiple topics (and will also block sub-topics, based on keywords) and if it see's the work | |
# 'offline' it sends a notification to the pushingbox topic. Mainly using this to track if a program goes offline | |
# | |
# by Matthew Bordignon / @bordignon | |
# | |
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
import urllib, json | |
class SABnzbd(object): | |
""" | |
Usage: | |
>>> from sabnzbd import SABnzbd | |
>>> s = SABnzbd('sakar.local', 8080, '4488f2881b90d7753bef8fb9e1bc56b3') | |
>>> s.pause() # Pauses the downloads | |
>>> s.shutdown() # Shut's down SABnzbd+ | |
""" |
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
from ouimeaux.environment import Environment | |
def on_switch(switch): | |
print ('******** Switch found:', switch.name) | |
def on_change(value): | |
print('******** light has changed state and has been switched!') | |
env = Environment(switch_callback=on_switch, with_cache=False) |
OlderNewer