Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRadev/5e859befdfcb297d6bef to your computer and use it in GitHub Desktop.
Save AndrewRadev/5e859befdfcb297d6bef to your computer and use it in GitHub Desktop.
#! /bin/sh
set -e
if [ -z $1 ];
then
echo "USAGE: share-image <image>"
exit 1
fi
filename=$1
extension=${filename##*.}
checksum=`md5sum $filename | cut -d' ' -f1`
scp $filename andrewradev.com:/home/andrew/shared_images/$checksum.$extension
echo http://i.andrewradev.com/$checksum.$extension
@valo
Copy link

valo commented Sep 17, 2014

Nice! I should create one for me too :) BTW, you can use this to share basically anything

@mitio
Copy link

mitio commented Sep 17, 2014

I'd add a pbcopy there, since that's what you'd probably do. Do you have an equivalent of pbcopy on Linux?

@ndyakov
Copy link

ndyakov commented Sep 17, 2014

@mitio xclip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment