Skip to content

Instantly share code, notes, and snippets.

Dave Cottlehuber dch

Block or report user

Report or block dch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View failures.tar.xz
This file has been truncated, but you can view the full file.
@dch
dch / _aarch64_getting_started.md
Last active Jan 22, 2020
see the depenguinator script
View _aarch64_getting_started.md

depenguinator - a fishy hack https://git.io/JeQDW

  • 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
  • https://git.io/JeQM5

usage

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
@dch
dch / dmesg.log
Last active Jul 24, 2019
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.
View dmesg.log
---<<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 Dec 12, 2018
ansible zerotier role
View main.yml
---
- name: zerotier | install pkg
pkgng:
state: latest
name:
- net/zerotier
notify: zerotier | restart
tags:
- pkg
- zerotier
@dch
dch / pizza.md
Last active Jul 18, 2019
pizza variations
View pizza.md

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
@dch
dch / minimal.yml
Last active Sep 25, 2018
minimal single-file ansible playbook for FreeBSD
View minimal.yml
---
# a minimal FreeBSD oriented ansible playbook
# you can run this as follows:
# ansible-playbook quick.yml -i localhost, -v
# note the trailing , necessary to skip needing an inventory file
- hosts: localhost
connection: local
become: yes
vars:
ansible_python_interpreter: /usr/local/bin/python2.7
You can’t perform that action at this time.