Skip to content

Instantly share code, notes, and snippets.

View waveform80's full-sized avatar

Dave Jones waveform80

View GitHub Profile
@waveform80
waveform80 / README.md
Last active September 17, 2020 12:11 — forked from cleverca22/uptime.c
rpi firmware load time

From the original comment:

@Yoshqu there is a much simpler way to measure boot time to the usec, without having to use that custom bootloader

basically, ST_CLO begins counting at 1mhz, the instant the SoC comes out of reset and /proc/uptime begins counting seconds when linux starts up its internal clocks

the code in the gist, will then print both of them at once, and if you find the difference, youll see how long it took for linux to gain control of the core

@waveform80
waveform80 / openvpn-in-lxd.txt
Created November 14, 2019 11:54 — forked from wastrachan/openvpn-in-lxd.txt
OpenVPN in LXD Container
# On the host
=============
lxc config set openvpn raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'
lxc config device add openvpn tun unix-char path=/dev/net/tun
# In the container
==================
1. mknod /dev/net/tun c 10 200
@waveform80
waveform80 / 1.md
Last active December 7, 2016 15:18 — forked from bennuttall/gpiozero.md
Multi-paradigm programming with GPIO Zero

Multi-paradigm programming with GPIO Zero

Like Python itself, GPIO Zero is an API with multiple programming paradigms. Users can begin with a simple approach, and have the opportunity to expand into using more advanced techniques to achieve more.

def process_iis_directory(d):
print('Processing IIS directory %s' % d)
for entry in os.listdir(d):
entry = os.path.join(d, entry)
if entry.endswith('.gz'):
print('Processing %s into CSV' % entry)
with gzip.open(entry, 'rb') as uncompressed, \
io.BufferedReader(uncompressed) as buffered, \
io.TextIOWrapper(buffered, encoding='latin1') as infile, \
io.open(os.path.splitext(entry)[0] + '.csv', 'wb') as outfile, \