A variant of shinatra.sh that serves the current version of a file (f is for file).
Usage: f.shinatra.sh somefile.html [port] [filter]
- Default port is
8080
- Default filter is
unix2dos
(see edge effect example below)
Examples:
A variant of shinatra.sh that serves the current version of a file (f is for file).
Usage: f.shinatra.sh somefile.html [port] [filter]
8080
unix2dos
(see edge effect example below)Examples:
#!/bin/bash | |
while { echo -en "HTTP/1.1 200 OK\r\nConnection: keep-alive\r\n\r\n$(${3:-unix2dos} < "$1")"; } | nc -l ${2:-8080}; do | |
echo "================================================" | |
done |
#!/bin/sh | |
echo "<html><head><title>jpg2html</title><meta http-equiv=\"refresh\" content=\"1\"></head><body><img style=\"width:100%; height:auto; margin:auto\" src=\"data:image/jpg;base64,$( jpegtopnm | ppmrelief | ppmbrighten -v 100 | pnminvert | pnmtojpeg | base64 )\"></body></html>" |