- Aliases
- Uploading and downloading
- Archiving and backups
- Encrypting and decrypting
- Scanning for viruses
transfer() {
curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename "$1") | tee /dev/null;
echo
}
alias transfer=transfertransfer() {
wget -t 1 -qO - --method=PUT --body-file="$1" --header="Content-Type: $(file -b --mime-type "$1")" https://transfer.sh/$(basename "$1");
echo
}
alias transfer=transferfunction transfer --description 'Upload a file to transfer.sh'
if [ $argv[1] ]
# write to output to tmpfile because of progress bar
set -l tmpfile ( mktemp -t transferXXXXXX )
curl --progress-bar --upload-file "$argv[1]" https://transfer.sh/(basename $argv[1]) >> $tmpfile
cat $tmpfile
command rm -f $tmpfile
else
echo 'usage: transfer FILE_TO_TRANSFER'
end
end
funcsave transferfunction transfer --description 'Upload a file to transfer.sh'
if [ $argv[1] ]
wget -t 1 -qO - --method=PUT --body-file="$argv[1]" --header="Content-Type: (file -b --mime-type $argv[1])" https://transfer.sh/(basename $argv[1])
else
echo 'usage: transfer FILE_TO_TRANSFER'
end
end
funcsave transferNow run it like this:
$ transfer test.txtPut a file called transfer.cmd somewhere in your PATH with this inside it:
@echo off
setlocal
:: use env vars to pass names to PS, to avoid escaping issues
set FN=%~nx1
set FULL=%1
powershell -noprofile -command "$(Invoke-Webrequest -Method put -Infile $Env:FULL https://transfer.sh/$Env:FN).Content"$ wget --method PUT --body-file=/tmp/file.tar https://transfer.sh/file.tar -O - -nv PS H:\> invoke-webrequest -method put -infile .\file.txt https://transfer.sh/file.txt $ http https://transfer.sh/ -vv < /tmp/test.log $ grep 'pound' /var/log/syslog | curl --upload-file - https://transfer.sh/pound.log $ curl https://transfer.sh/1lDau/test.txt -o test.txt$ wget https://transfer.sh/1lDau/test.txt$ mysqldump --all-databases | gzip | gpg -ac -o- | curl -X PUT --upload-file "-" https://transfer.sh/test.txt$ tar -czf - /var/log/journal | curl --upload-file - https://transfer.sh/journal.tar.gz$ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt https://transfer.sh/$ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).tar.gz
$ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).zip $ transfer /tmp/hello.txt | mail -s "Hello World" user@yourmaildomain.com $ cat /tmp/hello.txt | gpg -ac -o- | curl -X PUT --upload-file "-" https://transfer.sh/test.txt$ curl https://transfer.sh/1lDau/test.txt | gpg -o- > /tmp/hello.txt Import keys from keybase
$ keybase track [them] # Encrypt for recipient(s)
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' https://transfer.sh/test.txt # Decrypt
$ curl https://transfer.sh/sqUFi/test.md | keybase decrypt$ wget http://www.eicar.org/download/eicar.com
$ curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal