Skip to content

Instantly share code, notes, and snippets.

@brunojppb
Created October 24, 2020 16:50
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 brunojppb/e01a02ba166454d9dfdcdf22ccebb1fc to your computer and use it in GitHub Desktop.
Save brunojppb/e01a02ba166454d9dfdcdf22ccebb1fc to your computer and use it in GitHub Desktop.
A collection of useful Bash commands used often

Useful Bash Commands

Check SSL certificate information

curl --insecure -vvI https://www.google.com 2>&1 | \
     awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'

# The output will be something like this:
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=www.google.com
*  start date: Oct  6 06:41:20 2020 GMT
*  expire date: Dec 29 06:41:20 2020 GMT
*  issuer: C=US; O=Google Trust Services; CN=GTS CA 1O1
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fa5d100be00)
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
* Connection #0 to host www.google.com left intact
* Closing connection 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment