From 8e13bb968cb5aef9cddb0b074c29e67ccc2f6c91 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 6 Sep 2019 14:42:53 -0500 Subject: [PATCH] Moar scripts --- scripts/bin/pbin | 2 +- scripts/bin/upload | 15 +++++++++++++++ shell/bash/aliases | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 scripts/bin/upload diff --git a/scripts/bin/pbin b/scripts/bin/pbin index 29bef80..61ac971 100755 --- a/scripts/bin/pbin +++ b/scripts/bin/pbin @@ -4,7 +4,7 @@ HOST="ld" INTERNAL_PUBLIC_DIR="~/../services/data/files/pastes" f="${1}" -uuid="$(uuid v1)" +uuid="$(uuid -v 1)" [ "${f}" == "" ] && echo "No file provided. Exiting." >&2 && exit 2 [ ! -f "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1 diff --git a/scripts/bin/upload b/scripts/bin/upload new file mode 100755 index 0000000..5038c2e --- /dev/null +++ b/scripts/bin/upload @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +HOST="ld" +INTERNAL_PUBLIC_DIR="~/../services/data/files/uploads" + +f="${1}" +fname="$(basename "${f}")" +uuid="$(uuid -v 1)" + +[ "${f}" == "" ] && echo "No file provided. Exiting." >&2 && exit 2 +[ ! -f "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1 + +scp "${f}" "${HOST}:${INTERNAL_PUBLIC_DIR}/${fname}" + +echo "${f} uploaded to https://lyte.dev/uploads/${fname}" diff --git a/shell/bash/aliases b/shell/bash/aliases index 7c79047..23b3d88 100644 --- a/shell/bash/aliases +++ b/shell/bash/aliases @@ -97,6 +97,8 @@ alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar" alias t="task" alias sc="sc-im" alias scs="sc-im \"\$NOTES_PATH/_scratch.sc\"" +alias disks="lsblk && df -h" +alias dd="dd status=progress" # games aliases # this sometimes fixes steam dynamic library issues? @@ -108,3 +110,6 @@ alias man="vman" # neomutt is better alias mutt="neomutt" + +# fsw aliases +alias fsw-mix-test="fsw \"mix test\" ./**/*.{ex,exs,erl,hrl,xrl,yrl}"