Skip to content

Instantly share code, notes, and snippets.

@martin-v
Last active August 29, 2015 13:56
Show Gist options
  • Save martin-v/9056008 to your computer and use it in GitHub Desktop.
Save martin-v/9056008 to your computer and use it in GitHub Desktop.
#!/usr/bin/sh
#
# Simpel shell snippet to share files
function httpShare() {
echo "link: http://`hostname`:8080/$1";
{
echo -e "HTTP/1.1 200 OK\r\nContent-Type: `file -b -i $1`\r\n\r\n";
cat $1;
} | nc -l 8080;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment