madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://"]
  insteadOf = madduck:

add idiotheke download script
authormartin f. krafft <>
Mon, 15 Jan 2018 21:07:47 +0000 (10:07 +1300)
committermartin f. krafft <>
Mon, 15 Jan 2018 21:07:47 +0000 (10:07 +1300)
.zsh/func/idiotheke [new file with mode: 0755]

index ef3e74172af9c55caadbc9b9d039a83339eaed93..54fe9b9c4f04c375b39cfe3061cfbc3d7a57a7c0 100644 (file)
@@ -1,9 +1,6 @@
@@ -75,7 +67,6 @@
diff --git a/.zsh/func/idiotheke b/.zsh/func/idiotheke
new file mode 100755 (executable)
index 0000000..5a0d5d6
--- /dev/null
@@ -0,0 +1,32 @@
+set -u
+if [ -n "${ZSH_VERSION:-}" ]; then
+  # don't execute trap on return from functions
+  setopt local_options posix_traps no_warn_create_global
+LOGIN="$(echo "$PASSWORD" | sed -rne 's/login: //p')"
+URL="$(echo "$PASSWORD" | sed -rne 's/url: //p')"
+*}" #first line only
+if [ -n "${1:-}" ]; then
+  ASKPASS="$(tempfile --prefix=askpass --mode=700)"
+  cleanup() { rm -f $ASKPASS; trap - 0; }
+  trap cleanup 0
+  echo '#!/bin/sh' >> $ASKPASS
+  echo "echo ${LOGIN}:${PASSWORD}" >> $ASKPASS
+  wget --continue --use-askpass="$ASKPASS" "$@"
+  cleanup
+  ! command -v unfunction >/dev/null || unfunction cleanup
+  LFTP_PASSWORD="$PASSWORD" lftp -e "open -u $LOGIN --env-password $URL"