Browse Source

updated text alias sample, changed sed regex to ._- from .-_ to prevent

range.
tags/v1.0.0
Remco 9 years ago
parent
commit
896579efee
4 changed files with 17 additions and 10 deletions
  1. +3
    -1
      transfersh-server/static/index.html
  2. +4
    -4
      transfersh-server/static/index.txt
  3. +3
    -1
      transfersh-web/index.html
  4. +7
    -4
      transfersh-web/index.txt

+ 3
- 1
transfersh-server/static/index.html View File

@@ -173,7 +173,9 @@
<span class="code-title"># Add this to .bashrc or its equivalent</span>
<br/>transfer() {
<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/>alias transfer=transfer


+ 4
- 4
transfersh-server/static/index.txt View File

@@ -18,10 +18,10 @@ Add alias to .bashrc or .zshrc:
===
transfer() {
# write to output to tmpfile because of progress bar
tmpfile=$( mktemp -t transfer )
curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile;
cat $tmpfile;
rm -f $tmpfile;
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;
}

alias transfer=transfer


+ 3
- 1
transfersh-web/index.html View File

@@ -147,7 +147,9 @@ include "includes/head.html"
<span class="code-title"># Add this to .bashrc or its equivalent</span>
<br/>transfer() {
<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/>alias transfer=transfer


+ 7
- 4
transfersh-web/index.txt View File

@@ -14,14 +14,17 @@ $ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
Upload to 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:
===
transfer() {
# write to output to tmpfile because of progress bar
tmpfile=$( mktemp -t transfer )
curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile;
cat $tmpfile;
rm -f $tmpfile;
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;
}

alias transfer=transfer


Loading…
Cancel
Save