From 71516ff7341bb71fe0483f71a12be7ec177fa306 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Fri, 5 Nov 2021 00:18:37 -0400 Subject: [PATCH] gopher: Add concept of tag-sorted notes I've been musing about this for a while -- a simple plaintext "second brain". Nothing fancy, but categorized notes that are easily version controlled, edited, and servable for others to see. So here's the combo of my favorite tech: * version control -- git, of course * edited -- $EDITOR * servable -- why not try gopher? --- gopher/.gitignore | 2 ++ gopher/Makefile | 12 ++++++++++-- gopher/bin/notetag | 18 ++++++++++++++++++ gopher/gophermap | 2 +- gopher/notes/all/openbsd-on-linode.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 gopher/.gitignore create mode 100755 gopher/bin/notetag create mode 100644 gopher/notes/all/openbsd-on-linode.txt diff --git a/gopher/.gitignore b/gopher/.gitignore new file mode 100644 index 0000000..6c7b43f --- /dev/null +++ b/gopher/.gitignore @@ -0,0 +1,2 @@ +notes/*/ +!notes/all/ diff --git a/gopher/Makefile b/gopher/Makefile index b0c6313..b7badde 100644 --- a/gopher/Makefile +++ b/gopher/Makefile @@ -3,7 +3,15 @@ FILES = about.txt \ gophermap \ phlog.txt +.PHONY: build +build: + cd notes && ../bin/notetag + .PHONY: install -install: - mkdir -p /var/gopher/phlog +install: build + mkdir -p /var/gopher/notes install -m 444 $(FILES) /var/gopher + for tag in notes/*; do \ + mkdir -p /var/gopher/$$tag; \ + install -m 444 $$tag/* /var/gopher/$$tag; \ + done diff --git a/gopher/bin/notetag b/gopher/bin/notetag new file mode 100755 index 0000000..1090f29 --- /dev/null +++ b/gopher/bin/notetag @@ -0,0 +1,18 @@ +#!/bin/sh +# notetag -- small program to sort notes into tagged dirs +set -e +die() { + echo "$*" 1>&2 + exit 1 +} + +[ -d all ] || die "ERROR: unable to find the 'all' notes directory; check cwd" + +for f in all/*; do + tags=$(grep '^tags:' "$f" | sed 's/tags: //') + tags=${tags:-misc} + for t in $tags; do + mkdir -p "$t" + (cd "$t" && ln -sf "../$f") + done +done diff --git a/gopher/gophermap b/gopher/gophermap index 9cb01c7..7beef70 100644 --- a/gopher/gophermap +++ b/gopher/gophermap @@ -11,7 +11,7 @@ 1 |.| blog (http mirror) /blog 1 | | jam setlists /jam-tuesday 0 |.| phlog (gopher exclusive!) /phlog.txt - | | +1 | | tech notes /notes |.| . |-| |` . | | __ o' . diff --git a/gopher/notes/all/openbsd-on-linode.txt b/gopher/notes/all/openbsd-on-linode.txt new file mode 100644 index 0000000..7dc744a --- /dev/null +++ b/gopher/notes/all/openbsd-on-linode.txt @@ -0,0 +1,42 @@ +OpenBSD on Linode +================= +Tues Sept 21, 2021 + +tags: openbsd + +I'm a huge fan of OpenBSD. The simplicity of the system, the cohesive +feel it has, the proactive stance on security... The only problem? +My preferred cloud provider (Linode) doesn't support it! + +Fortunately there's a comprehensive post on the Linode forum of how to +do it [1]. + +I wanted to document it here in case said post ever goes away. + +1. Create a New Linode (any OS will do) +2. Once booted, shut it down +3. Under the "Storage" tab delete the ext4 partitions +4. Create two new disks, both "Raw" format: + - One labeled "install", 1GB (could do less) + - One labeled "os", the rest of the space +5. Boot in "Rescue" mode +6. In the serial console, wget the minirootXX.img + - Check the sha256 against the SHA256 file + - Check the signature using signify (on a different machine that + has signify) +7. Find the install disk with `lsblk` +8. Flash the img using: `dd if=minirootXX.img of=/dev/sdX bs=1M` +9. In the Configurations tab, create a new one: + - Full Virtualization + - Select a Kernel > Direct Disk + - /dev/sda - os + - /dev/sdb - install + - boot from sdb +10. Reboot into configuration, install OpenBSD from serial console +11. Halt/shutdown, and change configuration to boot from sda +12. Rejoice! + +NOTE: if you skip the "Direct Disk" kernel step, it boots a Linux +kernel and tries to load the img... it panics every time! + +[1]: https://www.linode.com/community/questions/10329/openbsd-on-linode -- libgit2 1.1.1