From 896579efee13a07d42f227eb883bea7a7656a010 Mon Sep 17 00:00:00 2001 From: Remco Date: Fri, 14 Nov 2014 11:14:07 +0100 Subject: [PATCH] updated text alias sample, changed sed regex to ._- from .-_ to prevent range. --- transfersh-server/static/index.html | 4 +++- transfersh-server/static/index.txt | 8 ++++---- transfersh-web/index.html | 4 +++- transfersh-web/index.txt | 11 +++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/transfersh-server/static/index.html b/transfersh-server/static/index.html index 7e556dd..208c41f 100644 --- a/transfersh-server/static/index.html +++ b/transfersh-server/static/index.html @@ -173,7 +173,9 @@ # Add this to .bashrc or its equivalent
transfer() {
# write to output to tmpfile because of progress bar -
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; +
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 diff --git a/transfersh-server/static/index.txt b/transfersh-server/static/index.txt index eaafee8..7e0465c 100644 --- a/transfersh-server/static/index.txt +++ b/transfersh-server/static/index.txt @@ -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 diff --git a/transfersh-web/index.html b/transfersh-web/index.html index bb763e7..92f836e 100644 --- a/transfersh-web/index.html +++ b/transfersh-web/index.html @@ -147,7 +147,9 @@ include "includes/head.html" # Add this to .bashrc or its equivalent
transfer() {
# write to output to tmpfile because of progress bar -
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; +
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 diff --git a/transfersh-web/index.txt b/transfersh-web/index.txt index eaafee8..c8a16b7 100644 --- a/transfersh-web/index.txt +++ b/transfersh-web/index.txt @@ -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