Skip to content

Instantly share code, notes, and snippets.


Eliot Blennerhassett eliotb

  • Christchurch, New Zealand
View GitHub Profile
import logging
import string
def is_yes(prompt="", default=True):
"""Ask user to enter Y or N in response to a prompt.
returns True if answer is Y, Falseif N or default if answer is empty"""
if default:
prompt += " [Y/n]"
eliotb / ba.c
Created Sep 3, 2015
Experiment with ctypes interface to string read/write from python string, bytearray, list or tuple
View ba.c
// Build library with : gcc -o -fPIC -shared ba.c
#include <string.h>
#include <stdio.h>
static unsigned char buf[100];
static size_t blen = 0;
int write(const char *pc, size_t len)
if (len > 100)
#!/usr/bin/env python
General CAN functions using Kvaser canlib
from __future__ import print_function
import logging
from sys import exit
# kvaser canlib
"""KeyedList : A list that can also be accessed using a (string) key like a dict
A mutable alternative to namedtuple, yet a lot simpler than the full featured 'namedlist' class
Intended for use like a C struct with writeable fields
class KeyedList(list):
"""A list that can also be accessed using a (string) key like a dict.
eliotb / wscript_dox.patch
Created Dec 11, 2012
patch for jack2 wscript doxygen
View wscript_dox.patch
--- /home/eliot/src/jack/jack-
+++ /home/eliot/src/jack/wscript
@@ -115,7 +115,7 @@
#if conf.env['IS_SUN']:
# conf.check_tool('compiler_cxx')
# conf.check_tool('compiler_cc')
conf.env.append_unique('CXXFLAGS', '-Wall')
conf.env.append_unique('CFLAGS', '-Wall')
eliotb / dissector_cobranet.lua
Created Nov 9, 2011
Wireshark CobraNet dissector as lua plugin
View dissector_cobranet.lua
-- Wireshark dissector for CobraNet protocol (ethertype == 0x8819)
-- Note that this is incomplete. Shows PDU type and version, plus
-- some known fields from Reservation PDU
-- Eliot Blennerhassett <>
-- Create a new dissector
COBRANET = Proto ("cobranet", "CobraNet")
local cobranet_ethertype = 0x8819
eliotb /
Last active May 1, 2022
Tools for working with Texas Instruments COFF and AIS files
#!/usr/bin/env python
'''Read fully linked TI COFF file, and generate AIS format file
Commandline parameters
enable sequential read,
pll and emifb configuration
pinmux configuration
enable checksums
'Eliot Blennerhassett' <>