Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile

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

This file has been truncated, but you can view the full file.
@dch
dch / _aarch64_getting_started.md
Last active June 23, 2020 08:45
see the depenguinator script

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
@dch
dch / nif.c
Created December 13, 2019 11:29
#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 17:37
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
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
- ..
@dch
dch / app.sh
Last active March 14, 2019 21:13
#!/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}
# 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
@dch
dch / dmesg.log
Last active July 24, 2019 14:02
This nvme drive does (in real-world terms) ~ 1400GiB/hr streaming reads from a zpool under FreeBSD 12.0p2 amd64 after a couple of years of sustained abuse.
---<<BOOT>>---
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-RELEASE-p2 GENERIC amd64
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
VT(efifb): resolution 1280x1024
module_register: cannot register mmc/mmcsd from kernel; already loaded from mmcsd.ko
Module mmc/mmcsd failed to register: 17
@dch
dch / main.yml
Created December 12, 2018 19:13
ansible zerotier role
---
- name: zerotier | install pkg
pkgng:
state: latest
name:
- net/zerotier
notify: zerotier | restart
tags:
- pkg
- zerotier
@dch
dch / pizza.md
Last active July 18, 2019 13:58
pizza variations

pizza variations

I got some "fancy" 00 pizza flour, and some std semolina pasta flour too. Let's do some experiments on getting the crusty feeling.

  • 4c flour (600g)
  • 375mL warm water
  • 1 cube live yeast
  • 2 tsp salt
  • 2 slops olive oil