Skip to content

Instantly share code, notes, and snippets.

View waveform80's full-sized avatar

Dave Jones waveform80

View GitHub Profile
@r41k0u
r41k0u / debug.md
Last active May 15, 2025 15:21
KGDB on Raspberry Pi 5 running Ubuntu using the Raspberry Pi Debug Probe

TODO: try with linux-image-*-dbgsym package as well, maybe we can cut on the compile time.

Step 1: Compile

  • Taken largely from this, though you can use your own kernel source. You can also do a cross-compilation, refer to the previous link for details on that
  • specify the KERNEL (kernel_2712 in my case). Do make menuconfig instead of the raspi preset defconfigs
  • Enable the KGDB options under Kernel Hacking. I don't remember exactly what flags you need, but the following in .config should set you up for something atleast
    • CONFIG_DEBUG_INFO=y
    • CONFIG_GDB_SCRIPTS=y
    • # CONFIG_DEBUG_INFO_REDUCED is not set
  • CONFIG_KALLSYMS can also be set
@waveform80
waveform80 / README.md
Created March 2, 2018 18:13
A quick hack to see if it's feasible to detect shadowed modules on import

Shadow.py

This is a rough'n'ready experiment to see if it's feasible to detect shadowed modules on import. A shadowed module is one where a user has inadvertently named a module the same as a module on the standard search path (a common example in education is "turtle.py" and my own unfortunately named "picamera.py" :).

If this module is imported, it tweaks the standard import machinery to check for such shadowing the first time a module is imported. If it finds any, it raises ShadowWarning (which descends from ImportWarning) giving the path of the imported module, and the path of the first module

@wastrachan
wastrachan / openvpn-in-lxd.txt
Last active March 21, 2023 13:07
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 / README.md
Last active August 3, 2020 21:39
Extract thumbnails from images captured by picamera.

Relies upon PIL to parse the initial JPEG structure and then does its own TIFF/Exif parsing because PIL's isn't up to dealing with the "full" Exif structure; looks like it gives up after IFD0.

Only tested with the V1 camera module, but I expect it'll work with either model. There's lots of stuff in here which isn't as efficient as it could be and a fair bit of cruft, but it's only a demo :)

@bradfitz
bradfitz / diskchecker.pl
Created July 24, 2012 21:05
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]