~ecs/dotfiles

9b80fa406fa3aa9766f4aaa3e4a485846bef661b — Eyal Sawady 11 days ago b9ed287
bin/gencanary: initial commit
1 files changed, 9 insertions(+), 0 deletions(-)

A bin/gencanary
A bin/gencanary => bin/gencanary +9 -0
@@ 0,0 1,9 @@
#!/bin/sh -eu

tmp="$(mktemp)"
trap "rm $tmp" EXIT

curl -sf "https://xkcd.com/" >"$tmp"
canary="As of $(date +%Y-%m-%d), no warrants have ever been served to d2evs.net or any people with shell access to d2evs.net, nor have any searches or seizures of any kind been performed on d2evs.net assets. xkcd #$(($(hq 'sel [rel=prev] | . href' <"$tmp" | head -n1 | tr -d '/') + 1)), the most recent as of now, has the title \"$(hq 'sel div [id=ctitle] | totext' <"$tmp")\" and the title text \"$(hq 'sel div [id=comic] img | . title' <"$tmp")\""
signature="$(printf "%s\n" "$canary" | sshign ~/.ssh/id_ed25519)"
printf "\n%s\nSignature: %s\n" "$canary" "$signature" | ssh d2evs.net 'doas tee -a /var/www/d2evs.net/canary.txt'