Monday, November 15, 2010

Windows batch script as CVS commit trigger

Windows batch script, as a commit trigger, to prevent check ins for a CVS branch.

@@echo off
if exist CVS\tag (set /p TAG=<CVS\tag) else (set TAG=THEAD)
if ["%TAG%"] equ ["T%1"] (echo Cannot commit to %1 branch. && exit 1)
exit 0

Friday, November 12, 2010

Apache Rewrite Rule for outage notification.

Apache rewrite rule to redirect all application specific URLs to an outage page during maintenance. Make sure that modules/mod_rewrite.so module is loaded and turned on.

...
RewriteEngine On
...

Also make sure that this rule is ahead of any other rules in the conf file.
...
RewriteRule (^/context.*$|^/cxt2.*$) /outage/reason.html [R,L]
....
 
R - to send HTTP redirection.
L - this is the last rule to be evaluated.