diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-27 11:13:28 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-27 11:13:28 +0900 |
| commit | 6edeeaeb1cdaac6b3ce0cff366aa82f3db13d6b3 (patch) | |
| tree | 8713fafa950ec868345cff56bb9a2da64b0230f8 | |
| parent | cbe4041526958056233208bf390114f49f40f9ba (diff) | |
deleted com.colliderli.iina/input_conf", created bin/hugow, created bin/ylog, created bin/hugow, created bin/ylog
| -rwxr-xr-x | ar/.local/bin/hugow | 66 | ||||
| -rwxr-xr-x | ar/.local/bin/ylog | 25 | ||||
| -rwxr-xr-x | mac/.local/bin/hugow | 66 | ||||
| -rwxr-xr-x | mac/.local/bin/ylog | 25 | ||||
| -rw-r--r-- | mac/Library/Application Support/com.colliderli.iina/input_conf/SI.conf (renamed from mac/Library/Application Support/com.colliderli.iina/input_conf) | 0 |
5 files changed, 182 insertions, 0 deletions
diff --git a/ar/.local/bin/hugow b/ar/.local/bin/hugow new file mode 100755 index 0000000..b96cc93 --- /dev/null +++ b/ar/.local/bin/hugow @@ -0,0 +1,66 @@ +#!/bin/sh +set -eu + +repodir="$HOME/Private/repos/THESIAH" +out="$repodir/public/recordings/index.html" +server="${THESIAH_SERVER:-root@thesiah.xyz}" +dest="/var/www/thesiah/recordings/" +defaults="sy after foramonth" +src="$repodir/public/recordings/" + +cd "$repodir" +hugo --cleanDestinationDir + +if [ ! -f "$out" ]; then + echo "error: not found: $out" >&2 + exit 1 +fi + +tmp="$(mktemp "$out.XXXXXXXX.tmp")" + +awk -v defaults="$defaults" ' +BEGIN { + n = split(defaults, a, /[[:space:]]+/) + insert = "" + for (i = 1; i <= n; i++) { + if (a[i] == "") continue + name = a[i] ".mp4" + insert = insert \ +" <li>\n" \ +" <a href=\"/recordings/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ +" </li>\n" + } + injected = 0 +} +{ + print + if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { + printf("%s", insert) + injected = 1 + } +} +END { if (!injected) exit 2 } +' "$out" >"$tmp" + +mv "$tmp" "$out" +echo "Injected defaults into: $out" + +ssh "$server" "mkdir -p '$dest'" + +if [ -n "${THESIAH_SSH_OPTS:-}" ]; then + rsync -azv --update --itemize-changes --stats \ + -e "ssh $THESIAH_SSH_OPTS" \ + "$src" "$server:$dest" +else + rsync -azv --update --itemize-changes --stats \ + "$src" "$server:$dest" +fi + +if [ -n "${1-}" ]; then + new="$repodir/content/recordings/$1" + [ -f "$new" ] && rsync -az --update "$new" "$server:$dest" +fi + +ssh "$THESIAH_SERVER" "chmod 644 $dest/index.html" + +cd - >/dev/null diff --git a/ar/.local/bin/ylog b/ar/.local/bin/ylog new file mode 100755 index 0000000..ff4083e --- /dev/null +++ b/ar/.local/bin/ylog @@ -0,0 +1,25 @@ +#!/bin/sh + +HOST="root@thesiah.xyz" +LOG_DIR="/var/log/nginx" +target="${1:-207.96.105.230}" + +esc_target=$(printf '%s' "$target" | sed -E 's/[][^$.*/+?(){}|\\]/\\&/g') + +ssh "$HOST" " + for f in $LOG_DIR/recordings* $LOG_DIR/access*; do + [ -e \"\$f\" ] || continue + case \"\$f\" in + *.gz) + zgrep -E \"${esc_target}[[:space:]]\" \"\$f\" \ + | grep -v '59.19.56.8' \ + | grep -vi 'firefox' + ;; + *) + grep -E \"${esc_target}[[:space:]]\" \"\$f\" \ + | grep -v '59.19.56.8' \ + | grep -vi 'firefox' + ;; + esac + done +" diff --git a/mac/.local/bin/hugow b/mac/.local/bin/hugow new file mode 100755 index 0000000..b96cc93 --- /dev/null +++ b/mac/.local/bin/hugow @@ -0,0 +1,66 @@ +#!/bin/sh +set -eu + +repodir="$HOME/Private/repos/THESIAH" +out="$repodir/public/recordings/index.html" +server="${THESIAH_SERVER:-root@thesiah.xyz}" +dest="/var/www/thesiah/recordings/" +defaults="sy after foramonth" +src="$repodir/public/recordings/" + +cd "$repodir" +hugo --cleanDestinationDir + +if [ ! -f "$out" ]; then + echo "error: not found: $out" >&2 + exit 1 +fi + +tmp="$(mktemp "$out.XXXXXXXX.tmp")" + +awk -v defaults="$defaults" ' +BEGIN { + n = split(defaults, a, /[[:space:]]+/) + insert = "" + for (i = 1; i <= n; i++) { + if (a[i] == "") continue + name = a[i] ".mp4" + insert = insert \ +" <li>\n" \ +" <a href=\"/recordings/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ +" </li>\n" + } + injected = 0 +} +{ + print + if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { + printf("%s", insert) + injected = 1 + } +} +END { if (!injected) exit 2 } +' "$out" >"$tmp" + +mv "$tmp" "$out" +echo "Injected defaults into: $out" + +ssh "$server" "mkdir -p '$dest'" + +if [ -n "${THESIAH_SSH_OPTS:-}" ]; then + rsync -azv --update --itemize-changes --stats \ + -e "ssh $THESIAH_SSH_OPTS" \ + "$src" "$server:$dest" +else + rsync -azv --update --itemize-changes --stats \ + "$src" "$server:$dest" +fi + +if [ -n "${1-}" ]; then + new="$repodir/content/recordings/$1" + [ -f "$new" ] && rsync -az --update "$new" "$server:$dest" +fi + +ssh "$THESIAH_SERVER" "chmod 644 $dest/index.html" + +cd - >/dev/null diff --git a/mac/.local/bin/ylog b/mac/.local/bin/ylog new file mode 100755 index 0000000..ff4083e --- /dev/null +++ b/mac/.local/bin/ylog @@ -0,0 +1,25 @@ +#!/bin/sh + +HOST="root@thesiah.xyz" +LOG_DIR="/var/log/nginx" +target="${1:-207.96.105.230}" + +esc_target=$(printf '%s' "$target" | sed -E 's/[][^$.*/+?(){}|\\]/\\&/g') + +ssh "$HOST" " + for f in $LOG_DIR/recordings* $LOG_DIR/access*; do + [ -e \"\$f\" ] || continue + case \"\$f\" in + *.gz) + zgrep -E \"${esc_target}[[:space:]]\" \"\$f\" \ + | grep -v '59.19.56.8' \ + | grep -vi 'firefox' + ;; + *) + grep -E \"${esc_target}[[:space:]]\" \"\$f\" \ + | grep -v '59.19.56.8' \ + | grep -vi 'firefox' + ;; + esac + done +" diff --git a/mac/Library/Application Support/com.colliderli.iina/input_conf b/mac/Library/Application Support/com.colliderli.iina/input_conf/SI.conf index 4165405..4165405 100644 --- a/mac/Library/Application Support/com.colliderli.iina/input_conf +++ b/mac/Library/Application Support/com.colliderli.iina/input_conf/SI.conf |
