One Liner: A cool one line command

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
Change the cvs server from one machine to another
find . -name Root -print -exec perl -pi -e 's|oldserver.geek-of-all-work.com|newserver.geek-of-all-work.com|g' {} \;

Change the cvs user from on to another
find . -name Root -exec perl -pi -e 's|olduser|newuser|g' {} \;

Add an IP address, FreeBSD style:

ifconfig fxp0 inet 192.168.1.222 netmask 255.255.255.255 alias

(in rc.conf …   ifconfig_fxp0_alias0=”inet 192.168.1.222 netmask 255.255.255.255″ )

Remove one…

ifconfig fxp0 inet 192.168.1.197 -alias