From fdcb3fdc000d2a8eb542a43064e45b32d3f716ed Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Fri, 28 May 2021 20:27:52 -0400 Subject: [PATCH] ash: switch to just self-hosting pastebin --- config.org | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/config.org b/config.org index 58575bf..067f181 100644 --- a/config.org +++ b/config.org @@ -834,15 +834,6 @@ Use the vi editing mode. I still haven't found a good way to show visual feedbac set -o vi #+end_src *** Functions -**** Interact with 0x0 -#+begin_src shell :tangle ~/.config/ash/ashrc - zxz="https://envs.sh" - ufile() { curl -F"file=@$1" "$zxz" ; } - upb() { curl -F"file=@-;" "$zxz" ; } - uurl() { curl -F"url=$1" "$zxz" ; } - ushort() { curl -F"shorten=$1" "$zxz" ; } - uclip() { xclip -out | curl -F"file=@-;" "$zxz" ; } -#+end_src **** Finger #+begin_src shell :tangle ~/.config/ash/ashrc finger() { @@ -853,9 +844,26 @@ Use the vi editing mode. I still haven't found a good way to show visual feedbac #+end_src **** Upload to ftp.armaanb.net #+begin_src shell :tangle ~/.config/ash/ashrc - pubup() { - rsync "$1" "root@armaanb.net:/var/ftp/pub/${2}" - echo "https://ftp.armaanb.net/pub/"$(basename "$1") | tee /dev/tty | xclip -sel c + _uprint() { + echo "https://l.armaanb.net/$(basename "$1")" | tee /dev/tty | xclip -sel c + } + + _uup() { + rsync "$1" "root@armaanb.net:/var/ftp/pub/$2" --chmod 644 + } + + ufile() { + _uup "$1" "$2" + _uprint "$1" + } + + uclip() { + tmp=$(mktemp) + xclip -o -sel c >> "$tmp" + basetmp=$(echo "$tmp" | tail -c +5) + _uup "$tmp" "$basetmp" + _uprint "$basetmp" + rm -f "$tmp" } #+end_src *** Exports -- 2.39.2