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.
 
 
 
 

44 lines
1.9 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 with gpg & upload:
  7. $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
  8. Download & decrypt with gpg:
  9. $ curl {{.WebAddress}}1lDau/test.txt|gpg -o- > /tmp/hello.txt
  10. Encrypt with openssl & upload:
  11. $ cat /tmp/hello.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
  12. Download & decrypt with openssl:
  13. $ curl {{.WebAddress}}1lDau/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hello.txt
  14. Grep pound from syslog and transfer
  15. cat /var/log/syslog|grep pound|curl --upload-file - {{.WebAddress}}pound.log
  16. Using Keybase:
  17. # import keys from keybase
  18. $ keybase track [them]
  19. # encrypt for recipients
  20. $ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
  21. # decrypt
  22. $ curl {{.WebAddress}}sqUFi/test.md |keybase decrypt
  23. Upload to Virustotal:
  24. $ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/virustotal
  25. Virusscan:
  26. $ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/scan
  27. Add shell function to .bashrc or .zshrc or its equivalent:
  28. ===
  29. 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;}
  30. ===
  31. $ transfer test.txt