--- /dev/null
+id_ed25519
+id_ed25519.pub
--- /dev/null
+body {
+ color: #dfd9ac;
+ background-color: #252436;
+ border: 1px solid #2d2a49;
+}
+
+.page_header, .page_footer {
+ background-color: #2d2a49 !important;
+}
+
+a {
+ color: #b5a17b !important;
+}
+
+a:visited {
+ color: #7a749d !important;
+}
--- /dev/null
+#!/usr/bin/env bash
+
+read -r -d '' hook <<'EOF'
+#!/usr/bin/env bash
+while read _ _ refname; do
+ if [[ "${refname}" == refs/heads/master ]]; then
+ . <(git show master:post-receive.sh)
+ break
+ fi
+done
+EOF
+
+hook_hash="$(printf '%s' "${hook}"|sha256sum| cut -d\ -f1)"
+post_receive="hooks/post-receive"
+[[ -f "${dest}" ]] && current_hash="$(sha256sum "${post_receive}"| cut -d\ -f1)"
+
+print_and_run() {
+ printf ">>>"
+ for (( i = 1; i < $# + 1; i++ )); do
+ printf ' %q' "${!i}"
+ done
+ printf "\n"
+ "$@"
+}
+
+update_hook() {
+ print_and_run bash -c "cat >${post_receive} <<'EOF'"$'\n'"${hook}"$'\nEOF\n'
+}
+
+if [[ "${1}" == --install ]]; then
+ if (( $# > 1 )); then
+ echo "Error: No further arguments expected." >&2
+ exit 1
+ fi
+ update_hook "${post_receive}"
+ exit
+fi
+
+[[ "${hook_hash}" != "${current_hash}" ]] && update_hook "${post_receive}"
+[[ -x "${post_receive}" ]] || chmod 755 "${post_receive}"
+
+update_gitweb_theme() {
+ local theme_css_dest="/usr/share/gitweb/static/gitweb-theme.css"
+ print_and_run bash -c "git show master:gitweb-theme.css > ${theme_css_dest}"
+}
+
+tasks=(update_gitweb_theme)
+
+for task in "${tasks[@]}"; do
+ "${task}"
+done
--- /dev/null
+#!/usr/bin/env bash
+
+# this works if the remote has pam_ssh_agent_auth with the local id_ed25519.pub set up
+
+script="$(realpath -e "${0}")"
+script_dir="${script%/*}"
+
+get_ssh_agent_socket() {
+ local tmpdir="${TMPDIR:-/tmp}"
+ local former_nullglob_set=0 found=0 output
+ shopt -q nullglob && former_nullglob_set=1
+ shopt -s nullglob
+ for SSH_AUTH_SOCK in "${tmpdir}"/ssh-*/agent.*; do
+ output="$(ssh-add -l 2>&1)"
+ [[ "${output}" == "Error connecting to agent: Connection refused" ]] && continue
+ export SSH_AUTH_SOCK
+ found=1
+ break
+ done
+ (( found == 0 )) && . <(ssh-agent)
+ (( former_nullglob_set )) || shopt -u nullglob
+ return 0
+}
+
+add_ssh_key() {
+ local privkey="${script_dir}/${1}"
+ [[ ! -f "${privkey}" ]] && ssh-keygen -t "${1}" -b 521 -f "${privkey}"
+ grep -qE "^$(ssh-keygen -lf "${privkey}"|sed -r 's/([][{}|()+?])/\\\1/g')\$" \
+ <(ssh-add -l) || ssh-add "${privkey}"
+}
+
+get_ssh_agent_socket
+add_ssh_key id_ed25519
+
+script_b64="$(gzip -9<"${2}"|base64 -w0)"
+launcher="$(printf '%q' '. <(printf "%s" "'"${script_b64}"'"|base64 -d|gunzip)')"
+ssh -o ForwardX11=no -At "${1}" sudo bash -c "${launcher}"
--- /dev/null
+print_and_run() {
+ printf ">>>"
+ for (( i = 1; i < $# + 1; i++ )); do
+ printf ' %q' "${!i}"
+ done
+ printf "\n"
+ "$@"
+}
+
+print_and_run pacman -Syu
+print_and_run pacdiff -f -o
+cd
+print_and_run bash