6 ms·
Here's my small webserver: #!/bin/bash while : ; do cat conference.txt | nc -l 80; done Here's the story behind it: https://www.go350.com/posts/find
by _wldu 5y ago
Here's my small webserver:
#!/bin/bash
while : ; do cat conference.txt | nc -l 80; done
Here's the story behind it:
https://www.go350.com/posts/finding-a-hacked-server/ https://www.go350.com/posts/finding-a-hacked-server/
- Tepix 5y agoI liked the story and the impromptu web server! Two comments: - using "ping -a" creates an audible ping so you can find the server if you're by yourself without having to look at the screen. - No need for cat: while :; do nc -l 80 < conference.txt; done
- vincnetas 5y agoTIL. thanx for -a.
- _wldu 5y agoInteresting. I don't hear anything when I use the -a flag.
- thanatos519 5y agoLet's check with "reveal codes": $ ping -a 127.0.0.1 | less PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.029 ms^G 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.023 ms^G Looks like you need a terminal that has a BEL sound.
- vesinisa 5y agoIt just echoes a Bell character to your terminal. Make sure your terminal emulator supports it, and is configured properly: https://en.wikipedia.org/wiki/Bell_character https://en.wikipedia.org/wiki/Bell_character
- rzzzt 5y agoWindows Terminal shows a "visual bell" in the tab bar whenever BEL is emitted (even though I have it set to "audible" in advanced settings of the profile, hmm). Edit: Uhm, right. I have also silenced all system sounds in Windows.
- dormento 5y agoWhoa, nifty. Why does firefox shows the "chose an application to open this link" when you access the http://localhost http://localhost link, but shows the content correctly when you access the 127.0.0.1/0.0.0.0 ip-based version?
- hericium 5y agoBrowser expects to see some HTTP headers before the content. Adding HTTP version with response code, content type declaration and empty line dividing headers and content should do the trick: HTTP/1.1 200 Content-Type: text/plan; 1st line of content
- deleted 5y ago[deleted]
- laputan_machine 5y agoI could read stories like this forever, they are educational and engrossing, thanks for sharing
- tessierashpool 5y agofor a more complete solution, check out Bash On Balls, a Rails clone written in bash: https://github.com/jneen/balls https://github.com/jneen/balls
- deleted 5y ago[deleted]