commit 0b23b0528d0852db95ce52b37558589933922029 (patch)
parent 71516ff7341bb71fe0483f71a12be7ec177fa306
Author: Alex Karle <alex@alexkarle.com>
Date: Fri, 5 Nov 2021 00:46:01 -0400
gopher: Add gophermap with counts, second note
The second note isn't very contentful, but it's cool to see the tagging
system at work AND play with my first ever generated gophermap (to show
the counts of each tag!)
Diffstat:
5 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/gopher/.gitignore b/gopher/.gitignore
@@ -1,2 +1,3 @@
notes/*/
+notes/gophermap
!notes/all/
diff --git a/gopher/Makefile b/gopher/Makefile
@@ -5,13 +5,14 @@ FILES = about.txt \
.PHONY: build
build:
- cd notes && ../bin/notetag
+ cd notes && ../bin/notetag > gophermap
.PHONY: install
install: build
mkdir -p /var/gopher/notes
install -m 444 $(FILES) /var/gopher
- for tag in notes/*; do \
+ for tag in notes/*/; do \
mkdir -p /var/gopher/$$tag; \
install -m 444 $$tag/* /var/gopher/$$tag; \
done
+ install -m 444 notes/gophermap /var/gopher/notes
diff --git a/gopher/bin/notetag b/gopher/bin/notetag
@@ -11,8 +11,41 @@ die() {
for f in all/*; do
tags=$(grep '^tags:' "$f" | sed 's/tags: //')
tags=${tags:-misc}
- for t in $tags; do
+ for t in $tags; do
mkdir -p "$t"
(cd "$t" && ln -sf "../$f")
done
done
+
+cat <<'EOM'
+my technical
+ __
+ /\ \__
+ ___ ___\ \ ,_\ __ ____
+/' _ `\ / __`\ \ \/ /'__`\ /',__\
+/\ \/\ \/\ \L\ \ \ \_/\ __//\__, `\
+\ \_\ \_\ \____/\ \__\ \____\/\____/
+ \/_/\/_/\/___/ \/__/\/____/\/___/
+
+No warranty / use at your own risk!
+
+
+
+EOM
+
+for tag in */; do
+ count="$(ls "$tag" | wc -l | sed 's/^[[:space:]]*//')"
+ if [ "$count" = "1" ]; then
+ printf "1 %-24s %4s note)\t%s\n" "$tag" "($count" "$tag"
+ else
+ printf "1 %-24s %4s notes)\t%s\n" "$tag" "($count" "$tag"
+ fi
+done
+
+cat <<EOM
+
+
+1 <-- Back /
+
+Last Updated: $(date)
+EOM
diff --git a/gopher/gophermap b/gopher/gophermap
@@ -10,8 +10,8 @@
0 | | about me /about.txt
1 |.| blog (http mirror) /blog
1 | | jam setlists /jam-tuesday
-0 |.| phlog (gopher exclusive!) /phlog.txt
-1 | | tech notes /notes
+1 |.| tech notes /notes
+0 | | phlog (gopher exclusive!) /phlog.txt
|.| .
|-| |`
. | | __ o' .
diff --git a/gopher/notes/all/openbsd-web-server.txt b/gopher/notes/all/openbsd-web-server.txt
@@ -0,0 +1,32 @@
+OpenBSD Web Server
+==================
+Tues Sept 21, 2021
+
+tags: openbsd www
+
+One of the first things I do when I set up a machine is set up
+httpd(8) and grab a HTTPS cert via acme-client(8).
+
+Here's a quick rundown (though reading the man pages is worth
+the time!).
+
+ # sed 's/example.com/<MY HOSTNAME>/g' \
+ /etc/examples/httpd.conf > /etc/httpd.conf
+ # sed 's/example.com/<MY HOSTNAME>/g' \
+ /etc/examples/acme-client.conf > /etc/acme-client.conf
+
+Then go in and edit the files to add aliases if needed!
+
+To get the certs for the first time:
+
+ # rcctl enable httpd
+ # rcctl start httpd
+ # acme-client -v <MY HOSTNAME> # get certs
+ # rcctl reload httpd # load certs
+
+Finally, to keep the certs up to date, add the following to the
+crontab:
+
+ # crontab -e
+ ...
+ ~ * * * * acme-client <MY HOSTNAME> && rcctl reload httpd