Created
June 18, 2020 22:38
-
-
Save MasterQ32/19b7f15d9361dda1e3a6e611b0c97a77 to your computer and use it in GitHub Desktop.
Mini Gemini Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
encodings="UTF-8 UTF-16LE UTF-16BE UTF-32LE UTF-32BE WINDOWS-1252 TCVN-5712 CP437 EBCDICATDE" | |
for enc in ${encodings,,}; do | |
echo -ne "20 text/plain charset=${enc}\r\n" > ${enc,,}.txt | |
echo -e "Serving content as ${enc}\n" | iconv -f "UTF-8" -t "${enc}" >> ${enc,,}.txt | |
iconv -f "UTF-8" -t "${enc}//TRANSLIT" ground-truth.txt >> ${enc,,}.txt | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "listening..." | |
for f in "$@"; do | |
cat "$f" | ncat --ssl --ssl-cert ../cert.pem --ssl-key ../key.pem --listen 1965 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment