summary refs log tree commit diff
path: root/home/.bin/up
diff options
context:
space:
mode:
Diffstat (limited to 'home/.bin/up')
-rwxr-xr-xhome/.bin/up12
1 files changed, 12 insertions, 0 deletions
diff --git a/home/.bin/up b/home/.bin/up
new file mode 100755
index 00000000..3a25e112
--- /dev/null
+++ b/home/.bin/up
@@ -0,0 +1,12 @@
+#!/usr/bin/env zsh
+set -o errexit -o nounset -o pipefail
+
+ts=$(date +%s)
+rand=$(openssl rand -hex 4)
+ext=${1##*.}
+url=$(printf 'tmp.cmcenroe.me/%x%s.%s' "$ts" "$rand" "$ext")
+
+scp -q "$1" "tmp.cmcenroe.me:/usr/local/www/$url"
+
+echo "https://$url"
+type pbcopy > /dev/null && echo -n "https://$url" | pbcopy