Skip to content

Instantly share code, notes, and snippets.

@jonahbron
Created July 15, 2014 01:16
Show Gist options
  • Save jonahbron/0c27f046ce46bc5bd766 to your computer and use it in GitHub Desktop.
Save jonahbron/0c27f046ce46bc5bd766 to your computer and use it in GitHub Desktop.
Single file server
serve_file=$1
ip_addr=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo "$ip_addr:8000"
while true ; do nc -l 8000 < "$serve_file" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment