GNU/screen copy/paste

2010-01-24

Posted by Benjamin Owens under Sysadmin Notes

GNU screen comes with it's own copy & paste system that can be extremely handy when you are limited to a console: Control-o [ enters the region select mode, then Control-O ] will paste it again.

Create PEM file

2010-01-24

Posted by Benjamin Owens under Sysadmin Notes

If you have the key, certificate, and intermediary certificate for an SSL site but your software only takes a PEM file, you can create it easily:

cat key crt intermediary >> pem

Strip password from ssl key

2010-01-24

Posted by Benjamin Owens under Sysadmin Notes

To strip a password from an SSL key with openssl, just do

openssl rsa -in key-file-with-pass -out key-file-without-pass

New phone number

2007-03-13

Posted by Benjamin Owens under Personal

My previous phone has stopped working: it won't answer calls. T-Mobile wouldn't let me keep my previous number, so the shiny new number is 1.805.264.7967.

Create a reverse proxy with apache

2007-03-13

by Benjamin Owens under Sysadmin Notes

<VirtualHost ip:80>
    ServerName hostname        
    ProxyPass        / http://somewhere/ retry=1
    ProxyPassReverse / http://somewhere/        
    DocumentRoot     /                          
</VirtualHost>

Use netcat/telnet over SSL

2007-03-13

Posted by Benjamin Owens under Sysadmin Notes

telnet and netcat are fine networking tools, but they don't themselves handle SSL: but that's okay, because openssl will do it for them.

openssl s_client -connect site:port

Tunnel ports over SSH

2007-03-13

Posted by Benjamin Owens under Sysadmin Notes

Simple enough: with this any connections to (localport) on localhost are routed off to (remoteport) on (remotehost).

ssh -2 -N -f -l localport:localhost:remoteport remotehost

Use mod_rewrite to re-direct traffic from www.*

2007-03-13

Posted by Benjamin Owens under Sysadmin Notes

This is normally done for SEO. In most situations a site is example.org with an alias of www.example.org (or vice versa) : they're the same site with the same IP. Some people believe that it helps your SEO if one is directed to the other and so you only have one site.

RewriteCond %{HTTP_HOST} ^www.example.org$ [NC]
RewriteRule ^(.*)$ http://example.org$1 [L,R]