Chuck's Two Kilobytes Worth

Home Computing One-Liners Resume Chickens!?!

One-Liner: A one line command that does something cool on a computer

SSL and certs

Make an SSL key:

openssl genrsa -des3 -out pass.key 1024

To get a self signed crt:

openssl req -new -key server.key -x509 -out server.crt -days 999

To get a csr suitable for purchasing a real crt....

openssl req -new -key ssl.key/www.example.com.key -out www.example.com.csr

For cert for Postfix:

cd /usr/local/etc/ssl/; openssl req -new -x509 -nodes -out smtpd.pem -keyout smtpd.pem -days 3650

Check on the contents of a CSR

openssl req -noout -text -in www.example.com.csr

Check on the contents of a CRT

openssl x509 -noout -text -in server.crt

Networking and the like

Use s-client to connect to https server. Perhaps for peeking at the cert?

openssl s_client -connect remote.host:443

Use ngrep to watch traffic, but ignore jabber, mail and ssh:

sudo ngrep -t -d en1 -W byline '' not port 22 and not port 993 and not port 5222

Source Code and Revision Control

Get a list of files that are different between two directories. Ignore CVS files, Mac .DS files and CVS Id lines in files:

diff -I '\$Id.*\$' -x CVS -x .#* -x .DS* -rq dir1 dir2