]> git.armaanb.net Git - config.org.git/commitdiff
ash: switch to just self-hosting pastebin
authorArmaan Bhojwani <me@armaanb.net>
Sat, 29 May 2021 00:27:52 +0000 (20:27 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 29 May 2021 00:27:52 +0000 (20:27 -0400)
config.org

index 58575bfbee8d484243ace6468939234cc7b36f10..067f181e808edfdf4ccf978549cf3c894d52b400 100644 (file)
@@ -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