Skip to content

Instantly share code, notes, and snippets.

@matbor
matbor / mqttitudeTOmysql.py
Last active September 3, 2022 13:32
Simple Python script (v2.7x) that subscribes to a MQTT broker topic and inserts the data into a mysql database for later querying. This is designed to be used with the http://mqttitude.org/
#!/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
@matbor
matbor / gauge-mqtt-websockets.html
Created September 25, 2013 12:31
Steelseries gauge displaying temperature live using websockets from a mqtt/mosquitto broker.
<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>
@matbor
matbor / 00Readme.md
Last active January 4, 2022 14:53
mqtt/websocket html/js example
@matbor
matbor / connectagent.py
Last active December 22, 2020 02:32
Quick example of using python and Twilio for connecting agent to customer using the VERIFIED caller id of the agent to make the call.
# 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
@matbor
matbor / plex_create_rating_collection.py
Created March 8, 2017 09:20
This script will create a collection of your movies based on the movie rating, ie. If you want all G rated movies in a collection on it's own.
#!/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
@matbor
matbor / 00readme.md
Last active December 22, 2020 02:31
Scripts for my raspberry pi SDR RTL pager decoder.

Scripts for my raspberry pi SDR RTL pager decoder.

@matbor
matbor / Distance.py
Created October 5, 2013 07:21
Simple python script to find the line of sight distance between two sets of latitude and longitude points. Will modified later for geofencing with mqttitude.org backend server.
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
@matbor
matbor / 00readme.md
Last active February 24, 2019 10:31
Scripts on using on my sdr-rtl pi for pager messages

Currently using the getpagermsg2mqtt_all.sh script, running on a pi with supervisord

@matbor
matbor / apilimts.py
Created February 2, 2015 01:51
Just playing with tweepy / twitter api and apilimits. This example gets the user_timeline remaining.
# 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 = ''