Skip to content

Instantly share code, notes, and snippets.

View brookst's full-sized avatar

Tim Brooks brookst

View GitHub Profile
@brookst
brookst / joystick.py
Created November 14, 2012 10:55
Joystick event echoer using Pygame.
#!/usr/bin/env python
# Written by alex@nyrpnz.com March 14 2012
# Modified by brooks@skoorb.net November 12 2012
#
# Disable global warning, we need to store OPTS globally
# pylint: disable-msg=W0603
#
"Joystick event echoer using Pygame."
import pygame
@brookst
brookst / zmq_test.py
Created November 14, 2012 12:11
ZeroMQ REQ/REP test
#!/bin/env python
"0MQ messaging test"
import zmq
CONTEXT = zmq.Context.instance()
def get_opts():
"Get program options"
from argparse import ArgumentParser
parser = ArgumentParser()
@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)
@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">
#!/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

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:

#!/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
@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 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 / .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
#