Skip to content

Instantly share code, notes, and snippets.

Andrew Bradford bradfa

Block or report user

Report or block bradfa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View move more to

In the longer term, I could see us having the possibility of leveraging Github more. Currently the web page has a perception of lacking in functionality, for instance it's very hard to tell someone how to go from the front page of trac to reading the current development version of the books online. Migrating everything from trac onto Github is an option in order to reduce maintenance burden of the trac instance. Additionally, instead of relying on the existing git hooks and existing book building infrastructure, we could host the built books on Github pages and use something like Travis to do the building of that. Github pages can also be setup for the cross-lfs group on Github to take the place of what the trac instance has been used for in the past, mainly as a presence on the web and directing visitors on how to read/contribute to the books. The only aspect which I don't feel Github could serve all of the project's needs is with mailing lists.

I don't want to push for moving ev

bradfa /
Last active Apr 23, 2019
Setting up YubiKeys Notes

Setting up YubiKeys Notes


To setup a YubiKey 4 and YubiKey 5 NFC to both authenticate myself for the following services:

  1. U2F for Google Advanced Protection, GitHub, etc.
  2. OpenPGP smart card (using same private key on both devices) for signing, encrypting, and auth (including SSH)
  3. Yubico OTP (for some legacy services, etc)
View AMD ring 0

Errors cause graphics output to lock up but mouse still moves, keyboard is dead, libvirt guests are OK, SSH access is OK. Can't shutdown cleanly over SSH, keyboard input doesn't work. Requires hard power-off via power button hold.

syslog looks like:

Dec 19 08:10:48 kaim-eeyore kernel: [88492.249393] radeon 0000:03:00.0: ring 0 stalled for more than 10248msec
Dec 19 08:10:48 kaim-eeyore kernel: [88492.249395] radeon 0000:03:00.0: ring 3 stalled for more than 10248msec
Dec 19 08:10:48 kaim-eeyore kernel: [88492.249398] radeon 0000:03:00.0: GPU lockup (current fence id 0x000000000007de00 last fence id 0x000000000007df67 on ring 3)
Dec 19 08:10:48 kaim-eeyore kernel: [88492.249402] radeon 0000:03:00.0: GPU lockup (current fence id 0x0000000000035dda last fence id 0x0000000000035e12 on ring 0)
bradfa /
Last active Nov 21, 2018
Network slowdown/latency simulation

Lots of good info with examples:

Can induce a reduction in throughput for a network interface like:

sudo tc qdisc add dev br0 root tbf rate 5mbit burst 8096 latency 100ms

Set the "rate" to your desired outbound throughput for the interface. The "burst" and "latency" numbers coordinate some underlying configurations which aren't critical to really understand so long as they're big enough.

bradfa /
Last active Jul 12, 2019
mips64el Debian QEMU install

Installing Debian Stretch mips64el Using QEMU

We're going to emulate the mips64el "malta" machine and install Debian Stretch using QEMU on a amd64 Debian Buster host.

Likely you need your user to be in the "libvirt" group and have installed these packages (or a subset of such):

sudo apt install qemu-system-mips virt-manager libguestfs-tools
View .restic.excludes
# Exclude poky default build dir
# Exclude our sstate, downloads, and build output dirs
# Exclude virt-manager and downloads dirs
bradfa /
Last active Aug 15, 2018
virt-manager notes

"Hardware" Notes

  • Need OVMF UEFI firmware for 64 bit machines installed. Be sure guest is using UEFI firmware! You can't change this after you create a machine in virt-manager!
  • Be sure using i440FX chipset.
  • Enable a qemu-ga channel for guest. Make a VirtIO serial controller.
  • Make sure your hard disk is using VirtIO, not IDE.
  • Be sure you have the VirtIO floppy image for Windows 7 install, you'll need to load drivers so installer can see the VirtIO disk.
  • Bridging to main Ethernet interface works fine, depsite the warnings. Use the VirtIO ethernet type.
  • The VirtIO 0.1.141 drivers work well for me in Win 7 Pro 64 bit.
  • To avoid the NVIDIA "Code 43" error, see the Arch Linux wiki about modifying the hypervisor name. Or somehow find older NVIDIA drivers prior to version 337 that work with your card.
  • Remove the "sound" device, sound pass through sucks. Just pass through a USB sound card/device but this isn't needed at install time.
bradfa / vimium.conf
Created May 31, 2018
Vimium configuration
View vimium.conf
# Insert your preferred key mappings here.
map d removeTab
custom search engines:
amazon: Amazon
debian: Debian
google: Google
wikipedia: Wikipedia
bradfa /
Last active May 17, 2018
curl-for-win improvements needed

The list of debian/ubuntu prereq packages is incomplete, you at least need to add:

  • python3-pip
  • curl
  • time
  • cmake
  • g++-mingw-w64

You also need both i386 and amd64 arches setup in dpkg so the proper packages for both arches are pulled in by apt, such as for wine and mingw.

bradfa / TI's toolchain build script
Last active Sep 27, 2018
Attempt at modernizing Debian's MSP430 toolchain
View TI's toolchain build script
This is from TI's MSP430 "GCC Sources" source distribution:
# This directory contains the sources for gcc, newlib, binutils, and gdb used
# to build the "msp430-gcc" binary toolchain packages distributed by TI.
# The following example script demonstrates how these sources can be used to
# build a toolchain from these sources. It has been developed on a CentOS 7
# machine, and may need to be adapted for use on other platforms, such as
# Microsoft Windows.
You can’t perform that action at this time.