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

<channel>
	<title>Pattern Buffer:</title>
	<atom:link href="http://patternbuffer.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://patternbuffer.wordpress.com</link>
	<description>Kyle Crawford</description>
	<pubDate>Tue, 15 Jul 2008 03:21:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Simple AFP Forensics using Access Logs</title>
		<link>http://patternbuffer.wordpress.com/2008/07/15/simple-afp-forensics-using-access-logs/</link>
		<comments>http://patternbuffer.wordpress.com/2008/07/15/simple-afp-forensics-using-access-logs/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 03:21:27 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[Mac OS X Server]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Unix]]></category>

		<category><![CDATA[AFP]]></category>

		<category><![CDATA[dscl]]></category>

		<category><![CDATA[forensics]]></category>

		<category><![CDATA[grep]]></category>

		<category><![CDATA[gunzip]]></category>

		<category><![CDATA[log]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=48</guid>
		<description><![CDATA[Mac OS X Server&#8217;s AFP server access logs aren&#8217;t the greatest (no full paths is a glaring omission), but if you have them enabled, they can be useful for finding who deleted a file or folder for example.
If the item&#8217;s name starts with &#8220;Important File&#8221;, this command gives us the ip address of the client [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mac OS X Server&#8217;s AFP server access logs aren&#8217;t the greatest (no full paths is a glaring omission), but if you have them enabled, they can be useful for finding who deleted a file or folder for example.</p>
<p>If the item&#8217;s name starts with &#8220;Important File&#8221;, this command gives us the ip address of the client that deleted the item :<br />
<code>file_server:~ root# grep -i "Delete Important File*" /Library/Logs/AppleFileService/AppleFileServiceAccess.log<br />
IP 10.1.21.6 - - [08/Jul/2008:14:26:14 -0500] &#8220;Delete Important File 2009.xls&#8221; 0 0 0<br />
</code></p>
<p>Then we pass the ip address into this command to give us the login of the user:<br />
<code>file_server:~ root# grep 10.1.21.6 /Library/Logs/AppleFileService/AppleFileServiceAccess.log | grep Login<br />
IP 10.1.21.6 - - [08/Jul/2008:09:05:43 -0500] &#8220;Login mpickens&#8221; 0 0 0<br />
</code></p>
<p>Finally we can use dscl to lookup the full name the user:<br />
<code>file_server:~ root# dscl localhost read /Search/Users/mpickens RealName<br />
RealName: Pickens, Mary Ellen<br />
</code></p>
<p>Older logs are available too in zipped form.  Use gunzip -c to read the contents.<br />
<code>file_server:~ root# gunzip -c '/Library/Logs/AppleFileService/AppleFileServiceAccess.log 12.11.07.gz' | grep Login | grep mpickens<br />
IP 10.1.21.143 - - [14/Dec/2007:19:12:38 -0500] &#8220;Login mpickens&#8221; 0 0 0<br />
IP 10.1.21.143 - - [14/Dec/2007:19:24:32 -0500] &#8220;Login mpickens&#8221; 0 0 0<br />
IP 10.1.21.143 - - [17/Dec/2007:09:21:38 -0500] &#8220;Login mpickens&#8221; 0 0 0<br />
IP 10.1.21.143 - - [17/Dec/2007:10:37:49 -0500] &#8220;Login mpickens&#8221; 0 0 0<br />
&#8230;<br />
</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=48&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/07/15/simple-afp-forensics-using-access-logs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>get parent process from ps</title>
		<link>http://patternbuffer.wordpress.com/2008/07/15/get-parent-process-from-ps/</link>
		<comments>http://patternbuffer.wordpress.com/2008/07/15/get-parent-process-from-ps/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 02:54:12 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Unix]]></category>

		<category><![CDATA[ps]]></category>

		<category><![CDATA[parent process]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=47</guid>
		<description><![CDATA[While booted from NetRestore I couldn&#8217;t figure out what was launching Terminal.app.  Finally found the script that was launching it using an option the ps to show the parent process.
Simple, but useful.
ps auxww -o ppid
It was rc.install.
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While booted from <a href="http://www.bombich.com/software/netrestore.html">NetRestore</a> I couldn&#8217;t figure out what was launching Terminal.app.  Finally found the script that was launching it using an option the ps to show the parent process.</p>
<p>Simple, but useful.</p>
<p><code>ps auxww -o ppid</code></p>
<p>It was rc.install.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/47/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/47/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=47&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/07/15/get-parent-process-from-ps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix for slow AD logins/joins caused by macAddress query</title>
		<link>http://patternbuffer.wordpress.com/2008/06/13/fix-for-slow-ad-loginsjoins-caused-by-macaddress-query/</link>
		<comments>http://patternbuffer.wordpress.com/2008/06/13/fix-for-slow-ad-loginsjoins-caused-by-macaddress-query/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 19:33:58 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[Deployment]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[10.5]]></category>

		<category><![CDATA[ActiveDirectory.plist]]></category>

		<category><![CDATA[AD plugin]]></category>

		<category><![CDATA[Leopard]]></category>

		<category><![CDATA[macAddress]]></category>

		<category><![CDATA[mapping]]></category>

		<category><![CDATA[R2 schema]]></category>

		<category><![CDATA[slow logins]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=44</guid>
		<description><![CDATA[I&#8217;ve been hassling Apple about this issue for quite a while.
Apple has two workarounds for this problem:
1.) Index the macAddress attribute in AD.  Even though the macAddress is not part of the Computer class by default, the AD plugin queries on it for joins ( to ensure the the computer that you are adding [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been hassling Apple about this <a href="http://patternbuffer.wordpress.com/2008/04/15/105-ad-plugin-slow-logins-related-to-macaddress-query/">issue</a> for quite a while.</p>
<p>Apple has two workarounds for this problem:</p>
<p>1.) <a href="http://technet.microsoft.com/en-us/library/aa995762(EXCHG.65).aspx">Index</a> the macAddress attribute in AD.  Even though the macAddress is not part of the Computer class by default, the AD plugin queries on it for joins ( to ensure the the computer that you are adding doesn&#8217;t already exist ), and for MCX ( managed client information ).  Normally I would frown on any changes to AD since the Enterprise doesn&#8217;t like making changes to their infrastructure just to support Macs.  However, supposedly in Windows 2008 Server, the macAddress attribute is indexed by default, so at least their is some justification there.</p>
<p>2.) If you&#8217;d prefer to make changes on your client machines rather than bother your AD administrators with a Mac-specific fix, remove the ENetAddress mapping from /Library/Preferences/ActiveDirectory.plist.  The lines to remove look like this:</p>
<p><code>                        &lt;key&gt;1.3.6.1.1.1.1.22&lt;/key&gt;<br />
                        &lt;string&gt;dsAttrTypeStandard:ENetAddress&lt;/string&gt;<br />
</code></p>
<p>The key is the OID for the <a href="http://msdn.microsoft.com/en-us/library/ms676850(VS.85).aspx">macAddress attribute in AD</a>.<br />
The string value is the mapping to a native Open Directory attribute, which Apple calls ENetAddress.</p>
<p>Update:<br />
You&#8217;ll also need to remove /Library/Preferences/DirectoryService/ActiveDirectoryDynamicData.plist as this file also contains the cached mappings.</p>
<p>Then killall -9 DirectoryService or reboot the machine.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=44&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/06/13/fix-for-slow-ad-loginsjoins-caused-by-macaddress-query/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mac upload problems with Google App Engine</title>
		<link>http://patternbuffer.wordpress.com/2008/06/03/mac-upload-problems-with-google-app-engine/</link>
		<comments>http://patternbuffer.wordpress.com/2008/06/03/mac-upload-problems-with-google-app-engine/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 05:34:56 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[google app engine]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[uploading]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=43</guid>
		<description><![CDATA[I kept getting errors uploading to Google App Engine on Mac.
ERROR appcfg.py:1128 An unexpected error occurred. Aborting.

I run as a normal user.  Apparently appcfg.py requires some elevated privileges, as running it as root uploaded without a problem.
Here is the command to run the appcfg.py inside the GoogleAppEngineLauncher app.
sudo /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/appcfg.py update appdirectory/ --noisy -v --email [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I kept getting errors uploading to Google App Engine on Mac.</p>
<p><code>ERROR appcfg.py:1128 An unexpected error occurred. Aborting.<br />
</code></p>
<p>I run as a normal user.  Apparently appcfg.py requires some elevated privileges, as running it as root uploaded without a problem.</p>
<p>Here is the command to run the appcfg.py inside the GoogleAppEngineLauncher app.</p>
<p><code>sudo /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/appcfg.py update appdirectory/ --noisy -v --email username@gmail.com<br />
</code></p>
<p>Substitute your own appdirectory and username and path to the GoogleAppEngineLauncher.app.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=43&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/06/03/mac-upload-problems-with-google-app-engine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Notes on Leopard AD Plugin 10.5.3</title>
		<link>http://patternbuffer.wordpress.com/2008/05/29/notes-on-leopard-ad-plugin-1053/</link>
		<comments>http://patternbuffer.wordpress.com/2008/05/29/notes-on-leopard-ad-plugin-1053/#comments</comments>
		<pubDate>Thu, 29 May 2008 03:12:31 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[10.5.3]]></category>

		<category><![CDATA[AD plugin]]></category>

		<category><![CDATA[macAddress]]></category>

		<category><![CDATA[R2]]></category>

		<category><![CDATA[slow logins]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=42</guid>
		<description><![CDATA[All of the bugs listed here are fixed in 10.5.3.
What isn&#8217;t fixed is the slow logins on AD environments with an R2 schema that hasn&#8217;t been extended with Mac attributes.
Again, please file bug reports if you are experiencing this issue.
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>All of the bugs listed <a href="http://patternbuffer.wordpress.com/2008/02/17/notes-on-leopard-ad-plugin-1052/">here</a> are fixed in 10.5.3.</p>
<p>What isn&#8217;t fixed is the <a href="http://patternbuffer.wordpress.com/2008/04/15/105-ad-plugin-slow-logins-related-to-macaddress-query/">slow logins on AD environments</a> with an R2 schema that hasn&#8217;t been extended with Mac attributes.</p>
<p>Again, please file <a href="http://bugreport.apple.com">bug reports</a> if you are experiencing this issue.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=42&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/05/29/notes-on-leopard-ad-plugin-1053/feed/</wfw:commentRss>
		</item>
		<item>
		<title>dockutil 1.0 released</title>
		<link>http://patternbuffer.wordpress.com/2008/05/16/dockutil-10-released/</link>
		<comments>http://patternbuffer.wordpress.com/2008/05/16/dockutil-10-released/#comments</comments>
		<pubDate>Fri, 16 May 2008 05:55:21 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Deployment]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[dockutil]]></category>

		<category><![CDATA[command line]]></category>

		<category><![CDATA[dock]]></category>

		<category><![CDATA[plist]]></category>

		<category><![CDATA[plistlib]]></category>

		<category><![CDATA[replace]]></category>

		<category><![CDATA[stack]]></category>

		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=41</guid>
		<description><![CDATA[As a Mac sysadmin, I&#8217;ve had the need to manipulate the dock on hundreds of systems at a time.
I used to cobble together terrible shell scripts to do the job, but now thanks to plistlib and python, plist manipulation is really easy.  I am releasing this utility free under the Apache 2.0 license.  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As a Mac sysadmin, I&#8217;ve had the need to manipulate the dock on hundreds of systems at a time.</p>
<p>I used to cobble together terrible shell scripts to do the job, but now thanks to plistlib and python, plist manipulation is really easy.  I am releasing this utility free under the Apache 2.0 license.  Hopefully some other sysadmins will find it useful.</p>
<p>dockutil is a command line utility for managing Mac OS X dock items.<br />
It can add, replace, list, move, find, and delete dock items. It supports Applications, Folders, Stacks, and URLs. It can act on a specific dock plist or every dock plist in a folder of home directories.<br />
It is compatible with Mac OS X Tiger and Leopard.</p>
<p><a href="http://code.google.com/p/dockutil">Download dockutil here.</a></p>
<p>Here is the usage information:</p>
<p><code>usage:     dockutil -h<br />
usage:     dockutil &#8211;add (path to item) | (url) [--label (label)] [ folder_options ] [ position_options ] [ plist_location_specification ]<br />
usage:     dockutil &#8211;remove (dock item label) [ plist_location_specification ]<br />
usage:     dockutil &#8211;move (dock item label)  position_options [ plist_location_specification ]<br />
usage:     dockutil &#8211;find (dock item label) [ plist_location_specification ]<br />
usage:     dockutil &#8211;list [ plist_location_specification ]</p>
<p>position_options:<br />
  &#8211;replacing (dock item label name)                            replaces the item with the given dock label or adds the item to the end if item to replace is not found<br />
  &#8211;position [ index_number | beginning | end | middle ]        inserts the item at a fixed position: can be an position by index number or keyword<br />
  &#8211;after (dock item label name)                                inserts the item immediately after the given dock label or at the end if the item is not found<br />
  &#8211;before (dock item label name)                               inserts the item immediately before the given dock label or at the end if the item is not found<br />
  &#8211;section [ apps | others ]                                   specifies whether the item should be added to the apps or others section</p>
<p>plist_location_specifications:<br />
  (path to a specific plist)                                    default is the dock plist for current user<br />
  (path to a home directory)<br />
  &#8211;allhomes                                                    attempts to locate all home directories and perform the operation on each of them<br />
  &#8211;homeloc                                                     overrides the default /Users location for home directories</p>
<p>folder_options:<br />
  &#8211;view [grid|fan|list|automatic]                              stack view option<br />
  &#8211;display [folder|stack]                                      how to display a folder&#8217;s icon<br />
  &#8211;sort [name|dateadded|datemodified|datecreated|kind]         sets sorting option for a folder view</p>
<p>Examples:<br />
  The following adds TextEdit.app to the end of the current user&#8217;s dock:<br />
           dockutil &#8211;add /Applications/TextEdit.app</p>
<p>  The following replaces Time Machine with TextEdit.app in the current user&#8217;s dock:<br />
           dockutil &#8211;add /Applications/TextEdit.app &#8211;replacing &#8216;Time Machine&#8217;</p>
<p>  The following adds TextEdit.app after the item Time Machine in every user&#8217;s dock on that machine:<br />
           dockutil &#8211;add /Applications/TextEdit.app &#8211;after &#8216;Time Machine&#8217; &#8211;allhomes</p>
<p>  The following adds ~/Downloads as a grid stack displayed as a folder for every user&#8217;s dock on that machine:<br />
           dockutil &#8211;add &#8216;~/Downloads&#8217; &#8211;view grid &#8211;display folder &#8211;allhomes</p>
<p>  The following adds a url dock item after the Downloads dock item for every user&#8217;s dock on that machine:<br />
           dockutil &#8211;add vnc://miniserver.local &#8211;label &#8216;Mini VNC&#8217; &#8211;after Downloads &#8211;allhomes</p>
<p>  The following removes System Preferences from every user&#8217;s dock on that machine:<br />
           dockutil &#8211;remove &#8216;System Preferences&#8217; &#8211;allhomes</p>
<p>  The following moves System Preferences to the second slot on every user&#8217;s dock on that machine:<br />
           dockutil &#8211;move &#8216;System Preferences&#8217; &#8211;position 2 &#8211;allhomes</p>
<p>  The following finds any instance of iTunes in the specified home directory&#8217;s dock:<br />
           dockutil &#8211;find iTunes /Users/jsmith</p>
<p>  The following lists all dock items for all home directories at homeloc in the form: item(tab)path(tab)(section)tab(plist)<br />
           dockutil &#8211;list &#8211;homeloc /Volumes/RAID/Homes &#8211;allhomes</p>
<p>Notes:<br />
  When specifying a relative path like ~/Documents with the &#8211;allhomes option, ~/Documents must be quoted like &#8216;~/Documents&#8217; to get the item relative to each home</p>
<p>Bugs:<br />
  Names containing special characters like accent marks will fail</p>
<p>Contact:<br />
  Send bug reports and comments to kcrwfrd at gmail.<br />
</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=41&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/05/16/dockutil-10-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Shell Injection with AppleScript&#8217;s do shell script</title>
		<link>http://patternbuffer.wordpress.com/2008/05/14/shell-injection-with-applescripts-do-shell-script/</link>
		<comments>http://patternbuffer.wordpress.com/2008/05/14/shell-injection-with-applescripts-do-shell-script/#comments</comments>
		<pubDate>Wed, 14 May 2008 02:40:58 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Unix]]></category>

		<category><![CDATA[applescript]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[do shell script]]></category>

		<category><![CDATA[quoted form of]]></category>

		<category><![CDATA[shell injection]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=40</guid>
		<description><![CDATA[AppleScript&#8217;s do shell script capability is immensely useful, but if you are sending variable data to do shell script, always validate input and use quoted form of variableName.  See the following example:
set dialogResult to (display dialog "Enter a directory name to pass to ls:" default answer ";say boo" buttons {"Cancel", "Quoted Form", "Raw"})
if button [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>AppleScript&#8217;s do shell script capability is immensely useful, but if you are sending variable data to do shell script, always validate input and use <code>quoted form of variableName</code>.  See the following example:</p>
<p><code>set dialogResult to (display dialog "Enter a directory name to pass to ls:" default answer ";say boo" buttons {"Cancel", "Quoted Form", "Raw"})</p>
<p>if button returned of dialogResult is &#8220;Quoted Form&#8221; then<br />
	try<br />
		set theCommand to &#8220;ls  ~/&#8221; &amp; quoted form of text returned of dialogResult<br />
		display dialog &#8220;Will execute:&#8221; &amp; return &amp; theCommand &amp; return &amp; &#8220;Proceed?&#8221;<br />
		do shell script theCommand<br />
	end try<br />
else<br />
	try<br />
		set theCommand to &#8220;ls ~/&#8221; &amp; text returned of dialogResult<br />
		display dialog &#8220;Will execute:&#8221; &amp; return &amp; theCommand &amp; return &amp; &#8220;Proceed?&#8221;<br />
		do shell script theCommand<br />
	end try<br />
end if</code></p>
<p>Note you&#8217;ll have to fix the quotes to standard double quotes to get this to compile.  I couldn&#8217;t get wordpress to cooperate.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=40&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/05/14/shell-injection-with-applescripts-do-shell-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unix Environment Variable Scope/Security</title>
		<link>http://patternbuffer.wordpress.com/2008/05/05/unix-environment-variable-scopesecurity/</link>
		<comments>http://patternbuffer.wordpress.com/2008/05/05/unix-environment-variable-scopesecurity/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:29:41 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Unix]]></category>

		<category><![CDATA[environment]]></category>

		<category><![CDATA[scope]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=39</guid>
		<description><![CDATA[I recently encountered a command line tool which exposed passwords in the process listing.
The command would also also accept a password as an environment variable.  I was concerned with the security of storing a password in an environment variable.
This article at itworld.com does a nice job explaining environment variable scope.
Environment variables are only accessible [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently encountered a command line tool which exposed passwords in the process listing.</p>
<p>The command would also also accept a password as an environment variable.  I was concerned with the security of storing a password in an environment variable.</p>
<p>This <a href="http://www.itworld.com/Comp/2378/swol-0500-unix101/">article at itworld.com</a> does a nice job explaining environment variable scope.</p>
<p>Environment variables are only accessible in the shell in which they are set.</p>
<p>If you export the variable, it is accessible to any subshell of the shell in which it is exported.  Simply logging in as another user on the system or even the same user does not allow access to the exported variable.</p>
<p>So, until someone corrects me, I believe that setting and exporting environment variables containing passwords in a script does protect the password from exposure.  As soon as the command requiring the password has completed, the variable can be reset to an empty string to prevent any further access to the password.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=39&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/05/05/unix-environment-variable-scopesecurity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PyAverager tutorial error with Cocoa Bindings</title>
		<link>http://patternbuffer.wordpress.com/2008/05/05/pyaverager-tutorial-error-with-cocoa-bindings/</link>
		<comments>http://patternbuffer.wordpress.com/2008/05/05/pyaverager-tutorial-error-with-cocoa-bindings/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:05:04 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[bindings]]></category>

		<category><![CDATA[cocoa]]></category>

		<category><![CDATA[PyObjC]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=38</guid>
		<description><![CDATA[this class is not key value coding-compliant for the key numbersInput
If you are getting this error after doing the PyObjC averager tutorial called  Using PyObjC for Developing Cocoa Applications with Python , import your class in main.py.
After the line:
import PyAveragerAppDelegate
add:
import Averager
This should allow the numbersInput variable to be properly bound to Interface Builder.
I found [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><code>this class is not key value coding-compliant for the key numbersInput</code></p>
<p>If you are getting this error after doing the PyObjC averager tutorial called <a href="http://developer.apple.com/cocoa/pyobjc.html"> <em>Using PyObjC for Developing Cocoa Applications with Python</em> </a>, import your class in main.py.</p>
<p>After the line:<br />
<code>import PyAveragerAppDelegate</code></p>
<p>add:<br />
<code>import Averager</code></p>
<p>This should allow the numbersInput variable to be properly bound to Interface Builder.</p>
<p>I found the solution on macosxhints forum <a href="http://forums.macosxhints.com/showthread.php?t=84528">here</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=38&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/05/05/pyaverager-tutorial-error-with-cocoa-bindings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>10.5 AD plugin slow logins related to macAddress query</title>
		<link>http://patternbuffer.wordpress.com/2008/04/15/105-ad-plugin-slow-logins-related-to-macaddress-query/</link>
		<comments>http://patternbuffer.wordpress.com/2008/04/15/105-ad-plugin-slow-logins-related-to-macaddress-query/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 04:09:35 +0000</pubDate>
		<dc:creator>Kyle Crawford</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[Deployment]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[AD plugin]]></category>

		<category><![CDATA[DirectoryService]]></category>

		<category><![CDATA[ldapsearch]]></category>

		<category><![CDATA[macAddress]]></category>

		<category><![CDATA[slow login]]></category>

		<guid isPermaLink="false">http://patternbuffer.wordpress.com/?p=37</guid>
		<description><![CDATA[The slow login times in the Leopard AD plugin seem to be related to a search by macAddress.  If you killall -USR1 DirectoryService, and login on a Leopard machine bound to AD, you&#8217;ll notice a query on macAddress in the /Library/Logs/DirectoryService/DirectoryService.debug.log. I am not sure the purpose of this query, but our computer objects don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The slow login times in the Leopard AD plugin seem to be related to a search by macAddress.  If you killall -USR1 DirectoryService, and login on a Leopard machine bound to AD, you&#8217;ll notice a query on macAddress in the /Library/Logs/DirectoryService/DirectoryService.debug.log. I am not sure the purpose of this query, but our computer objects don&#8217;t even use the macAddress attribute, so the query always results in no records found.</p>
<p>I can manually execute the same query and the time almost perfectly matches the delay I see with logins; about 45 seconds.</p>
<p><code>time ldapsearch -v -w password -x -h domaincontroller.domain.forest.com -D username@domain.forest.com -b "DC=domain,DC=forest,DC=com" "(&amp;(objectCategory=cn=computer,cn=schema,cn=configuration,dc=forest,dc=com)<br />
(macAddress=00:1a:22:ee:31:ac))&#8221;</code></p>
<p>Just substitute your own domain, forest, domain controller, username, password, and mac address etc to test.</p>
<p>I&#8217;ve tried manually mapping macAddress to another attribute, but it didn&#8217;t make a difference, so I don&#8217;t have any workaround to offer. Adding the macAddress attribute to your computer objects in AD might speed things up, but I have not tested this.  I&#8217;ve notified Apple of the issue in radar 5752763, which is marked as a Duplicate of 5679705.  If you see this macAddress query taking a long time, please <a title="Bug Reporter" href="http://bugreport.apple.com">report</a> this to Apple so it can get fixed sooner rather than later.  Actually, this same query is used during the join process, which may explain the long join times while it searches for an existing computer.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/patternbuffer.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/patternbuffer.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/patternbuffer.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/patternbuffer.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/patternbuffer.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/patternbuffer.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/patternbuffer.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/patternbuffer.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/patternbuffer.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/patternbuffer.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/patternbuffer.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/patternbuffer.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=patternbuffer.wordpress.com&blog=2078764&post=37&subd=patternbuffer&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://patternbuffer.wordpress.com/2008/04/15/105-ad-plugin-slow-logins-related-to-macaddress-query/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>