Skip to content

Instantly share code, notes, and snippets.

@nijotz
Last active August 29, 2015 14:01
Show Gist options
  • Save nijotz/1b541b07e7c5f34dc4f1 to your computer and use it in GitHub Desktop.
Save nijotz/1b541b07e7c5f34dc4f1 to your computer and use it in GitHub Desktop.
omg what have I done
while true; do echo -e '<html><body>' $(grep server_name /etc/nginx/sites-enabled/* | sed -e 's/.*server_name //' -e 's/localhost *//' -e 's/ /\n/g' -e 's/;$//' | sed -re 's_^(.*)$_<a href="http://\1">\1<a/>_') '</body></html>' > index.html; python -m SimpleHTTPServer 9999 & sleep 1; curl -i localhost:9999 > index_headers.html 2>/dev/null; kill %1; cat index_headers.html | netcat -l 8080; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment