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

<channel>
	<title>Make Mac Work &#187; Command Line</title>
	<atom:link href="http://www.makemacwork.com/category/command-line/feed" rel="self" type="application/rss+xml" />
	<link>http://www.makemacwork.com</link>
	<description>Helping Manage The Macintosh Enterprise</description>
	<lastBuildDate>Mon, 31 Aug 2009 07:00:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Secure Finder Permissions</title>
		<link>http://www.makemacwork.com/secure-finder-permissions.htm</link>
		<comments>http://www.makemacwork.com/secure-finder-permissions.htm#comments</comments>
		<pubDate>Mon, 17 Aug 2009 07:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/secure-finder-permissions/</guid>
		<description><![CDATA[File permissions are something systems administrators deal with every day. Usually when somebody can&#8217;t read something on the server, and they need you to figure out why. In multi-user environments, however, what people can&#8217;t read is often as important as what they can, and by default the Mac OS X Finder may allow people to [...]]]></description>
			<content:encoded><![CDATA[<p>File permissions are something systems administrators deal with every day. Usually when somebody can&#8217;t read something on the server, and they need you to figure out why. In multi-user environments, however, what people can&#8217;t read is often as important as what they can, and by default the Mac OS X Finder may allow people to read far more than your users expect.</p>
<h3>A Complex Explanation of Unix Permissions:</h3>
<p>In cross-platform deployments, permissions may most often be Windows-style ACLs (access control lists), allowing a wide variety of context-sensitive settings but requiring a degree of administrative overhead to set up and maintain. On native Mac OS X systems, you&#8217;ll most likely be dealing with POSIX-style permissions (also known as Unix permissions) which define file access as granted to the owner, the group, and others. This information is available for every file and folder in the Finder by highlighting an item and choosing &#8220;Get Info&#8221; in the &#8220;File&#8221; menu, then selecting &#8220;Ownership and Permissions&#8221; in the window that appears.</p>
<p>The underlying Unix operating system keeps track of those file permissions as numeric values, where <tt>4</tt> represents read, <tt>2</tt> represents write, and <tt>1</tt> represents execute (which the Finder doesn&#8217;t report). These values are additive, so that a file which allows read and write access to it&#8217;s owner and read-only access to it&#8217;s group and others is denoted as <tt>644</tt>, with the <tt>6</tt> being the sum of <tt>4</tt> for read and <tt>2</tt> for write. For a directory these read and write permissions are denoted as <tt>755</tt> (without execute permissions a user is unable to interact with or even list directory contents, so an additional <tt>1</tt> is added to each position). It&#8217;s these numeric values that are used by Unix commands like <tt>chown</tt> and <tt>chmod</tt>, which change ownership and permissions mode respectively.</p>
<p>When you create a new file the default permissions are defined by a value called the <tt>umask</tt>. This value is subtracted from <tt>666</tt> for regular files (and <tt>777</tt> for directories) to determine their access privileges. So when creating a new folder, a umask of <tt>022</tt> would yield permissions of <tt>755</tt>, allowing the owner to both read and write enclosed files while the group and others are able to read them. Unfortunately, these are the settings used by the Finder in a new OS X installation.</p>
<h3>A Simple Way to Improve Finder Security:</h3>
<p>By default, the Finder creates folders with permissions that allow read access to anyone who can log in to your machine. This isn&#8217;t a problem if users only save files in the pre-existing folders in their home directory (like Documents), as their permissions already prevent access by anyone but the user.</p>
<p>When users create additional directories, however, the documents stored inside them can be accessed by other users on that computer (or in the case of servers and when file-sharing is enabled, by anyone on the network). This is seldom the behavior that users expect, and in many settings it can present a serious security problem.</p>
<p>There are lots of ways to adjust the <tt>umask</tt> system-wide, depending on the OS version you&#8217;re using (such as the <tt>GlobalPreferences.plist</tt> and the <tt>NSUmask</tt> property). Unfortunately, setting the <tt>umask</tt> for the entire system is also a really good way to break things unexpectedly.  </p>
<p>The easy way to solve this issue is to adjust the Finder&#8217;s <tt>umask</tt> settings by creating a new preferences file on the command line. So long as the files your applications save are inside folders the Finder created, you&#8217;ll have the security you need to prevent casual snooping. While logged in as an administrative user, open the Terminal and type:</p>
<p><code><strong>defaults write /Library/Preferences/com.apple.finder \<br />umask -int 077</strong></code></p>
<p>On their next login, users who create new folders in the Finder will have their permissions set automatically to <tt>700</tt> &#8212; allowing them to read and write the contents but preventing access by any other users entirely.</p>
<p><span class="note">Recommended Reading: </span>Is there anything that Wikipedia can&#8217;t explain? I&#8217;m not sure, but for more information on this topic, take a look at their excellent <a href="http://en.wikipedia.org/wiki/file_system_permissions">file system permissions</a> entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/secure-finder-permissions.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide Administrative User Accounts</title>
		<link>http://www.makemacwork.com/hide-administrative-user-accounts.htm</link>
		<comments>http://www.makemacwork.com/hide-administrative-user-accounts.htm#comments</comments>
		<pubDate>Mon, 20 Jul 2009 07:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/hide-administrative-user-accounts.htm</guid>
		<description><![CDATA[While never technically required (though often politically desirable), hiding local administrative accounts on Leopard workstations and laptops is one of the most popular requests we receive from IT personnel. The most common scenario is removing a pre-existing administrative account from view. This is a typical approach when building a disk image for manual cloning or [...]]]></description>
			<content:encoded><![CDATA[<p>While never technically required (though often politically desirable), hiding local administrative accounts on Leopard workstations and laptops is one of the most popular requests we receive from IT personnel. The most common scenario is removing a pre-existing administrative account from view. This is a typical approach when building a disk image for manual cloning or <a href="http://www.makemacwork.com/configure-network-installation.htm">installation via NetInstall</a>, and in this article we&#8217;ll take a look at the steps it requires.</p>
<p>In a stock Mac OS X installation, the first account created during the installation process always has administrative privileges. That first account is also always assigned the UniqueID (the number by which the operating system identifies users) of <tt>501</tt>. Since there&#8217;s a built-in preference setting that will hide accounts with a <tt>UID</tt> below <tt>500</tt>, changing that number with the <tt>dscl</tt> command is a good place to start. </p>
<p>It&#8217;s advisable to do this from the <tt>root</tt> account (where you won&#8217;t need to use <tt>sudo</tt> for the following commands), or from another administrative account created for this purpose. Open the Terminal, and type:</p>
<p><code><strong>sudo dscl . -change /Users/ADMIN UniqueID 501 NEWUID</strong></code></p>
<p>Change <tt>ADMIN</tt> to the name of your actual administrative user, and <tt>NEWUID</tt> to the new UniqueID number you&#8217;d like to use. While many numbers below <tt>500</tt> are used by the operating system, <tt>490-499</tt> are left unused by default.</p>
<p>Because we&#8217;ve changed the <tt>UID</tt>, which is used to determine ownership of files, we&#8217;ll need to make sure that any files owned by that user (especially their home directory) have their ownership changed to the new <tt>UID</tt> as well. This can be accomplished by searching for those files with the Unix <tt>find</tt> command, then changing their ownership with <tt>chown</tt> to the new <tt>UID</tt>:</p>
<p><code><strong>sudo find / -user 501 -exec chown NEWUID {} \;</strong></code></p>
<p>With file ownership now matching the new administrative <tt>UID</tt>, the last task is to tell the system not to display the administrative user at login or in the Fast User Switching menu. This is accomplished by editing the LoginWindow preferences file, by typing:</p>
<p><code><strong>sudo defaults write /Library/Preferences/com.apple.loginwindow \<br />Hide500Users -bool TRUE</strong></code></p>
<p>With this command, the initial administrative account will be hidden entirely, but it&#8217;s home directory will still be visible in the <tt>/Users</tt> directory. This is fine for most environments, but if you want that home directory hidden, you can move it to a hidden location and tell the OS to look there with the <tt>dscl</tt> command. </p>
<p>OS X keeps the <tt>root</tt> home directory in the hidden <tt>/var</tt> directory. That&#8217;s unusual for Unix, but it sets a precedent you might as well follow. To hide your administrative account&#8217;s home directory in the same manner, move it by typing:</p>
<p><code><strong>sudo mv /Users/ADMIN /var/ADMIN</strong></code></p>
<p>With the directory now hidden from the Finder, set its new location with:</p>
<p><code><strong>sudo dscl . -change /Users/ADMIN NFSHomeDirectory \<br />/Users/ADMIN /var/ADMIN</strong></code></p>
<p>In both these cases, change <tt>ADMIN</tt> to the name of your actual administrative user account. With this method, your administrative account should be entirely hidden from view, allowing you to keep both it&#8217;s name and it&#8217;s existence a secret from typical users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/hide-administrative-user-accounts.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirror Disks After Install</title>
		<link>http://www.makemacwork.com/mirror-disks-after-install.htm</link>
		<comments>http://www.makemacwork.com/mirror-disks-after-install.htm#comments</comments>
		<pubDate>Mon, 13 Jul 2009 07:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/mirror-disks-after-install/</guid>
		<description><![CDATA[Disk mirroring, where data is written to two disks simultaneously, is a great low cost method to protect against single-disk failure and improve read-intensive performance.  Apple&#8217;s Disk Utility provides an easy way to set two disks up as a RAID mirror prior to installation. Once the operating system has been installed, though, OS X [...]]]></description>
			<content:encoded><![CDATA[<p>Disk mirroring, where data is written to two disks simultaneously, is a great low cost method to protect against single-disk failure and improve read-intensive performance.  Apple&#8217;s Disk Utility provides an easy way to set two disks up as a RAID mirror prior to installation. Once the operating system has been installed, though, OS X can&#8217;t mirror an existing drive without completely reformatting. Unless, of course, you choose to do some from the command line.</p>
<p>Now this process has the potential to destroy all the data on your machine, so make sure you have a current backup of the drive you&#8217;re going to mirror and confirm the backup is both restorable and bootable. Also, if you&#8217;re mirroring your existing startup disk, you&#8217;ll need to boot off an installation DVD or external drive for the first part of the operation. But if you have a system disk that isn&#8217;t already mirrored, this procedure can save you a lot of time and frustration.</p>
<p>First, from the Terminal, type:</p>
<p><code><strong>diskutil list</strong></code></p>
<p>This will produce a listing of the attached disks, along with their types, names, sizes, and identifiers, like so:</p>
<p><code><strong>/dev/disk1<br />#:                   type name         size       identifier<br />0: Apple_partition_scheme              *465.8 GB  disk1<br />1:    Apple_partition_map              31.5 KB    disk1s1<br />2:              Apple_HFS Server Disk  465.6 GB   disk1s2</strong></code></p>
<p>Use the name of the volume you wish to mirror to find it&#8217;s identifier. If your machine only has one internal hard drive, for instance, the identifier of your boot volume will most likely be <tt>disk1s2</tt>, the second slice (after the partition scheme and map) of disk 1. Once you&#8217;ve determined which disk you&#8217;re working with, type the following, replacing <tt>IDENTIFIER</tt> appropriately:</p>
<p><code><strong>sudo diskutil enableRAID mirror IDENTIFIER</strong></code></p>
<p>If all goes well, the disk will unmount, reappearing in the Finder a moment later along with &#8220;The disk has been converted into a RAID&#8221; reported in the Terminal. At this point you can insert the additional disk you wish to use in the mirrored RAID array (assuming it&#8217;s not installed already), then reboot the machine off the original drive.</p>
<p>Now when when you run <tt>diskutil list</tt> from the Terminal you should see two new listings, one for the new virtual RAID array (the one without slice information) and the other for the additional physical disk you installed.</p>
<p><code><strong>/dev/disk2<br />#:                   type name         size      identifier<br />0:              Apple_HFS Server Disk  *465.6 GB disk2<br />/dev/disk3<br />#:                   type name         size      identifier<br />0:  GUID_partition_scheme              *465.6 GB disk3<br />1:                    EFI              200.0 MB  disk3s1<br />2:              Apple_HFS New Disk     465.4 GB  disk3s2</strong></code></p>
<p>Now with the necessary identifier information, you can assign the physical disk to the mirrored RAID array, replacing <tt>RAIDARRAY</tt> with the RAID volume (in our example <tt>disk2</tt>) and <tt>NEWDISK</tt> with the hard drive being added (here <tt>disk3</tt>):</p>
<p><code><strong>sudo diskutil addToRAID member NEWDISK RAIDARRAY &#038;</strong></code></p>
<p>How long the RAID mirror takes to build depends on how much data is on the original volume, but the ampersand at the end of the command tells it to run in the background. When the process is completed you&#8217;ll have two fully mirrored and redundant disks, built from your existing installation without ever having to erase the original volume.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/mirror-disks-after-install.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Invalid Font Files</title>
		<link>http://www.makemacwork.com/find-invalid-font-files.htm</link>
		<comments>http://www.makemacwork.com/find-invalid-font-files.htm#comments</comments>
		<pubDate>Mon, 06 Jul 2009 07:00:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/find-invalid-font-files.htm</guid>
		<description><![CDATA[Just because solving a problem is easy doesn&#8217;t mean it&#8217;s an easy problem. The issue of &#8220;corrupted&#8221; or out-of-spec font files causing operating system or application crashes is a long-standing thorn in the side of Mac users and administrators. That&#8217;s because font files are software that interacts directly with the OS, but that software is [...]]]></description>
			<content:encoded><![CDATA[<p>Just because solving a problem is easy doesn&#8217;t mean it&#8217;s an easy problem. The issue of &#8220;corrupted&#8221; or out-of-spec font files causing operating system or application crashes is a long-standing thorn in the side of Mac users and administrators. That&#8217;s because font files are software that interacts directly with the OS, but that software is often judged (and purchased) on aesthetic, rather than technical, grounds. While the problem of bad font software isn&#8217;t likely to go away any time soon, it&#8217;s at least possible to solve the problem of locating and removing those files.</p>
<p>Beginning in OS X 10.5 (Leopard), Apple built in the ability to run validity checks on any font file. Those checks can be done when the fonts are loaded into Font Book, but they&#8217;re also run beforehand when your disks are indexed by Spotlight. By using <tt>mdfind</tt>, one of the command line tools that works behind the Spotlight interface, it&#8217;s easy to find all the indexed files that may contain bad font data. Open the Terminal and type:</p>
<p><code><strong>mdfind "com_apple_ats_font_invalid == 1"</strong></code></p>
<p>This short and simple trick will return a list of all the suspect font files stored on any machine, whether they&#8217;re loaded in one of your user&#8217;s font folders or just stored on a spare external drive. Push the command out with Apple Remote Desktop, and you&#8217;ve got a list of every questionable font on every machine at your whole company. Once you&#8217;ve located these potential problems, it should be easy to round them up and remove them before they cause additional frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/find-invalid-font-files.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Remote System Logging</title>
		<link>http://www.makemacwork.com/enable-remote-system-logging.htm</link>
		<comments>http://www.makemacwork.com/enable-remote-system-logging.htm#comments</comments>
		<pubDate>Mon, 29 Jun 2009 07:00:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/enable-remote-system-logging.htm</guid>
		<description><![CDATA[If you&#8217;ve ever had to troubleshoot a Mac OS X machine, you probably know how invaluable the system logs can be. By simply opening the Console application in the Utilities folder, you can browse the information logged by almost any process on the machine. But how can you compare that data over a large number [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever had to troubleshoot a Mac OS X machine, you probably know how invaluable the system logs can be. By simply opening the Console application in the Utilities folder, you can browse the information logged by almost any process on the machine. But how can you compare that data over a large number of systems, or look at the logs for a machine that isn&#8217;t right in front of you? It&#8217;s simply a matter of properly configuring <tt>syslogd</tt>.</p>
<h3>Listening For Syslog Data:</h3>
<p>Like all Unix systems, Mac OS X logs it&#8217;s system activity through <tt>syslogd</tt>, the system logging daemon. This facility keeps track of all the system activity specified in <tt>/etc/syslog.conf</tt>, which details the kind of information to log (based on its process of origin) and its level of priority (set by its parent process). This system is well documented by simply typing &#8220;<tt>man syslog</tt>&#8221; at the command line. What isn&#8217;t so easy to find is how to configure OS X clients to send this data to a central collection server for analysis.</p>
<p>The secret is hidden in <tt>/System/Library/LaunchDaemons/com.apple.syslogd.plist</tt>. The last item in the file is a key named <tt>NetworkListener</tt>, and by removing the comment characters around it you can tell your Mac server to listen for any and all logging information sent to it via UDP port 514. Once that&#8217;s done, you&#8217;ll need to restart the syslog mechanism by opening the Terminal and typing:</p>
<p><code><strong>sudo launchctl unload \<br />/System/Library/LaunchDaemons/com.apple.syslogd.plist<br />sudo launchctl load \<br />/System/Library/LaunchDaemons/com.apple.syslogd.plist</strong></code></p>
<p>With <tt>syslogd</tt> restarted, your server can now receive and store remote logging data from Macintosh clients, networking devices, and other Unix-compatible systems.</p>
<h3>Sending Remote Syslog Data:</h3>
<p>Now you&#8217;ve got a brand new <tt>syslog</tt> server. It&#8217;s listening, but nothing&#8217;s talking to it yet. For that, we&#8217;ll need to edit <tt>/etc/syslog.conf</tt> on your client machines, telling them what (and where) to report.</p>
<p>Open the file in any text editor, and you&#8217;ll see the following format on the very first line:</p>
<p><code><strong>auth.info;authpriv.*;remoteauth.crit          /var/log/secure.log</strong></code></p>
<p>On the left side are a series of &#8220;selectors&#8221;, each separated by a semi-colon. Each selector is made up of a &#8220;facility&#8221; (before the period), which indicates the category being logged to, and a &#8220;level&#8221; (after the period), which indicates the level of importance that a message from that category needs to reach before it&#8217;s logged. An asterisk acts as a wildcard, including any possible facility or level. </p>
<p>On the right side is an &#8220;action&#8221;, preformed when <tt>syslogd</tt> receives a message matching the specified selector. This is most often expressed as a local log file, but can also be another machine listening for <tt>syslog</tt> data.</p>
<p>So if you wanted to log every possible message to the <tt>syslog</tt> server, you could simply add the following line (replacing <tt>server.example.com</tt> with the name of your local server):</p>
<p><code><strong>*.*          @server.example.com</strong></code></p>
<p>That would send all that messages from any facility at any level of priority to your new syslog server. That configuration&#8217;s fine for testing a single machine, but unless your goal is to completely flood your local network with logging traffic, you&#8217;ll need to narrow down your selectors significantly before you push your revised file out to all your client machines.</p>
<p>Once you determine what information is important to your organization, you can build a custom <tt>syslog.conf</tt> file to install across your whole network, and begin collecting system log information for all your machines.</p>
<p><span class="note">Recommended Reading:</span> For in-depth information on configuring remote logging, check the manpages for <tt>syslogd</tt>, <tt>syslog</tt>, <tt>syslog.conf</tt>, and <tt>logger</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/enable-remote-system-logging.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repair Spotlight Indexing</title>
		<link>http://www.makemacwork.com/repair-spotlight-indexing.htm</link>
		<comments>http://www.makemacwork.com/repair-spotlight-indexing.htm#comments</comments>
		<pubDate>Mon, 22 Jun 2009 07:00:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/repair-spotlight-indexing.htm</guid>
		<description><![CDATA[You&#8217;re looking for an email invitation you sent months ago, but the option to search through each &#8220;Entire Message&#8221; in Mail is grayed out entirely. Instead, you search iCal for the appointment itself, only to find the results are empty. Thinking you have the minutes stored somewhere on your hard drive, you try searching in [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re looking for an email invitation you sent months ago, but the option to search through each &#8220;Entire Message&#8221; in Mail is grayed out entirely. Instead, you search iCal for the appointment itself, only to find the results are empty. Thinking you have the minutes stored somewhere on your hard drive, you try searching in the Finder but discover that even items displayed in open windows can&#8217;t be located. Spotlight indexing has broken on your local machine.</p>
<p>Leopard brought a number of improvements to Spotlight, the OS X search mechanism, including system-wide integration with the Finder and native applications. This is accomplished with an indexing process, <tt>mdworker</tt>, that runs in the background at all times organizing file metadata. While this feature has proven to be quite powerful, it&#8217;s also proved quite troublesome, as issues that would previously effect only Spotlight can now disable the ability to search the content of email messages and calendars as well.</p>
<p>When Spotlight attempts to scan a corrupt file, it can stall or crash, failing to properly index your disks and (as a result) disabling the search functionality in other Apple applications.  To figure out what Spotlight&#8217;s choking on, you&#8217;ll first need it to stop indexing entirely.  Make sure you&#8217;ve quit out of all your effected applications, then open the Terminal and type:</p>
<p><code><strong>sudo mdutil -i off /Volumes/*</strong></code></p>
<p>Once the Spotlight process is disabled, remove the old index files Spotlight built of your existing file system, replacing DISKNAME for the name of each mounted volume:</p>
<p><code><strong>sudo rm -r /Volumes/DISKNAME/.Spotlight-V100</strong></code></p>
<p>Next, open the Console application in the Utilities folder.  View &#8220;All Messages&#8221; in the left hand column, and use the &#8220;Filter&#8221; field in the top right to search for &#8220;<tt>mdworker</tt>&#8221; (the behind-the-scenes process that indexes data for Spotlight).  If the remaining errors end in file names, you&#8217;ve found a likely source for your Spotlight woes.  </p>
<p>Make sure these corrupt files are safe to move (and not within Application bundles or required by the OS), then relocate them to a removable drive or erase them entirely. With your suspect files out of the way, you can restart Spotlight indexing:</p>
<p><code><strong>sudo mdutil -E -i on /Volumes/*</strong></code></p>
<p>Once the indexing is complete, check the Console logs again to make sure the errors haven&#8217;t repeated.  You can now reopen your applications, and the ability to search messages and appointments should be restored.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/repair-spotlight-indexing.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Network .DS_Store Files</title>
		<link>http://www.makemacwork.com/disable-network-ds_store-files.htm</link>
		<comments>http://www.makemacwork.com/disable-network-ds_store-files.htm#comments</comments>
		<pubDate>Mon, 25 May 2009 07:00:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/disable-network-ds_store-files.htm</guid>
		<description><![CDATA[If you aren&#8217;t lucky enough to have corporate servers that run AFP, you&#8217;ve probably had just about enough of the .DS_Store files that Mac OS X leaves lying around your Windows SMB and Linux NFS shares. While the files are turned off by default in Leopard, there are enough Tiger and Panther servers around to [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren&#8217;t lucky enough to have corporate servers that run AFP, you&#8217;ve probably had just about enough of the <tt>.DS_Store</tt> files that Mac OS X leaves lying around your Windows SMB and Linux NFS shares. While the files are turned off by default in Leopard, there are enough Tiger and Panther servers around to drive underfunded IT departments mad.</p>
<p>Keep in mind that those files hold comments and folder views for the Finder, so you&#8217;ll be annoying your Mac users by disabling them. But if your own obsessive-compulsive tendencies outweigh other people&#8217;s convenience (and whose don&#8217;t?), it&#8217;s as simple as running the following command on each client machine:</p>
<p><code><strong>sudo defaults write /Library/Preferences/com.apple.desktopservices \<br />DSDontWriteNetworkStores true</strong></code></p>
<p>If you push this out with ARD, Casper Suite, or LANrev, you can leave off &#8220;<tt>sudo</tt>&#8221; as you&#8217;ll be running the command as <tt>root</tt>. Once the prefernces have changed, just reboot your machines for it to take effect. Just like magic, no more <tt>.DS_Store</tt>!</p>
<p><span class="note">Special Thanks:</span> It&#8217;s a beautiful lazy holiday weekend in Seattle as I write this, and there&#8217;s nothing lazier than stealing an old trick from the <a href="http://creativetechs.com/tipsblog/">Creativetechs Tips</a> blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/disable-network-ds_store-files.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Internal DNS &#8212; Part 2</title>
		<link>http://www.makemacwork.com/configure-internal-dns-2.htm</link>
		<comments>http://www.makemacwork.com/configure-internal-dns-2.htm#comments</comments>
		<pubDate>Mon, 11 May 2009 07:00:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[OS X Server]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/configure-internal-dns-2.htm</guid>
		<description><![CDATA[Last week in part one of this article, we learned how to configure a single OS X Server to provide DNS. This week, we&#8217;ll look at providing redundancy with a secondary DNS server and configure our client machines to receive our new DNS settings.
Configuring Secondary DNS:
Now that you&#8217;ve got a functioning DNS server inside your [...]]]></description>
			<content:encoded><![CDATA[<p>Last week in <a href="http://www.makemacwork.com/configure-internal-dns-1.htm">part one</a> of this article, we learned how to configure a single OS X Server to provide DNS. This week, we&#8217;ll look at providing redundancy with a secondary DNS server and configure our client machines to receive our new DNS settings.</p>
<h3>Configuring Secondary DNS:</h3>
<p>Now that you&#8217;ve got a functioning DNS server inside your network, the next thing to do is consider what happens if that server is interrupted. Once your internal DNS becomes the center of your network, it&#8217;s hard to make an argument against the importance of providing redundancy. Unless you expect your main server will never go down for even a second, you&#8217;ll want a backup plan. </p>
<p>Fortunately, a second OS X Server can act as a secondary DNS source with little configuration. This secondary server will provide the same information as the primary (synchronized periodically to catch any changes), and </p>
<p><img alt="Server Admin - DNS - Zone Transfers" src="http://www.makemacwork.com/wp-content/images/serveradmin-dns-zones-transfer.png"></p>
<p>First, on the primary server you&#8217;ve just configured, go back to the &#8220;Zones&#8221; pane in the &#8220;DNS&#8221; settings of Server Admin and highlight your domain. Then further down the window, check the box marked &#8220;Allows Zone Transfer&#8221;. With the default DNS settings Apple provides, other servers within your network should now be able to inherit and host the zone file for this domain.</p>
<p><img alt="Server Admin - DNS - Secondary Zones" src="http://www.makemacwork.com/wp-content/images/serveradmin-dns-zones-secondary.png"></p>
<p>Now, on the server that will act as your secondary DNS, open Server Admin, and browse to the same &#8220;Zones&#8221; pane. This should be empty on an unconfigured machine. Click the &#8220;Add Zone&#8221; button at the middle of the window, and select &#8220;Add Secondary Zone (Slave)&#8221;. Enter the domain you&#8217;ll be handling secondary DNS for, and the IP address of your primary DNS server. Save, then start the DNS server.</p>
<h3>DNS Client Configuration:</h3>
<p>In order to get the domain information your new servers provide, client machines need to be told where to look. And since the DNS servers at your ISP likely see an external server as authoritative for your domain, you&#8217;ll need to make sure your internal clients (including your server itself) look to the internal server first. </p>
<p><img alt="System Preferences - Network - DNS" src="http://www.makemacwork.com/wp-content/images/syspref-network-dns.png"></p>
<p>For a single machine, this is as easy as opening the &#8220;Network&#8221; pane of the System Preferences application and replacing the current setting with your DNS server&#8217;s IP. When you&#8217;ve got to make this change on a couple hundred machines, though, even a minute each will make for hours of work. In most cases, this means some kind of network settings deployment.</p>
<p>If you&#8217;re already utilizing DHCP (that&#8217;s Dynamic Host Configuration Protocol) to distribute IPs on your LAN, it makes sense to use the same mechanism to distribute DNS settings as well. If, instead, your network setup somehow precludes this, Mac OS X has an easy way to push DNS settings out to your machines. Using Apple Remote Dektop&#8217;s &#8220;Send UNIX Command&#8221; feature, just select your new client machines and enter:</p>
<p><code><strong>networksetup -setdnsservers "NETWORKSERVICE" PRIMARY SECONDARY</strong></code></p>
<p>In this setup, <tt>NETWORKSERVICE</tt> describes the network interface on the client machine. It&#8217;s typically &#8220;Ethernet 1&#8243; (or just &#8220;Ethernet&#8221; for laptops), but you may wish to run <tt>networksetup -listallnetworkservices</tt> if you&#8217;ve got an unusual configuration, just to see what options are available to you. <tt>PRIMARY</tt> and <tt>SECONDARY</tt> are simply the IPs for your new DNS server(s).</p>
<p>This will reset the servers your client machines look to for DNS information, and allow them to find domain information specific to your internal network.</p>
<p><span class="note">Recommended Reading:</span> For a complete understanding of the BIND software that runs Mac OS X DNS, there isn&#8217;t a more definitive text than the venerable <a href="http://oreilly.com/catalog/9780596100575/">DNS and BIND</a>, now in it&#8217;s fifth edition by Paul Albitz and Cricket Liu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/configure-internal-dns-2.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize The User Template</title>
		<link>http://www.makemacwork.com/customize-the-user-template.htm</link>
		<comments>http://www.makemacwork.com/customize-the-user-template.htm#comments</comments>
		<pubDate>Mon, 09 Mar 2009 07:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[System Settings]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/create-a-new-user-template/</guid>
		<description><![CDATA[Providing a consistent user experience across multiple machines is a common way for system administrators to minimize troubleshooting time and facilitate training. A new user begins work with a standardized environment, designed for their organization and familiar to those around them.
At the heart of this practice is a default set of user data, carefully designed [...]]]></description>
			<content:encoded><![CDATA[<p>Providing a consistent user experience across multiple machines is a common way for system administrators to minimize troubleshooting time and facilitate training. A new user begins work with a standardized environment, designed for their organization and familiar to those around them.</p>
<p>At the heart of this practice is a default set of user data, carefully designed around the needs of the group and applied to each account when it&#8217;s first created. For Windows that data is typically stored in <tt>C:\Documents and Settings\Default User</tt>, while Unix systems have traditionally used <tt>/etc/skel</tt>. Mac OS X keeps its user template deep within the <tt>/System</tt> hierarchy, but while finding it can be difficult, customizing it to your needs is quite easy.</p>
<p>Start with a new account created specifically for this purpose. Choose the system preferences, dock items, browser bookmarks, server shortcuts, and application settings appropriate to your user base, leaving out anything you can instead control via Open Directory&#8217;s managed preferences. If you install individual applications or fonts on a per-user level, include those in <tt>~/Applications</tt> and <tt>~/Library/Fonts</tt> (where the tilde represents the user&#8217;s home directory).</p>
<p>Once you&#8217;ve finished, open Keychain Access from the <tt>/Applications/Utilities</tt> folder and delete the &#8220;login&#8221; keychain (both references and files when prompted) so new users will get their own keychain file created for them. You&#8217;ll also want to delete the cache files stored in <tt>~/Library/Caches</tt>, clear out the &#8220;Recent Items&#8221; from the Apple menu, and (if you&#8217;ve used the Terminal) discard the <tt>~/.bash_history</tt> file.</p>
<p>Now log out of the template, and log in to an Admin account. From here, you&#8217;ll be clearing Apple&#8217;s existing user template and copying your new template user in its place. In Leopard, that work can&#8217;t be done using the <tt>sudo</tt> command, and instead must be preformed as the <tt>root</tt> user, meaning you run the risk of doing serious damage if you don&#8217;t understand what you&#8217;re typing. If you&#8217;re at peace with that, just open the Terminal, and very carefully type:</p>
<p><code><strong>su -</strong></code></p>
<p>After prompting you for a password, this will let you assume the role of <tt>root</tt>, the Unix &#8220;superuser&#8221;. This allows you to modify and delete any file on the machine.</p>
<p><code><strong>rm -r /System/Library/User\ Template/English.lproj/*</strong></code></p>
<p>This removes everything inside the English-speaking template folder. If you&#8217;re utilizing another language, you&#8217;ll need to change this to the appropriate template.</p>
<p><code><strong>cp -R /Users/TEMPLATE/* /System/Library/User\ Template/English.lproj/</strong></code></p>
<p>In the command above, replace <tt>TEMPLATE</tt> with the actual name of the template account you&#8217;ve created. This copies your prepared user environment into the template location. After which you can:</p>
<p><code><strong>exit</strong></code></p>
<p>Now, when you add a new user account, it&#8217;ll be created with your customizations already in place. You can then delete the original account from the install you built it on, but be sure to back up the home directory. The process can be repeated on multiple machines, deployed on your server, or incorporated into a system image, all using the same template.</p>
<p><span class="note">Updated:</span> This post appeared in an earlier form for Tiger back in October 2007. We thought the technique was important enough that we dragged it out of the mothballs and updated it for Leopard.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/customize-the-user-template.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iCal Can&#8217;t Connect To Server</title>
		<link>http://www.makemacwork.com/ical-cant-connect-to-server.htm</link>
		<comments>http://www.makemacwork.com/ical-cant-connect-to-server.htm#comments</comments>
		<pubDate>Mon, 02 Mar 2009 07:00:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[OS X Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.makemacwork.com/ical-cant-connect-to-server</guid>
		<description><![CDATA[For a much-ballyhooed feature when Leopard premiered, iCal Server has had a checkered history, dangerously unstable for its first few minor updates and providing little more than database corruption, frustration, and an excuse to use the word &#8220;ballyhooed&#8221;. Now that things have calmed down, many companies are experimenting with the service to see if it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>For a much-ballyhooed feature when Leopard premiered, iCal Server has had a checkered history, dangerously unstable for its first few minor updates and providing little more than database corruption, frustration, and an excuse to use the word &#8220;ballyhooed&#8221;. Now that things have calmed down, many companies are experimenting with the service to see if it&#8217;s ready for production.</p>
<p>So imagine the surprise when you&#8217;ve configured and started the service, but your client machines simply won&#8217;t connect. In fact, they complain there&#8217;s a username or password error, when the username and password work fine for other services. Check the logs in Server Admin, and all you&#8217;ll find is an ominous message:</p>
<blockquote><p>The selected logfile does not exist.</p></blockquote>
<p>In some Leopard Server installations, the iCal Server logfiles aren&#8217;t ever created properly. The result is that the server process starts, but doesn&#8217;t do anything because it has no place to log its actions. It&#8217;s the sort of problem you&#8217;d usually figure out by digging through log files, but because they don&#8217;t exist, iCal Server just sits there dumbly, unable to provide any clues.</p>
<p>The easy way to stop this serpent from eating its own tail is to create and properly permission the files, then restart the iCal service. Open the Terminal, and type:</p>
<p><code><strong>cd /var/log/caldavd/<br />sudo touch access.log error.log<br />sudo chmod 640 access.log<br />sudo chmod 644 error.log</strong></code></p>
<p>The <tt>touch</tt> command creates the required logs, while <tt>chmod</tt> is used to set their permissions. With the log files now in their expected place, client machines should have no trouble connecting to iCal Server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.makemacwork.com/ical-cant-connect-to-server.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
