Using CheatSheets To Apply Best Practices

Cheatsheet: Linux Networking

Cheatsheet: Linux Networking

1.1 Linux Networking

Name Comment
Examine network nic traffic ethtool -S eth0
Check system configuration sysctl -a
Ports for well-known services cat /etc/services
Reference SSH CheatSheet, Tcpdump CheatSheet, CheatSheet: Curl & Wget
Reference CheatSheet: Linux File, CheatSheet: Linux Process, CheatSheet: Linux Networking

1.2 HTTP

Name Command
See HTTP request statistics httpstat (brew install httpstat)
Monitor HTTP URLs SaaS:
Examine web page performance SaaS:
Test webpage from different browsers SaaS:
Export local http service to Internet SaaS:
Reference CheatSheet: Curl & Wget, GitHub: free-for-dev

1.3 TCP

Name Comment
List all listening tcp ports netstat -tunlp
Port scan for a given host sudo nmap -O, SaaS:
Add 97ms latency to eth0 Link: tc, tc qdisc add dev eth0 root netem delay 97ms
Check tc status tc -s qdisc
Remove tc rule tc qdisc del dev eth0 root netem
Check network speed SaaS:
Tcp manual man 7 tcp
Reference Tcpdump CheatSheet

1.4 Route

Name Comment
List route rules route -n, netstat -nr
Add default rule route add default gw netmask dev eth0
Add route rule route add -net gw netmask dev eth0
Del route rule route del -net netmask dev eth1

1.5 DNS

Name Comment
Check dns naming sudo nslookup
Print routing table netstat -rn
List all the router hops traceroute
DNS lookup utility host
DNS pin test SaaS:
Websites To Register DNS Link: Google Domain DNS, Link: GoDaddy, Link: Amazon Route 53

1.6 CDN

Name Command
CDN services cloudflare, jsDelivr

1.7 TCP sockets workflow

Name Comment
create a new anonymous socket s = socket(<parameters>)
Bind tcp port to a socket bind(s, <local IP:port>)
Create a socket to remote endpoint connect(s, <remote IP:port>)
Create local socket and make it eligible to take requests listen(s, ...)
Accept client requests s2 = accept(s)
Read n bytes from a socket n = read(s, buffer, n)
Write n bytes to a socket n = write(s, buffer, n)
Close a socket close(s)
Shutdown stdin and stdout/stderr for a socket shutdown(s, <side>)
Read socket options getsockopt(s, ..)
Change socket options setsockopt(s, ..)

1.8 More Resources

Leave a Reply

Your email address will not be published. Required fields are marked *