Skip to content

Instantly share code, notes, and snippets.

View brookst's full-sized avatar

Tim Brooks brookst

View GitHub Profile
@brookst
brookst / fs5000.py
Last active May 15, 2024 23:23
Serial interface to Bosean FS-5000 radiation detector
#!/usr/bin/env python3
__author__ = "Tim Brooks"
__email__ = "brooks@skoorb.net"
__date__ = "2024-04-23"
import datetime
from enum import Enum, Flag
import logging
import serial
import serial.tools.list_ports as list_ports
@brookst
brookst / nodata_alarm.ps1
Last active September 6, 2023 16:59
No data alarm for PowerShell
# Check data is being written
# Tim Brooks Sept 2023 <brooks@skoorb.net>
#
# Specify a hashmap of Contacts with WhatsApp numbers and APIKeys
# E.g. > $Contacts=@{'+271234567890'=123456}; .\nodata_alarm.ps1
#
# Complete the enrolment described below to get an APIKey for each number:
# https://www.callmebot.com/blog/free-api-whatsapp-messages/
$FileName = "foo.txt" #File that should grow in size
@brookst
brookst / .config
Created November 16, 2019 22:16
busybox config equivalent to rustybox defaults
#
# Automatically generated make config: don't edit
# Busybox version: 1.32.0.git
# Sat Nov 16 21:39:04 2019
#
CONFIG_HAVE_DOT_CONFIG=y
#
# Settings
#
#!/bin/bash
# Demo using a hook to pull a file from master branch
# !Run in a temp dir!
set -ue
main () {
echo \> Setup
mkdir work
cd work
@brookst
brookst / git_branch.sh
Created November 3, 2016 14:35
Demo using a hook to restrict branch names
#!/bin/bash
# Demo using a hook to restrict branch names
# !Run in a temp dir!
set -ue
main () {
echo \> Setup
mkdir work
cd work
#!/bin/bash
# Demo pushing changes to checked out clones of a repo
# !Run in a temp dir!
set -uex
main () {
# Setup
mkdir work
pushd work

Keybase proof

I hereby claim:

  • I am brookst on github.
  • I am morphit (https://keybase.io/morphit) on keybase.
  • I have a public key whose fingerprint is EBF5 4075 C42A CDFC 4A95 709B A468 70CF 0C66 D5A7

To claim this, I am signing this object:

#!/usr/bin/env python
"""
Tools for interacting with usbtmc devices
Tim Brooks 2015 <brooks@cern.ch>
"""
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import usbtmc
@brookst
brookst / Layout_hotas_x45.xml
Last active December 24, 2016 12:26
Star Citizen X45 layout
<!-- Star Citizen X45 Mappings
Thanks to Electrocutor
https://forums.robertsspaceindustries.com/discussion/110454/guide-actionmap-and-controller-mapping/p1
Thanks to Athan
http://www.miggy.org/games/starcitizen/misc/Layout_saitek_x45.xml
http://www.miggy.org/games/starcitizen/misc/Layout_saitek_x45-public.xml
Thanks to smellasaurus
http://www.reddit.com/r/starcitizen/comments/27c9qj/joystick_configuration_info_x55_config_tweakfix/
-->
<ActionMaps version="0">
@brookst
brookst / scrape.py
Created December 8, 2012 23:31
Bittorrent tracker scraper
#!/usr/bin/env python
"""Simple script to scrape a tracker"""
import bencode
import urllib2
SCRAPE_URL = 'http://localhost:6969/scrape'
def scrape(url=SCRAPE_URL):
"""Return dict of scrape results"""
req = urllib2.Request(url)