Posts

Google Wifi and Verizon FiOS

Image
There are a bunch of articles spread around the internet about how to best use Google Wifi and Verizon FiOS together. The concepts are really applicable to any case where you want to replace the Verizon FiOS router with your own, while still retaining full TV functionality (Guide, On-Demand, Remote DVR access, On-Screen Caller ID, etc). My experience drew heavily from several sources, including http://www.dslreports.com/faq/16077 , https://robotpoweredhome.com/google-nest-wifi-verizon-fios/ , and https://www.arhea.net/posts/2020-01-012-fios-own-router.html . My ultimate goal was to completely remove the Verizon FiOS router (in my case, a G1100), while retaining full functionality. The gist of what my setup looks like is below: The components involved here are: FiOS ONT (Optical Network Terminal) Google Wifi Points Any unmanaged 10/100/1000 Ethernet Switch (you decide how many ports you need) MOCA Bridge (Actiontec WCB3000) FiOS TV One DVR (Arris VMS4100) FiOS TV Set Top Boxes (Arris

journalctl Notes

Show logs since a specific time journalctl --since yesterday journalctl --since "1 hour ago" journalctl --since "2020-09-03 12:34" Show logs for a specific systemd unit journalctl -u haproxy.service Show logs for several units together journalctl -u varnish.service -u hitch.service --since today Show logs by executable journalctl /usr/bin/bash Display kernel messages journalctl -k Output journal entires as JSON journalctl -b -u nobody -o json or formatted JSON journalctl -b -u nobody -o json-pretty Supported output formats: cat : Only the message field export : Binary format for backup or transfer json : One-line per entry standard JSON json-pretty : Human readable JSON json-sse : Server-sent event compatible JSON short : Default syslog style output short-iso : Default with ISO 8601 timestamps ( YYYY-MM-DDTHH:mm:SS+TZ ) short-monotonic : Default with monotonic timestamps since boot ( [ 1.817288] ) short-precise : Default with microsecond precision timestamps (

awk One-Liners

(This is a work in progress) Get the average of a column ls -l | grep -v total | awk -F' ' '{sum += $5 } END { print "AVG=", sum/NR }' Print a file with line numbers awk '{ print FNR "\t" $0 }' file Print number of lines in a file (analogous to wc -l ) awk 'END { print NR }'

Find the process listening on a port

Using netstat PORT=80; sudo netstat -ltnp | grep ":${PORT}" Using lsof PORT=80; sudo lsof -i :${PORT}

Show connections per destination for a specific port

PORT=5432; netstat -an |grep ":${PORT} " | \ awk '{count[$5]++} END {for (host in count) print host, count[host]}' To view the same over time: PORT=5432; watch "netstat -an |grep \":${PORT} \" | \ awk '{count[\$5]++} END {for (host in count) print host, count[host]}'"

Find deleted files that have open file handles

If you have unexplained disk usage that isn't reflected in du output, you most likely have a process holding onto a filehandle for a file that has since been deleted. You can use lsof to find the process/file by running: lsof -nP | grep '(deleted)'

Clearing IPTables rules

Occasionally I find it necessary to quickly clear out all the IPTables rules without accidentally losing access to the machine. I've found the below commands to be the quickest way to accomplish that goal (substitute ip6tables if you live in an IPv6 world) iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -t nat -F iptables -t mangle -F iptables -F iptables -X You can confirm afterward by running iptables -nvL , which should produce output similar to: Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination