added pound example, builded static files

This commit is contained in:
Remco 2014-12-08 14:49:18 +01:00
parent 28b68b4d90
commit 91b8156f82
4 changed files with 52 additions and 46 deletions

View file

@ -157,10 +157,10 @@
<code>
<span class="code-title"># Uploading is easy using curl</span>
<br>$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
<br>
<br>https://transfer.sh/66nb8/hello.txt
<br>
<span class="code-title"># Download the file</span>
<br>$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
<br>$ curl https://transfer.sh/66nb8/hello.txt -o hello.txt
</code>
</div>
</div>
@ -171,28 +171,7 @@
<div class="terminal">
<code>
<span class="code-title"># Add this to .bashrc or its equivalent</span>
<br/>transfer() {
<br/> if [ $# -eq 0 ]; then
<br/> echo "No arguments specified. Usage:"
<br/> echo "$ transfer /tmp/test.md"
<br/> echo "$ cat /tmp/test.md | transfer test.md"
<br/> return 1
<br/> fi
<br/>
<br/> # write to output to tmpfile because of progress bar
<br/> tmpfile=$( mktemp -t transferXXX );
<br/>
<br/> if tty -s; then
<br/> basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
<br/> curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
<br/> else
<br/> curl --progress-bar --upload-file "-" "https://transfer.sh/$1"
<br/> fi
<br/>
<br/> cat $tmpfile; rm -f $tmpfile;
<br/>}
<br/>
<br/>alias transfer=transfer
<br/>transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi <br/>tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
<br/>
<br/>
<span class="code-title"># Now you can use transfer command</span>
@ -298,6 +277,30 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>wget uploads also supported</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># wget</span>
<br/>$ wget --method PUT --body-file=/tmp/file.tar https://transfer.sh/file.tar -O - -nv
</code>
</div>
</div>
<div class="col-md-6">
<h3>Transfer pound logs</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># grep syslog for pound and transfer</span>
<br/>$ cat /var/log/syslog|grep pound|curl --upload-file - https://transfer.sh/pound.log
</code>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Send us your awesome example</h3>

View file

@ -11,6 +11,9 @@ $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.
Download & decrypt:
$ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
Grep pound from syslog and transfer
cat /var/log/syslog|grep pound|curl --upload-file - https://transfer.sh/pound.log
Using Keybase:
# import keys from keybase
$ keybase track [them]
@ -30,24 +33,8 @@ $ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/scan
Add alias to .bashrc or .zshrc:
===
transfer() {
if [ $# -eq 0 ]; then
echo "No arguments specified. Usage:"
echo "$ transfer /tmp/test.md"
echo "$ cat /tmp/test.md | transfer test.md"
return 1
fi
# write to output to tmpfile because of progress bar
tmpfile=$( mktemp -t transferXXX );
if tty -s; then
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
else
curl --progress-bar --upload-file "-" "https://transfer.sh/$1"
fi
cat $tmpfile; rm -f $tmpfile;
if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1"; fi; cat $tmpfile; rm -f $tmpfile; }; alias transfer=transfer
}
alias transfer=transfer

View file

@ -263,6 +263,19 @@ include "includes/head.html"
</code>
</div>
</div>
<div class="col-md-6">
<h3>Transfer pound logs</h3>
<div class="terminal-top">
</div>
<div class="terminal">
<code>
<span class="code-title"># grep syslog for pound and transfer</span>
<br/>$ cat /var/log/syslog|grep pound|curl --upload-file - https://transfer.sh/pound.log
</code>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>Send us your awesome example</h3>
<div class="terminal-top">

View file

@ -11,6 +11,9 @@ $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.
Download & decrypt:
$ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
Grep pound from syslog and transfer
cat /var/log/syslog|grep pound|curl --upload-file - https://transfer.sh/pound.log
Using Keybase:
# import keys from keybase
$ keybase track [them]