Skip to content

Instantly share code, notes, and snippets.

View sserrano44's full-sized avatar

sebastian serrano sserrano44

View GitHub Profile
@sserrano44
sserrano44 / transfercheck.sh
Last active June 2, 2018 16:48 — forked from cbanowsky/>> .bashrc
Virus check a file using the command line and VirusTotal. Append to .bashrc or .bash_profile depending on your system
transfercheck() {
if [ $# -eq 0 ];
then echo -e "No arguments specified. Usage:\n transfercheck /tmp/test.md\ncat /tmp/test.md | transfercheck test.md";
return 1;
fi
# write to output to tmpfile for progress bar
tmpfile=$( mktemp -t transferXXX)
if tty -s;
then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
curl -X PUT --progress-bar --upload-file $1 https://transfer.sh/$basefile/virustotal >> $tmpfile;