Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / koans_init_couch.ex
Created October 28, 2025 10:40
mix tasks to init couchdb and rabbitmq
defmodule Mix.Tasks.Koans.Init.Couch do
use Mix.Task
import ICouch
alias ICouch.Document, as: Doc
@shortdoc "Initialise CouchDB for koan-ci"
def run(_) do
# at this point in time, no apps are started and we do not have
# access to parameters stashed in ./config/*.ex
Application.ensure_all_started(:icouch)
chflags: /usr/obj/usr/src/arm64.aarch64/release: No such file or directory
chown: /usr/obj/usr/src/arm64.aarch64/release: No such file or directory
HEAD is now at 8d2dcf925d33 vmimage.subr: Add missing directories to METALOG
make[1]: /usr/src/Makefile.inc1:362: SYSTEM_COMPILER: Determined that CC=/usr/local/bin/ccache cc matches the source tree. Not bootstrapping a cross-compiler.
make[1]: /usr/src/Makefile.inc1:367: SYSTEM_LINKER: Determined that LD=ld matches the source tree. Not bootstrapping a cross-linker.
--------------------------------------------------------------
>>> World build started on Fri Oct 17 17:48:54 UTC 2025
--------------------------------------------------------------
--------------------------------------------------------------
@dch
dch / oci-launch-zfs-arm64.fish
Last active August 19, 2025 22:07
oci-launch-zfs-arm64
function oci-launch-zfs-arm64
set -l USERDATA (mktemp -t oci)
echo '#!/bin/sh -eux
set -o pipefail
touch /var/run/cloud_script_was_here
sed -i"" -E -e "s/.*ssh-/ssh-/" /root/.ssh/authorized_keys
# https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm
curl --fail -H Authorization:\ Bearer\ Oracle -s \
http://169.254.169.254/opc/v2/instance \
| jq . > /var/run/oci.json
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-settings: version 460.73.01
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Option "Xinerama" "0"
EndSection
@dch
dch / zonekeys.fish
Last active June 23, 2025 16:06
DNSSEC RR tools - use zonekeys <zone> to create the KSK that is published into the parent zone as DS RR
function zonekeys
set -l type rsa
set -l algo 8
set -l zone $argv[1]
test -d $zone || mkdir $zone
cd $zone
# generate keys if missing
test -s $zone-old.pem || ln -s canonical/51186.rsa1024.pem $zone-old.pem
test -s $zone-ksk.pem || brssl skey -gen $type:1024 -rawpem $zone-ksk.pem
test -s $zone-zsk.pem || brssl skey -gen $type:2048 -rawpem $zone-zsk.pem
@dch
dch / amdbuild.sh
Created June 20, 2025 19:18
building 14.3-RELEASE packages on 14.3-RELEASE
#!/bin/sh -eu
export __MAKE_CONF=/dev/null
umask 0022
cd /usr/src
NOW=$(date -u +%Y%m%d-%H%M)
NCPU=8
COMMIT=g$(git rev-parse --verify --short=7 HEAD)
RELEASE=/usr/obj/usr/src/amd64.amd64/release
-- vim: set filetype=lua :
--- bootstrap plugin manager
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
-- vim: set filetype=lua :
--- bootstrap plugin manager
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
#!/bin/sh
#
# $FreeBSD: tools/git-release/builds-15.conf 2804 2025-04-21 17:34:35Z cperciva $
#
# usage
# zfs destroy -vrf zroot/releng
# zfs create -o sync=disabled -o mountpoint=/releng zroot/releng
# zfs create -o mountpoint=/releng zroot/releng
# ./thermite.sh -b -d -c dch.conf
@dch
dch / rc.d
Created April 23, 2025 14:12
#!/bin/sh
#
# PROVIDE: APP
# REQUIRE: networking epmd
# AFTER: epmd
# KEYWORD:
. /etc/rc.subr
name="APP"