mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2025-01-12 11:50:18 +01:00
added pound example, builded static files
This commit is contained in:
parent
28b68b4d90
commit
91b8156f82
4 changed files with 52 additions and 46 deletions
|
@ -157,10 +157,10 @@
|
||||||
<code>
|
<code>
|
||||||
<span class="code-title"># Uploading is easy using curl</span>
|
<span class="code-title"># Uploading is easy using curl</span>
|
||||||
<br>$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
|
<br>$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt
|
||||||
<br>
|
<br>https://transfer.sh/66nb8/hello.txt
|
||||||
<br>
|
<br>
|
||||||
<span class="code-title"># Download the file</span>
|
<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>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -171,28 +171,7 @@
|
||||||
<div class="terminal">
|
<div class="terminal">
|
||||||
<code>
|
<code>
|
||||||
<span class="code-title"># Add this to .bashrc or its equivalent</span>
|
<span class="code-title"># Add this to .bashrc or its equivalent</span>
|
||||||
<br/>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/> 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/>
|
<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>
|
||||||
|
@ -298,6 +277,30 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<h3>Send us your awesome example</h3>
|
<h3>Send us your awesome example</h3>
|
||||||
|
|
|
@ -11,6 +11,9 @@ $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.
|
||||||
Download & decrypt:
|
Download & decrypt:
|
||||||
$ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
|
$ 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:
|
Using Keybase:
|
||||||
# import keys from keybase
|
# import keys from keybase
|
||||||
$ keybase track [them]
|
$ 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:
|
Add alias to .bashrc or .zshrc:
|
||||||
===
|
===
|
||||||
transfer() {
|
transfer() {
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
|
||||||
echo "No arguments specified. Usage:"
|
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
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
alias transfer=transfer
|
alias transfer=transfer
|
||||||
|
|
|
@ -263,6 +263,19 @@ include "includes/head.html"
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<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">
|
||||||
|
|
|
@ -11,6 +11,9 @@ $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.
|
||||||
Download & decrypt:
|
Download & decrypt:
|
||||||
$ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
|
$ 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:
|
Using Keybase:
|
||||||
# import keys from keybase
|
# import keys from keybase
|
||||||
$ keybase track [them]
|
$ keybase track [them]
|
||||||
|
|
Loading…
Reference in a new issue