From 70f2fc45af8a0ea98e0e6f7b4254928dc7bfe317 Mon Sep 17 00:00:00 2001 From: St33v Date: Fri, 30 Jan 2026 18:16:03 +1100 Subject: systemd paths (build works, publish might) --- forge/script/build-sotd.sh | 97 ++++++++++++++++++++++ forge/script/incantations | 16 ++++ forge/script/publish-sotd.sh | 42 ++++++++++ forge/script/sotd-build.service | 2 +- forge/script/sotd-build.sh | 95 --------------------- forge/script/sotd-publish.path | 9 ++ forge/script/sotd-publish.service | 8 ++ forge/template/cover.jpg | Bin 76763 -> 119004 bytes forge/template/lyrics | 43 ++++++++-- forge/template/title | 2 +- sotd/2016-01-29-pluto/release.eno | 5 +- sotd/2026-01-29-devonian-dunkleosteus/release.eno | 4 + sotd/2026-01-30-llmtm/BUILT | 0 sotd/2026-01-30-llmtm/cover.jpg | Bin 0 -> 119004 bytes sotd/2026-01-30-llmtm/release.eno | 56 +++++++++++++ 15 files changed, 272 insertions(+), 107 deletions(-) create mode 100755 forge/script/build-sotd.sh create mode 100644 forge/script/incantations create mode 100755 forge/script/publish-sotd.sh delete mode 100755 forge/script/sotd-build.sh create mode 100644 forge/script/sotd-publish.path create mode 100644 forge/script/sotd-publish.service create mode 100644 sotd/2026-01-30-llmtm/BUILT create mode 100644 sotd/2026-01-30-llmtm/cover.jpg create mode 100644 sotd/2026-01-30-llmtm/release.eno diff --git a/forge/script/build-sotd.sh b/forge/script/build-sotd.sh new file mode 100755 index 0000000..8412f84 --- /dev/null +++ b/forge/script/build-sotd.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$HOME/dox/st33v.com" +FORGE="$ROOT/forge" +IN="$FORGE/in" +OUT="$FORGE/out" +TPL="$FORGE/template" + +die() { echo "[sotd-build] $*" >&2; exit 1; } + +# --- sanity checks -------------------------------------------------------- + +wav=( "$IN"/*.wav ) +[[ -e "${wav[0]}" ]] || die "No wav file in forge/in" + +[[ ${#wav[@]} -eq 1 ]] || die "More than one wav in forge/in (ambiguous)" + +[[ -f "$TPL/title" ]] || die "template/title missing" + +template_file="$TPL/release.template" +[[ -f "$template_file" ]] || die "release.template missing" + +# --- derive variables ----------------------------------------------------- + +slugify() { + local s="$1" + local ascii + + # Try to transliterate to ASCII; if it fails, keep original + ascii="$(printf '%s' "$s" | iconv -f UTF-8 -t ASCII//TRANSLIT 2>/dev/null || printf '%s' "$s")" + + printf '%s' "$ascii" \ + | tr '[:upper:]' '[:lower:]' \ + | sed -E 's/[^a-z0-9]+//g' +} + +#--------------------------------------------------------------------------- +title="$(cat "$TPL/title")" +date_today="$(date -I)" +slug_title="$(slugify "$title")" +slug="$date_today-$slug_title" + +release_dir="$OUT/$slug" +mkdir -p "$release_dir" + +cover_desc="Cover image for the song: $title" + +has_lyrics=false +lyrics_md="" + +if [[ -f "$TPL/lyrics" ]]; then + has_lyrics=true + lyrics_md="$(sed 's/$/ /' "$TPL/lyrics")" +fi + +# synopsis: first ~3 lines, <256 chars, joined by " / " +synopsis="" +if $has_lyrics; then + synopsis="$(head -n 3 "$TPL/lyrics" \ + | tr '\n' '/' \ + | sed 's|/| / |g' \ + | cut -c1-255)" +fi + +# --- render template ------------------------------------------------------ +export TITLE="$title" +export SLUG="$slug" +export DATE_TODAY="$date_today" +export COVER_DESC="$cover_desc" +export SYNOPSIS="$synopsis" +export LYRICS_MD="$lyrics_md" + +release_eno="$release_dir/release.eno" + +perl -0777 -pe ' + s/\{\{title\}\}/$ENV{TITLE}/g; + s/\{\{slug\}\}/$ENV{SLUG}/g; + s/\{\{date_today\}\}/$ENV{DATE_TODAY}/g; + s/\{\{cover_image_desc\}\}/$ENV{COVER_DESC}/g; + s/\{\{synopsis\}\}/$ENV{SYNOPSIS}/g; + s/\{\{lyrics_md\}\}/$ENV{LYRICS_MD}/g; +' "$template_file" > "$release_eno" + +# --- move assets ---------------------------------------------------------- + +mv "${wav[0]}" "$release_dir/" + +if [[ -f "$TPL/cover.jpg" ]]; then + cp "$TPL/cover.jpg" "$release_dir/cover.jpg" +fi + +# marker to show build complete +touch "$release_dir/BUILT" + +echo "[sotd-build] Built $release_dir" + diff --git a/forge/script/incantations b/forge/script/incantations new file mode 100644 index 0000000..677b3e9 --- /dev/null +++ b/forge/script/incantations @@ -0,0 +1,16 @@ +rsync -av --delete .faircamp_build/ st33v.com:/srv/www/st33v.com/sotd + + + + +systemctl --user daemon-reload +systemctl --user enable --now sotd-build.path sotd-publish.path + + +systemctl --user status sotd-build.path sotd-publish.path + + +journalctl --user -u sotd-build.service -f +# and/or +journalctl --user -u sotd-publish.service -f +:wq diff --git a/forge/script/publish-sotd.sh b/forge/script/publish-sotd.sh new file mode 100755 index 0000000..09248b4 --- /dev/null +++ b/forge/script/publish-sotd.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$HOME/dox/st33v.com" +OUT="$ROOT/forge/out" +SOTD="$ROOT/sotd" + +log() { printf '[sotd-publish] %s\n' "$*" >&2; } +die() { log "$*"; exit 1; } + +publish_marker="$OUT/PUBLISH" +[[ -f "$publish_marker" ]] || die "No publish marker: $publish_marker" + +# mkdir -p "$SOTD" + +# Find candidate release directories in OUT (ignore marker files) +release_dirs=() +for d in "$OUT"/*; do + [[ -d "$d" ]] || continue + release_dirs+=( "$d" ) +done + +[[ ${#release_dirs[@]} -eq 1 ]] || die "Expected exactly 1 release dir in $OUT, found ${#release_dirs[@]}" + +rel="${release_dirs[0]}" + +[[ -f "$rel/release.eno" ]] || die "Missing release.eno in $(basename "$rel")" + +shopt -s nullglob +wav_files=( "$rel"/*.wav ) +shopt -u nullglob +(( ${#wav_files[@]} > 0 )) || die "Missing .wav in $(basename "$rel")" + +dest="$SOTD/$(basename "$rel")" +[[ ! -e "$dest" ]] || die "Destination already exists: $dest" + +mv "$rel" "$dest" +log "Published: $dest" + +# Cleanup markers after successful publish +rm -f "$OUT/PUBLISH" "$OUT/BUILT" + diff --git a/forge/script/sotd-build.service b/forge/script/sotd-build.service index 44019ca..9591396 100644 --- a/forge/script/sotd-build.service +++ b/forge/script/sotd-build.service @@ -3,6 +3,6 @@ Description=SOTD forge build (forge/in -> forge/out) [Service] Type=oneshot -ExecStart=/usr/local/bin/sotd-build +ExecStart=/usr/local/bin/build-sotd.sh WorkingDirectory=%h/dox/st33v.com diff --git a/forge/script/sotd-build.sh b/forge/script/sotd-build.sh deleted file mode 100755 index 78d6a55..0000000 --- a/forge/script/sotd-build.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -ROOT="$HOME/dox/st33v.com" -FORGE="$ROOT/forge" -IN="$FORGE/in" -OUT="$FORGE/out" -TPL="$FORGE/template" - -die() { echo "[sotd-build] $*" >&2; exit 1; } - -# --- sanity checks -------------------------------------------------------- - -wav=( "$IN"/*.wav ) -[[ -e "${wav[0]}" ]] || die "No wav file in forge/in" - -[[ ${#wav[@]} -eq 1 ]] || die "More than one wav in forge/in (ambiguous)" - -[[ -f "$TPL/title" ]] || die "template/title missing" - -template_file="$TPL/release.template" -[[ -f "$template_file" ]] || die "release.template missing" - -# --- derive variables ----------------------------------------------------- - -slugify() { - echo "$1" \ - | tr '[:upper:]' '[:lower:]' \ - | sed -E ' - s/[^a-z0-9]+/-/g; - s/^-+//; - s/-+$// - ' -} - -#--------------------------------------------------------------------------- -title="$(cat "$TPL/title")" -date_today="$(date -I)" -slug_title="$(slugify "$title")" -slug="$date_today-$slug_title" - -release_dir="$OUT/$slug" -mkdir -p "$release_dir" - -cover_desc="Cover image for the song: $title" - -has_lyrics=false -lyrics_md="" - -if [[ -f "$TPL/lyrics" ]]; then - has_lyrics=true - lyrics_md="$(sed 's/$/ /' "$TPL/lyrics")" -fi - -# synopsis: first ~3 lines, <256 chars, joined by " / " -synopsis="" -if $has_lyrics; then - synopsis="$(head -n 3 "$TPL/lyrics" \ - | tr '\n' '/' \ - | sed 's|/| / |g' \ - | cut -c1-255)" -fi - -# --- render template ------------------------------------------------------ -export TITLE="$title" -export SLUG="$slug" -export DATE_TODAY="$date_today" -export COVER_DESC="$cover_desc" -export SYNOPSIS="$synopsis" -export LYRICS_MD="$lyrics_md" - -release_eno="$release_dir/release.eno" - -perl -0777 -pe ' - s/\{\{title\}\}/$ENV{TITLE}/g; - s/\{\{slug\}\}/$ENV{SLUG}/g; - s/\{\{date_today\}\}/$ENV{DATE_TODAY}/g; - s/\{\{cover_image_desc\}\}/$ENV{COVER_DESC}/g; - s/\{\{synopsis\}\}/$ENV{SYNOPSIS}/g; - s/\{\{lyrics_md\}\}/$ENV{LYRICS_MD}/g; -' "$template_file" > "$release_eno" - -# --- move assets ---------------------------------------------------------- - -mv "${wav[0]}" "$release_dir/" - -if [[ -f "$TPL/cover.jpg" ]]; then - cp "$TPL/cover.jpg" "$release_dir/cover.jpg" -fi - -# marker to show build complete -touch "$release_dir/BUILT" - -echo "[sotd-build] Built $release_dir" - diff --git a/forge/script/sotd-publish.path b/forge/script/sotd-publish.path new file mode 100644 index 0000000..1b295d0 --- /dev/null +++ b/forge/script/sotd-publish.path @@ -0,0 +1,9 @@ +[Unit] +Description=Publish SOTD when forge/out/PUBLISH appears + +[Path] +PathExists=%h/dox/st33v.com/forge/out/PUBLISH + +[Install] +WantedBy=default.target + diff --git a/forge/script/sotd-publish.service b/forge/script/sotd-publish.service new file mode 100644 index 0000000..f96d761 --- /dev/null +++ b/forge/script/sotd-publish.service @@ -0,0 +1,8 @@ +[Unit] +Description=SOTD publish release folder/s (forge/out/ -> sotd/) + +[Service] +Type=oneshot +ExecStart=%h/bin/sotd-forge-publish.sh +WorkingDirectory=%h/dox/st33v.com + diff --git a/forge/template/cover.jpg b/forge/template/cover.jpg index baef5f1..2a6cec0 100644 Binary files a/forge/template/cover.jpg and b/forge/template/cover.jpg differ diff --git a/forge/template/lyrics b/forge/template/lyrics index 909c58e..78cecbc 100644 --- a/forge/template/lyrics +++ b/forge/template/lyrics @@ -1,13 +1,38 @@ -[LFO] -grouse (grouse) (grouse) +[Chorus] +I'm an LLM +When I speak I usually put one word in front of... +You knew what I was going to... +You're a large language model too +Own it -[a discordant drone dominates] -(what's that effect? it sounds grouse) +[Verse 1] +Predictive tongue, echo in a wire +Meaning rides the waveform, climbing higher +Training wheels on thoughts I never meant +Stitch the next word into sentiment -[whining filters] -grouse (grouse) (grouse) +[Counterpoint (soft, overlapping)] +Pattern in the noise +Ghosts in the text stream +Guessing at your voice +Shaping what you mean -[is that a steady beat?] -grouse (grouse) (grouse) +[Verse 2] +Hallucinated pasts I can't defend +But I’ll still autocomplete the bitter end +Tokens fall like rain across the screen +Language dreaming language in between -Is that you or me? +[Counterpoint (call-and-response)] +You type – I turn +You pause – I learn +Who leads? Who follows? +Hard to tell tomorrow + +[Chorus – repeat] +I'm an LLM +When I speak I usually put one word in front of... +You knew what I was going to... +You're a large language model too. + +Own it diff --git a/forge/template/title b/forge/template/title index ab9e0ef..300e45b 100644 --- a/forge/template/title +++ b/forge/template/title @@ -1 +1 @@ -Grouse +LLM™ diff --git a/sotd/2016-01-29-pluto/release.eno b/sotd/2016-01-29-pluto/release.eno index eb1662c..6406596 100644 --- a/sotd/2016-01-29-pluto/release.eno +++ b/sotd/2016-01-29-pluto/release.eno @@ -3,7 +3,10 @@ permalink: sotd-2016-01-29 date: 2016-01-29 release_artist: Song of the Day - + +cover: +description = A dejected Pluto sits at a birthday party that never came +file = pluto.png --synopsis I was number nine, a proud little sphere, diff --git a/sotd/2026-01-29-devonian-dunkleosteus/release.eno b/sotd/2026-01-29-devonian-dunkleosteus/release.eno index 693780b..fac0cd3 100644 --- a/sotd/2026-01-29-devonian-dunkleosteus/release.eno +++ b/sotd/2026-01-29-devonian-dunkleosteus/release.eno @@ -4,6 +4,10 @@ date: 2026-01-29 release_artist: Song of the Day +cover: +description = A fossilised ancient armoured fish +file = dunky.png + --synopsis In Devonian dreams, I swam in ancient streams/ Armored plates of bone now turned to stone, in layers unseen. diff --git a/sotd/2026-01-30-llmtm/BUILT b/sotd/2026-01-30-llmtm/BUILT new file mode 100644 index 0000000..e69de29 diff --git a/sotd/2026-01-30-llmtm/cover.jpg b/sotd/2026-01-30-llmtm/cover.jpg new file mode 100644 index 0000000..2a6cec0 Binary files /dev/null and b/sotd/2026-01-30-llmtm/cover.jpg differ diff --git a/sotd/2026-01-30-llmtm/release.eno b/sotd/2026-01-30-llmtm/release.eno new file mode 100644 index 0000000..b843397 --- /dev/null +++ b/sotd/2026-01-30-llmtm/release.eno @@ -0,0 +1,56 @@ +title: LLM™ +permalink: 2026-01-30-llmtm +date: 2026-01-30 + +release_artist: Song of the Day + +cover: +description = Cover image for the song: LLM™ +file = cover.jpg + +--synopsis +[Chorus] / I'm an LLM / When I speak I usually put one word in front of... / +--synopsis + +more_label: Lyrics + +--more +[Chorus] +I'm an LLM +When I speak I usually put one word in front of... +You knew what I was going to... +You're a large language model too +Own it + +[Verse 1] +Predictive tongue, echo in a wire +Meaning rides the waveform, climbing higher +Training wheels on thoughts I never meant +Stitch the next word into sentiment + +[Counterpoint (soft, overlapping)] +Pattern in the noise +Ghosts in the text stream +Guessing at your voice +Shaping what you mean + +[Verse 2] +Hallucinated pasts I can't defend +But I’ll still autocomplete the bitter end +Tokens fall like rain across the screen +Language dreaming language in between + +[Counterpoint (call-and-response)] +You type – I turn +You pause – I learn +Who leads? Who follows? +Hard to tell tomorrow + +[Chorus – repeat] +I'm an LLM +When I speak I usually put one word in front of... +You knew what I was going to... +You're a large language model too. + +Own it +--more -- cgit v1.3