<?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>Mac Stuff</title>
	<atom:link href="http://macstuff.beachdogs.org/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://macstuff.beachdogs.org/blog</link>
	<description>A place for all my Macintosh-related scripts, tricks and tips</description>
	<lastBuildDate>Thu, 08 Jul 2010 14:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Disable Directory Listing for User Sites Folder in Macintosh OS X</title>
		<link>http://macstuff.beachdogs.org/blog/?p=247</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=247#comments</comments>
		<pubDate>Thu, 08 Jul 2010 14:51:52 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=247</guid>
		<description><![CDATA[I&#8217;ve been using the &#8220;Sites&#8221; folder in my local home directory for some web development testing recently. I had a couple of directories created that didn&#8217;t include an &#8220;index.html&#8221; file. That means that anyone hitting the directory itself could list the contents and see all the other files I was working on in there. Not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the &#8220;Sites&#8221; folder in my local home directory for some web development testing recently.  I had a couple of directories created that didn&#8217;t include an &#8220;index.html&#8221; file.  That means that anyone hitting the directory itself could list the contents and see all the other files I was working on in there.  Not a major problem for what I was doing but a security issue none the less.  After a quick bit of research I found it was quite easy to disable this at the command line.</p>
<p>Open Terminal and type <code>cd /private/etc/apache2/users</code>.  Inside the &#8220;users&#8221; folder will be conf files for each of the users with accounts on the machine. So, if we have a user with the short name of &#8220;joe&#8221; on the machine there will be a file in there named &#8220;joe.conf&#8221;.</p>
<p>To edit this file you need to have root permissions.  So open it using <code>sudo</code>.  I prefer using <code>pico</code> as my editor but use whichever works for you.  The command below assumes you are already in the &#8220;users&#8221; folder.</p>
<p><code>sudo pico joe.conf</code></p>
<p>You&#8217;ll see something like this:<br />
<code><directory "/Users/joe/Sites/"><br />
Options Indexes MultiViews<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
</directory><br />
</code></p>
<p>Navigate down to the line <code>Options Indexes MultiViews</code>.  Carefully delete the <code>Indexes</code> part of the line and save the file.  Now restart Apache, either by going to System Preferences and turning off and then back on Web Sharing, or at the command line by typing <code>sudo apachectl restart</code>.</p>
<p>Now navigate to a directory in your &#8220;Sites&#8221; folder that doesn&#8217;t have an index file.  You should get a &#8220;403 No permissions&#8221; error unless you specify a file.  Much more secure.  Note that you&#8217;ll need to do this individually for each account on the machine.  </p>
<p>I&#8217;ve tested this with Snow Leopard and I&#8217;m betting it will work with Leopard.  I&#8217;m not sure if versions of the OS below 10.5 support this feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=247</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up MySQL databases on an OS X Server</title>
		<link>http://macstuff.beachdogs.org/blog/?p=184</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=184#comments</comments>
		<pubDate>Mon, 14 Dec 2009 17:31:51 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=184</guid>
		<description><![CDATA[I recently started using the build-in MySQL database server on my Leopard server. I&#8217;m collecting user login data in one database and SMB and AFP login information in another. Nothing major but information I wouldn&#8217;t really want to lose. I was looking for an easy way to backup these databases when a post on the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started using the build-in MySQL database server on my Leopard server.  I&#8217;m collecting user login data in one database and SMB and AFP login information in another.  Nothing major but information I wouldn&#8217;t really want to lose.  I was looking for an easy way to backup these databases when a post on the <a href="http://www.macenterprise.org" target="_blank">MacEnterprise</a> mailing list asked the same thing.  Several people suggested <a href="http://sourceforge.net/projects/automysqlbackup/" target="_blank">AutoMySQLBackup</a>, an open source shell script.  After checking into it I can say it is an incredibly easy way of backing up all your data.  The author has done a great service by posting this script.</p>
<p>The script backups up the databases to the local drive but can also email the backups to you.  I wanted them emailed so I could archive them and have them backed up there as well.  That way I don&#8217;t have to come up with any other scripts to move the backups some where else.</p>
<p>The AutoMySQLBackup script requires that you have <a href="http://www.mutt.org/" target="_blank">Mutt</a> installed if you want to have it email anything.  Mutt is an command line email program that does not come pre-installed on OS X.  Here are the steps I went through to get everything up and running.</p>
<p><strong>Step 1 &#8211; Install Mutt</strong></p>
<p>There are instructions on the Mutt website for installing the program but I wanted something I could easily update without a lot of hassle.  I decided to install using <a href="http://www.macports.org" target="_blank">MacPorts</a>.  </p>
<p>Download and install the latest version of MacPorts.  There is excellent documentation on the web page.  You&#8217;ll need the Apple Developer&#8217;s Tools installed before installing MacPorts.  If you don&#8217;t already have them you can install them from your OS X install disc or download them from the <a href="http://developer.apple.com/" target="_blank">Apple Developer Connection </a>site.</p>
<p>Once MacPorts is installed an running you&#8217;re ready to install Mutt.  At the time of this writing the default version of Mutt in the MacPorts repository is 1.4.2.  I wanted the 1.5.x version as I had read that it was much easier to configure.  Check the MacPorts list of available ports before you install.  To get the 1.5.x version I had to install the development version.</p>
<p>In Terminal type the following:</p>
<p><code>sudo port install mutt-devel +smtp +ssl +imap +pop</code></p>
<p>If you want the standard install of mutt enter this:</p>
<p><code>sudo port install mutt +smtp +ssl +imap +pop</code></p>
<p>Then go do something else for a while as it downloads and compiles everything.  After a bit you&#8217;ll have an install of mutt.</p>
<p><strong>Step 2 &#8211; Configure Mutt</strong></p>
<p>With the 1.5.x version of Mutt I only had to make one configuration file.  In the home directory root of the account you are running the script from make a &#8220;.muttrc&#8221; file.</p>
<p><code>touch .muttrc</code></p>
<p>Now, use your favorite editor (I prefer pico) and add the address of the SMTP server you plan to use:</p>
<p><code>set smtp_url="smtp://my.smtp.server.com"</code></p>
<p>Now try sending an email from Mutt in Terminal and make sure everything is working correctly.</p>
<p><strong>Step 3 &#8211; Configuring AutoMySQLBackup</strong></p>
<p>Download <a href="http://sourceforge.net/projects/automysqlbackup/">AutoMySQLBackup</a> and put it where ever you put your scripts.  I changed the permission so that only the account I was running it from had any access.</p>
<p><code> chmod 700 automysqlbackup.sh</code></p>
<p>Open the script in your editor of choice.  Don&#8217;t use Word or other such editors as they will mess up your line returns. Use a command-line editor or a GUI editor like <a href="http://www.codingmonkeys.de/subethaedit/" target="_blank">SubEthaEdit</a> that understands UNIX line returns.</p>
<p>The script author has great instructions right in the script so I won&#8217;t cover those here.  I did, however, have to make two changes to the script to get things to work.</p>
<p>First, I had to add in the path to the MacPorts installation in the path variable for the script.  That was on line 338.</p>
<p>The original reads:</p>
<p><code>PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/mysql/bin</code></p>
<p>Edit it to look like this:</p>
<p><code>PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/mysql/bin</code></p>
<p>Remember, all the MacPorts installations live in /opt/local.  Now the script can find Mutt.</p>
<p>The second change I had to make was to the order of items that the script was sending to Mutt.  It just didn&#8217;t work in 1.5.x as written.  This is on line 644 of the script.</p>
<p>The original reads:</p>
<p><code>mutt -s "$ERRORNOTE MySQL Backup Log and SQL Files for $HOST - $DATE" $BACKUPFILES $MAILADDR < $LOGFILE</code>	</p>
<p>I had to switch the order of $BACKUPFILES and $MAILADDR to get it send the file to me.  So my edited version looks like this:</p>
<p></code><code>mutt -s "$ERRORNOTE MySQL Backup Log and SQL Files for $HOST - $DATE" $MAILADDR $BACKUPFILES   < $LOGFILE</code></p>
<p>After making that switch and running the script it backed up my databases and emailed me the backup files as well.  Fantastic!</p>
<p>Schedule your script to run on a nightly basis so you get regular backups of everything.  You can either do that via </code><code>cron</code> or via a <code>launchd</code> item.  If you want to use <code>cron</code> and don&#8217;t want to do it at the command line I recommend <a href="http://www.versiontracker.com/dyn/moreinfo/macosx/9478" target="_blank">Cronnix</a>.  For <code>launchd</code> I recommend <a href="http://sourceforge.net/projects/lingon/" target="_blank">Lingon</a></p>
<p>One last note.  When I was trying to troubleshoot why the attachments weren&#8217;t being send I couldn&#8217;t find the log files that said what was happening.  That&#8217;s because the automysqlbackup script puts them in the script and then deletes them along with everything else after it mails them.  To disable that function I had to comment out these two lines at the very end of the script:<br />
<code><br />
eval rm -f "$LOGFILE"<br />
eval rm -f "$LOGERR"<br />
</code></p>
<p>Once I had things working I uncommented them so things would continue to be cleaned up.</p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=184</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting user login data from Macs using AppleScript</title>
		<link>http://macstuff.beachdogs.org/blog/?p=141</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=141#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:13:37 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=141</guid>
		<description><![CDATA[A lab we work with recently upgraded to 10.5 and found that the program they were running to get the user login data for their billing wouldn&#8217;t work in 10.5 and wasn&#8217;t going to be upgrading. In looking at the data it was grabbing it was clear the same data could be gotten using the [...]]]></description>
			<content:encoded><![CDATA[<p>A lab we work with recently upgraded to 10.5 and found that the program they were running to get the user login data for their billing wouldn&#8217;t work in 10.5 and wasn&#8217;t going to be upgrading.  In looking at the data it was grabbing it was clear the same data could be gotten using the <code>last</code> command in Terminal. You can see more about <code>last</code> at my post <a href="http://macstuff.beachdogs.org/blog/?p=19">here</a>. However, these folks were not computer-savvy and needed the information in a comma-delimited file.  So, I came up with this script.</p>
<p>When you run the script it asks you which month you want the data for in a list.  Select the month and it will generate a file on the desktop with that months data.  You can save it out as an application, run it from Script Editor or run it as a launchd/cron job.  You can customize the output by changing the line that begins with &#8220;write&#8221;.   For example, replace the &#8220;,&#8221; with <code>tab</code> and create a tab-delimited file instead.  </p>
<p>If you run this script logged in as a regular user you will only get the login information for that user.  If you run it as an administrator you&#8217;ll get the login information for every account on the machine.</p>
<p>Click here to download the script file:<br />
<a href='http://macstuff.beachdogs.org/blog/wp-content/uploads/2009/09/Monthly-Login-accounting.scpt.zip'>Monthly Login accounting</a></p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="applescript" style="font-family:monospace;"><span class="kw3">set</span> the_months <span class="kw3">to</span> <span class="br0">&#123;</span><span class="br0">&#125;</span>
<span class="kw3">set</span> the_total <span class="kw3">to</span> 0
<span class="kw3">set</span> the_time <span class="kw3">to</span> <span class="st0">&quot;&quot;</span>
<span class="kw3">set</span> the_computer <span class="kw3">to</span> <span class="br0">&#40;</span>computer <span class="kw1">name</span> <span class="kw3">of</span> <span class="br0">&#40;</span>system info<span class="br0">&#41;</span><span class="br0">&#41;</span>
<span class="co1">--get the raw login log information</span>
<span class="kw3">set</span> the_login <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;last&quot;</span><span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
<span class="kw3">set</span> the_count <span class="kw3">to</span> <span class="kw2">the</span> <span class="kw1">count</span> <span class="kw3">of</span> <span class="kw1">paragraphs</span> <span class="kw3">of</span> the_login
<span class="co1">--get the list of all the months login data is available for</span>
<span class="kw3">repeat</span> <span class="kw3">with</span> x <span class="kw3">from</span> 1 <span class="kw3">to</span> the_count
	<span class="kw3">if</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login <span class="kw2">contains</span> <span class="st0">&quot;console&quot;</span> <span class="kw3">then</span>
		<span class="kw3">set</span> month_check <span class="kw3">to</span> <span class="br0">&#40;</span>word 4 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
		<span class="kw3">if</span> the_months does <span class="kw2">not</span> contain month_check <span class="kw3">then</span>
			<span class="kw3">set</span> <span class="kw3">end</span> <span class="kw3">of</span> the_months <span class="kw3">to</span> month_check
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">end</span> <span class="kw3">repeat</span>
<span class="kw3">set</span> selected_month <span class="kw3">to</span> <span class="kw1">choose <span class="kw3">from</span> list</span> the_months <span class="kw3">with</span> prompt <span class="st0">&quot;Select the month:&quot;</span>
<span class="co1">--create the file to write data to</span>
<span class="kw3">if</span> selected_month <span class="kw3">is</span> <span class="kw2">not</span> <span class="kw1">false</span> <span class="kw3">then</span>
	<span class="kw3">tell</span> <span class="kw1">application</span> <span class="st0">&quot;Finder&quot;</span>
		<span class="kw3">set</span> file_name <span class="kw3">to</span> <span class="br0">&#40;</span>the_computer <span class="sy0">&amp;</span> <span class="st0">&quot;-&quot;</span> <span class="sy0">&amp;</span> selected_month <span class="sy0">&amp;</span> <span class="st0">&quot;-&quot;</span> <span class="sy0">&amp;</span> <span class="br0">&#40;</span>year <span class="kw3">of</span> <span class="br0">&#40;</span>current date<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">&amp;</span> <span class="st0">&quot; login stats.txt&quot;</span><span class="br0">&#41;</span>
		<span class="kw3">if</span> <span class="kw2">not</span> <span class="br0">&#40;</span><span class="kw1">exists</span> <span class="kw1">file</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw1">path to</span> <span class="kw1">desktop</span> <span class="kw3">from</span> user domain <span class="kw2">as</span> <span class="kw1">text</span><span class="br0">&#41;</span> <span class="sy0">&amp;</span> file_name<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw3">then</span>
			<span class="kw3">set</span> login_file <span class="kw3">to</span> <span class="kw1">make</span> <span class="kw1">file</span> <span class="kw3">with</span> <span class="kw1">properties</span> <span class="br0">&#123;</span><span class="kw1">name</span>:file_name, <span class="kw1">file</span> type:<span class="st0">&quot;TEXT&quot;</span><span class="br0">&#125;</span> at <span class="br0">&#40;</span><span class="kw1">path to</span> <span class="kw1">desktop</span> <span class="kw3">from</span> user domain<span class="br0">&#41;</span>
		<span class="kw3">else</span>
			<span class="kw1">display dialog</span> <span class="st0">&quot;This stats file already exists.  Do you want to overwrite it?&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;Yes&quot;</span>, <span class="st0">&quot;No&quot;</span><span class="br0">&#125;</span> default button 2
			<span class="kw3">set</span> the_answer <span class="kw3">to</span> <span class="kw2">the</span> button returned <span class="kw3">of</span> <span class="kw2">the</span> <span class="kw1">result</span>
			<span class="kw3">if</span> the_answer <span class="kw3">is</span> <span class="st0">&quot;Yes&quot;</span> <span class="kw3">then</span>
				<span class="kw1">delete</span> <span class="kw1">file</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw1">path to</span> <span class="kw1">desktop</span> <span class="kw3">from</span> user domain <span class="kw2">as</span> <span class="kw1">text</span><span class="br0">&#41;</span> <span class="sy0">&amp;</span> file_name<span class="br0">&#41;</span>
				<span class="kw3">set</span> login_file <span class="kw3">to</span> <span class="kw1">make</span> <span class="kw1">file</span> <span class="kw3">with</span> <span class="kw1">properties</span> <span class="br0">&#123;</span><span class="kw1">name</span>:file_name, <span class="kw1">file</span> type:<span class="st0">&quot;TEXT&quot;</span><span class="br0">&#125;</span> at <span class="br0">&#40;</span><span class="kw1">path to</span> <span class="kw1">desktop</span> <span class="kw3">from</span> user domain<span class="br0">&#41;</span>
			<span class="kw3">end</span> <span class="kw3">if</span>
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">tell</span>
	<span class="kw3">set</span> login_file <span class="kw3">to</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw1">path to</span> <span class="kw1">desktop</span> <span class="kw3">from</span> user domain<span class="br0">&#41;</span> <span class="sy0">&amp;</span> file_name<span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
<span class="kw3">end</span> <span class="kw3">if</span>
<span class="co1">--loop through the data and pull out the logins for the selected month</span>
<span class="kw3">repeat</span> <span class="kw3">with</span> x <span class="kw3">from</span> 1 <span class="kw3">to</span> the_count
	<span class="kw3">if</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login <span class="kw2">contains</span> selected_month <span class="kw3">then</span>
		<span class="kw3">if</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login <span class="kw2">contains</span> <span class="st0">&quot;console&quot;</span> <span class="kw3">then</span>
			<span class="kw3">set</span> the_user <span class="kw3">to</span> <span class="br0">&#40;</span>word 1 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span>
			<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="br0">&#40;</span>word 4 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
			<span class="kw3">set</span> the_logmonth <span class="kw3">to</span> MonthNumber<span class="br0">&#40;</span>the_month<span class="br0">&#41;</span>
			<span class="kw3">set</span> the_day <span class="kw3">to</span> <span class="br0">&#40;</span>word 5 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
			<span class="kw3">if</span> <span class="br0">&#40;</span><span class="kw2">the</span> <span class="br0">&#40;</span><span class="kw1">count</span> <span class="kw3">of</span> characters <span class="kw3">of</span> the_day<span class="br0">&#41;</span> <span class="kw3">is</span> <span class="kw2">less</span> than 2<span class="br0">&#41;</span> <span class="kw3">then</span>
				<span class="kw3">set</span> the_day <span class="kw3">to</span> <span class="br0">&#40;</span><span class="st0">&quot;0&quot;</span> <span class="sy0">&amp;</span> the_day<span class="br0">&#41;</span>
			<span class="kw3">end</span> <span class="kw3">if</span>
			<span class="kw3">set</span> the_year <span class="kw3">to</span> yearCheck<span class="br0">&#40;</span>selected_month, the_months<span class="br0">&#41;</span>
			<span class="kw3">set</span> log_date <span class="kw3">to</span> <span class="br0">&#40;</span>the_logmonth <span class="sy0">&amp;</span> <span class="st0">&quot;/&quot;</span> <span class="sy0">&amp;</span> the_day <span class="sy0">&amp;</span> <span class="st0">&quot;/&quot;</span> <span class="sy0">&amp;</span> the_year<span class="br0">&#41;</span>
			<span class="kw3">set</span> login_time <span class="kw3">to</span> <span class="br0">&#40;</span>word 6 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login <span class="sy0">&amp;</span> <span class="st0">&quot;:&quot;</span> <span class="sy0">&amp;</span> word 7 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span>
			<span class="kw3">set</span> logout_time <span class="kw3">to</span> <span class="br0">&#40;</span>word 8 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login <span class="sy0">&amp;</span> <span class="st0">&quot;:&quot;</span> <span class="sy0">&amp;</span> word 9 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login<span class="br0">&#41;</span>
			<span class="kw3">set</span> old_delims <span class="kw3">to</span> AppleScript<span class="co2">'</span>s <span class="kw1">text</span> <span class="kw1">item</span> <span class="kw1">delimiters</span>
			<span class="kw3">set</span> AppleScript<span class="co2">'</span>s <span class="kw1">text</span> <span class="kw1">item</span> <span class="kw1">delimiters</span> <span class="kw3">to</span> <span class="st0">&quot;(&quot;</span>
			<span class="kw3">try</span>
				<span class="kw3">set</span> the_time1 <span class="kw3">to</span> <span class="kw1">text</span> <span class="kw1">item</span> 2 <span class="kw3">of</span> <span class="kw1">paragraph</span> x <span class="kw3">of</span> the_login
				<span class="kw3">set</span> AppleScript<span class="co2">'</span>s <span class="kw1">text</span> <span class="kw1">item</span> <span class="kw1">delimiters</span> <span class="kw3">to</span> old_delims
				<span class="kw3">set</span> the_time <span class="kw3">to</span> <span class="br0">&#40;</span>characters 1 <span class="kw2">through</span> 5 <span class="kw3">of</span> the_time1<span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">text</span>
			<span class="kw3">on</span> <span class="kw3">error</span>
				<span class="kw3">set</span> AppleScript<span class="co2">'</span>s <span class="kw1">text</span> <span class="kw1">item</span> <span class="kw1">delimiters</span> <span class="kw3">to</span> old_delims
			<span class="kw3">end</span> <span class="kw3">try</span>
			<span class="co1">--write all the date to the file</span>
			write <span class="br0">&#40;</span>the_user <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> the_computer <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> log_date <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> login_time <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> log_date <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> logout_time <span class="sy0">&amp;</span> <span class="st0">&quot;,&quot;</span> <span class="sy0">&amp;</span> the_time <span class="sy0">&amp;</span> <span class="kw3">return</span><span class="br0">&#41;</span> <span class="kw3">to</span> <span class="kw1">file</span> login_file starting at eof
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">end</span> <span class="kw3">repeat</span>
<span class="co1">--if the list contains January see if the selected month comes before or after January.  Adjust the year accordingly.</span>
<span class="kw3">on</span> yearCheck<span class="br0">&#40;</span>selected_month, the_months<span class="br0">&#41;</span>
	<span class="kw3">if</span> the_months <span class="kw2">contains</span> <span class="st0">&quot;Jan&quot;</span> <span class="kw3">then</span>
		<span class="kw3">repeat</span> <span class="kw3">with</span> x <span class="kw3">from</span> 1 <span class="kw3">to</span> <span class="kw1">count</span> <span class="kw3">of</span> the_months
			<span class="kw3">if</span> <span class="kw1">item</span> x <span class="kw3">of</span> the_list <span class="kw2">contains</span> selected_month <span class="kw3">then</span>
				<span class="kw3">set</span> the_num <span class="kw3">to</span> x
			<span class="kw3">else</span>
				<span class="kw3">if</span> <span class="kw1">item</span> x <span class="kw3">of</span> the_list <span class="kw2">contains</span> <span class="st0">&quot;Jan&quot;</span> <span class="kw3">then</span>
					<span class="kw3">set</span> jan_num <span class="kw3">to</span> x
				<span class="kw3">end</span> <span class="kw3">if</span>
			<span class="kw3">end</span> <span class="kw3">if</span>
		<span class="kw3">end</span> <span class="kw3">repeat</span>
		<span class="kw3">set</span> year_check <span class="kw3">to</span> <span class="br0">&#40;</span>the_num <span class="sy0">-</span> jan_num<span class="br0">&#41;</span>
		<span class="kw3">if</span> year_check <span class="kw3">is</span> <span class="kw2">greater</span> than 0 <span class="kw3">then</span>
			<span class="kw3">set</span> the_year <span class="kw3">to</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>year <span class="kw3">of</span> <span class="br0">&#40;</span>current date<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">-</span> 1<span class="br0">&#41;</span>
		<span class="kw3">else</span>
			<span class="kw3">set</span> the_year <span class="kw3">to</span> <span class="br0">&#40;</span>year <span class="kw3">of</span> <span class="br0">&#40;</span>current date<span class="br0">&#41;</span><span class="br0">&#41;</span>
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">else</span>
		<span class="kw3">set</span> the_year <span class="kw3">to</span> <span class="br0">&#40;</span>year <span class="kw3">of</span> <span class="br0">&#40;</span>current date<span class="br0">&#41;</span><span class="br0">&#41;</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">return</span> the_year
<span class="kw3">end</span> yearCheck
<span class="kw3">on</span> MonthNumber<span class="br0">&#40;</span>the_month<span class="br0">&#41;</span>
	<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Jan&quot;</span> <span class="kw3">then</span>
		<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;01&quot;</span>
	<span class="kw3">else</span>
		<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Feb&quot;</span> <span class="kw3">then</span>
			<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;02&quot;</span>
		<span class="kw3">else</span>
			<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Mar&quot;</span> <span class="kw3">then</span>
				<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;03&quot;</span>
			<span class="kw3">else</span>
				<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Apr&quot;</span> <span class="kw3">then</span>
					<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;04&quot;</span>
				<span class="kw3">else</span>
					<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;May&quot;</span> <span class="kw3">then</span>
						<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;05&quot;</span>
					<span class="kw3">else</span>
						<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Jun&quot;</span> <span class="kw3">then</span>
							<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;06&quot;</span>
						<span class="kw3">else</span>
							<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Jul&quot;</span> <span class="kw3">then</span>
								<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;07&quot;</span>
							<span class="kw3">else</span>
								<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Aug&quot;</span> <span class="kw3">then</span>
									<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;08&quot;</span>
								<span class="kw3">else</span>
									<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Sep&quot;</span> <span class="kw3">then</span>
										<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;09&quot;</span>
									<span class="kw3">else</span>
										<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Oct&quot;</span> <span class="kw3">then</span>
											<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;10&quot;</span>
										<span class="kw3">else</span>
											<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Nov&quot;</span> <span class="kw3">then</span>
												<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;11&quot;</span>
											<span class="kw3">else</span>
												<span class="kw3">if</span> the_month <span class="sy0">=</span> <span class="st0">&quot;Dec&quot;</span> <span class="kw3">then</span>
													<span class="kw3">set</span> the_month <span class="kw3">to</span> <span class="st0">&quot;12&quot;</span>
												<span class="kw3">end</span> <span class="kw3">if</span>
											<span class="kw3">end</span> <span class="kw3">if</span>
										<span class="kw3">end</span> <span class="kw3">if</span>
									<span class="kw3">end</span> <span class="kw3">if</span>
								<span class="kw3">end</span> <span class="kw3">if</span>
							<span class="kw3">end</span> <span class="kw3">if</span>
						<span class="kw3">end</span> <span class="kw3">if</span>
					<span class="kw3">end</span> <span class="kw3">if</span>
				<span class="kw3">end</span> <span class="kw3">if</span>
			<span class="kw3">end</span> <span class="kw3">if</span>
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">return</span> the_month <span class="kw2">as</span> <span class="kw1">string</span>
<span class="kw3">end</span> MonthNumber</pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=141</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Switching between 32 bit and 64 bit mode in Snow Leopard</title>
		<link>http://macstuff.beachdogs.org/blog/?p=134</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=134#comments</comments>
		<pubDate>Thu, 03 Sep 2009 20:14:09 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=134</guid>
		<description><![CDATA[Out of the box Snow Leopard defaults to running in 32 bit mode. This is so the drivers for things like printers, scanners, network cards, etc. that have not been ported to 64 bit can run. Applications are unaffected by this. A 64 bit app will run in 32 bit mode and vice versa. If [...]]]></description>
			<content:encoded><![CDATA[<p>Out of the box Snow Leopard defaults to running in 32 bit mode.  This is so the drivers for things like printers, scanners, network cards, etc. that have not been ported to 64 bit can run.  Applications are unaffected by this.  A 64 bit app will run in 32 bit mode and vice versa.  If you&#8217;re not sure what mode your machine is running Snow Leopard in check out this <a href="http://www.macobserver.com/tmo/article/checking_32_or_64-bit_kernel_boot_mode_in_snow_leopard/">article</a> at MacObserver on how to tell.</p>
<p>The average user is much better off staying with the 32 bit mode for compatibility and ease of use.  However, there may be times, especially for those running scientific software, when you need to run in 64 bit mode.  And some servers, as mentioned in this <a href="http://support.apple.com/kb/HT3770">Knowledge Base</a> article do boot directly into 64 bit mode and may need to be set back.</p>
<p>You can choose to hold down the &#8220;6&#8243; and &#8220;4&#8243; keys on startup to boot into 64 bit mode.  This will boot you into 64 bit for that boot cycle.  When you reboot you will fall back to 32 bit again.  Likewise, holding down the &#8220;3&#8243; and &#8220;2&#8243; keys on boot will put you into 32 bit mode.</p>
<p>If you want to change the mode and make it stick you need to do it at the command line.  Fortunately Apple has added a command in the <code>systemsetup</code> tool for just that.</p>
<p>To check which mode you&#8217;re currently in run this command in Terminal:<br />
<code>systemsetup -getkernelbootarchitecturesetting</code></p>
<p>To set your machine to boot into 64 bit mode enter this command and reboot:<br />
<code>sudo systemsetup -setkernelbootarchitecture x86_64</code></p>
<p>To set your machine to boot into 32 bit mode enter this command and reboot:<br />
<code>sudo systemsetup -setkernelbootarchitecture i386</code></p>
<p>One oddity I&#8217;ve found so far is that on some machines that were upgraded from Leopard to Snow Leopard this command doesn&#8217;t appear in systemsetup.  Do a <code>man systemsetup</code> before running it to make sure you have the Snow Leopard version of <code>systemsetup</code></p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enabling clear text passwords in Snow Leopard with AppleScript</title>
		<link>http://macstuff.beachdogs.org/blog/?p=79</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=79#comments</comments>
		<pubDate>Mon, 31 Aug 2009 19:45:32 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[clear text]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=79</guid>
		<description><![CDATA[Update: It appears that clear text passwords for AFP connections only work when booted into 32 bit mode. I&#8217;ve updated the script to check for which kernel the user is booted into. If they are running 64 bit it asks them if they want to switch to 32 bit. If they say &#8220;Yes&#8221; then it [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> It appears that clear text passwords for AFP connections only work when booted into 32 bit mode.  I&#8217;ve updated the script to check for which kernel the user is booted into.  If they are running 64 bit it asks them if they want to switch to 32 bit.  If they say &#8220;Yes&#8221; then it makes the switch and reboots the machine for them.</p>
<p>A nice article explaining how to see if  you are running in 32 or 64 bit mode is <a href="http://www.macobserver.com/tmo/article/checking_32_or_64-bit_kernel_boot_mode_in_snow_leopard/" target="_blank">here</a> at MacObserver.</p>
<p>There is an Apple Knowledge base article dealing with servers but with good information on switching kernels <a href="http://support.apple.com/kb/HT3773" target="_blank">here</a>.</p>
<p>The procedure for enabling clear text passwords for AFP connections is the same in Snow Leopard as it is in Leopard with one very critical difference.  The details about how and why are already in my post on <a href="http://macstuff.beachdogs.org/blog/?p=39">Leopard</a>.  If you want the background information you should check out that page. This post will only deal with the Snow Leopard-specific changes. </p>
<p>The big change for enabling clear text passwords for Snow Leopard is that the .plist file is now a binary.  This is something Apple has been moving towards since 10.4 and there is a built-in utility that allows you to change the format back and forth to allow for easy editing called &#8220;plutil&#8221;.  The full path to it is &#8220;/usr/bin/plutil&#8221;</p>
<p>The flag we need to be aware of in &#8220;plutil&#8221; is the &#8220;-convert&#8221; flag.  There are two formats that we&#8217;ll use for this flag, &#8220;xml1&#8243; and &#8220;binary1&#8243;.</p>
<p>To convert the plist file to XML to allow editing we have to run the following command:<br />
<code>/usr/bin/plutil -convert xml1 /Users/joe/Library/Preferences/com.Apple.AppleShareClient.plist</code></p>
<p>This will convert the file to XML for editing.  Now we will do the actual editing.  This line is the same as in Leopard.<br />
<code>defaults write com.Apple.AppleShareClient afp_cleartext_allow -bool YES</code></p>
<p>Now that we have edited the file we have to convert it back to binary form.  So we use the &#8220;plutil&#8221; tool again with a different format:<br />
<code>/usr/bin/plutil -convert binary1 /Users/joe/Library/Preferences/com.Apple.AppleShareClient.plist</code></p>
<p>Now the preference file is converted back to binary and can be used by the AFP client.</p>
<p>Here is an updated version of the Leopard AppleScript for changing this setting.</p>
<p><strong>If you would prefer to download a pre-complied script file click below:</strong><br />
<a href='http://macstuff.beachdogs.org/blog/wp-content/uploads/2009/08/sl_cleartext.scpt3.zip'>Snow Leopard Clear Text Script</a></p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://macstuff.beachdogs.org/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="applescript" style="font-family:monospace;"><span class="kw3">set</span> afp_pref_path <span class="kw3">to</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw1">POSIX path</span> <span class="kw3">of</span> <span class="br0">&#40;</span><span class="kw1">path to</span> preferences <span class="kw3">from</span> user domain<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">&amp;</span> <span class="st0">&quot;com.Apple.AppleShareClient.plist&quot;</span><span class="br0">&#41;</span>
<span class="kw3">set</span> OS_version <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;sw_vers -productVersion&quot;</span><span class="br0">&#41;</span>
<span class="kw3">set</span> kernel_answer <span class="kw3">to</span> <span class="st0">&quot;&quot;</span>
<span class="co1">--check if the user is running 32 or 64 bit kernel.</span>
<span class="kw3">if</span> OS_version <span class="kw2">contains</span> <span class="st0">&quot;10.6&quot;</span> <span class="kw3">then</span>
	<span class="kw3">set</span> kernel_version <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;/usr/sbin/systemsetup -getkernelbootarchitecturesetting&quot;</span><span class="br0">&#41;</span>
	<span class="kw3">if</span> kernel_version <span class="kw2">contains</span> <span class="st0">&quot;x86_64&quot;</span> <span class="kw3">then</span>
		<span class="kw3">set</span> kernel_answer <span class="kw3">to</span> button returned <span class="kw3">of</span> <span class="br0">&#40;</span><span class="kw1">display dialog</span> <span class="st0">&quot;You are currently running in 64 bit mode.  Clear text passwords only work in 32 bit mode.  Would you like to change to 32 bit mode?  This will require a restart.&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;Yes, change it and restart&quot;</span>, <span class="st0">&quot;No, just enable clear text&quot;</span><span class="br0">&#125;</span> default button 1<span class="br0">&#41;</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">try</span>
	<span class="kw3">set</span> clearStatus <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;defaults read com.Apple.AppleShareClient afp_cleartext_allow&quot;</span><span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">number</span>
<span class="kw3">on</span> <span class="kw3">error</span>
	<span class="co1">--the first command will throw an error if the afp_cleartext_allow setting does not exist</span>
	<span class="co1">--if there is an error we'll assume that the setting isn't there and set our variable to the disabled setting</span>
	<span class="kw3">set</span> clearStatus <span class="kw3">to</span> 0
<span class="kw3">end</span> <span class="kw3">try</span>
<span class="co1">--a status of &quot;1&quot; means it's enabled.  So ask if they want to disable it</span>
<span class="kw3">if</span> clearStatus <span class="kw3">is</span> 1 <span class="kw3">then</span>
	<span class="kw1">display dialog</span> <span class="st0">&quot;Do you want to disable clear text passwords?&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;Cancel&quot;</span>, <span class="st0">&quot;Disable&quot;</span><span class="br0">&#125;</span> default button 2
	<span class="kw3">if</span> <span class="kw2">the</span> button returned <span class="kw3">of</span> <span class="kw2">the</span> <span class="kw1">result</span> <span class="kw3">is</span> <span class="st0">&quot;Disable&quot;</span> <span class="kw3">then</span>
		<span class="kw1">do shell script</span> <span class="st0">&quot;/usr/bin/plutil -convert xml1 &quot;</span> <span class="sy0">&amp;</span> afp_pref_path
		<span class="kw1">do shell script</span> <span class="st0">&quot;defaults write com.Apple.AppleShareClient afp_cleartext_allow -bool NO&quot;</span>
		<span class="kw1">do shell script</span> <span class="st0">&quot;/usr/bin/plutil -convert binary1 &quot;</span> <span class="sy0">&amp;</span> afp_pref_path
		<span class="kw3">set</span> clearStatus <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;defaults read com.Apple.AppleShareClient afp_cleartext_allow&quot;</span><span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">number</span>
		<span class="co1">--check to make sure the change really took effect</span>
		<span class="kw3">if</span> clearStatus <span class="kw3">is</span> 0 <span class="kw3">then</span>
			<span class="kw1">display dialog</span> <span class="st0">&quot;Clear text passwords have been disabled&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;OK&quot;</span><span class="br0">&#125;</span>
		<span class="kw3">else</span>
			<span class="kw1">display dialog</span> <span class="st0">&quot;There was an error disabling clear text passwords!&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;OK&quot;</span><span class="br0">&#125;</span>
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">else</span>
	<span class="kw1">display dialog</span> <span class="st0">&quot;Do you want to enable clear text passwords?&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;Cancel&quot;</span>, <span class="st0">&quot;Enable&quot;</span><span class="br0">&#125;</span> default button 2
	<span class="kw3">if</span> <span class="kw2">the</span> button returned <span class="kw3">of</span> <span class="kw2">the</span> <span class="kw1">result</span> <span class="kw3">is</span> <span class="st0">&quot;Enable&quot;</span> <span class="kw3">then</span>
		<span class="kw1">do shell script</span> <span class="st0">&quot;/usr/bin/plutil -convert xml1 &quot;</span> <span class="sy0">&amp;</span> afp_pref_path
		<span class="kw1">do shell script</span> <span class="st0">&quot;defaults write com.Apple.AppleShareClient afp_cleartext_allow -bool YES&quot;</span>
		<span class="kw1">do shell script</span> <span class="st0">&quot;/usr/bin/plutil -convert binary1 &quot;</span> <span class="sy0">&amp;</span> afp_pref_path
		<span class="kw3">set</span> clearStatus <span class="kw3">to</span> <span class="br0">&#40;</span><span class="kw1">do shell script</span> <span class="st0">&quot;defaults read com.Apple.AppleShareClient afp_cleartext_allow&quot;</span><span class="br0">&#41;</span> <span class="kw2">as</span> <span class="kw1">number</span>
		<span class="co1">--check to make sure the change really took effect</span>
		<span class="kw3">if</span> clearStatus <span class="kw3">is</span> 1 <span class="kw3">then</span>
			<span class="kw1">display dialog</span> <span class="st0">&quot;Clear text passwords have been enabled&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;OK&quot;</span><span class="br0">&#125;</span>
		<span class="kw3">else</span>
			<span class="kw1">display dialog</span> <span class="st0">&quot;There was an error enabling clear text passwords!&quot;</span> <span class="kw1">buttons</span> <span class="br0">&#123;</span><span class="st0">&quot;OK&quot;</span><span class="br0">&#125;</span>
		<span class="kw3">end</span> <span class="kw3">if</span>
	<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">end</span> <span class="kw3">if</span>
<span class="kw3">if</span> kernel_answer <span class="kw2">contains</span> <span class="st0">&quot;Yes&quot;</span> <span class="kw3">then</span>
	<span class="kw1">do shell script</span> <span class="st0">&quot;/usr/sbin/systemsetup -setkernelbootarchitecture i386&quot;</span> <span class="kw3">with</span> administrator privileges
	<span class="kw1">do shell script</span> <span class="st0">&quot;/sbin/shutdown -r now&quot;</span> <span class="kw3">with</span> administrator privileges
<span class="kw3">end</span> <span class="kw3">if</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=79</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Disable Time Machine prompts for external disks</title>
		<link>http://macstuff.beachdogs.org/blog/?p=72</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=72#comments</comments>
		<pubDate>Fri, 07 Aug 2009 19:19:38 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=72</guid>
		<description><![CDATA[This certainly isn&#8217;t a new thing but I haven&#8217;t had a need for it until just recently. I moved my lab machines to Leopard and now every time you plug in an external hard drive it asks to use it for a Time Machine backup. That gets annoying fast. Use the defaults command in Terminal [...]]]></description>
			<content:encoded><![CDATA[<p>This certainly isn&#8217;t a new thing but I haven&#8217;t had a need for it until just recently.  I moved my lab machines to Leopard and now every time you plug in an external hard drive it asks to use it for a Time Machine backup.  That gets annoying fast.  Use the <em>defaults</em> command in Terminal to shut it off.  I used Apple Remote Desktop to send it out to all my machines at once.</p>
<p><code>defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES</code></p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Time Machine with a networked drive</title>
		<link>http://macstuff.beachdogs.org/blog/?p=59</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=59#comments</comments>
		<pubDate>Fri, 27 Feb 2009 18:22:34 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[drive]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=59</guid>
		<description><![CDATA[Those folks who are using Time Machine know how great it is for backing up everything quickly and easily. However, what if you can&#8217;t always have an external drive hooked up to your machine. Or, maybe you want to back up more then one machine to that drive. Time Machine backups live quite nicely next [...]]]></description>
			<content:encoded><![CDATA[<p>Those folks who are using Time Machine know how great it is for backing up everything quickly and easily.  However, what if you can&#8217;t always have an external drive hooked up to your machine.  Or, maybe you want to back up more then one machine to that drive.  Time Machine backups live quite nicely next to other backups or files.  </p>
<p>Out of the box Time Machine does not allow you to back up to a network drive.  It just doesn&#8217;t show up when you go to choose a backup disk.  You have to run a command in Terminal first to enable this function.  On the machine you want to be able to access a network drive open Terminal and enter this command to enable networked drives in Time Machine:</p>
<p><code>defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1</code></p>
<h2>How to make your local external hard drive accesible to Time Machine</h2>
<p>Now that you have your remote machine able to use Time Machine on a network drive how to you network the drive you want to use?</p>
<p>It&#8217;s important to know that Time Machine will only work on HFS+, also known as Mac OS Extended, drives.  If your drive is formatted FAT or NTFS for use on Windows it won&#8217;t work.  Also, Time Machine over the network only works for share points shared out using the version of AFP found in Leopard.  You can&#8217;t share it off an older Tiger machine.</p>
<h2>Create a share point for Time Machine</h2>
<ul>
<li>Open System Preferences and click on &#8220;Accounts&#8221;</li>
<li>Click on the lock at the bottom left of the window and enter your admin name and password.</li>
<li>Now click on the &#8220;+&#8221;  at the bottom right of the window to create a new account.  From the drop down at the top of the window select &#8220;Sharing only&#8221;.  This will create an account that can only be used to access share points from the network.  If you have that user already in your address book you can select them from that list.  Otherwise just enter the desired name and password.</li>
</ul>
<p>Now that you have an account for your network user to access the Time Machine share point you have to create it.</p>
<ul>
<li>Create a folder on your local external drive to share out for backups</li>
<li>On a Leopard machine open System Preferences > Sharing.  Then place a check next to File Sharing if it isn&#8217;t already checked.</li>
<li>Click on the &#8220;+&#8221; under &#8220;Shared Folders&#8221; and select the folder on your external drive.</li>
<li>The folder now shows up under &#8220;Shared Folders&#8221;.  Select it and then click the &#8220;+&#8221; sign under &#8220;Users&#8221;.  Add the &#8220;Sharing only&#8221; you created and make sure they have Read and Write permissions.  You can delete the other users from that list so that only the remote user can access that share point if you prefer.</li>
</ul>
<h2>Configure Time Machine on the client</h2>
<p>Now, go back to the remote machine and connect to that share point.  </p>
<p>In the Finder select Go > Connect to Server and either put in the IP address of the machine you want to back up to or browse for it.</p>
<p>Once you&#8217;ve connected to the share go to System Preferences > Time Machine and click on the &#8220;Choose Backup Drive&#8221;.  You should see your network share in the list.  Select it and you&#8217;ll be asked for the login credentials again. Make sure you check the &#8220;Save in Keychain&#8221; option so you aren&#8217;t asked repeatedly.</p>
<p>Now configure Time Machine the way you want and you&#8217;re set!</p>
<p>Every time Time Machine runs it will mount that share point, back up to it and then unmount it.  One of the security benefits from using Time Machine like this is that all of the files are saved in an encrypted disk image so they are more secure then a regular time machine backup.</p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=59</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recommended AppleScript Books for Beginners</title>
		<link>http://macstuff.beachdogs.org/blog/?p=56</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=56#comments</comments>
		<pubDate>Fri, 16 May 2008 19:53:37 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Applescript]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=56</guid>
		<description><![CDATA[I&#8217;ve got several AppleScripts on this site and I get lots of questions about things relating to AppleScript. One of the questions I hear is &#8220;Are there any good books about AppleScript, especially for beginners&#8221;. Well, the answer is yes and no. I&#8217;ll give a few recommendations here that I think will help most beginning [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got several AppleScripts on this site and I get lots of questions about things relating to AppleScript.  One of the questions I hear is &#8220;Are there any good books about AppleScript, especially for beginners&#8221;.  Well, the answer is yes and no.  I&#8217;ll give a few recommendations here that I think will help most beginning AppleScripters and possibly some more advanced ones.  There are lots of sites out there as well such a <a href="http://macscripter.net">Macscripter.net</a> that also have a wealth of information.  I encourage anyone looking into AppleScript to use these sites as well as printed materials.</p>
<p>Having said that I know that I personally benefit from having books around.  In some cases it just an easy way to quickly look something up.  Most books have examples on how to use either a scripting addition or a vanilla AppleScript command.  Having those examples makes it a lot easier for me to figure things out.</p>
<p><strong>Danny Goodman&#8217;s AppleScript Handbook</strong></p>
<p><center><a href="http://www.amazon.com/gp/product/0966551419?ie=UTF8&#038;tag=macstu06-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0966551419"><img border="0" src="http://macstuff.beachdogs.org/blog/wp-content/uploads/2008/05/goodman.jpg" alt="" title="Danny Goodman\&#039;s AppleScript Handbook" width="128" height="160" class="aligncenter size-full wp-image-51"/></a><img src="http://www.assoc-amazon.com/e/ir?t=macstu06-20&#038;l=as2&#038;o=1&#038;a=0966551419" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></center></p>
<p>This is, in my opinion,  the best book still out there on AppleScript.  Danny Goodman has been around about as long as the Mac and his knowledge as well as his writing style are unsurpassed.  He lays out the basics of AppleScript first and gives tons of examples each time.  He steps you through each of the examples and explains what each line is about and why it does what it does.  I learn languages best by doing lots of examples and see what things do.  This book excels at that.  </p>
<p>Many of the examples are short so you don&#8217;t get bogged down in code while trying to understand everything.  It&#8217;s also a fantastic reference book.  Whether you&#8217;re trying to find out what a list is or how to create a new folder all you have to do is look here.  If you&#8217;re a beginning AppleScripter and you can only afford one book this is it.  He hasn&#8217;t updated it in several years but the material is all still very relevant.  Just watch out for example for things like &#8220;Scriptable Text Editor&#8221; since that was replaced long ago by Text Edit.</p>
<p><strong>AppleScript: The Missing Manual</strong></p>
<p><center><a href="http://www.amazon.com/gp/product/0596008503?ie=UTF8&#038;tag=macstu06-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596008503"><img border="0" src="http://macstuff.beachdogs.org/blog/wp-content/uploads/2008/05/missingman.jpg" alt="Applescript: The Missing Manual" title="missingman" width="120" height="160" class="alignnone size-medium wp-image-52"/></a><img src="http://www.assoc-amazon.com/e/ir?t=macstu06-20&#038;l=as2&#038;o=1&#038;a=0596008503" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></center></p>
<p>Another in the &#8220;Missing Manual&#8221; series this is another great book for beginners.  It&#8217;s full of great and useful scripting examples that you can use right out of the box.  I started writing AppleScripts to do little things that I got tired of doing over and over.  You&#8217;ll find lots of examples in this book of just that.  And along the way you&#8217;ll find yourself thinking about how you can adjust those scripts to suit your needs.  And THAT is the best way, in my opinion, to learn AppleScript. </p>
<p>The first three chapters of the book are all about getting your feet wet.  It starts with showing you where things like Script Editor lives and the wide variety of scripts that already come with your Mac.  You&#8217;ll open several of those existing scripts and edit them to change what they do.  A great way to introduce scripting in my opinion.  Change something, see what it does and go from there.  The last chapter in that section shows you how to start creating scripts from scratch in Script Editor.  You&#8217;ll cover things like creating dialog boxes and opening the AppleScript dictionaries of various applications to see what you can do with them.</p>
<p>The second section gets into more of the everyday aspects of AppleScript and what you can do with it.  It covers topics such as manipulating text in Text Edit and Microsoft Word and how to move, select and delete files.  People who work with graphics on a regular basis will like the sections on controlling Photoshop and iPhoto with AppleScript.  I particularly liked the fact that he covers using the built-in Image Events to manipulate graphics.  Image Events comes with your OS and lets you do very cool things with graphics without ever opening a program, such as determine color space, rotate the image or even convert it from one format to another.</p>
<p>This section also covers scripting iTunes and Quicktime but only briefly.  With AppleScript you can access the features of Quicktime Pro without paying for the Pro license.  It would have been nice to see more of that but the Quicktime section gets you started.  </p>
<p>The Internet and Networking section has some useful scripts for Internet Connect and Airport but I think most people will find the Mail and iChat scripting section the most useful.  The final chapter in this section covers database scripting, in particular making a small AppleScript database and scripting Filemaker Pro.</p>
<p>The third section of the book is labeled as the &#8220;Power Users&#8221; section but there are lots of things in there that the beginning scripter will find incredibly useful.  Things like assigning scripts to folder actions so they run automatically will be immediately useful to many.  And the section on running UNIX commands using AppleScript will open up a whole new world to many.  There is a very brief chapter on using AppleScript Studio to create applications.  It&#8217;s enough to get your started if you&#8217;re interested but otherwise you would be better off getting an actual AppleScript Studio book.</p>
<p>The most useful part of this section for any scripter has to be the Debugging section.  Nothing is more frustrating when writing scripts, especially for new scripters, then getting error messages and having no idea what they mean.  Script Editor does a great job of pointing out where the problem is but not in telling you how to fix it.  This section covers in detail what many of those error messages mean and how to fix them.  It also covers how to trap for errors that may occur and what to do in your script when they do. </p>
<p><strong>AppleScript: A Comprehensive Guide to Scripting and Automation on Mac OS X</strong></p>
<p><center><a href="http://www.amazon.com/gp/product/1590594045?ie=UTF8&#038;tag=macstu06-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1590594045"><img border="0" src="http://macstuff.beachdogs.org/blog/wp-content/uploads/2008/05/ascomp.jpg"/></a><img src="http://www.assoc-amazon.com/e/ir?t=macstu06-20&#038;l=as2&#038;o=1&#038;a=1590594045" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></center></p>
<p>This book is one of the more recent and takes things to the next level from the &#8220;Missing Manual&#8221; series.  This book takes you into the meat of AppleScript and shows you how to do really great things like scripting all those command line tools you know are there but don&#8217;t want to open Terminal to use.  You&#8217;ll even learn how to write scripts that can be executed on a remote Mac.  This can be really handy when you need to re-start the Filemaker Pro database from across a campus or business.  After you&#8217;ve gotten an understanding of the basics of AppleScript from the first two books this one will take you to the next level and get you writing more involved and exciting scripts.</p>
<p>These books are just a small sample of the things that are out there but I think these books will give anyone who is starting in AppleScript or wants a more complete understand the foundation they need.  As I said, I like books that give lots of real world examples and all of these do exactly that and more.</p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=56</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determining if an application is 64 bit, 32 bit or both</title>
		<link>http://macstuff.beachdogs.org/blog/?p=46</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=46#comments</comments>
		<pubDate>Mon, 11 Feb 2008 19:17:33 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=46</guid>
		<description><![CDATA[With the release of Leopard Macs now have the ability to run 64 bit applications natively from the GUI. Tiger, the previous release of the OS, supported 64 bit applications but only at the command line. Also, most Macintosh applications these days come as Universal Binaries so they can run on Intel and PowerPC machines. [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Leopard Macs now have the ability to run 64 bit applications natively from the GUI.  Tiger, the previous release of the OS, supported 64 bit applications but only at the command line.  Also, most Macintosh applications these days come as Universal Binaries so they can run on Intel and PowerPC machines.</p>
<p>So how do you tell if you have a 64 bit capable application?</p>
<p>The first place to look is the &#8220;Get Info&#8221; box of the application itself.  If it has a checkbox that gives you the option to run it as a 32 bit application then it is 64 bit.  But, is it 64 bit for Intel machines only or for both PowerPC and Intel?</p>
<p>The solution to the problem is found in Terminal using the <strong>file</strong> command.</p>
<p>Open up Terminal and cd into your application and find the actual compiled binary.  This is located in /Contents/MacOS inside your application.</p>
<p>So, for example, if I wanted to check out iWeb I would type the following:</p>
<p><code>cd /Applications/iWeb.app/Contents/MacOS/</code></p>
<p>Typing <strong>ls</strong> once you are inside the app will show you the actual name of the binary.</p>
<p>Now, use the <strong>file</strong> command on that binary.</p>
<p><code>file iWeb</code></p>
<p>That returns the following:</p>
<p><code><br />
iWeb: Mach-O universal binary with 2 architectures<br />
iWeb (for architecture ppc):	Mach-O executable ppc<br />
iWeb (for architecture i386):	Mach-O executable i386<br />
</code></p>
<p>Here&#8217;s how to read the results:</p>
<p>(for architecture ppc) = 32 bit PowerPC executable<br />
(for architecture ppc64) = 64 bit PowerPC executable<br />
(for architecture i386) = 32 bit Intel executable<br />
(for architecture x86_64) = 64 bin Intel executable</p>
<p>So, we can see that iWeb has one 32 bit executable for PowerPC machines and one 32 bit executable for Intel (i386) machines.</p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Turning your Airport Card on and off</title>
		<link>http://macstuff.beachdogs.org/blog/?p=44</link>
		<comments>http://macstuff.beachdogs.org/blog/?p=44#comments</comments>
		<pubDate>Mon, 07 Jan 2008 17:55:54 +0000</pubDate>
		<dc:creator>webmaster</dc:creator>
				<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://macstuff.beachdogs.org/blog/?p=44</guid>
		<description><![CDATA[This is a simple tip I stumbled across a month or so ago. There were some bugs in Leopard wireless that wouldn&#8217;t let me connect to the encrypted wireless network at work after a machine was restarted. I found that turning the airport card on and off let me connect again. I hated having to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple tip I stumbled across a month or so ago.  There were some bugs in Leopard wireless that wouldn&#8217;t let me connect to the encrypted wireless network at work after a machine was restarted.  I found that turning the airport card on and off let me connect again.  I hated having to remember this every time I restarted so I dug around and found that the command line tool <strong>networksetup</strong> can do it for me.  Great!</p>
<p>This tool exists on Tiger machines in the Apple Remote Desktop client bundle.  The path to it is:</p>
<p>/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup</p>
<p>Fortunately they very kindly included it in the build for Leopard.  The path in Leopard is:</p>
<p>/usr/sbin/networksetup</p>
<p>So, in Leopard, to turn the Airport card off enter the following in Terminal:</p>
<p><code>/usr/sbin/networksetup -setairportpower off</code></p>
<p>To turn the card back on change &#8220;off&#8221; to &#8220;on&#8221;.  If you&#8217;re running Tiger make sure to change the path so it points to the app correctly.</p>
<p>Put both of these commands in an AppleScript, save it as an application and add it to your Login items.  Then, when the machine is rebooted the card gets turned off and then on and in my case makes my wireless connection.</p>
<p><strong>Snow Leopard changes</strong><br />
In Snow Leopard the command remains, however now you need to run it as <code>sudo</code>.  You also need to include the actual network device name AirPort is running on.  You can get that by running the following command:</p>
<p><code>/usr/sbin/networksetup -listallhardwareports</code></p>
<p>You&#8217;ll see Airport listed and below it the device.  If the machine does not have two Ethernet ports AirPort is commonly listed as &#8220;en1&#8243;</p>
<p>After you have that you include it in your command:</p>
<p><code>sudo /usr/sbin/networksetup -setairportpower en1 on</code></p>
<p>I&#8217;ve included these changes and a routine that will find the airport device in the Snow Leopard version of the script.</p>
<p><strong>Click here to download a copy of the script for Tiger/Leopard:</strong><br />
<a href='http://macstuff.beachdogs.org/blog/wp-content/uploads/2008/01/airport-off-and-on.zip' title='Airport off and on'>Airport off and on</a></p>
<p><strong>Click here to download a copy of the script for Snow Leopard:</strong><br />
<a href='http://macstuff.beachdogs.org/blog/wp-content/uploads/2008/01/SL-Airport-off-and-on.zip'>Snow Leopard Airport off and on</a></p>
<p><strong>networksetup</strong> is a great tool for administrators and even just people who want a little more control over their machines.  </p>
]]></content:encoded>
			<wfw:commentRss>http://macstuff.beachdogs.org/blog/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
