diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-03-27 18:46:45 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-03-27 18:46:45 +0100 |
commit | 6021a9e22f99bb9b19134e2cb443bdeba852edc6 (patch) | |
tree | 398720cbb8a601553900866031ba3f093e051106 /accounts/gkleen@sif/zshrc | |
parent | e203311de813949dec992b76b04410068768eaf5 (diff) | |
download | nixos-6021a9e22f99bb9b19134e2cb443bdeba852edc6.tar nixos-6021a9e22f99bb9b19134e2cb443bdeba852edc6.tar.gz nixos-6021a9e22f99bb9b19134e2cb443bdeba852edc6.tar.bz2 nixos-6021a9e22f99bb9b19134e2cb443bdeba852edc6.tar.xz nixos-6021a9e22f99bb9b19134e2cb443bdeba852edc6.zip |
…
Diffstat (limited to 'accounts/gkleen@sif/zshrc')
-rw-r--r-- | accounts/gkleen@sif/zshrc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc index c65e35f9..fd1f1002 100644 --- a/accounts/gkleen@sif/zshrc +++ b/accounts/gkleen@sif/zshrc | |||
@@ -1,9 +1,20 @@ | |||
1 | filebin() { | 1 | filebin() { |
2 | basePath=/srv/www/files | 2 | basePath=/srv/www/files |
3 | ssh ymir find "${basePath}" -type f -print0 \ | 3 | ssh ymir find /srv/www/files -type f -printf "$'%T@ %TY-%Tm-%TdT%TH:%TM %P\\\\0'" | sort -zn | cut -z -d ' ' -f 2- \ |
4 | | while IFS= read -r -d $'\0' p; do | 4 | | while IFS= read -r -d $'\0' l; do |
5 | printf "https://f.141.li/%s\n" "${p#${basePath}/}" | 5 | IFS=' ' read -r t p <<<"${l}" |
6 | printf "%s https://f.141.li/%s\n" "${t}" "${p}" | ||
7 | done | ||
8 | } | ||
9 | |||
10 | push2bin() { | ||
11 | if [[ ${#@} -eq 1 && ! -r ${1} ]]; then | ||
12 | uux -p 'ymir!push2bin' $(echo -n "${1:t}" | tr -c $'[:alnum:]+-=.' '_') | ||
13 | else | ||
14 | for f (${@}); do | ||
15 | uux -p 'ymir!push2bin' $(echo -n "${f:t}" | tr -c $'[:alnum:]+-=.' '_') <${f} | ||
6 | done | 16 | done |
17 | fi | ||
7 | } | 18 | } |
8 | 19 | ||
9 | genmail() { | 20 | genmail() { |