1. command line view remote ssl server cert

    Sometimes I want to view a server certificate without bringing up a browser.

    To view a server cert from the command line, something like the following works:

    openssl s_client -connect ${REMHOST}:${REMPORT}
    

    Reference: http://www.madboa.com/geek/openssl/#cert-retrieve

  2. Finding date given a date in the past, and a span, on the terminal.

    I was trying to find a given date increment, from a specific date in the past, with the date command on OS X via the command line. For the increment, I chose 60 days in this example, and for the start date, I chose Feb 1, 2009.

    >> date -j -v+60d -f "%Y-%m-%d" "2009-02-01"
    Thu Apr  2 11:55:44 PDT 2009