From 0b23b0528d0852db95ce52b37558589933922029 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Fri, 5 Nov 2021 00:46:01 -0400 Subject: [PATCH] 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!) --- gopher/.gitignore | 1 + gopher/Makefile | 5 +++-- gopher/bin/notetag | 35 ++++++++++++++++++++++++++++++++++- gopher/gophermap | 4 ++-- gopher/notes/all/openbsd-web-server.txt | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 gopher/notes/all/openbsd-web-server.txt diff --git a/gopher/.gitignore b/gopher/.gitignore index 6c7b43f..3d433f2 100644 --- a/gopher/.gitignore +++ b/gopher/.gitignore @@ -1,2 +1,3 @@ notes/*/ +notes/gophermap !notes/all/ diff --git a/gopher/Makefile b/gopher/Makefile index b7badde..b8574e1 100644 --- 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 index 1090f29..451f558 100755 --- 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 </g' \ + /etc/examples/httpd.conf > /etc/httpd.conf + # sed 's/example.com//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 # 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 && rcctl reload httpd -- libgit2 1.1.1