Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / arm64_zig_0.8.0.log
Last active June 11, 2021 19:20
poudriere says no
=>> Building lang/zig
build started at Fri Jun 11 19:14:25 UTC 2021
port directory: /usr/ports/lang/zig
package name: zig-0.8.0
building for: FreeBSD pkg.skunkwerks.at 13.0-RELEASE FreeBSD 13.0-RELEASE arm64
maintained by: dch@FreeBSD.org
Makefile datestamp: -rw-r--r-- 1 dch wheel 893 Jun 11 17:36 /usr/local/poudriere/data/.m/13_0_a64-default/01//usr/ports/lang/zig/Makefile
Poudriere version: 3.3.99.20210521
Host OSVERSION: 1400018
Jail OSVERSION: 1300139
commit 1c63e38a8878d24a011f37f4d1f13865f5bb5aa6
Author: Dave Cottlehuber <dch@FreeBSD.org>
Date: Fri Jun 11 08:10:42 2021 +0000
ftp/curl: build with contentious patch from PR#7039
diff --git ftp/curl/Makefile ftp/curl/Makefile
index 0e979ef5a475..89cba3031c7c 100644
--- ftp/curl/Makefile
+++ ftp/curl/Makefile
@dch
dch / sha.erl
Created May 18, 2014 23:33
erlang quick conversion of binary sha hash to printable hex/ascii
(akai@akai)27> Hex=fun(<<Hash:20/big-unsigned-integer-unit:8>>) ->
lists:flatten(io_lib:format("~40.16.0b", [Hash])) end.
#Fun<erl_eval.6.106461118>
(akai@akai)28> Hex(<<200,152,0,191,200,46,208,30,214,227,191,213,64,140,81,39,68,145,247,212>>).
"c89800bfc82ed01ed6e3bfd5408c51274491f7d4"
(akai@akai)29>
@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
# 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 June 12, 2020 10:23
Stopped at linux_root_RB_INSERT_COLOR+0x40: ldr x11, [x8]
# 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
@dch
dch / 20160101_freebsd_build_upgrade_via_source.md
Last active May 18, 2020 09:12
freebsd upgrade using git or svn source & making a low-fat bootable image aka memstick

overview

FreeBSD OS upgrades are done in 3 phases:

  • install new kernel
  • install new userland
  • upgrade all packages

Around these 3 stages, we use zfs snapshot and a git snapshot of /etc to make rollback and diffing any releases easier. freebsd-version -ku has been used

This file has been truncated, but you can view the full file.
@dch
dch / atkin.erl
Created November 27, 2013 14:27 — forked from nox/atkin.erl
-module(atkin).
-export([primes_smaller_than/1]).
primes_smaller_than(Limit) ->
primes_smaller_than(Limit, sieve(Limit), []).
primes_smaller_than(0, _, Acc) ->
Acc;
primes_smaller_than(N, Bin, Acc) ->