commit 71516ff7341bb71fe0483f71a12be7ec177fa306 (patch)
parent e7196b336669f18be390e5591c446471c5cb527b
Author: Alex Karle <alex@alexkarle.com>
Date: Fri, 5 Nov 2021 00:18:37 -0400
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?
Diffstat:
5 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/gopher/.gitignore b/gopher/.gitignore
@@ -0,0 +1,2 @@
+notes/*/
+!notes/all/
diff --git 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
@@ -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
@@ -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
@@ -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