Skip to content

Instantly share code, notes, and snippets.

@samqi
Created May 3, 2018 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samqi/fbb50f2463752c42f462e33d33c5b568 to your computer and use it in GitHub Desktop.
Save samqi/fbb50f2463752c42f462e33d33c5b568 to your computer and use it in GitHub Desktop.
curL-ly magic
#check curl connection speed: https://coderwall.com/p/lwpszg/measuring-download-speed-from-the-command-line-with-curl
curl -Lo /dev/null -skw "\ntime_connect: %{time_connect}s\ntime_namelookup: %{time_namelookup}s\ntime_pretransfer: %{time_pretransfer}\ntime_starttransfer: %{time_starttransfer}s\ntime_redirect: %{time_redirect}s\ntime_total: %{time_total}s\n\n" http://foolproofcode.com
#example result:
#time_connect: 0.074s
#time_namelookup: 0.063s
#time_pretransfer: 0.103
#time_starttransfer: 0.278s
#time_redirect: 0.067s
#time_total: 0.346s
@samqi
Copy link
Author

samqi commented Sep 24, 2019

check HTTP code from https://gist.github.com/drobune/e03d64ef7ba02864781a and https://superuser.com/questions/272265/getting-curl-to-output-http-status-code
curl -o /dev/null -w '%{http_code}\n' -s -LI http://www.google.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment