<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>intuitive engineering</title>
	<atom:link href="http://dougmunsinger.com/feed" rel="self" type="application/rss+xml" />
	<link>http://dougmunsinger.com</link>
	<description>doug munsinger</description>
	<lastBuildDate>Fri, 13 Jan 2012 17:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ashley Lyn, you are loved and you are missed&#8230;</title>
		<link>http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html</link>
		<comments>http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html#comments</comments>
		<pubDate>Wed, 26 Jan 2011 21:37:27 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[daughter]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Ashley]]></category>
		<category><![CDATA[cancer]]></category>
		<category><![CDATA[love]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=813</guid>
		<description><![CDATA[Leaf at St. Joseph&#8217;s Hospital by Ashley Lyn Munsinger When Ashley was born, on a bright day in July, her nickname was immediately &#8220;Bug,&#8221; as in &#8220;cute as a bug.&#8221; I went in to watch her sleep in her crib almost every night after we brought her home. I watched her very small chest rise [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://damgoodespresso.com/wp-content/uploads/2011/01/leaf_st_jos.jpg" alt="leaf at st josephs by ashley lyn" /><br />
<em>Leaf at St. Joseph&#8217;s Hospital by Ashley Lyn Munsinger</em></p>
<p>When Ashley was born, on a bright day in July,<br />
her nickname was immediately &#8220;Bug,&#8221;<br />
as in &#8220;cute as a bug.&#8221;</p>
<p>I went in to watch her sleep in her crib almost every night after we brought her home.<br />
I watched her very small chest rise and fall.<br />
That was a miracle.</p>
<p>Having this child meant being completely vulnerable to the whims of the universe.</p>
<p>I cast hope out into the future.<br />
I get to watch over her and love her, forever.</p>
<p>When she was about three Ashley got quieter and quieter over several days.<br />
Her doctor said she had pneumonia<br />
and was hours from needing admittance to a hospital.</p>
<p>She got better.<br />
But she scared me.</p>
<p>She rode her bike without training wheels in Lake View Terrace, CA.<br />
She helped me build a coffee table in Boulder CO.<br />
She sledded down the hill with our dog Samantha at the house in Milford MA.</p>
<p>She was golden blonde,<br />
sunshine<br />
and warmth.</p>
<p>She faded the winter she spent in Massachusetts,<br />
so I sent her back to California.</p>
<p>Ashley traveled through Europe when she was fifteen.<br />
She determined that Corfu was her favorite place on the planet.<br />
She talked about that trip for years&#8230;</p>
<p>&#8220;When I was in France&#8230;&#8221;</p>
<p>Ashley studied International Business in New York City<br />
She found she hated it.<br />
She discovered space and color and form and balance and function.<br />
She studied Interior Design, and she found she loved it.</p>
<p>She got quiet once again, this time over several months.<br />
She was admitted to the hospital and we got word that she had leukemia.</p>
<p>By the time I got across the country from Boston to Los Angeles,<br />
Ashley was on a ventilator and could no longer speak or communicate directly.</p>
<p>All of us,<br />
all of you,<br />
family and friends,<br />
came together<br />
and somehow we got her through the worst two months ever.</p>
<p>At the lowest point in that February I was holding Ash&#8217;s hand,<br />
feeling the warmth of her still presence,<br />
accepting each moment as a gift.</p>
<p>That diagnosis<br />
and then that reality,<br />
cancer patient,<br />
Ash just accepted.</p>
<p>She looked ahead with true courage at each point in her journey<br />
and asked,<br />
&#8220;What next?&#8221;</p>
<p>Ashley knew she was dying that last week.<br />
She found<br />
the rare gift<br />
in that<br />
rather than the despair of it,<br />
that ending.</p>
<p>I tried to find everything I needed to say to her, as her dad, as someone responsible for her and to her.<br />
I came close enough.</p>
<p>She managed a death<br />
at peace<br />
and without despair or anxiety.<br />
Her passing on was with eyes wide open.<br />
She said &#8220;It&#8217;s over&#8230;&#8221;<br />
and she meant this life, this struggle.</p>
<p>And then she asked<br />
&#8220;What&#8217;s next?&#8221;<br />
and she went on.</p>
<p>An expansion of being, rather than in any way diminished.</p>
<p>This breath holds the spirit to the body.</p>
<p>And so it was.<br />
Ash let go<br />
and the breath stopped.</p>
<p><img title="Ashley Lyn at her birthday, age 24" src="http://damgoodespresso.com/wp-content/uploads/2011/01/ash_in_july_at_24.jpg" alt="ash at her birthday" /><br />
<em>July 2nd 1986 &#8211; 3rd January 2011</em></p>
<p>I will always miss her presence here.</p>
<p><img title="Koi Pond at St. Josephs by Ashley Lyn Munsinger" src="http://damgoodespresso.com/wp-content/uploads/2011/01/koi_pond_st_jo.jpg" alt="koi pond by Ashley Lyn" /><br />
<em>Koi Pond at St. Joseph&#8217;s Hospital by Ashley Lyn Munsinger</em></p>
<p><em><br />
</em></p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html&title=Ashley Lyn, you are loved and you are missed&#8230;" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html&title=Ashley Lyn, you are loved and you are missed&#8230;" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2011/01/ashley-lyn-you-are-loved-and-you-are-missed.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iphone alarm bug cost me 9 hours of time with my daughter before she died</title>
		<link>http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html</link>
		<comments>http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html#comments</comments>
		<pubDate>Thu, 13 Jan 2011 19:39:21 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[move]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=805</guid>
		<description><![CDATA[This is from an email I wrote to steve@apple.com: &#160; &#160; &#8230;she died January 3rd.&#160; &#160; My iphone HAD been a reliable alarm. &#160;I missed the daylight savings update debacle, at least for anything vital.&#160; I set a 3:30 AM and a 4 AM alarm for getting up to catch a 6:30 flight from Boston [...]]]></description>
			<content:encoded><![CDATA[<p>This is from an email I wrote to steve@apple.com:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<blockquote>
<p>&#8230;she died January 3rd.&nbsp;</p>
<p>&nbsp;</p>
<p>My iphone HAD been a reliable alarm. &nbsp;I missed the daylight savings update debacle, at least for anything vital.&nbsp;</p>
<p>I set a 3:30 AM and a 4 AM alarm for getting up to catch a 6:30 flight from Boston to Los Angeles on Sunday 2 January, which would have had me in LA at 10:30.&nbsp;</p>
<p>I woke at 5:19 AM, looked at my iphone (which showed both alarms set) in horror, raced to the airport and made it to the gate at 6:35. &nbsp;The plane was gone.&nbsp;</p>
<p>&nbsp;</p>
<p>The woman behind the counter at United at first said there were no more seats available on any plane to get to L.A. on January 2nd. &nbsp;</p>
<p>&nbsp;</p>
<p>After I explained that my daughter was terminal from Leukemia she found me a flight to Washington DC and then to LA.&nbsp;</p>
<p>I got to L.A. at 7:30 PM and spent from 8 &nbsp;to 11:30 with my daughter in the cancer ward on the fourth floor at Cedars-Sinai.&nbsp;</p>
<p>She died at 11:02 AM on January &nbsp;3rd. &nbsp; She was 24 and had battled leukemia for one week short of a year. &nbsp; We had been told by doctors that she had perhaps another couple of weeks, but it turned out that wasn&#39;t so.&nbsp;</p>
<p>&nbsp;</p>
<p>If I had listened to the woman behind the counter I would not have been there at my daughter&#39;s side. &nbsp;If your alarm had actually been fixed and functioned January 2nd, I would have had an additional 9 to 10 hours with my daughter on the last two days of her life.&nbsp;</p>
<p>&nbsp;</p>
<p>There&#39;s no way I can begin to count what the iphone bug managed to cost me. &nbsp;</p>
<p>But I thought you should know that it was not trivial, not a simple bug that has no impact. &nbsp;</p>
<div>&#8211;doug</div>
</blockquote>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html&title=iphone alarm bug cost me 9 hours of time with my daughter before she died" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html&title=iphone alarm bug cost me 9 hours of time with my daughter before she died" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2011/01/iphone-alarm-bug-cost-me-9-hours-of-time-with-my-daughter-before-she-died.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>compacting logs</title>
		<link>http://dougmunsinger.com/2010/06/compacting-logs.html</link>
		<comments>http://dougmunsinger.com/2010/06/compacting-logs.html#comments</comments>
		<pubDate>Mon, 07 Jun 2010 16:44:28 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[move3]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=796</guid>
		<description><![CDATA[I love good tools. &#160; &#160;I recently wrote a log zipping script specific to the environment I currently work in. &#160;We don&#39;t remove logs from the servers (yet &#8211; that will change, but has not so far). &#160;The partitions on which the logs live are quite large. &#160;The servers&#39; lifespan is short enough before rebuild [...]]]></description>
			<content:encoded><![CDATA[<p>I love good tools.</p>
<p>&nbsp;</p>
<p>&nbsp;I recently wrote a log zipping script specific to the environment I currently work in. &nbsp;We don&#39;t remove logs from the servers (yet &#8211; that will change, but has not so far). &nbsp;The partitions on which the logs live are quite large. &nbsp;The servers&#39; lifespan is short enough before rebuild or replace to make leaving logs in place possible. In many cases no compressing of logs is needed. &nbsp;On some servers the traffic and the application do create files that must be compressed to keep free space on the partition acceptable. &nbsp;</p>
<p>&nbsp;</p>
<p>We had an ad hoc script to do this in detail. &nbsp;The complexity in it was in trying to work around not touching live logs that a process was writing to, tweaking and tuning the regular expressions to miss those active files &nbsp;and still catch the ones wanted. &nbsp; Lots of hand work.&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre><code>

#! /bin/bash

###
### version: 20100414.01
### author:  dsm
###
### Note - &quot;rm -f $i &gt;&gt; $LOG 2&gt;&amp;1&quot; for deleting testing
###        log files is commented out in 2 places
###        to prevent mistake - uncomment if you really
###        want to delete files.  Until
###        uncommented, files that would have been deleted
###        will by logged but not actually
###        deleted from the filesystem...
###

### VARIABLES

# file to alter retention for individual servers
# create the file via something like
#   export MYHOST=`hostname -s`
#   echo &quot;3&quot; &gt; /etc/$MYHOST.AGE.CTCT_gzip_and_cleanup_logs
# This would change the AGE variable to &quot;3&quot;
# this resolves having different files to
# propagate for individual servers or losing the settings
# when a new version is copied out...

MYSELF=`hostname -s`
MYSELF_AGE_FILE=&quot;/etc/gzip/$MYSELF.AGE.gzip_and_cleanup_logs&quot;

DATE=`date +%y%m%d%H%M%S`
LOG=&quot;/var/logs/gzip_and_cleanup.${DATE}&quot;
date &gt; $LOG # initialize log
if [[ -f $MYSELF_AGE_FILE ]]; then
    AGE=`cat $MYSELF_AGE_FILE`
else
    AGE=7 # files must be older than $AGE days to be gzipped
fi
# debug
#echo &quot;age set to: $AGE&quot;

LSOF=&quot;/usr/sbin/lsof&quot;  #location of lsof binary...
if [[ -f $LSOF ]]; then
    echo &quot;found $LSOF, continuing...&quot; &gt;&gt; $LOG
else
    echo &quot;FAILED TO FIND LSOF AT:  $LSOF - EXITING&quot; &gt;&gt; $LOG
    echo &quot;this will have to be corrected before this script will run&quot; &gt;&gt; $LOG
    exit
fi

GZIP=&quot;/usr/bin/gzip&quot;
if [[ -f $GZIP ]]; then
    echo &quot;found $GZIP, continuing...&quot; &gt;&gt; $LOG
else
    echo &quot;FAILED TO FIND gzip AT:  $GZIP - EXITING&quot; &gt;&gt; $LOG
    echo &quot;this will have to be corrected before this script will run&quot; &gt;&gt; $LOG
    exit
fi

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TESTING=&quot;false&quot; # this enables the delele function
              # NOT TO BE ENABLED ON PRODUCTION MACHINES!
KEEP=30 # days to keep, older will be deleted if TESTING set to &quot;true&quot;
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

### MAIN

#
# If TESTING:  Delete logfiles older than $KEEP
#
if [[ $TESTING == &quot;true&quot; ]]; then
    export LOGDIR=/var/logs
    cd ${LOGDIR}
    date &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
    echo &quot;start $LOGDIR DELETE:  TESTING is $TESTING&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
    for i in `ls --color=no | grep -i log | egrep -v .gz$`
    do
        if [[ `find . -name ${i} -mtime +${KEEP}` ]]; then
    	    if [[ `$LSOF $i` ]]; then
	    	echo &quot;found $i older than $KEEP - but found to be opened by a process - NOT deleting&quot; &gt;&gt; $LOG
	    else
                echo &quot;found $i older than $KEEP:  deleting&quot; &gt;&gt; $LOG
                # rm -f $i &gt;&gt; $LOG 2&gt;&amp;1
	    fi
        else
            echo &quot;$i found to be newer than $KEEP:  keeping this file&quot; &gt;&gt; $LOG
        fi
    done
    export LOGDIR=/var/logs/http
    cd ${LOGDIR}
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
    echo &quot;start $LOGDIR DELETE:  TESTING is $TESTING&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
    for i in `ls --color=no | grep -i log | egrep -v .gz$`
    do
        if [[ `find . -name ${i} -mtime +${KEEP}` ]]; then
 	    if [[ `$LSOF $i` ]]; then
                echo &quot;found $i older than $KEEP - but found to be opened by a process - NOT deleting&quot; &gt;&gt; $LOG
            else
                echo &quot;found $i older than $KEEP:  deleting&quot; &gt;&gt; $LOG
                # rm -f $i &gt;&gt; $LOG 2&gt;&amp;1
	    fi
        else
            echo &quot;$i found to be newer than $KEEP:  keeping this file&quot; &gt;&gt; $LOG
        fi
    done
else
    echo &quot;TESTING set to false:  $TESTING:  NOT deleting any log files...&quot; &gt;&gt; $LOG
fi

#
# Begin cleanup with application server logs
#

export LOGDIR=/var/logs
cd ${LOGDIR} &gt;&gt; $LOG 2&gt;&amp;1
date &gt;&gt; $LOG
echo &quot;&quot; &gt;&gt; $LOG
echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
echo &quot;start $LOGDIR cleanup&quot; &gt;&gt; $LOG
echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
echo &quot;&quot; &gt;&gt; $LOG
for i in `ls --color=no | grep -i log | egrep -v .gz$`
do
    if [[ `$LSOF ${i}` ]]; then
        echo &quot;&quot; &gt;&gt; $LOG
	echo &quot;found $i OPEN - not handling&quot; &gt;&gt; $LOG
	echo &quot;&quot; &gt;&gt; $LOG
    else
        if [[ `find . -name ${i} -mtime +${AGE}` ]]; then
	    if [[ -f ${i}.gz ]]; then
	        echo &quot;found gzipped file of the same name:  ${i}.gz - not gzipping ${i}...&quot; &gt;&gt; $LOG
	    else
	        echo &quot;gzipping $i as it is older than $AGE...&quot; &gt;&gt; $LOG
	        $GZIP $i &gt;&gt; $LOG 2&gt;&amp;1
	    fi
	else
	    echo &quot;$i is not open but is newer than $AGE, so NOT being gzipped&quot; &gt;&gt; $LOG
        fi
    fi
done
echo &quot;completed cleanup of application logs...&quot; &gt;&gt; $LOG

#
# Continue cleanup with web server logs
#

export LOGDIR=/var/logs/http
if [[ -d $LOGDIR ]]; then # these may not exist on some apps...
    cd ${LOGDIR} &gt;&gt; $LOG 2&gt;&amp;1
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
    echo &quot;start $LOGDIR cleanup&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
    for i in `ls --color=no | grep -i log | egrep -v .gz$ | egrep -v error_log$ | egrep -v access_log$`
    do
        if [[ `$LSOF ${i}` ]]; then
	    echo &quot;&quot; &gt;&gt; $LOG
            echo &quot;found $i OPEN - not handling&quot; &gt;&gt; $LOG
	    echo &quot;&quot; &gt;&gt; $LOG
        else
	    if [[ `find . -name ${i} -mtime +${AGE}` ]]; then
		if [[ -f ${i}.gz ]]; then
	            echo &quot;found gzipped file of the same name:  ${i}.gz - not gzipping ${i}...&quot; &gt;&gt; $LOG
	        else
                    echo &quot;gzipping $i as it is older than $AGE...&quot; &gt;&gt; $LOG
                    $GZIP $i &gt;&gt; $LOG 2&gt;&amp;1
		fi
	    else
                echo &quot;$i is not open but is newer than $AGE, so NOT being gzipped&quot; &gt;&gt; $LOG
            fi
        fi
    done
    echo &quot;completed cleanup of apache logs...&quot; &gt;&gt; $LOG
else
    echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
    echo &quot;start $LOGDIR cleanup&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;??? failed to find $LOGDIR - PROBLEM???&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
fi

#
# Cleanup logs once processed...
#

# these logs are post-processing - no need to check for lsof and no need to retain unzipped...

export LOGDIR=/var/logs/app
if [[ -d $LOGDIR ]]; then
    cd ${LOGDIR} &gt;&gt; $LOG 2&gt;&amp;1
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot;&gt;&gt; $LOG
    echo &quot;start app $LOGDIR cleanup&quot; &gt;&gt; $LOG
    echo &quot;-----------------------------------&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
    for i in `ls --color=no | grep open0`
    do
	echo &quot;looking through $LOGDIR/${i}/processed...&quot; &gt;&gt; $LOG
        echo &quot;&quot; &gt;&gt; $LOG
        cd $LOGDIR/${i}/processed
        for j in `ls --color=no | egrep -v .gz$`
	do
	    if [[ -f ${j}.gz ]]; then
                echo &quot;found gzipped file of the same name:  ${j}.gz - not gzipping ${j}...&quot; &gt;&gt; $LOG
            else
                echo &quot;gzipping $j app log...&quot; &gt;&gt; $LOG
                    $GZIP $j &gt;&gt; $LOG 2&gt;&amp;1
            fi
	done
        echo &quot;COMPLETED $LOGDIR/${i}/processed...&quot; &gt;&gt; $LOG
	echo &quot;&quot; &gt;&gt; $LOG
    done
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;Processing ${LOGDIR}/processed app logs...&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
    cd ${LOGDIR}/processed
    for k in `ls --color=no | egrep -v .gz$`
    do
        if [[ -f ${k}.gz ]]; then
            echo &quot;found gzipped file of the same name:  ${k}.gz - not gzipping ${k}...&quot; &gt;&gt; $LOG
        else
            echo &quot;gzipping $k app log...&quot; &gt;&gt; $LOG
            $GZIP $k &gt;&gt; $LOG 2&gt;&amp;1
        fi
    done
    echo &quot;completed app logs cleanup...&quot; &gt;&gt; $LOG
else
    echo &quot;&quot; &gt;&gt; $LOG
    echo &quot;failed to find $LOGDIR - skipping cleanup of application logs...&quot; &gt;&gt; $LOG
    echo &quot;&quot; &gt;&gt; $LOG
fi 

#### Changelog ####
dsm - edited for broad issue

 </code></pre>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2010/06/compacting-logs.html&title=compacting logs" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2010/06/compacting-logs.html&title=compacting logs" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2010/06/compacting-logs.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2010/06/compacting-logs.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2010/06/compacting-logs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I miss my brother&#8230;</title>
		<link>http://dougmunsinger.com/2010/04/i-miss-my-brother.html</link>
		<comments>http://dougmunsinger.com/2010/04/i-miss-my-brother.html#comments</comments>
		<pubDate>Mon, 26 Apr 2010 19:28:47 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[move3]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Dennis]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=801</guid>
		<description><![CDATA[My brother Dennis, my youngest brother, the baby of the family for so long, died Saturday 24th April 2010, very suddenly.&#160; He had a huge loving heart, and leaves an overwhelming hole behind him.&#160; He was there for me without any question or reservation and I hope he begins to know how much he is [...]]]></description>
			<content:encoded><![CDATA[<p>My brother Dennis, my youngest brother, the baby of the family for so long, died Saturday 24th April 2010, very suddenly.&nbsp; </p>
<p>
	He had a huge loving heart, and leaves an overwhelming hole behind him.&nbsp; He was there for me without any question or reservation and I hope he begins to know how much he is loved and how much he is missed.&nbsp; How proud I am of him.&nbsp; He was a very good man. </p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2010/04/i-miss-my-brother.html&title=I miss my brother&#8230;" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2010/04/i-miss-my-brother.html&title=I miss my brother&#8230;" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2010/04/i-miss-my-brother.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2010/04/i-miss-my-brother.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2010/04/i-miss-my-brother.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>home to Boston, daughter in remission</title>
		<link>http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html</link>
		<comments>http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:42:54 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[daughter]]></category>
		<category><![CDATA[move3]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=792</guid>
		<description><![CDATA[My daughter is in remission from AML type M4.&#160;&#160; She is coming off a ventilator she&#39;s been on for 38 days now, in an ICU in California.&#160; I&#39;m leaving tomorrow after six weeks out with her.&#160; That&#39;s good &#8211; I miss being home, I miss my family in MA.&#160; I am so glad my daughter [...]]]></description>
			<content:encoded><![CDATA[<p>My daughter is in remission from AML type M4.&nbsp;&nbsp; She is coming off a ventilator she&#39;s been on for 38 days now, in an ICU in California.&nbsp;</p>
<p>
	I&#39;m leaving tomorrow after six weeks out with her.&nbsp; That&#39;s good &#8211; I miss being home, I miss my family in MA.&nbsp; I am so glad my daughter is better enough that I can see leaving.</p>
<p>But leaving isn&#39;t easy, either.&nbsp;</p>
<p>&#8211;doug</p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html&title=home to Boston, daughter in remission" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html&title=home to Boston, daughter in remission" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2010/02/home-to-boston-daughter-in-remission.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>visually healthy bone marrow&#8230;</title>
		<link>http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html</link>
		<comments>http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html#comments</comments>
		<pubDate>Fri, 19 Feb 2010 00:12:04 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[move3]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[daughter]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=788</guid>
		<description><![CDATA[Not something you hope to have to hope for&#8230; &#160; My daughter has visually more healthy bone marrow than she had 36 days ago when she came into the hospital in crisis.&#160;&#160; She has at least managed to knock the cancer back and rebuild a bone marrow that is not diseased.&#160; More detailed tests will [...]]]></description>
			<content:encoded><![CDATA[<p>Not something you hope to have to hope for&#8230;</p>
<p>&nbsp;</p>
<p>My daughter has visually more healthy bone marrow than she had 36 days ago when she came into the hospital in crisis.&nbsp;&nbsp; She has at least managed to knock the cancer back and rebuild a bone marrow that is not diseased.&nbsp; More detailed tests will look for any trace at all of cancerous marrow.&nbsp; I&#39;m hoping there will be none to find at all.&nbsp; That would be remission, the first step toward a life outside of a hospital room.</p>
<p>&nbsp;</p>
<p>&#8211;doug</p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html&title=visually healthy bone marrow&#8230;" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html&title=visually healthy bone marrow&#8230;" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2010/02/visually-healthy-bone-marrow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>matter of the lungs</title>
		<link>http://dougmunsinger.com/2010/02/matter-of-the-lungs.html</link>
		<comments>http://dougmunsinger.com/2010/02/matter-of-the-lungs.html#comments</comments>
		<pubDate>Sun, 07 Feb 2010 18:02:01 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[entropy]]></category>
		<category><![CDATA[move3]]></category>
		<category><![CDATA[writers]]></category>
		<category><![CDATA[doughter]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=783</guid>
		<description><![CDATA[I&#39;ve been willing my daughter to breathe for the last 24 days.&#160; She came down with leukemia.&#160;&#160; Acute, dangerous and sudden leukemia that tried very hard to kill her.&#160; Right now she is on an oscillating ventilator, with two chest tubes, daily dialysis, and a wall of IVs you would have to see to believe.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#39;ve been willing my daughter to breathe for the last 24 days.&nbsp;</p>
<p>She came down with leukemia.&nbsp;&nbsp; Acute, dangerous and sudden leukemia that tried very hard to kill her.&nbsp; Right now she is on an oscillating ventilator, with two chest tubes, daily dialysis, and a wall of IVs you would have to see to believe.&nbsp; And she is still breathing.&nbsp;</p>
<p>I have a log rotation script I put together that works for my new employer, Constant Contact.&nbsp; I&#39;ll put that up soon enough.&nbsp;</p>
<p>
	As soon as she is out the other side of all of this.</p>
<p>&#8211;doug</p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2010/02/matter-of-the-lungs.html&title=matter of the lungs" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2010/02/matter-of-the-lungs.html&title=matter of the lungs" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2010/02/matter-of-the-lungs.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2010/02/matter-of-the-lungs.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2010/02/matter-of-the-lungs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fall through code to a success&#8230;</title>
		<link>http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html</link>
		<comments>http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html#comments</comments>
		<pubDate>Thu, 10 Dec 2009 15:58:10 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[move3]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[bash shell]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html</guid>
		<description><![CDATA[I found a piece of code in a nagios alerting script that returns &#8220;success&#8221; matter what is happening with the jboss application it is checking. This script had been perpetuated as a service alerting script for years in the environs I work in, edited and passed on as working. It reads: if [failure code here]; [...]]]></description>
			<content:encoded><![CDATA[<p>I found a piece of code in a nagios alerting script that returns &#8220;success&#8221; matter what is happening with the jboss application it is checking.  </p>
<p>This script had been perpetuated as a service alerting script for years in the environs I work in, edited and passed on as working.  It reads:</p>
<p>if [failure code here]; then<br />
    # return failure to nagios nrpe daemon<br />
else<br />
   # return success to nrpe<br />
fi</p>
<p>The test for a failure failed to match, even when the test was looking for a jboss instance not present on the server.  Because the code falls through to success, everything looks just fine, all of the time.  </p>
<p>The test for failure being incorrect struck me first when I looked through the script.  The more basic flaw in logic hit me after.  I think it would be true in an alerting script you would NEVER drop through a loop to a final success.   The test would be for success, the fall-through to failure.  This would have prevented a false sense of security, and the failure to detect success would have been dealt with immediately.</p>
<p>Something like: </p>
<p>if [success code here]; then<br />
    # return success to nagios nrpe daemon<br />
else<br />
   # return failure nrpe<br />
fi</p>
<p>Obvious.  But an epiphany anyway.</p>
<p>&#8211;doug</p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html&title=Fall through code to a success&#8230;" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html&title=Fall through code to a success&#8230;" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2009/12/fall-through-code-to-a-success.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>another tool for SVN &#8211; list_repositories.pl</title>
		<link>http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html</link>
		<comments>http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html#comments</comments>
		<pubDate>Mon, 11 May 2009 15:28:14 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[move2]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[CGI.pm]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=762</guid>
		<description><![CDATA[&#160; &#160; One of the features of subversion + apache2 is the ability to list repositories &#8211; natively.&#160; SVNParentPath /apps/repos SVNListParentPath on Unfortunately, once you restrict the httpd.conf to individual repositories and start handling permissions separately you lose that.&#160; Both of these permissions, set at the top level, at the parent path to the repositories, [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p>One of the features of subversion + apache2 is the ability to list repositories &#8211; natively.&nbsp;</p>
<p>SVNParentPath /apps/repos<br />
SVNListParentPath on</p>
<p>Unfortunately, once you restrict the httpd.conf to individual repositories and start handling permissions separately you lose that.&nbsp; Both of these permissions, set at the top level, at the parent path to the repositories, have to be commented out to have the individual permissions on the directories below take effect.</p>
<p>And listing just the repositories wasn&#8217;t enough for what I had in mind &#8211; I wanted a read-only table showing an individual developer or a team lead for a project who has what permissions for the subversion repositories. All the users, all the repositories.</p>
<p>Just your basic cgi.</p>
<p>&nbsp;</p>
<p><a href="http://dougmunsinger.com/images/posts/2009/repos_1.png" rel="shadowbox[sbpost-762];player=img;" title="repository listing cgi"><img src="http://dougmunsinger.com/images/posts/2009/repos_1_420.png" title="repos" alt="repos" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;and the script:</p>
<p><a href="http://dougmunsinger.com/images/posts/2009/list_repositories.pl.txt" title="list_repositories.pl"><br />
</a><code>#! /bin/perl -w</p>
<p>
# script to parse and display users and repositories and rights (R, RW)</p>
<p>use strict;<br />
use CGI qw(:standard);<br />
use CGI::Carp qw(fatalsToBrowser);</p>
<p>
##----------------------------<br />
## Variables<br />
##----------------------------</p>
<p>
#debug<br />
my $debug = 0; #set to 0 to turn off, 1 (true) to turn on </p>
<p># title for page<br />
my $PageTitle = &quot;List of SVN Repositories&quot;;</p>
<p>## repository directory<br />
my $SVN = &quot;/apps/repos&quot;;<br />
## location for htpasswd files<br />
my $HTDIR = &quot;/apps/apache2/conf/htpasswd&quot;;<br />
## Set untainted path<br />
$ENV{PATH} = '/apps/apache2/bin:/bin:/usr/bin:/usr/local/bin';<br />
$ENV{IFS} = &quot;&quot; if $ENV{IFS} ne &quot;&quot;;</p>
<p># css <br />
my $css = &quot;http://&lt;your server name&gt;/css/main.css&quot;;<br />
my $headerimg = &quot;http://&lt;your server name&gt;/css/roger_rabbit_120.jpg&quot;;</p>
<p>
##------------------------------<br />
## MAIN<br />
##------------------------------</p>
<p>&amp;standard_header;<br />
my ($ref_repos, $ref_tabledata, $ref_users) = &amp;CreateTableSpace;<br />
&amp;DisplayTable ($ref_repos, $ref_tabledata, $ref_users);<br />
&amp;standard_footer;<br />
exit;</p>
<p>##------------------------------<br />
## subs<br />
##------------------------------</p>
<p>sub standard_header {<br />
&nbsp;&nbsp;&nbsp; print header();<br />
&nbsp;&nbsp;&nbsp; print start_html(-Title =&gt; &quot;$PageTitle&quot;, -BGCOLOR=&gt;&quot;White&quot;, <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -style =&gt; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -src =&gt; &quot;${css}&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; );<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;div id=\&quot;header\&quot;&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; print p(&quot;&lt;img src=\&quot;${headerimg}\&quot; title=\&quot;Wells logo\&quot; alt=\&quot;wells logo\&quot;/&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;/div&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;div id=\&quot;headertitle\&quot;&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; print h3(&quot;Repositories&lt;br/&gt;\nusers | read (R) | read &amp; write (RW)\n&quot;); # start_multipart_form() if file upload<br />
}</p>
<p>
sub standard_footer { <br />
&nbsp;&nbsp;&nbsp; print end_html(); <br />
}</p>
<p>
sub CreateTableSpace {<br />
&nbsp;&nbsp;&nbsp; my $ref_repos = &amp;GetBlankRepos;<br />
&nbsp;&nbsp;&nbsp; my @repos = @$ref_repos; # dereference<br />
&nbsp;&nbsp;&nbsp; my %tabledata = (); # hash to hold table data<br />
&nbsp;&nbsp;&nbsp; my @users = (); # list of users<br />
&nbsp;&nbsp;&nbsp; my %seen = (); <br />
&nbsp;&nbsp;&nbsp; foreach my $rep (@repos) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open(FILE, &quot;$HTDIR/${rep}_read&quot;) || croak &quot;Failed to open $HTDIR/${rep}_read for reading...&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my @filelines = &lt;FILE&gt;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close FILE;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach my $line (@filelines) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # lines are user:passwd<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my ($user, $pass) = split (&quot;:&quot;, $line);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unless ($seen{$user}) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $seen{$user} = 1; # save as seen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push (@users, $user); # save the user to a list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tabledata{$rep}{$user} = &quot;read&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open (FILE, &quot;$HTDIR/${rep}_write&quot;) || croak &quot;Failed to open $HTDIR/${rep}_write for reading&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my @file_lines = &lt;FILE&gt;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close FILE;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach my $line (@file_lines) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # lines are user:passwd<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my ($user, $pass) = split (&quot;:&quot;, $line);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unless ($seen{$user}) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $seen{$user} = 1; # save as seen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push (@users, $user); # save the user to a list<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tabledata{$rep}{$user} = &quot;readwrite&quot;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; return (\@repos, \%tabledata, \@users);<br />
}</p>
<p>
sub GetBlankRepos {<br />
&nbsp;&nbsp;&nbsp; my @repos = ();<br />
&nbsp;&nbsp;&nbsp; # list $SVN<br />
&nbsp;&nbsp;&nbsp; opendir (DIR, $SVN) || croak &quot;Failed to open directory $SVN for reading...&quot;;<br />
&nbsp;&nbsp;&nbsp; while (defined(my $file = readdir(DIR))) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # skip &quot;.&quot;, &quot;..&quot; and .&lt;hidden&gt; files...<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($file =~ /^\./) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push(@repos, $file);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; return (\@repos);<br />
}</p>
<p>sub DisplayTable {<br />
&nbsp;&nbsp;&nbsp; my $ref_repos = shift;&nbsp; #@repos<br />
&nbsp;&nbsp;&nbsp; my $ref_tabledata = shift; # %tabledata<br />
&nbsp;&nbsp;&nbsp; my $ref_users = shift; # @users<br />
&nbsp;&nbsp;&nbsp; # dereference<br />
&nbsp;&nbsp;&nbsp; my @repos = @$ref_repos;<br />
&nbsp;&nbsp;&nbsp; my %tabledata = %$ref_tabledata;<br />
&nbsp;&nbsp;&nbsp; my @users = @$ref_users;<br />
&nbsp;&nbsp;&nbsp; # repos across the top, users down, R or RW for permissions<br />
&nbsp;&nbsp;&nbsp; # $tabledata{$rep}{$user} = &quot;readwrite&quot;;<br />
&nbsp;&nbsp;&nbsp; # start table<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;table&gt;\n&lt;tbody&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; # table header<br />
&nbsp;&nbsp;&nbsp; my $cols = ($#repos + 1);<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;tr&gt;&lt;td&gt;Users&lt;/td&gt;&lt;td colspan=\&quot;$cols\&quot;&gt;Repositories&lt;/td&gt;&lt;/tr&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;div id=\&quot;repotitles\&quot;&gt;&lt;tr&gt;\n&lt;td&gt;&amp;nbsp;&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp; foreach my $rep (@repos) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;&lt;td&gt;$rep&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; print (&quot;\n&lt;/tr&gt;\n&lt;/div&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; foreach my $user (@users) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;&lt;tr&gt;\n&lt;td&gt;$user&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach my $repo (@repos) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($tabledata{$repo}{$user}) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($tabledata{$repo}{$user} eq &quot;read&quot;) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;&lt;td&gt;R&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } elsif ($tabledata{$repo}{$user} eq &quot;readwrite&quot;) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;&lt;td&gt;RW&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;&lt;td&gt;&amp;nbsp; - &amp;nbsp;&lt;/td&gt;&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print (&quot;\n&lt;/tr&gt;\n&quot;);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; # finish table<br />
&nbsp;&nbsp;&nbsp; print (&quot;&lt;/tbody&gt;\n&lt;/table&gt;\n&quot;);<br />
}</code></p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html&title=another tool for SVN &#8211; list_repositories.pl" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html&title=another tool for SVN &#8211; list_repositories.pl" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2009/05/subversion-cg-tool-list-repositories.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svnadmin.pl &#8211; perl cgi script to manage svn over apache</title>
		<link>http://dougmunsinger.com/2009/05/svnadmin.html</link>
		<comments>http://dougmunsinger.com/2009/05/svnadmin.html#comments</comments>
		<pubDate>Fri, 08 May 2009 15:29:58 +0000</pubDate>
		<dc:creator>doug</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[move2]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://dougmunsinger.com/?p=738</guid>
		<description><![CDATA[One of the tedious tasks in repository administration is managing users over repositories. Who has access to what repository and to what degree (read-only, or write). Subversion over apache2 allows a tremendous amount of control, down to individual directories within the repository. (see &#34;Per Directory Access Control&#34; in the subversion book). So far I haven&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>One of the tedious tasks in repository administration is managing users over repositories.  Who has access to what repository and to what degree (read-only, or write).  Subversion over apache2 allows a tremendous amount of control, down to individual directories within the repository. (see <a title="per directory access control" href="http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.serverconfig.httpd.authz.perdir">&quot;Per Directory Access Control&quot; in the subversion book</a>).</p>
<p>So far I haven&#8217;t placed that but I have set up a default deny and then separate htpasswd files for read, or write access permission. This does at times cause TWO passwords to need to be used to first read and then again write to a repository.  However, these are cached, so we&#8217;ll see how much developers find to complain about in that.</p>
<p>The script svnadmin.pl assumes that a naming convention for the relationship bewtween htpasswd access files and subversion repositories is set so that the htpasswd file is named &lt;repository_name&gt;_read and &lt;repository_name&gt;_write.  You need to setthe path to htpasswd, the path to the htpasswd files, and a location for the top level directory of subversion &#8211; the parent directory for all repositories. Within the script you&#8217;ll also need to set the paths for the css file ($css) and for the header image ($headerimg).  This image should be roughly 420 px wide x 200 px high.  I used my corporate logo.</p>
<p>The script also uses a username-as-corporate-ID assumption (begins with &quot;a&quot; or &quot;d&quot; or &quot;x&quot;, contains up to eight characters), and a reasonable password assumption (at least 8 charcaters, nor more than 12, must contain at least one capital letter and one digit).  This is for internal use, not to be exposed, so if you are going to do something like this on ethe internet, you would want to revisit that and lock it down further.</p>
<h3><a title="svnadmin.pl" target="blank" href="http://dougmunsinger.com/images/posts/2009/svnadmin_pl.txt">svnadmin.pl</a></h3>
<h3><a title="main.css" target="blank" href="http://dougmunsinger.com/images/posts/2009/main.css.txt">main.css</a></h3>
<p>To run the script &#8211; save-file-as and then change the first line to &quot;#! /usr/bin/perl&quot; (or the appropriate path for the perl you want to use).  This is basically removing the extra &quot;#&quot; mark.   Rename the script to &quot;svnadmin.pl&quot;, put in your cgi-bin location, and put the main.css file in an appropriate location.  Edit the variables as above.</p>
<p>Screenshots:</p>
<table>
<tbody>
<tr>
<td><a title="screenshot 1" href="http://dougmunsinger.com/images/posts/2009/svnadmin_1.png" rel="shadowbox[sbpost-738];player=img;"><img rel="lightbox[svn]" alt="screenshot" title="screenshot" src="http://dougmunsinger.com/images/posts/2009/svnadmin_1_220.png" /></a></td>
<td><a title="screenshot 1" href="http://dougmunsinger.com/images/posts/2009/svnadmin_2.png" rel="shadowbox[sbpost-738];player=img;"><img rel="lightbox[svn]" alt="screenshot" title="screenshot" src="http://dougmunsinger.com/images/posts/2009/svnadmin_2_220.png" /></a></td>
</tr>
<tr>
<td><a title="screenshot 1" href="http://dougmunsinger.com/images/posts/2009/svnadmin_3.png" rel="shadowbox[sbpost-738];player=img;"><img rel="lightbox[svn]" alt="screenshot" title="screenshot" src="http://dougmunsinger.com/images/posts/2009/svnadmin_3_220.png" /></a></td>
<td><a title="screenshot 1" href="http://dougmunsinger.com/images/posts/2009/svnadmin_4.png" rel="shadowbox[sbpost-738];player=img;"><img rel="lightbox[svn]" alt="screenshot" title="screenshot" src="http://dougmunsinger.com/images/posts/2009/svnadmin_4_220.png" /></a></td>
</tr>
</tbody>
</table>
<p>Really fairly simple. This started with a script called &quot;htpasswd.pl&quot; which I downloaded and reworked, then adapted to use CGI.pm for multi-screen form presentation.  That framework alone was work rediscovering.  I used a similar framework with perl DBI and mysql to do fluid reporting on large system installations 9 years ago.  It recurs.</p>
<p>&mdash; doug</p>
<div class="addtothis"><p>
				<table cellspacing="0" cellpadding="0" border="0" style="width: 180px; height: 30px; text-align: left; margin-left: 0px; ">
				<tbody>
				<tr>
				<td style="text-align: center;">
				<a href="http://www.stumbleupon.com/submit?url=http://dougmunsinger.com/2009/05/svnadmin.html&title=svnadmin.pl &#8211; perl cgi script to manage svn over apache" rel="nofollow">
                                <img src="http://dougmunsinger.com/wp-content/plugins/addtothis/stumble.png" title="Add to Stumble Upon" alt="Stumble It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://del.icio.us/post?url=http://dougmunsinger.com/2009/05/svnadmin.html&title=svnadmin.pl &#8211; perl cgi script to manage svn over apache" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/delicious.png" title="Add to Del.icio.us" alt="Add to Del.cio.us" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://technorati.com/faves?add=http://dougmunsinger.com/2009/05/svnadmin.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/technorati.png" title="Add to Technorati" alt="Add to Technorati Favorites" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://digg.com/submit?phase=2&url=http://dougmunsinger.com/2009/05/svnadmin.html" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/digg.png" title="Add to Digg" alt="Digg It!" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				<td style="text-align: center;">
				<a href="http://dougmunsinger.com/feed/rss" rel="nofollow">
				<img src="http://dougmunsinger.com/wp-content/plugins/addtothis/feeds.png" title="Add Feed to Bookmarks" alt="RSS Feed" style="border: 0px solid ; width: 28px; height: 28px;"/>
				</a>
				</td>
				</tr>
				</tbody>
				</table>

                
		
				</p></div>]]></content:encoded>
			<wfw:commentRss>http://dougmunsinger.com/2009/05/svnadmin.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

