Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / oci-launch-zfs-amd64.fish
Last active July 22, 2025 13:11
oci-launch-zfs-amd64
# Defined in /home/dch/.config/fish/functions/oci-launch-zfs-amd64.fish @ line 1
function oci-launch-zfs-amd64
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 \
# 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"
@dch
dch / Makefile
Created March 14, 2025 16:36
surfer
PORTNAME= surfer
DISTVERSIONPREFIX= v
DISTVERSION= 0.3.0
CATEGORIES= cad
MAINTAINER= [email protected]
COMMENT= Extensible and snappy waveform viewer
WWW= https://surfer-project.org
LICENSE= EUPL12
@dch
dch / mix.exs
Created February 15, 2025 14:16
defmodule Indie.MixProject do
use Mix.Project
def project do
[version, description] = version()
[
app: :indie,
version: version,
id: description,