Created
January 29, 2021 20:29
-
-
Save thunderpoot/ceefd8c90b6eac7d86d0a16040db671f to your computer and use it in GitHub Desktop.
a small telnet gif server using gif-for-cli and netcat
This file contains hidden or 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 | |
if [ $# -eq 0 ] | |
then | |
echo "%usage: $0 <id> [options]" | |
exit | |
fi | |
echo "[$0] 🌶 Now servin' up hot GIFs!" | |
trap ctrl_c INT | |
function ctrl_c() { | |
echo "[$0] ** Terminating **" | |
exit | |
} | |
while true; do | |
gif-for-cli $2 --rows 20 --cols 80 $1 -l 4 2> /dev/null | sudo nc -l -p 23 -q 1 -v | |
MYCOUNT=$(expr $MYCOUNT + 1) | |
echo "[$0] 🌄 served $MYCOUNT gif(s)" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I hope it's obvious to people that
sudo nc -l -p 23 -q 1 -v
is only a sudo command because of the default telnet port usage;you can run this without root privs (and probably should anyway if you don't know what it's doing) by changing that line to
...or something.