Skip to content

Instantly share code, notes, and snippets.

@matbor
matbor / 00readme.md
Last active April 10, 2018 21:01
bom weather 2 mqtt -- bom = bom.gov.au weather. Old example of a script I am stil using daily.

Todo

@matbor
matbor / index.html
Last active August 29, 2015 14:19 — forked from anonymous/index.html
Highlight a row in table on ios if selected/touched.
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
@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 / removechar.py
Created March 3, 2015 02:45
Needed a function to remove and replace odd German characters. Original idea from here; http://stackoverflow.com/a/6117124/1710905
# -*- coding: utf-8 -*-
import re
message = "POCSAG512: Address: 241657 Function: 0 Alpha: HbRE: EVENT F150300647 - FROM POLICE ONSCENE, OCCUPANT OUT OF VEH ÄKMREÜ<NUL><NUL>"
repChars = {"Ä": "[", "Ü": "]", "<NUL>": ""} # define desired replacements here
def replaceText(text, rep):
# use these three lines to do the replacement
rep = dict((re.escape(k), v) for k, v in rep.iteritems())
@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 / add_mosquitto_key.sh
Last active August 29, 2015 14:15
Just adds the repo/key for mosquitto on raspberry pi and then installs it. for raspberry pi.
#!/bin/bash
sudo curl -O http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
sudo rm mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo curl -O http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients -y
@matbor
matbor / pushover_test.py
Created February 10, 2015 02:31
Pushover api test for python. Simple script for testing out the pushover api and all it's options.
# https://pushover.net/api#
import httplib, urllib
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": "xxxxxxxxxxxxxxxxxxxx",
"user": "xxxxxxxxxxxxxxxxxxxx",
"title": "Title of message",
@matbor
matbor / sickbeard_history.py
Last active August 29, 2015 14:15
A quick python script using Sickbeard api to get what TV has downloaded today and format for mqttwarn (for mqtt message/topic). I run this via cron at 7pm (when i sit down for the night, hopefully!) and i can quickly see what to watch. If you are very clever you could have this delivered to your phone when you turn your TV on at night. (aka open…
#!/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
# 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
@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 = ''