Assorted shell and Python scripts

Add/update stuff

+4
awkuptime
···
···
+
#!/usr/bin/env sh
+
+
# Lifted from https://superuser.com/a/1783477/3091052
+
awk '{m=int($1/60%60);h=int($1/3600%24);d=int($1/86400);printf "%sd %sh %sm\n", d, h, m}' /proc/uptime
+20
feed_count
···
···
+
#!/usr/bin/env nu
+
+
let mf_auth_token = (kwallet-query -r miniflux-auth-token kdewallet)
+
let mf_password = (kwallet-query -r miniflux-password kdewallet)
+
+
(
+
curl \
+
-s \
+
-X GET \
+
-H "Content-Type: application/json" \
+
-H $"X-Auth-Token: ($mf_auth_token)" \
+
-u $"hyperreal:($mf_password)" \
+
"https://mf.vern.cc/v1/feeds/counters"
+
)
+
| from json
+
| get unreads
+
| values
+
| math sum
+
+
# vim: sw=4 sts=4 ts=4 ai et ft=nu
-1
hyperreal_backup
···
BORG_ARCHIVE=$(borg list ssh://root@hyperreal.carp-wyvern.ts.net/srv/borgbackup/hyperreal | tail -n 1 | awk '{print $1}')
ARCHIVE_BASENAME=$(echo "$BORG_ARCHIVE" | cut -d "T" -f 1)
-
TS_HOST=$(tailscale status --json | jq ".Self.HostName" | tr -d '"')
if ! borg export-tar \
"ssh://root@hyperreal.carp-wyvern.ts.net/srv/borgbackup/hyperreal::${BORG_ARCHIVE}" \
···
BORG_ARCHIVE=$(borg list ssh://root@hyperreal.carp-wyvern.ts.net/srv/borgbackup/hyperreal | tail -n 1 | awk '{print $1}')
ARCHIVE_BASENAME=$(echo "$BORG_ARCHIVE" | cut -d "T" -f 1)
if ! borg export-tar \
"ssh://root@hyperreal.carp-wyvern.ts.net/srv/borgbackup/hyperreal::${BORG_ARCHIVE}" \
+24
split_dict
···
···
+
#!/usr/bin/env bash
+
+
# Check if gum is available
+
if ! command -v gum >/dev/null; then
+
echo "Missing dependency: gum"
+
echo "See https://github.com/charmbracelet/gum"
+
exit 1
+
fi
+
+
# Check if get-def is available
+
if ! command -v get-def >/dev/null; then
+
echo "Missing dependency: get-def"
+
echo "Run pipx install get-def"
+
exit 1
+
fi
+
+
WORD=$(gum input --placeholder="word")
+
+
if [[ -n "$ZELLIJ" ]]; then
+
zellij action new-pane -- get-def "$WORD"
+
else
+
echo "No Zellij sessions detected."
+
exit 1
+
fi
+1 -1
split_man
···
#!/usr/bin/env bash
# Check if gum is available
-
if ! test -x "$(command -v gum)"; then
echo "Missing dependency: gum"
echo "See https://github.com/charmbracelet/gum"
exit 1
···
#!/usr/bin/env bash
# Check if gum is available
+
if ! command -v gum >/dev/null; then
echo "Missing dependency: gum"
echo "See https://github.com/charmbracelet/gum"
exit 1