openssl commands to check certificate, request and private key

  • Check a certificate: Check a certificate and return information about it (signing authority, expiration date, etc.):
    openssl x509 -text -noout -in server.crt
  • Check a key: Check the SSL key and verify the consistency:
    openssl rsa -check -in server.key
  • Check a CSR: Verify the CSR and print CSR data filled in when generating the CSR:
    openssl req -text -noout -verify -in server.csr
  • Verify a certificate and key matches: These two commands print out md5 checksums of the certificate and key; the checksums can be compared to verify that the certificate and key match.
    openssl x509 -noout -modulus -in server.crt| openssl md5
    openssl rsa -noout -modulus -in server.key| openssl md5

Shell scripting: get total file sizes of a directory

find . -type f -exec du -ch {} + | grep total$
find . -type f -name '*.java' -exec du -ch {} + | grep total$
find . -type f -name '*.pdf' -exec du -ch {} + | grep total$

Eclipse Debug Arguments: double dashes are replaced by single long dash automatically. How to disable smart dashes substitution?

On Eclipse Oxygen, when input double dash -- into "Arguments" of "Debug Configurations...", It substitutes double dash -- with single long dash —
It is really annoying. You cannot even input the correct arguments. The only way to make it work is to disable "Smart Dashes" See below:

  • Right click the Arguments area to open the context menu
  • Select "Substitutions" then uncheck "Smart Dashes"
  • Now you should be able to input double dashes