Nice oneliners which may be useful to show some console output via HTTP.
An example of showing the iptables FORWARD chain:
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(sudo iptables -L FORWARD -vn --line-numbers)" | nc -l -p 8080 -q 1; done
Then go to http://ip.add.re.ss:8080 and you will see the output as a web page. In case of adding new rules renew the webpage and you will see the newly added rules.
To report file system disk space usage:
while true ; do echo -e "HTTP/1.1 200 OK\n\n $(df -h)" | nc -l -p 8080 -q 1; done
More info: https://www.linux-magazine.com/Issues/2021/250/Bash-Web-Server/(offset)/3/(tagID)/92#