Skip to content

Instantly share code, notes, and snippets.

View gist:2928c4ff4cc89545f3993bddd9d5edb2
This file has been truncated, but you can view the full file.
Failed to load bpf_testmod.ko into the kernel: -8
WARNING! Selftests relying on bpf_testmod.ko will be skipped.
libbpf: load bpf program failed: Permission denied
libbpf: -- BEGIN DUMP LOG ---
libbpf:
R1 type=ctx expected=fp
; int BPF_PROG(exec, struct linux_binprm *bprm) {
0: (79) r1 = *(u64 *)(r1 +0)
func 'bpf_lsm_bprm_committed_creds' arg0 has btf_id 1589 type STRUCT 'linux_binprm'
@bjackman
bjackman / opcodes.md
Last active Jun 1, 2021
A visualisation of eBPF opcodes
View opcodes.md

This table visualises the space of eBPF opcodes. It was generated by this hack

The *s represent opcodes that are exposed but not actually used, or used internally but not exposed

Note that there are gaps, but no empty columns.

There's also a prettier version here

|  0x00           |  0x01           |  0x02           |  0x03           |  0x04           |  0x05           |  0x06           |  0x07           |
@bjackman
bjackman / qemu_host_rootfs.sh
Created Sep 26, 2019
QEMU command to boot with host rootfs
View qemu_host_rootfs.sh
KERNEL_IMG=~/sources/linux/linux/arch/x86/boot/bzImage
kvm \
-kernel $KERNEL_IMG \
-smp $(nproc) \
-m 2G \
-nographic \
-fsdev local,security_model=none,id=fsdev-root,path=/,readonly \
-device virtio-9p-pci,id=fs-root,fsdev=fsdev-root,mount_tag=/dev/root \
-serial mon:stdio \
View self-enumerating-pangram.snt
// Copyright Chris Patuzzo 2016, Brendan Jackman 2019
// This is a modification of Chris Patuzzo's original Sentient example for
// finding self-enumerating pangrams - you can see the original here:
// https://sentient-lang.org/examples/self-enumerating-pangram
// I've added some comments and extended it
// a) to work on larger values (the original assumed that there would be no
// more than forty of any given letter), and
// b) to also find "near-miss" solutions - because for longer seed texts you
// usually find there are no solutions. This hack lets you write a seed
View keybase.md

Keybase proof

I hereby claim:

  • I am bjackman on github.
  • I am bjackman (https://keybase.io/bjackman) on keybase.
  • I have a public key whose fingerprint is 7155 7AF5 C862 3700 3DDD FD91 9F44 D1EE 6B2C BFB8

To claim this, I am signing this object:

View find-sched-commits.sh
#/bin/bash
set -eu
# In a kernel repo, this finds all the tip:sched commits Linus has merged,
# with a header for each of the merge commits that merged them.
# Got it?
# This helper takes a merge commit, then finds the point at which the merged
# branches diverged, and gives you all the commits between that point and the
# second parent of the merge commit. What? OK..
View wa_compare_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View curry_recipe.md

Brendan's curry recipe

Chop an onion, a red pepper and half a butternut squash (can replace with sweet potato if needed).

Chop & fry an onion until it's nice and soft, then add chopped & crushed garlic (you cannot really have too much garlic here) and fry a little while longer just until you can smell the garlic has infused into the oil a bit. If you're using fresh chilli, put it in now (chopped).

View wa_compare_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gfxinf_wat.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.