Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Cottlehuber dch

View GitHub Profile
View sd.log
# debug verbose
[57332] pci0: driver added
[57332] found-> vendor=0x8086, dev=0x1903, revid=0x03
[57332] domain=0, bus=0, slot=4, func=0
[57332] class=11-80-00, hdrtype=0x00, mfdev=0
[57332] cmdreg=0x0002, statreg=0x0090, cachelnsz=0 (dwords)
[57332] lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
[57332] intpin=a, irq=255
[57332] powerspec 3 supports D0 D3 current D0
@dch
dch / _panic.txt
Last active Jun 12, 2020
Stopped at linux_root_RB_INSERT_COLOR+0x40: ldr x11, [x8]
View _panic.txt
# Pastebin xYWQzmfp
DRAM Initialization: [100%] [ ==================== ]]]] [ =========> ]]]]]]]
Checkpoint 2F
Checkpoint 2E
Checkpoint 31
Checkpoint 32
SMpro FW version: 1.07
PMpro FW version: 1.07
FW date: 20190523
Reading loader env vars from /efi/freebsd/loader.env
View jz.fish
function jz
# find the zpool
set -x ZPOOL (zfs list -Ho name /jails | cut -f 1 -d /)
# grab the name
set -x JAIL $argv[1]
# create mountpoint if missing
zfs list -Ho name $ZPOOL/jails > /dev/null 2>&1 \
|| sudo zfs create -o mountpoint=/jails -p $ZPOOL/jails
# clone a template if missing
test -d /jails/$JAIL \
View freebsd_sysctl.md

Settable via /etc/sysctl.conf:

integer kern.maxvnodes

Target for maximum number of vnodes

integer kern.maxfiles

Maximum number of files

integer kern.securelevel

Current secure level

View failures.tar.xz
This file has been truncated, but you can view the full file.
@dch
dch / _aarch64_getting_started.md
Last active Jun 23, 2020
see the depenguinator script
View _aarch64_getting_started.md

de-penguinator - a fishy hack https://git.io/JeQDW to de-linux your systems

packet's big aarch64 servers don't have a FreeBSD ZFS image available, but we can fix that. We have the EFI partition, a 4GiB swap partition, and with Ubuntu 18.04, comes zfs. Anything is possible.

  • use packet.net to create an Ubuntu 18.04 install of either Ampere hr330a or cavium thunderX2
  • adapt depenguinator.sh as needed, it duplicates the current host's network settings
  • enjoy FreeBSD zfs sweetness after a short reboot
View nif.c
#include <stdint.h>
#include <erl_nif.h>
/* a basic nif that get a binary and returns a binary, with some error wrapping */
static
ERL_NIF_TERM get_bin_addr(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
{
if (!enif_is_binary(env, argv[0])) {
ERL_NIF_TERM error = enif_make_atom(env, "error");
@dch
dch / d10335-cbsd-9p-13.0.diff
Last active May 22, 2019
diff of D10335 patch vs CBSD-provided 13.0 diff, both rebased against latest current https://reviews.freebsd.org/D10335 & https://github.com/cbsd/cbsd/tree/develop/upgrade/patch/p9-13.0
View d10335-cbsd-9p-13.0.diff
diff --git etc/mtree/BSD.include.dist etc/mtree/BSD.include.dist
index 385e096b7e9..88b60c8794c 100644
--- etc/mtree/BSD.include.dist
+++ etc/mtree/BSD.include.dist
@@ -259,10 +259,10 @@
..
lib80211
..
- lib9p
- ..
View app.sh
#!/bin/sh -e
# obvious
export APP=$(basename -s .sh $0)
# derived paths are OS dependent
export ERTS=$(find /usr/local/lib/erlang* -type d -depth 1 -name erts-\* | tail -1)
export VERSION=$(cut -swf 2 /usr/local/lib/${APP}/releases/start_erl.data)
# config files
CONFIGS=/usr/local/etc/${APP}
View haproxy.conf.j2
# refer to http://cbonte.github.io/haproxy-dconv/1.7/configuration.html
# and http://cbonte.github.io/haproxy-dconv/1.7/management.html
global
daemon
pidfile /var/run/haproxy.pid
log 127.0.0.1 format rfc5424 local0
# drop privileges
chroot /var/empty
group www
You can’t perform that action at this time.