Skip to content

Instantly share code, notes, and snippets.

@ramn
Created November 26, 2011 22:54
Show Gist options
  • Save ramn/1396449 to your computer and use it in GitHub Desktop.
Save ramn/1396449 to your computer and use it in GitHub Desktop.
Netcat HTTP server in one line
while true; do nc -l 8989 < <(FILE=my_image.gif; echo -e "HTTP/1.1 200 OK\nContent-type: $(file -nb --mime-type $FILE)\n"; cat $FILE); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment