Skip to content

Instantly share code, notes, and snippets.

View patmaddox's full-sized avatar
🤔
Trying to figure out how to look up comments I've left

Pat Maddox patmaddox

🤔
Trying to figure out how to look up comments I've left
View GitHub Profile
@patmaddox
patmaddox / 1_src_changes.txt
Last active April 13, 2024 19:11
make buildworld buildkernel - src changes
freebsd-src.git/b/main $ git status
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
tests/sys/fs/fusefs/.depend.access
tests/sys/fs/fusefs/.depend.allow_other
@patmaddox
patmaddox / jail.conf
Created November 1, 2023 17:56
freebsd jail config with host configuring things in guest (iface name, resolv.conf, etc)
path = "/jails/${name}";
vnet;
$iface = "$name";
vnet.interface = "${iface}b";
host.hostname = "$name";
exec.clean;
exec.start = "sh /etc/rc";
exec.stop = "sh /etc/rc.shutdown jail";
exec.release = "ifconfig ${iface}a destroy";
enforce_statfs = 1;
@patmaddox
patmaddox / repeat.exs
Created April 14, 2023 03:19
elixir peg all CPUs (or not?)
IO.puts("Schedulers: #{System.schedulers_online()}")
Stream.repeatedly(fn -> 1 end)
|> Stream.with_index(1)
|> Task.async_stream(fn {val, index} ->
# if index % 1000 == 0 do
Process.sleep(:rand.uniform(10))
IO.puts(index)
# end
end, max_concurrency: 20)
@patmaddox
patmaddox / 5_10-graphics-cards.md
Last active March 23, 2023 04:48
linux graphics cards

Check out https://github.com/torvalds/linux at v5.10

amdgpu

  1. cd drivers/gpu/drm/amd/amdgpu
  2. grep -R MODULE_FIRMWARE | sed -e 's/.*(//' -e 's/);//' -e 's/"//g' | grep FIRMWARE | sort -u | tr '[:upper:]' '[:lower:]' | sed -e 's/firmware_//'

(note: a couple are left out from that list. full list of blobs can be produced with grep -R MODULE_FIRMWARE | sed -e 's/.*(//' -e 's/);//' -e 's/"//g' | sort -u | tr '[:upper:]' '[:lower:]' | sed -e 's/firmware_//' -e 's|amdgpu/||' | sort -u)

@patmaddox
patmaddox / 1_messages_kabylake
Created December 6, 2022 08:00
i915kms freebsd
# with gpu-firmware-intel-kmod-kabylake installed
Dec 5 23:55:13 beastie14 kernel: iic0: <I2C generic I/O> on iicbus0
Dec 5 23:55:13 beastie14 kernel: iic1: <I2C generic I/O> on iicbus1
Dec 5 23:55:13 beastie14 kernel: drmn0: <drmn> on vgapci0
Dec 5 23:55:13 beastie14 kernel: vgapci0: child drmn0 requested pci_enable_io
Dec 5 23:55:13 beastie14 syslogd: last message repeated 1 times
Dec 5 23:55:13 beastie14 kernel: drmn drmn0: drm_WARN_ON(!IS_PLATFORM(dev_priv, INTEL_TIGERLAKE) && !IS_PLATFORM(dev_priv, INTEL_ROCKETLAKE))
Dec 5 23:55:13 beastie14 kernel:
Dec 5 23:55:13 beastie14 kernel: [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
@patmaddox
patmaddox / messages
Created December 6, 2022 06:16
i915kms fails to load on freebsd 14
Dec 5 22:14:30 beastie14 kernel: iic0: <I2C generic I/O> on iicbus0
Dec 5 22:14:30 beastie14 kernel: iic1: <I2C generic I/O> on iicbus1
Dec 5 22:14:30 beastie14 kernel: drmn0: <drmn> on vgapci0
Dec 5 22:14:30 beastie14 kernel: vgapci0: child drmn0 requested pci_enable_io
Dec 5 22:14:30 beastie14 syslogd: last message repeated 1 times
Dec 5 22:14:30 beastie14 kernel: drmn drmn0: drm_WARN_ON(!IS_PLATFORM(dev_priv, INTEL_TIGERLAKE) && !IS_PLATFORM(dev_priv, INTEL_ROCKETLAKE))
Dec 5 22:14:30 beastie14 kernel:
Dec 5 22:14:30 beastie14 kernel: [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
Dec 5 22:14:30 beastie14 kernel: [drm] Got stolen memory base 0x0, size 0x0
Dec 5 22:14:30 beastie14 kernel: drmn0: could not load firmware image 'i915/kbl_dmc_ver1_04.bin'
@patmaddox
patmaddox / port_wrapper.sh
Created December 1, 2022 01:08
elixir port wrapper
# Start the program in the background
exec "$@" &
pid1=$!
# Silence warnings from here on
exec >/dev/null 2>&1
# Read from stdin in the background and
# kill running program when stdin closes
exec 0<&0 $(
@patmaddox
patmaddox / snap_and_sync.sh
Created November 28, 2022 19:23
sanoid syncoid script
#!/bin/sh
set -e
sudo sanoid --cron --quiet
sudo syncoid --quiet -r --no-privilege-elevation --no-sync-snap --sendoptions="w" --recvoptions="u" --sshkey=/usr/home/patmaddox/.ssh/nas-rsyncnet zdata/crypt/istudo [email protected]:zsync/snaps/istudo
@patmaddox
patmaddox / .cirrus.yml
Last active October 31, 2022 19:49
Cirrus CI build/test/deploy config for Elixir on FreeBSD using ex_freebsd
gcp_credentials: ENCRYPTED[!...!]
# custom-built instance with some packages pre-installed to save time
# otherwise use:
# freebsd_instance:
# image_family: freebsd-13-0
# and install your packages
gce_instance:
image_project: ratio-ops
image_family: ratio-freebsd-13-1-ci
@patmaddox
patmaddox / make_freebsd.sh
Last active July 27, 2023 08:05
script to build FreeBSD disk for cloud
#!/bin/sh
set -e
# Adapted from https://www.daemonology.net/blog/2019-02-16-FreeBSD-ZFS-AMIs-now-available.html
if [ ! $# -eq 2 ]; then
echo "Usage: configure.sh <cloud> <disk>"
echo " cloud: aws|gcp"
echo " disk: e.g. da1, nda1"
exit 1