Networking & Security¶
Debug APIs, manage SSH, inspect certificates, probe networks.
curl — Modern Patterns¶
POST JSON (the --json flag sets Content-Type and method automatically):
Measure request timing:
curl -o /dev/null -s -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTotal: %{time_total}s\n" https://example.com
Follow redirects and show response headers:
Download with retry and resume:
httpie — Human-Friendly HTTP¶
GET request with automatic formatting:
POST with JSON body:
Send with a bearer token:
Install:
brew install httpie·pip install httpie
SSH¶
Config File (~/.ssh/config)¶
Host myserver
HostName 192.168.1.100
User deploy
IdentityFile ~/.ssh/id_ed25519
Port 22
Host jump
HostName bastion.example.com
User admin
Host internal
HostName 10.0.0.5
ProxyJump jump
Generate an Ed25519 key:¶
Start the agent and add your key:¶
Copy public key to a server:¶
Port forwarding (local):¶
Access remote port 5432 at localhost:5432:
Tunnel through a jump host:¶
OpenSSL — Certificate Inspection¶
View a remote server's TLS certificate:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -text
Check certificate expiration:
Inspect a local certificate file:
Verify a certificate chain:
DNS¶
Lookup DNS records with dig:
Trace DNS resolution path:
dog (modern DNS client)¶
Install:
brew install dog
Network Debugging¶
Which process is using a port:
Test TCP connectivity:
Scan open ports on a host:
Note
Only scan hosts you own or have explicit permission to test.