Skip to content

Instantly share code, notes, and snippets.

View rob-smallshire's full-sized avatar

Robert Smallshire rob-smallshire

View GitHub Profile
@rob-smallshire
rob-smallshire / proxy.pac
Last active March 28, 2022 11:42
PAC file for routing iPlayer requests over a local SOCKS proxy
function FindProxyForURL(url, host)
{
if (shExpMatch(url, "*.bbc.co.uk/iplayer*")
|| shExpMatch(url, "*.bbc.co.uk/mediaselector*")
|| shExpMatch(url, "zaphod-live.bbc.co.uk.edgesuite.net/*")
|| shExpMatch(url, "bbcfmhds.vo.llnwd.net/*"))
{
return "SOCKS 127.0.0.1:8080";
}
else
@rob-smallshire
rob-smallshire / mkvenv
Created January 20, 2013 12:49
A shell script to create a new Python 3.3 virtualenv, and then download and install distribute and pip into it.
#!/bin/bash
# Create a new Python 3.3 venv and configure it with pip
# Usage: source path/to/mkvenv <path>
set -e
pyvenv $1
cd $1
source bin/activate
curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py
easy_install pip
@rob-smallshire
rob-smallshire / client_controller.py
Created November 17, 2012 20:01
Arduino Web Service and Python Client for a Digital Thermometer with LED display
"""
A Python web service client which GETs temperatures over a web service API
from an Arduino based server and PUTs the status of LEDs back to the Arduino
to provide a visual temperature indication.
The intent of this system is to demonstrate how control logic can be moved
to remote systems which communicate with the Arduino over the network.
Pass the base url of the server e.g. "http://192.168.1.101" as the
only command line argument.
@rob-smallshire
rob-smallshire / LedThermometer.ino
Created November 17, 2012 19:46
Arduino based LED digital thermometer based on DS18B20
// An Arduino sketch for continually reading the temperature from
// a Dallas DS18B20 digital thermometer and turning on or off red,
// yellow or green LEDs to indicate the temperature range
// OneWire 2 library (an improved version of the original OneWire)
// http://www.pjrc.com/teensy/td_libs_OneWire.html
#include <OneWire.h>
// Dallas Temperature Control library from
// http://milesburton.com/Dallas_Temperature_Control_Library