1
0
mirror of https://github.com/dutchcoders/transfer.sh.git synced 2020-11-18 19:53:40 -08:00

small fixes to examples and added some more examples

This commit is contained in:
Remco 2014-10-25 00:11:43 +02:00
parent fea7dc61c3
commit 9ff937d92d
2 changed files with 66 additions and 14 deletions

View File

@ -160,14 +160,16 @@
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<h3>Create an alias and add it to .bashrc</h3> <h3>Create an alias and add it to .bashrc or .zshrc</h3>
<div class="terminal-top"> <div class="terminal-top">
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Add this to .bashrc or it equivalent</span> <span class="code-title"># Add this to .bashrc or its equivalent</span>
<br>transfer() { # write to output to tmpfile because of progress bar tmpfile=$( mktemp -t transferXXX ) curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile; cat $tmpfile; rm -f $tmpfile; } <br>transfer() { # write to output to tmpfile because of progress bar tmpfile=$( mktemp -t transferXXX ) curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile; cat $tmpfile; rm -f $tmpfile; }
<br> <br>
<br>alias transfer=transfer
<br>
<br> <br>
<span class="code-title"># Now you can use transfer command</span> <span class="code-title"># Now you can use transfer command</span>
<br>$ transfer hello.txt <br>$ transfer hello.txt
@ -204,7 +206,7 @@
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Encrypt files with password using gpk</span> <span class="code-title"># Encrypt files with password using gpg</span>
<br>$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt <br>$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt
<br> <br>
<br> <br>
@ -223,21 +225,45 @@
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Scan for malware or viruses using Clamav</span> <span class="code-title"># Scan for malware or viruses using Clamav</span>
<br>wget http://www.eicar.org/download/eicar.com <br>$ wget http://www.eicar.org/download/eicar.com
<br>curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan <br>$ curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan
<br><br> <br><br>
<span class="code-title"># Upload malware to VirusTotal, get a permalink in return</span> <span class="code-title"># Upload malware to VirusTotal, get a permalink in return</span>
<br>curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal <br>$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal
<br> <br>
</code> </code>
</div> </div>
</div> </div>
<div class="col-md-6">
<h3>Backup mysql database, encrypt and transfer</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># Backup, encrypt and transfer</span>
<br>$ mysqldump --all-databases|gzip|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt </code>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Send email with transfer link (uses alias)</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># Transfer and send email with link (uses alias)</span>
<br>$ transfer /tmp/hello.txt | mail -s "Hello World" user@yourmaildomain.com
</code>
</div>
</div>
<div class="col-md-6"> <div class="col-md-6">
<h3>Send us your awesome example</h3> <h3>Send us your awesome example</h3>
<div class="terminal-top"> <div class="terminal-top">
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Your awesome sample will be put here</span>
</code> </code>
</div> </div>
</div> </div>

View File

@ -162,15 +162,17 @@
</div> </div>
</div> </div>
<div class="col-md-6 "> <div class="col-md-6 ">
<h3>Create an alias and add it to .bashrc</h3> <h3>Create an alias and add it to .bashrc or .zshrc</h3>
<div class="terminal-top"> <div class="terminal-top">
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Add this to .bashrc or it equivalent</span> <span class="code-title"># Add this to .bashrc or its equivalent</span>
<br/>transfer() { # write to output to tmpfile because of progress bar tmpfile=$( mktemp -t transferXXX ) curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile; cat $tmpfile; rm -f $tmpfile; } <br/>transfer() { # write to output to tmpfile because of progress bar tmpfile=$( mktemp -t transferXXX ) curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile; cat $tmpfile; rm -f $tmpfile; }
<br> <br/>
<br> <br/>alias transfer=transfer
<br/>
<br/>
<span class="code-title"># Now you can use transfer command</span> <span class="code-title"># Now you can use transfer command</span>
<br>$ transfer hello.txt <br>$ transfer hello.txt
</code> </code>
@ -206,7 +208,7 @@
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Encrypt files with password using gpk</span> <span class="code-title"># Encrypt files with password using gpg</span>
<br>$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt <br>$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt
<br> <br>
<br> <br>
@ -225,21 +227,45 @@
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Scan for malware or viruses using Clamav</span> <span class="code-title"># Scan for malware or viruses using Clamav</span>
<br>wget http://www.eicar.org/download/eicar.com <br>$ wget http://www.eicar.org/download/eicar.com
<br>curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan <br>$ curl -X PUT --upload-file ./eicar.com https://transfer.sh/eicar.com/scan
<br><br> <br><br>
<span class="code-title"># Upload malware to VirusTotal, get a permalink in return</span> <span class="code-title"># Upload malware to VirusTotal, get a permalink in return</span>
<br>curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal <br>$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal
<br> <br>
</code> </code>
</div> </div>
</div> </div>
<div class="col-md-6">
<h3>Backup mysql database, encrypt and transfer</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># Backup, encrypt and transfer</span>
<br/>$ mysqldump --all-databases|gzip|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt </code>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Send email with transfer link (uses alias)</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># Transfer and send email with link (uses alias)</span>
<br/>$ transfer /tmp/hello.txt | mail -s "Hello World" user@yourmaildomain.com
</code>
</div>
</div>
<div class="col-md-6"> <div class="col-md-6">
<h3>Send us your awesome example</h3> <h3>Send us your awesome example</h3>
<div class="terminal-top"> <div class="terminal-top">
</div> </div>
<div class="terminal"> <div class="terminal">
<code> <code>
<span class="code-title"># Your awesome sample will be put here</span>
</code> </code>
</div> </div>
</div> </div>