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 https://www.google.com (brew install httpstat)
Monitor HTTP URLs SaaS: uptimerobot.com
Examine web page performance SaaS: pingdom.com
Test webpage from different browsers SaaS: www.browserling.com
Export local http service to Internet SaaS: ngrok.com
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 192.168.1.103, SaaS: viewdns.info/portscan
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: www.att.com/speedtest
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 10.0.0.1 netmask 255.255.255.0 dev eth0
Add route rule route add -net 0.0.0.0 gw 192.168.1.1 netmask 0.0.0.0 dev eth0
Del route rule route del -net 192.168.3.0 netmask 255.255.255.0 dev eth1

1.5 DNS

Name Comment
Check dns naming sudo nslookup www.google.com
Print routing table netstat -rn
List all the router hops traceroute
DNS lookup utility host www.google.com
DNS pin test SaaS: viewdns.info
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 *