<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Managing OS X</title>
	<atom:link href="http://managingosx.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://managingosx.wordpress.com</link>
	<description>Trials and Tribulations of an OS X Administrator</description>
	<lastBuildDate>Fri, 03 Apr 2009 23:46:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/cc4e14a7be2cce7be3ce3a3f75862051?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Managing OS X</title>
		<link>http://managingosx.wordpress.com</link>
	</image>
			<item>
		<title>Adobe Lightroom Installer</title>
		<link>http://managingosx.wordpress.com/2009/04/03/lightroom-installer/</link>
		<comments>http://managingosx.wordpress.com/2009/04/03/lightroom-installer/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 23:45:59 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=202</guid>
		<description><![CDATA[John Welch has written passionately about Adobe installers many times over the years.  Here&#8217;s another to add to the list, though not as colorfully as Mr. Welch might have done&#8230; 
The Lightroom 2.3 installer is an order of magnitude better than most other Adobe installers:

It is a standard Apple Installer package.
It installs just one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=202&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>John Welch has <a href="http://www.bynkii.com/archives/2009/02/on_installers.html">written</a> <a href="http://www.bynkii.com/archives/2006/12/adobe_reader_8_released_and_th.html">passionately</a> about <a href="http://www.bynkii.com/archives/2008/11/more_adobe_installer_lies.html">Adobe installers</a> many times over the years.  Here&#8217;s another to add to the list, though not as colorfully as Mr. Welch might have done&#8230; <span id="more-202"></span></p>
<p>The Lightroom 2.3 installer is an order of magnitude better than most other Adobe installers:</p>
<ul>
<li>It is a standard Apple Installer package.</li>
<li>It installs just one thing: Adobe Lightroom 2.3.</li>
<li>It does not secretly install Flash, or Air, or Adobe Reader.</li>
<li>It stores its registration info in a separate file from the Adobe CS2, CS3, and CS4 apps, so you don&#8217;t have to worry about registrations clobbering each other.</li>
</ul>
<p>But it&#8217;s not perfect.</p>
<p>Problem #1: the postinstall script at Contents/Resources/postinstall:</p>
<pre style="overflow:scroll;">
<code>
#!/bin/bash
#
# This postinstall script copies the camera raw profiles into the
# application support folder

ditto -kx "$1/Contents/Resources/profiles.zip" "/Library/Application Support/Adobe/CameraRaw/CameraProfiles"
</code>
</pre>
<p>This uses ditto to copy stuff out of a ZIP archive to /Library/Application Support/Adobe/CameraRaw/CameraProfiles/</p>
<p>Why?  Why couldn&#8217;t this just be in the package payload?  Or why couldn&#8217;t this be a metapackage, where one package installed Adobe Lightroom and another installed the CameraProfiles?</p>
<p>As an administrator, I don&#8217;t want to read scripts to see what else a package has installed &#8211; it should be in the bom files for the installer.  Worse, we&#8217;ll never see a useful uninstall capability as long as software vendors pull this sort of thing.  Ideally, we should be able to look at /Library/Receipts to see what has been installed, and in the future, be able to use this same info to uninstall things.  Postflight or postinstall scripts that install additional things break this concept.</p>
<p>But it gets worse.</p>
<p>Let&#8217;s look at the postflight script at Contents/Resources/postflight:</p>
<pre style="overflow:scroll;">
<code>
#!/bin/bash
#
# remove the receipt file, which causes problems if people try to reinstall
# an earlier version

RMPATH="/Library/Receipts/`basename "$1"`"
echo "removing receipt $RMPATH"
rm -rf "$RMPATH"
</code>
</pre>
<p>It removes its own receipt!  Now we&#8217;re really horked if we want to find out what&#8217;s been installed. Adobe destroys the evidence!</p>
<p>Sigh.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=202&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/04/03/lightroom-installer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>
	</item>
		<item>
		<title>Energy Saver scripting</title>
		<link>http://managingosx.wordpress.com/2009/03/31/energysaver-scripting/</link>
		<comments>http://managingosx.wordpress.com/2009/03/31/energysaver-scripting/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 17:12:21 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=192</guid>
		<description><![CDATA[Here&#8217;s a version of a script we use on all our machines in an attempt to reduce energy usage with a minimum of visible impact on users. Our machines are set to not sleep during the day.  This script runs hourly, and if it&#8217;s after 7pm and the machine has been idle for 20 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=192&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://managingosx.files.wordpress.com/2009/03/energysaver.jpg?w=128&#038;h=128" alt="energysaver" title="energysaver" width="128" height="128" class="alignright size-full wp-image-196" />Here&#8217;s a version of a script we use on all our machines in an attempt to reduce energy usage with a minimum of visible impact on users. Our machines are set to not sleep during the day.  This script runs hourly, and if it&#8217;s after 7pm and the machine has been idle for 20 minutes or more, it tries to sleep the machine if someone is logged in, or shut it down if no-one is logged in.<br />
The machine is also set to automatically startup or wake at 6am M-F. The net result is that most of our desktop machines go to sleep or shutdown a little after 7pm each weeknight and wake up at 6am each week morning, and our users are none the wiser.<span id="more-192"></span></p>
<pre style="overflow:scroll;">
<code>
#!/bin/sh

# Sleep or shutdown script
# tryin' to be 'green'.....

# look for exception file
if [ -f "/var/db/.dontSleep" ]; then
	exit 0
fi

# if we're a laptop, exit.
# No shutting down laptops (or waking them up unbidden!)
IS_LAPTOP=`/usr/sbin/system_profiler SPHardwareDataType | grep "Model" | grep "Book"`
if [ "$IS_LAPTOP" != "" ]; then
	exit 0
fi

# check the time; exit if it's between 5 am and 7 pm
current_hour=`/bin/date +%H`
if [ $current_hour -gt 5 -a $current_hour -lt 19 ]; then
	exit 0
fi

# now check idle time;
# exit if we've been idle less than 20 minutes
idleTime=`ioreg -c IOHIDSystem | perl -ane 'if (/Idle/) {$idle=int((pop @F)/1000000000); print $idle,"\n"; last}'`
if [ $idleTime -lt 1200 ]; then
	exit 0
fi

# tell Power Manager to wake us up or turn us on at 6am M-F
pmset repeat wakeorpoweron MTWRF 06:00:00

# check to see if a user's logged into the console
login_status=`/usr/bin/who | /usr/bin/awk '{ print $2 }'`
for i in $login_status; do
  if [ $i = "console" ]; then
       # someone's logged in, sleep
       osascript -e 'tell application "System Events" to sleep'
       exit 0
  fi
done

# if we got this far, it's OK to shut down.
/sbin/shutdown -h now
exit 0

</code>
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=192&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/03/31/energysaver-scripting/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2009/03/energysaver.jpg" medium="image">
			<media:title type="html">energysaver</media:title>
		</media:content>
	</item>
		<item>
		<title>Leopard, MobileAccounts, and NFS homes</title>
		<link>http://managingosx.wordpress.com/2009/02/19/leopard-mobileaccounts-and-nfs-homes/</link>
		<comments>http://managingosx.wordpress.com/2009/02/19/leopard-mobileaccounts-and-nfs-homes/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 18:02:27 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[DirectoryService]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=177</guid>
		<description><![CDATA[On the MacEnterprise maillist, Arjen van Bochoven wrote of problems with automatic HomeSyncs under Leopard with NFS home directories.  Manual syncs worked fine, but the automatic background syncs would fail with errors that looked like this:

1:: [228] Peer "network" is unable to sync. (-[SPeer_FS_PHD mountPeerVolume] (Peer-FS-PHD.m:140): "'((homePath))' is nil")
0:: [228] [2009/02/19 10:45:10.640] Peer "network" [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=177&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://managingosx.files.wordpress.com/2006/03/HomeSync1.png?w=76&#038;h=71" alt="HomeSync" title="HomeSync" width="76" height="71" class="alignleft size-full wp-image-39" />On the <a href="http://lists.psu.edu/archives/macenterprise.html">MacEnterprise maillist</a>, Arjen van Bochoven wrote of problems with automatic HomeSyncs under Leopard with NFS home directories.  Manual syncs worked fine, but the automatic background syncs would fail with errors that looked like this:</p>
<pre>
1:: [228] Peer "network" is unable to sync. (-[SPeer_FS_PHD mountPeerVolume] (Peer-FS-PHD.m:140): "'((homePath))' is nil")
0:: [228] [2009/02/19 10:45:10.640] Peer "network" is unable to sync. Not enough peers will be available to continue syncing.
0:: [228] [2009/02/19 10:45:10.640] Aborting sync of "HomeSync_Mirror".
</pre>
<p>I saw the exact same problem in my environment. This also affected login and logout syncs. Here&#8217;s the (ugly) fix.<span id="more-177"></span></p>
<p>For each mobile account, you&#8217;ll need to make two modifications to the account info in the local DS:</p>
<p><code>/usr/bin/dscl . create /Users/$USERNAME dsAttrTypeStandard:OriginalHomeDirectory "nfs://$NFSEXPORT$USERNAME"</code></p>
<p>where $USERNAME is the short username, and $NFSEXPORT is the nfsserver and its export. </p>
<p>This gives HomeSync a nfs:// URL to use to mount the network home directory (It shouldn&#8217;t have to do this, since the network home is already available at the autofs mountpoint for the network home, and obviously really doesn&#8217;t need it since manual syncs work), but we have to do it anyway.</p>
<p>The OriginalHomeDirectory attribute has two parts &#8211; a URL describing the mount, and a path describing the path to the actual home dir, relative to the mount.  In my case, when I type `mount`, my home autofs mount looks like this:</p>
<p><code>homeserver:/vol/home/fahome on /home/fahome</code></p>
<p>and my NFS home path is <code>/home/fahome/gneagle</code></p>
<p>So the URL is &#8216;nfs://homeserver/vol/home/fahome/&#8217; and the path is &#8216;gneagle&#8217;.</p>
<p>Depending on how the home mounts are setup in your environment, the division between the URL and the path might be different, for example, we might have had this instead:</p>
<p>URL &#8216;nfs://homeserver/vol/home/&#8217; with a path of &#8216;fahome/gneagle&#8217;.</p>
<p>The next change:<br />
<code>/usr/bin/dscl . append /Users/$USERNAME dsAttrTypeNative:preserved_attributes dsAttrTypeStandard:OriginalHomeDirectory</code></p>
<p>This prevents the OriginalHomeDirectory attribute from being overwritten by the empty value presumably coming from the network.  (If there was a useful value in the network directory, this hack wouldn&#8217;t be needed.)</p>
<p>You may be able to create the accounts &#8220;correctly&#8221; in the first place by using /System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount and passing the syncURL with the -u option in the form &#8220;nfs://homeserver/export/home/gneagle&#8221;.  This didn&#8217;t work in my environment, and even if it did, it wasn&#8217;t really an option to use createmobileaccount, so I instead wrote a login hook that &#8220;fixes&#8221; the mobile account if needed. WordPress will cut off the right side of the script when displaying it, but you can select, copy and paste into your favorite text editor for examination:</p>
<pre>
<code>
#!/bin/sh

# Leopard bug workaround as of 10.5.2. March 5 2008
# inserts nfs:// URL into OriginalHomeDirectory attribute
# for mobile accounts so that login/logout/background syncs
# work reliably
#
# Greg Neagle, Walt Disney Animation Studios

# the following is the actual NFS share that is mounted via autofs
NFSEXPORT="homeserver.example.com/vol/home/fahome/"

USERNAME=$1
LOCALACCT=`/usr/bin/dscl . read /Users/$USERNAME 2&gt;/dev/null`
if [ "$LOCALACCT" != "" ]; then
  # $USERNAME is a local account
  NETHOME=`/bin/echo $LOCALACCT | /usr/bin/grep OriginalNFSHomeDirectory`
  if [ "$NETHOME" != "" ]; then
    # $USERNAME is a mobile account
    # in our case, the path and the username are one and the same
    /usr/bin/dscl . create /Users/$USERNAME dsAttrTypeStandard:OriginalHomeDirectory "nfs://$NFSEXPORT$USERNAME"
    PRESERVED_ORIG_HOME=`/usr/bin/dscl . read /Users/$USERNAME dsAttrTypeNative:preserved_attributes | /usr/bin/grep dsAttrTypeStandard:OriginalHomeDirectory`
    if [ "$PRESERVED_ORIG_HOME" = "" ]; then
      /usr/bin/dscl . append /Users/$USERNAME dsAttrTypeNative:preserved_attributes dsAttrTypeStandard:OriginalHomeDirectory
    fi
  fi
fi
</code>
</pre>
<p>The user logs in with their network account. MCX computer group settings cause the user to be asked if they want to create a mobile account, if they agree the mobile account is created and the home directory is encrypted with FileVault. As they log in, the login hook runs and if needed, inserts the additional info into the cached local account info so that automatic HomeSyncs work. </p>
<p>Though this fixed the issue for our environment, I still consider this a bug.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=177&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/02/19/leopard-mobileaccounts-and-nfs-homes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2006/03/HomeSync1.png" medium="image">
			<media:title type="html">HomeSync</media:title>
		</media:content>
	</item>
		<item>
		<title>Image cleanup script</title>
		<link>http://managingosx.wordpress.com/2009/01/23/image-cleanup-script/</link>
		<comments>http://managingosx.wordpress.com/2009/01/23/image-cleanup-script/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 20:23:26 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=152</guid>
		<description><![CDATA[UPDATE 1/23/09: some commenters asked about cleanup of the LKDC (new in Leopard) &#8211; I&#8217;ve added that to the script.
At the Macworld Expo 2009 Power Tools System Imaging and Deployment session today, I was asked to share a &#8220;checklist&#8221; of cleanup steps I use when building images the &#8220;classic&#8221; way.  (The InstaDMG methodology of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=152&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>UPDATE 1/23/09: some commenters asked about cleanup of the LKDC (new in Leopard) &#8211; I&#8217;ve added that to the script.</p>
<p>At the Macworld Expo 2009 Power Tools System Imaging and Deployment session today, I was asked to share a &#8220;checklist&#8221; of cleanup steps I use when building images the &#8220;classic&#8221; way.  (The InstaDMG methodology of image building makes cleanup steps unneeded.) </p>
<p>Here&#8217;s a cleaned-up version of the script I use, with site-specific stuff removed for the most part.<br />
<span id="more-152"></span><br />
If you use this, you&#8217;ll need to modify the paths to any local user home directories for any local users you have on your image.  There are generic examples for a local admin user named &#8220;admin&#8221; and the root user (which if you never login as root, you shouldn&#8217;t have to clean up!)</p>
<pre style="overflow:scroll;">
<code>#!/bin/sh
#this script does some cleanup in preperation for building an image
#best to run this from single user mode, or at least right before you shutdown
#run this as root, or with sudo rights

#set machine names back to generic
/usr/sbin/scutil --set ComputerName "OSX_Standard_Image"
/usr/sbin/scutil --set LocalHostName "osximg"

#delete swapfiles
rm /private/var/vm/swapfile*

#delete volume info DB
rm /private/var/db/volinfo.database

#cleanup local admin's home dir
rm -rf /Users/admin/Desktop/*
rm -rf /Users/admin/Documents/*
rm -rf /Users/admin/Library/Caches/*
rm -rf /Users/admin/Library/Recent\ Servers/*
rm -rf /Users/admin/Library/Logs/*
rm -rf /Users/admin/Library/Keychains/*
rm -rf /Users/admin/Library/Preferences/ByHost/*
rm -f /Users/admin/Library/Preferences/com.apple.recentitems.plist
rm -rf /Users/admin/Movies/*
rm -rf /Users/admin/Music/*
rm -rf /Users/admin/Pictures/*
rm -rf /Users/admin/Public/Drop\ Box/* 

#cleanup root's home dir
rm -rf /private/var/root/Desktop/*
rm -rf /private/var/root/Documents/*
rm -rf /private/var/root/Downloads/*
rm -rf /private/var/root/Library/Caches/*
rm -rf /private/var/root/Library/Recent\ Servers/*
rm -rf /private/var/root/Library/Logs/*
rm -rf /private/var/root/Library/Keychains/*
rm -rf /private/var/root/Library/Preferences/ByHost/*
rm -f /private/var/root/Library/Preferences/com.apple.recentitems.plist
rm -rf /private/var/root/Public/Drop\ Box/*

#clean up global caches and temp data
rm -rf /Library/Caches/*
rm -rf /System/Library/Caches/*
rm -rf /Users/Shared/*
rm -f /private/etc/ssh_host*

#network interfaces - this is regenerated on reboot and can differ on different hardware
rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist

#Leopard - cleanup local KDC, see http://support.apple.com/kb/TS1245
/usr/sbin/systemkeychain -k /Library/Keychains/System.keychain -C -f
rm -rf /var/db/krb5kdc
/usr/bin/defaults delete /System/Library/LaunchDaemons/com.apple.configureLocalKDC Disabled

#log cleanup.  We touch the log file after removing it since syslog
#won't create missing logs.
rm /private/var/log/alf.log
touch /private/var/log/alf.log
rm /private/var/log/cups/access_log
touch /private/var/log/cups/access_log
rm /private/var/log/cups/error_log
touch /private/var/log/cups/error_log
rm /private/var/log/cups/page_log
touch /private/var/log/cups/page_log
rm /private/var/log/daily.out
rm /private/var/log/ftp.log*
touch /private/var/log/ftp.log
rm -rf /private/var/log/httpd/*
rm /private/var/log/lastlog
rm /private/var/log/lookupd.log*
rm /private/var/log/lpr.log*
rm /private/var/log/mail.log*
touch /private/var/log/lpr.log
rm /private/var/log/mail.log*
touch /private/var/log/mail.log
rm /private/var/log/monthly.out
rm /private/var/log/run_radmind.log
rm -rf /private/var/log/samba/*
rm /private/var/log/secure.log
touch /private/var/log/secure.log
rm /private/var/log/system.log*
touch /private/var/log/system.log
rm /private/var/log/weekly.out
rm /private/var/log/windowserver.log
touch /private/var/log/windowserver.log
rm /private/var/log/windowserver_last.log
rm /private/var/log/wtmp.*
</code>
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=152&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/01/23/image-cleanup-script/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>
	</item>
		<item>
		<title>Network and Portable Home slides</title>
		<link>http://managingosx.wordpress.com/2009/01/13/network-and-portable-home-slides/</link>
		<comments>http://managingosx.wordpress.com/2009/01/13/network-and-portable-home-slides/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 17:57:35 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[MCX]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=172</guid>
		<description><![CDATA[Here is a slightly modified version of the slides I used at presentation earlier in 2008 on the topic of Network and Portable Home Directories.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=172&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://homepage.mac.com/gregneagle/files/GN_2008_NetworkPortableHomes.pdf">Here</a> is a slightly modified version of the slides I used at presentation earlier in 2008 on the topic of Network and Portable Home Directories.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=172&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/01/13/network-and-portable-home-slides/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>
	</item>
		<item>
		<title>Macworld 2009 MCX presentation</title>
		<link>http://managingosx.wordpress.com/2009/01/07/macworld-mcx-presentation/</link>
		<comments>http://managingosx.wordpress.com/2009/01/07/macworld-mcx-presentation/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 00:08:57 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[DirectoryService]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[MCX]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=168</guid>
		<description><![CDATA[Here is a PDF of my presentation at Macworld SF 2008 on Managing OS X Clients with or without Open Directory.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=168&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://managingosx.files.wordpress.com/2008/02/wgm.jpg?w=124&#038;h=130" alt="WGM icon" title="WGM icon" width="124" height="130" class="alignleft size-full wp-image-98" /><a href="http://homepage.mac.com/gregneagle/files/MW2009_IT803.pdf">Here</a> is a PDF of my presentation at Macworld SF 2008 on Managing OS X Clients with or without Open Directory.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=168&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/01/07/macworld-mcx-presentation/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2008/02/wgm.jpg" medium="image">
			<media:title type="html">WGM icon</media:title>
		</media:content>
	</item>
		<item>
		<title>Firmware Updates Redux</title>
		<link>http://managingosx.wordpress.com/2009/01/06/firmware-updates/</link>
		<comments>http://managingosx.wordpress.com/2009/01/06/firmware-updates/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 21:45:03 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=160</guid>
		<description><![CDATA[Mac firmware updates generally need some sort of user intervention in order to apply them.
This makes it very difficult to automate the process.  I did manage at one point to automate SMC updates, but EFI updates and other hardware (keyboards, trackpads, graphics) each have their own issues.
So I finally decided to just punt on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=160&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mac firmware updates generally need some sort of user intervention in order to apply them.</p>
<p>This makes it very difficult to automate the process.  I did manage at one point to automate SMC updates, but EFI updates and other hardware (keyboards, trackpads, graphics) each have their own issues.</p>
<p>So I finally decided to just punt on the issue.  Here&#8217;s what I do now: a script runs at login and checks softwareupdate, looking for available firmware updates.  If there are any, the user is notified to call the help desk.<br />
<span id="more-160"></span></p>
<p>The script follows. </p>
<pre style="overflow:scroll;">
<code>
#!/usr/bin/perl -w

use strict;

# change 'com.myorg' to your organization name
my $prefs = "com.myorg.firmwareupdatecheck";

# check the last time we ran on this machine;
# exit if we already ran today so we don't annoy too much
my $now = time;
my $lastChecked =
   `defaults -currentHost read $prefs lastChecked 2&gt;/dev/null`;
chomp $lastChecked;
if ($lastChecked ne "") {
  my $daysSinceLastChecked =
     int(($now-$lastChecked)/(60*60*24));
  exit if ($daysSinceLastChecked &lt; 1);
}

# get list of available updates from softwareupdate
my $allupdates = `softwareupdate -l | grep '^   \\* '`;
chomp $allupdates;
my @updates = split /\n/, $allupdates;
my $firmwareupdates = "";
my $firmwarelist = "";
my $otherupdates = "";

# walk through the list looking for firmware updates
for my $update (@updates) {
  $update = substr($update,5);
  if ((     $update =~ /[F|f]irmware/)
        || ($update =~ /EFI/)
        || ($update =~ /SMC/)) {
    $firmwareupdates .= "$update ";
    $firmwarelist .= "   $update\n";
  } else {
    $otherupdates .= "$update ";
  }
}

# record when we checked and what we found
system "defaults -currentHost write $prefs lastChecked -int $now";
system "defaults -currentHost write $prefs availableUpdates '$firmwareupdates'";

if ($firmwareupdates) {
  # there are available firmware updates
  if ($otherupdates) {
    # hide the non-firmware updates since I don't want users tempted to install them
    system "softwareupdate --ignore $otherupdates &gt;/dev/null 2&gt;&amp;1";
  }

  # are we running under an admin account?
  my $checkAdmin = `dseditgroup -o checkmember admin`;
  if ($checkAdmin =~ /^yes/) {
     # user is an admin, prompt them to install
           my $result = `osascript&lt;&lt;EOFA
try
  tell application "System Events"
    activate
    display alert "Firmware updates available" message "There are firmware updates available for this Mac:" &amp; return &amp; "$firmwarelist" as warning buttons {"Later", "Install"} default button "Install" cancel button "Later" giving up after 120
  end tell
  if button returned of the result is "Install" then
    do shell script "open '/System/Library/CoreServices/Software Update.app'"
  end if
end try
EOFA`;

  } else {
    # user is not an admin, tell them to call help desk
    my $result = `osascript&lt;&lt;EOFB
try
  tell application "System Events"
    activate
    display alert "Firmware updates available" message "There are firmware updates available for this Mac:" &amp; return &amp; "$firmwarelist" &amp; return &amp; "Please call Tech Support at 555-1212 for help in installing these updates." as warning buttons {"OK"} default button "OK" cancel button "OK" giving up after 120
  end tell
end try
EOFB`;
  }
}

</code>
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=160&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2009/01/06/firmware-updates/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>
	</item>
		<item>
		<title>iTunes preference management</title>
		<link>http://managingosx.wordpress.com/2008/09/18/itunes-preference-management/</link>
		<comments>http://managingosx.wordpress.com/2008/09/18/itunes-preference-management/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 23:15:16 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[MCX]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=146</guid>
		<description><![CDATA[Workgroup Manager/MCX supports managing some iTunes preferences if you use the Preference Details and add the Managed Client preference managements.
It turns out there are a few more things you can manage if you look here.
These additional items include:

disableCheckForUpdates
disableAutomaticDeviceSync
disableGetAlbumArtwork
disablePlugins

and more.  These also seem to work as regular default keys. For example:
defaults write com.apple.iTunes disableCheckForUpdates -bool [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=146&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://managingosx.files.wordpress.com/2008/09/itunes.jpg?w=128&#038;h=128" alt="iTunes Icon" title="iTunes Icon" width="128" height="128" align="left" />Workgroup Manager/MCX supports managing some iTunes preferences if you use the Preference Details and add the Managed Client preference managements.</p>
<p>It turns out there are a few more things you can manage if you look <a href="http://support.apple.com/kb/HT2653">here.</a></p>
<p>These additional items include:</p>
<ul>
<li>disableCheckForUpdates</li>
<li>disableAutomaticDeviceSync</li>
<li>disableGetAlbumArtwork</li>
<li>disablePlugins</li>
</ul>
<p>and more.  These also seem to work as regular default keys. For example:</p>
<p><code>defaults write com.apple.iTunes disableCheckForUpdates -bool YES</code></p>
<p>turns off and disables automatic checking for updates. You might want to do that if you manage installation of iTunes updates yourself.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=146&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2008/09/18/itunes-preference-management/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2008/09/itunes.jpg" medium="image">
			<media:title type="html">iTunes Icon</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox default settings</title>
		<link>http://managingosx.wordpress.com/2008/08/18/firefox-default-settings/</link>
		<comments>http://managingosx.wordpress.com/2008/08/18/firefox-default-settings/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 18:32:33 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=133</guid>
		<description><![CDATA[Something I see pop up now and again is questions on how to define certain default settings (proxies, home pages, etc) for all users of Firefox. I was surprised to find that I had never posted on this topic before.
It turns out that you can edit a few files inside the Firefox bundle to set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=133&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://managingosx.files.wordpress.com/2008/08/firefox.jpg"><img src="http://managingosx.files.wordpress.com/2008/08/firefox.jpg?w=128&#038;h=128" alt="" width="128" height="128" class="alignleft size-full wp-image-138" /></a>Something I see pop up now and again is questions on how to define certain default settings (proxies, home pages, etc) for all users of Firefox. I was surprised to find that I had never posted on this topic before.</p>
<p>It turns out that you can edit a few files inside the Firefox bundle to set default preference values.<br />
Here&#8217;s what I do&#8230;<br />
<span id="more-133"></span></p>
<p>Edit /Applications/Firefox.app/Contents/MacOS/greprefs/all.js</p>
<p>Add the following to the end:</p>
<p><code></p>
<pre>
// MyOrganization additions
pref("general.config.obscure_value", 0);
pref("general.config.filename", "firefox_AA.cfg");
</pre>
<p></code></p>
<p>Create a file /Applications/Firefox.app/Contents/MacOS/firefox_AA.cfg with the following contents:</p>
<p><code></p>
<pre>
// This file sets some default prefs for use at MyOrganization
// and locks down some other prefs.
//

// proxy
pref("network.proxy.autoconfig_url", "http://myorg.com/auto.proxy");
pref("network.proxy.type", 2);

// application updates
lockPref("app.update.enabled", false);
lockPref("app.update.autoUpdateEnabled", false);
lockPref("extensions.update.autoUpdate", false);
lockPref("extensions.update.enabled", false);
lockPref("browser.search.update", false);

// Password Manager
pref("signon.rememberSignons", false);

// Default browser check
pref("browser.shell.checkDefaultBrowser", false);
</pre>
<p></code></p>
<p>Edit /Applications/Firefox.app/Contents/MacOS/browserconfig.properties to read:</p>
<p><code></p>
<pre>
browser.startup.homepage=http://myorg.com
browser.startup.homepage_reset=http://myorg.com
</pre>
<p></code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/managingosx.wordpress.com/133/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/managingosx.wordpress.com/133/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=133&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2008/08/18/firefox-default-settings/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2008/08/firefox.jpg" medium="image" />
	</item>
		<item>
		<title>Radmind: converting to case-insensitive transcripts</title>
		<link>http://managingosx.wordpress.com/2008/06/24/radmind-converting-to-case-insensitive-transcripts/</link>
		<comments>http://managingosx.wordpress.com/2008/06/24/radmind-converting-to-case-insensitive-transcripts/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 21:08:32 +0000</pubDate>
		<dc:creator>GregN</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Radmind]]></category>

		<guid isPermaLink="false">http://managingosx.wordpress.com/?p=131</guid>
		<description><![CDATA[
Radmind, being a set of UNIX tools, originally supported only case-sensitive transcripts.  Mac OS X&#8217;s HFS+ filesystem, developed by Apple pre-NeXT purchase, is a case-preserving, case-insensitive filesystem.
Support for case-insensitive transcripts was later added to the radmind tools.
As it turns out, it is perfectly possible to use radmind with case-sensitive transcripts to manage an OS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=131&subd=managingosx&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://managingosx.files.wordpress.com/2006/03/radmind_icon.jpg"><img src="http://managingosx.files.wordpress.com/2006/03/radmind_icon.jpg?w=138&#038;h=139" alt="" width="138" height="139" class="alignleft size-medium wp-image-48" /></a><br />
Radmind, being a set of UNIX tools, originally supported only case-sensitive transcripts.  Mac OS X&#8217;s HFS+ filesystem, developed by Apple pre-NeXT purchase, is a case-preserving, case-insensitive filesystem.</p>
<p>Support for case-insensitive transcripts was later added to the radmind tools.</p>
<p>As it turns out, it is perfectly possible to use radmind with case-sensitive transcripts to manage an OS X HFS+ filesystem.  There are sometimes a few annoyances, but it generally works OK.  Worst case, you might have to run the radmind tools twice to get the filesystem update when there is a case change: the first run might remove the lowercase version of the file, and the second run would install the uppercase version.  Or a sharp radmind admin might be able to avoid the problem altogether by renaming files in troublesome transcripts.<br />
<span id="more-131"></span></p>
<p>One situation where needing multiple runs of the radmind tools to get to a complete filesystem is problematic is during OS updates.  You really want to have a completely successful lapply run so that the filesystem is in a consistent, bootable state.  If lapply fails halfway through, you might end up with an unbootable startup disk.</p>
<p>So when doing major updates, like, say, from 10.4.x to 10.5.x, you need to minimize all failure modes.  While working on getting radmind to update our Macs from Tiger to Leopard, lapply would consistently fail because of case changes in filesystem objects. Instead of playing whack-a-mole trying to find and rename all the changed case filesystem objects, I decided to make the transition to case-insensitive transcripts.</p>
<p>This was not trivial.  We have very modular transcripts, typically describing a single application or single set of configuration changes.  In fact, right now, there are 961 transcripts sitting in the top level of my /var/radmind/transcript directory. So I needed a way to convert all of them to case-insensitive &#8212; simply recreating them from scratch was not an option.</p>
<p>It certainly is possible to convert existing case-sensitive transcripts to case-insensitive. The lsort tool that is part of the radmind tool set will resort transcripts either case-sensitively or case-insensitively. The bigger problem occurs when the transcript contains hard links.  Given a transcript like this:</p>
<p><code><br />
f /Z	0644     0     0 1088185725       0 2jmj7l5rSw0yVb/vlWAYkK/YBwk=<br />
h /a	/Z<br />
h /m	/Z<br />
</code></p>
<p>If you run it through lsort -I, you get this:</p>
<p><code><br />
h /a	/Z<br />
h /m	/Z<br />
f /Z	0644     0     0 1088185725       0 2jmj7l5rSw0yVb/vlWAYkK/YBwk=<br />
</code></p>
<p>which won&#8217;t lapply correctly, since you are creating hard links to files that don&#8217;t exist yet.  Instead, you need it to look like this:</p>
<p><code><br />
f /a	0644     0     0 1088185725       0 2jmj7l5rSw0yVb/vlWAYkK/YBwk=<br />
h /m	/a<br />
h /Z	/a<br />
</code></p>
<p>AND you need the actual files under /var/radmind/file moved around so that they match the transcript.  Yuck.  So I banged out a script that does all this. It&#8217;s a bit of a mess, and probably relies on assumptions about my environment that don&#8217;t apply in yours. Still, you may be able to modify it to fit your needs.</p>
<p>The usage is:</p>
<p><code>converttocaseinsensitive transcript.T</code></p>
<p>which results in a new case-insensitive loadset at </p>
<p><code>/var/radmind/transcript/caseinsensitive/transcript.T</code></p>
<p>and</p>
<p><code>/var/radmind/files/caseinsensitive/transcript.T/</code></p>
<p>To minimize disk usage, I symlink where possible, for example, in cases where the case-insensitive transcript is the same as the case-sensitive one, or where the file set has no hard links (and therefore needs no modifications).  The assumption is that you are using an HFS+ volume for your radmind data storage; if you are using a case-sensitive volume you&#8217;ll need to do more work to rename the actual files&#8230;</p>
<p><a href="http://homepage.mac.com/gregneagle/files/converttocaseinsensitive.pl">Here</a> is the script.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/managingosx.wordpress.com/131/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/managingosx.wordpress.com/131/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/managingosx.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/managingosx.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/managingosx.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/managingosx.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/managingosx.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/managingosx.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/managingosx.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/managingosx.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/managingosx.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/managingosx.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=managingosx.wordpress.com&blog=98681&post=131&subd=managingosx&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://managingosx.wordpress.com/2008/06/24/radmind-converting-to-case-insensitive-transcripts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e1088e2a7d9b1e45999c4ba13389b232?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">managingosx</media:title>
		</media:content>

		<media:content url="http://managingosx.files.wordpress.com/2006/03/radmind_icon.jpg?w=138" medium="image" />
	</item>
	</channel>
</rss>