Skip to content

Instantly share code, notes, and snippets.

View NotBobTheBuilder's full-sized avatar

Jack Wearden NotBobTheBuilder

View GitHub Profile
@NotBobTheBuilder
NotBobTheBuilder / tempergold.py
Last active September 28, 2024 11:40
Take a temperature reading from a TEMPer Gold USB thermometer/temperature sensor
#!/usr/bin/env python3
import os
import select
import struct
DEV = '/dev/hidraw1'
def read_temperature(device_path=DEV):
# Credit to https://github.com/urwen/temper for this byte sequence
QUERY = struct.pack('8B', 0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00)

For once, not DNS: Huawei Modem ARP spoofing

A couple of days ago I noticed my Ring Chime was disconnected in the Ring app. After a couple of years happily connected it was time to fulfil the ultimate purpose of both software and hardware: annoy humans.

image

I went through the reconnection process a couple of times to no luck. I called Ring support, who took me through the same process a couple of times to the same result. But one step in their process yielded an unusual result: if I set up a WiFi hotspot on my phone, the Chime would connect to it!

But when renaming my home WiFi network to have the same name and password as the hospot, the Chime still can't connect.

@NotBobTheBuilder
NotBobTheBuilder / gosund-up111-tasmota.json
Created November 22, 2020 20:23
GoSund UP111 Tasmota Template
{"NAME":"Gosund","GPIO":[0,56,0,17,134,132,0,0,0,0,21,0,0],"FLAG":0,"BASE":18}
trait TesterTrait {
type Out
def unapply(s: String): Out
}
object Tester extends TesterTrait {
override type Out = Boolean
def unapply(s: String) = false
}
@NotBobTheBuilder
NotBobTheBuilder / gist:08bad9d2554fcde371fd5d7aae56c644
Last active February 21, 2017 07:41
Python dynamic dispatch
from collections import OrderedDict, namedtuple
from functools import partial
class Dispatcher(object):
def __init__(self):
self.handlers = OrderedDict()
def match(self, *args):
def match_inner(handler_fn):
self.handlers[args] = handler_fn
/*
* /tmp/child.js
*/
var run = function () {
console.log('awh yeah');
return 3;
};
@NotBobTheBuilder
NotBobTheBuilder / sw.py
Created August 4, 2013 15:08
Tidied up version of @cymplecy's code
#Original Code Martin Bateman 2013
#Modified by Simon Walters
#GPLv2 applies
#PC End
#V0.2 04Aug13
import sys
import time
import socket
import Tkinter as Tk
@NotBobTheBuilder
NotBobTheBuilder / python.desktop
Created March 25, 2013 21:02
.desktop file for python interpreter
[Desktop Entry]
Name=Python 3
Comment=Python
Exec=/usr/bin/python3
Terminal=true
MultipleArgs=false
Type=Application
Categories=Application;Development;
StartupNotify=true
@NotBobTheBuilder
NotBobTheBuilder / chaser.js
Last active October 8, 2015 18:57
Rock-Paper-Scissors bot samples
var opponentName;
var nextHand = 'paper';
function init(opponent) {
opponentName = opponent;
}
function play() {
return nextHand;
}
@NotBobTheBuilder
NotBobTheBuilder / sources.list
Created September 24, 2015 13:59
ain't no party like an apt-get party
# deb cdrom:[Ubuntu 15.04 _Vivid Vervet_ - Release i386 (20150422)]/ vivid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ vivid main restricted
deb-src http://archive.ubuntu.com/ubuntu/ vivid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted