Skip to content

Instantly share code, notes, and snippets.

View lijikun's full-sized avatar
🍋
Dilettante

Jikun Li lijikun

🍋
Dilettante
View GitHub Profile
@marcellodesales
marcellodesales / formatted.sh
Last active November 14, 2023 19:22
One-liner REST server using netcat - nc
rm -f out
mkfifo out
trap "rm -f out" EXIT
while true
do
cat out | nc -w1 -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
export REQUEST=
while read line
do
line=$(echo "$line" | tr -d '[\r\n]')