user@computer $: netstat -an | awk ‘/^tcp/ {A[$(NF)]++} END {for (I in A) {printf “%5d %s\n”, A[I], I}}’
78 TIME_WAIT
3 CLOSE_WAIT
16 FIN_WAIT1
213 ESTABLISHED
1 SYN_RECV
1 LAST_ACK
15 LISTEN
Author Archives: chevava
making PTR records from bind zone files
This will make PTR records out of a bind zone file in one line:
cat domain_name.db | grep -e ^subdomain | tr -s ” ” | tr ‘ ‘ ‘ ‘ | awk -F’ ‘ ‘{print $4″ IN PTR “$1″.domain_name.com”}’| sed ‘s/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\(.*\)/\4.\3.\2\5/g’ >> db.172
Don’t forget to raise SOA serial and reload the zone.