cat /var/log/message | perl -pe 's/ERROR/\e[1;31;43m$&\e[0m/g'
[+/-] |
colorful log via perl |
[+/-] |
proxy via iptables |
#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
proxy_host=x.x.x.x
proxy_port=8080
iptables -F
iptables -F -t nat
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.0/8 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 10.0.0.0/8 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 172.16.0.0/16 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 172.19.0.0/16 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination
"$proxy_host":"$proxy_port"