You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
1.6 KiB

  1. {{.Hostname}}: Easy file sharing from the command line
  2. ===
  3. made with <3 by DutchCoders
  4. Upload:
  5. $ curl --upload-file ./hello.txt {{.WebAddress}}hello.txt
  6. Encrypt & upload:
  7. $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
  8. Download & decrypt:
  9. $ curl {{.WebAddress}}1lDau/test.txt|gpg -o- > /tmp/hello.txt
  10. Grep pound from syslog and transfer
  11. cat /var/log/syslog|grep pound|curl --upload-file - {{.WebAddress}}pound.log
  12. Using Keybase:
  13. # import keys from keybase
  14. $ keybase track [them]
  15. # encrypt for recipients
  16. $ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
  17. # decrypt
  18. $ curl {{.WebAddress}}sqUFi/test.md |keybase decrypt
  19. Upload to Virustotal:
  20. $ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/virustotal
  21. Virusscan:
  22. $ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/scan
  23. Add shell function to .bashrc or .zshrc or its equivalent:
  24. ===
  25. transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "{{.WebAddress}}$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "{{.WebAddress}}/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "{{.WebAddress}}/$file_name"|tee /dev/null;fi;}
  26. ===
  27. $ transfer test.txt