brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

tips

~/tips/curl
All tips

71 tips Curl

One command, setting or habit at a time about Curl: what it does, the line to copy and a caveat or two.

Downloads 17

Requests 13

Access and security 11

Scripting 7

Headers and timing 6

Network and DNS 6

  • Check that a site answers on both address families, not just the one your machine prefers.

    curl -4 -s -o /dev/null -w '%{remote_ip} %{http_code}\n' https://example.com/
  • Send both the request and the name lookup through a SOCKS proxy, so DNS does not leak.

    curl -x socks5h://localhost:1080 https://intranet.example.com/
  • Let one curl command resolve names through a DoH server instead of the system resolver.

    curl --doh-url https://dns.quad9.net/dns-query \
  • Shows the negotiated HTTP version and lets you force an older one for comparison.

    curl -sI --http2 -o /dev/null -w '%{http_version}\n' https://example.com/
  • Forces a request to leave through a specific interface or source address.

    curl --interface wg0 -s -o /dev/null -w '%{local_ip}\n' https://example.com/
  • Requests compressed content and shows from the headers whether the server provides it.

    curl -s --compressed -D - -o /dev/null https://example.com/ | grep -i '^content-encoding'

Safe scripts 5

Protocols and network 2

Prowlarr and indexers 2

  • Read Prowlarr's health checks and disabled indexers from a script, with the API key in a header.

    curl -fsS -H "X-Api-Key: $KEY" http://localhost:9696/api/v1/health | jq -r '.[] | "\(.type): \(.message)"'
  • Queries one Prowlarr indexer directly as a Torznab or Newznab feed with curl.

    curl "http://192.168.1.x:9696/11/api?t=caps&apikey=YOUR_API_KEY"

Web development 2