Skip to content

Instantly share code, notes, and snippets.

View rbarraud's full-sized avatar

Roger Barraud rbarraud

  • Robar Systems (New Zealand)
  • Up a Mountain, of course - just like all good Guru's should be ;-) - Wellington, New Zealand
View GitHub Profile

Case for Bus Pirate v3.6 (Dangerous Prototypes/Seeedstudio version)

Case for Bus Pirate v3.6

This is a case for the Bus Pirate v3.6 from Dangerous Prototypes as listed on Thingiverse to be printed on a 3D printer.

In order to compile this file to an STL you'll need OpenSCAD and also the file oshw.scad which you can find here on Thingiverse.

# Our simple example of a Turnstile state machine.
class Turnstile
def initialize
@state = "Locked"
end
def push!
@state = "Locked" if unlocked?
end
use32
UMB_START = 0x00100000
org UMB_START
MB_MAGIC = 1BADB002h
MB_F_BOOTALIGNED = 1
MB_F_MEMINFO = (1 shl 1)
MB_F_VIDEOTABLE = (1 shl 2)
MB_F_USE_MBOFFSETS = (1 shl 16)
MB_FLAGS = MB_F_BOOTALIGNED or MB_F_MEMINFO or \
@rbarraud
rbarraud / supervisord.service
Created March 15, 2017 07:04 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
@rbarraud
rbarraud / 20160101_freebsd_build_upgrade_via_source.md
Created May 7, 2017 10:06 — forked from dch/20160101_freebsd_build_upgrade_via_source.md
freebsd upgrade using git or svn source & making a low-fat bootable image aka memstick

overview

FreeBSD OS upgrades are done in 3 phases:

  • install new kernel
  • install new userland
  • upgrade all packages

Around these 3 stages, we use zfs snapshot and a git snapshot of /etc to make rollback and diffing any releases easier. freebsd-version -ku has been used

@rbarraud
rbarraud / colortest.py
Created June 19, 2017 04:38 — forked from justinabrahms/colortest.py
Small utility to test terminal support for 256-color output.
#!/usr/bin/env python
# Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349
print "Color indexes should be drawn in bold text of the same color."
print
colored = [0] + [0x5f + 40 * n for n in range(0, 5)]
colored_palette = [
"%02x/%02x/%02x" % (r, g, b)
for r in colored
@rbarraud
rbarraud / howto-filemerge-git-osx.md
Created September 8, 2018 06:56 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@rbarraud
rbarraud / opendiff.txt
Created September 8, 2018 07:06 — forked from kristofferh/opendiff.txt
Open FileMerge from command line
Open FileMerge from command line
opendiff
If the command-line doesn't work, and you have no /Developer directory anymore, you probably need to:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
@rbarraud
rbarraud / x86-assembly-notes.md
Created September 27, 2022 11:46 — forked from mikesmullin/x86-assembly-notes.md
Notes on x86-64 Assembly and Machine Code

Mike's x86-64 Assembly (ASM) Notes

Assembling Binary Machine Code

Operating Modes:

These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.

Modern operating systems, booted inside Real mode,

@rbarraud
rbarraud / json-parser.scm
Created December 28, 2022 06:42 — forked from joeltg/json-parser.scm
MIT Scheme JSON parser
(load-option '*parser)
(define (json-vector-list v)
(vector (vector->list v)))
(define json-object-pair
(*parser
(transform
(lambda (v)
(vector (cons (string->symbol (vector-ref v 0)) (vector-ref v 1))))