mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-23 20:50:18 +01:00
updated text alias sample, changed sed regex to ._- from .-_ to prevent
range.
This commit is contained in:
parent
8b56d3bc15
commit
896579efee
4 changed files with 17 additions and 10 deletions
|
@ -173,7 +173,9 @@
|
||||||
<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() {
|
||||||
<br># write to output to tmpfile because of progress bar
|
<br># write to output to tmpfile because of progress bar
|
||||||
<br>tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9.-_]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; cat $tmpfile; rm -f $tmpfile;
|
<br>tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||||
|
<br/>curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
|
||||||
|
<br/>cat $tmpfile; rm -f $tmpfile;
|
||||||
<br/>}
|
<br/>}
|
||||||
<br/>
|
<br/>
|
||||||
<br/>alias transfer=transfer
|
<br/>alias transfer=transfer
|
||||||
|
|
|
@ -18,10 +18,10 @@ Add alias to .bashrc or .zshrc:
|
||||||
===
|
===
|
||||||
transfer() {
|
transfer() {
|
||||||
# write to output to tmpfile because of progress bar
|
# write to output to tmpfile because of progress bar
|
||||||
tmpfile=$( mktemp -t transfer )
|
tmpfile=$( mktemp -t transferXXX );
|
||||||
curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile;
|
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
|
||||||
cat $tmpfile;
|
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
|
||||||
rm -f $tmpfile;
|
cat $tmpfile; rm -f $tmpfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
alias transfer=transfer
|
alias transfer=transfer
|
||||||
|
|
|
@ -147,7 +147,9 @@ include "includes/head.html"
|
||||||
<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() {
|
||||||
<br># write to output to tmpfile because of progress bar
|
<br># write to output to tmpfile because of progress bar
|
||||||
<br>tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9.-_]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; cat $tmpfile; rm -f $tmpfile;
|
<br>tmpfile=$( mktemp -t transferXXX ); basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
|
||||||
|
<br/>curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile
|
||||||
|
<br/>cat $tmpfile; rm -f $tmpfile;
|
||||||
<br/>}
|
<br/>}
|
||||||
<br/>
|
<br/>
|
||||||
<br/>alias transfer=transfer
|
<br/>alias transfer=transfer
|
||||||
|
|
|
@ -14,14 +14,17 @@ $ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
|
||||||
Upload to virustotal:
|
Upload to virustotal:
|
||||||
$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal
|
$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal
|
||||||
|
|
||||||
|
Virusscan:
|
||||||
|
$ 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() {
|
||||||
# write to output to tmpfile because of progress bar
|
# write to output to tmpfile because of progress bar
|
||||||
tmpfile=$( mktemp -t transfer )
|
tmpfile=$( mktemp -t transferXXX );
|
||||||
curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile;
|
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
|
||||||
cat $tmpfile;
|
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile;
|
||||||
rm -f $tmpfile;
|
cat $tmpfile; rm -f $tmpfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
alias transfer=transfer
|
alias transfer=transfer
|
||||||
|
|
Loading…
Reference in a new issue