Skip to content

Instantly share code, notes, and snippets.

@AaronJackson
Created June 9, 2013 13:56
Show Gist options
  • Save AaronJackson/5743647 to your computer and use it in GitHub Desktop.
Save AaronJackson/5743647 to your computer and use it in GitHub Desktop.
Simple shell function for quickly pushing a file to a web server. Link is copied into pasteboard for your convenience. :)
function pushfile
{
extension="${1##*.}"
newname=`md5 ${1} | awk '{print $4}'`'.'$extension
cp ${1} $newname
scp $newname root@serveraddress.co.uk:/var/www/blahblahblah/p/
rm -f $newname
echo 'http://serveraddress.co.uk/p/'$newname
echo 'http://serveraddress.co.uk/p/'$newname | pbcopy
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment