Skip to content

Instantly share code, notes, and snippets.

@sorz
Last active Mar 26, 2018
Embed
What would you like to do?
`curl sorz.org`
-oooooooooooo- -::::::::::::::::::::-
.---------. oMMMMMMMMMMMM+ dMMMMMMMMMMMMMMMMMMMMM.
.NMMMMMMMMMN` oMMN:...-yMMM: /+++++++++++++yMMMo+++`
.NMMhyyydMMN` oMMN. `mMMd /MMN`
.NMM/ oMMN` oMMN. +MMN: /MMN`
.NMM/ oMMN` oMMN. `dMMs /MMN`
.NMM/ oMMN` oMMN. /MMN. -hhhhhhhhhh/ /MMN`
.NMM/ oMMN` oMMN. dMMo :MMMNmmmNMMs /MMN`
.NMM/ oMMN` oMMN. +MMN. :MMN.```yMMs /MMN`
.NMM/ oMMN` oMMN.`NMMy :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. +NMMo :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. :NMM+ :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. /NMN+ :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. yMMm` :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. -MMM/ :MMN. yMMs /MMN`
.NMM/ oMMN` oMMN. `NMMs :MMMysssmMMs /MMN`
.NMM/ oMMN` oMMN. `NMMs :MMMMMMMMMMs /MMN`
.NMMMMMMMMMN` oMMN. +MMMo :MMN:......` /MMN`
.NMMmhhhmMMN` oMMNyhhhmMMMm. :MMN. /MMN`
.NMM/ oMMN` oMMN/MMMMMmo. `::: /MMN`
`sys- `--- oMMN.....` /MMN`
oMMN. +MMN`
oMMN. `soo++/+yNMMd
oMMN. `dMMMMMMMMMh.
oNNm. :+++++++/.
#!/bin/bash
read request
while true; do
read header
[ "$header" == $'\r' ] && break;
done
printf "HTTP/1.0 200 OK\r\n"
printf "Server: lolcat-ah\r\n"
printf "Content-Type: text/plain; charset=utf-8\r\n"
printf "\r\n"
/usr/bin/lolcat -f ah.plain.txt
[Unit]
Description=Listen on http and return `lolcat ah.txt`
[Socket]
ListenStream=127.0.0.80:8000
Accept=true
MaxConnections=1
[Install]
WantedBy=sockets.target
[Unit]
Description=Write out lolcat ah
[Service]
Type=simple
User=nobody
Group=nobody
WorkingDirectory=/opt/lolcat-ah/
ExecStart=/opt/lolcat-ah/ah.sh
StandardInput=socket
StandardOutput=socket
PrivateDevices=True
ProtectSystem=strict
ProtectHome=True
NoNewPrivileges=True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment