reqires;
Just a simple example for mqtt/websockets/html/js subscription and publishing of topics/messages in chrome console.
#!/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 |
FROM ubuntu:18.04 | |
# Install dependencies | |
RUN apt-get update && \ | |
apt-get -y install apache2 | |
# Install apache and write hello world message | |
RUN echo 'Hello World!' > /var/www/html/index.html | |
# Configure apache |
<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> |
reqires;
Just a simple example for mqtt/websockets/html/js subscription and publishing of topics/messages in chrome console.
# Download the helper library from https://www.twilio.com/docs/python/install | |
from twilio.rest import Client | |
import os | |
from twilio.twiml.voice_response import Dial, VoiceResponse | |
from flask import Flask, request | |
app = Flask(__name__) | |
# Your Account SID from twilio.com/console | |
account_sid = os.environ.get('TWILIO_ACCOUNT_SID') | |
# Your Auth Token from twilio.com/console |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Description: Create a Plex collection from based on content rating. | |
# Original Author: /u/SwiftPanda16 | |
# Modified by: @bordignon on Twitter. | |
# Requires: plexapi, requests | |
# | |
import requests |
Scripts for my raspberry pi SDR RTL pager decoder.
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 |
Currently using the getpagermsg2mqtt_all.sh script, running on a pi with supervisord
# how to check api limits with tweeepy | |
#http://tweepy.readthedocs.org/ | |
import tweepy # pip install tweepy | |
import time | |
# Consumer keys and access tokens, used for OAuth | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' |