Top Nav

Archive | General

Redirect Generator

Happened onto this “301 Redirect Generator” page today:

What’s notable is that it can generate PHP, ASP, ASP.Net, .htaccess, HTML meta tag and Javascript redirects. I used it to generate some redirects on a Windows server in ASP.Net.

Noted too is the lack of support for Web.config HTTP Redirects and Nginx.

Anybody know of a better tool for generating redirects?


Hosts File On Mac

Here’s a great little article on how to edit the hosts file on a Mac:


SSH session logging

Add the following line to /etc/profile to setup full logging of all ssh sessions:

script -q /var/log/sessions/ssh-date +%d-%M-%Y-%Hh-%Mm-%Sswhoami-$$.log && exit

Of course this is a security risk and violates user privacy.


Rename file via scripted FTP

Here’s an lftp script to rename a remote file vi FTP without downloading the file:


Content Sync For Load Balancer With Unison

This Unison program is great. It neatly handles syncing between two servers where changes are occurring on both sides. On one client site it takes about 30 seconds to compare/sync a 23GB /var/www/html/ structure with about 100 sites.

1) Install unison ( Requires “ocaml” compiler (, and needs the “etags” command from emacs (so “yum install emacs”, whatever)

2) Set up a “/root/.unison/profile-name.prf” file. See example pasted below. Comment out “batch=true” and “silent=true” for initial test runs. Uncomment them for running from a cron job.

3) Run manually to test: unison profile-name

4) If you leave the logging turned on, make an /etc/logrotate.d/unison file, something like this:

5) Set up cron job(s). Create multiple profiles if specific paths need more frequent syncing. With silent=true, the jobs should produce no output (silent=true automatically sets batch=true).

Sample profile (/root/.unison/profile-name.prf)