From f2df64db7df3325af25708f8cde5773ab4499daa Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 21 Oct 2022 17:24:45 +0200 Subject: Add watch script for prerecs --- 2022/organizers-notebook.md | 60 ++++++++++++++++++++++++++++++++++++-- 2022/organizers-notebook/index.org | 47 +++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 3 deletions(-) diff --git a/2022/organizers-notebook.md b/2022/organizers-notebook.md index 6b17a943..08118dcc 100644 --- a/2022/organizers-notebook.md +++ b/2022/organizers-notebook.md @@ -695,7 +695,12 @@ in prod or docker container ### TODO restreamers on live0 -### TODO icecast on live0 +### STARTED icecast on live0 + +(find-file “/ssh:live|sudo::/etc/icecast2/icecast.xml”) + + +#### TODO Set up watch/gen/480p ### TODO publishing environment @@ -2307,7 +2312,7 @@ Probably focus on grabbing the audio first and seeing what’s worth keeping Make a table of the form - +
@@ -3241,7 +3246,7 @@ Where: Nice if there’s an Ansible playbook sachac’s notes: - + - probably good to set it up on front It’s now on front. @@ -3907,6 +3912,55 @@ chatter in the other lists Cc’d on this message. Thank you. (message "Back to safety. Phew!") +## Prerecs + + +### Receive notification when new prerecs are available + + #!/usr/bin/env sh + + set -xeu + + sleep_duration=1800 + + data=prerec-wait-new.data + touch check-new-prerecs.data + + prerecs_number_current="$(TERM=xterm ssh orga@media.emacsconf.org -- ls -1 /srv/upload | wc -l)" + + plural() { + if [ "$2" = 1 ] || [ "$2" = -1 ]; then + echo "${1}" + else + case $1 in + "is" ) + "are" + ;; + * ) + "${1}s" + esac + fi + } + + notify() { + echo "$1" + notify-send -t 0 "EmacsConf" "$1" + } + + prerecs_number_past=$(cat check-new-prerecs.data) + diff=$((prerecs_number_current - prerecs_number_past)) + + echo "Currently waiting for prerec" + + while [ $diff = 0 ]; do + sleep "$sleep_duration" + done + + notify "Yay~, $diff new $(plural "prerec" $diff) $(plural "is" $diff) available!" + + echo "$prerecs_number_current" > "$data" + + ## Publish this page (defun emacsconf-org-publish-this-page () diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org index 68abe0e6..0a31aced 100644 --- a/2022/organizers-notebook/index.org +++ b/2022/organizers-notebook/index.org @@ -3376,6 +3376,53 @@ Throw an error if ERROR is non-nil, skip otherwise." (message "Back to safety. Phew!") #+end_src +** Prerecs +*** Receive notification when new prerecs are available +#+begin_src sh :eval no :tangle prerecs-wait-new.sh +#!/usr/bin/env sh + +set -xeu + +sleep_duration=1800 + +data=prerec-wait-new.data +touch check-new-prerecs.data + +prerecs_number_current="$(TERM=xterm ssh orga@media.emacsconf.org -- ls -1 /srv/upload | wc -l)" + +plural() { + if [ "$2" = 1 ] || [ "$2" = -1 ]; then + echo "${1}" + else + case $1 in + "is" ) + "are" + ;; + * ) + "${1}s" + esac + fi +} + +notify() { + echo "$1" + notify-send -t 0 "EmacsConf" "$1" +} + +prerecs_number_past=$(cat check-new-prerecs.data) +diff=$((prerecs_number_current - prerecs_number_past)) + +echo "Currently waiting for prerec" + +while [ $diff = 0 ]; do + sleep "$sleep_duration" +done + +notify "Yay~, $diff new $(plural "prerec" $diff) $(plural "is" $diff) available!" + +echo "$prerecs_number_current" > "$data" +#+end_src + ** Publish this page #+begin_src emacs-lisp -- cgit v1.2.3