Last week Brett Terpstra came up with a simple bash function to push any file to your Public space and give back a TinyURL to that file on your clipboard. I cleaned it up a bit and thought it worthy of its own post.
Paste this function into an open Terminal window or add it to the end of /.profile. Make sure to substitute your_username with your Strongspace username.
function sshare () {
scp "$1" ss:/strongspace/your_username/public
url="https://www.strongspace.com/your_username/public/$1"
tiny=$(curl -s --data-urlencode "url=$url" http://tinyurl.com/api-create.php)
echo -n $tiny | pbcopy && echo $tiny
}
This function assumes you have a ssh alias named “ss” setup, but it’s not required. It also is more convenient with password-less ssh authentication.
Now run sshare some_filename to push and host any file off to Strongspace, e.g.
sshare "Ray LaMontagne - Beg Steal or Borrow.mp3"