<?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>blogt0sk1 &#187; OS X</title>
	<atom:link href="http://blog.jerodsanto.net/category/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jerodsanto.net</link>
	<description>with Jerod Santo</description>
	<lastBuildDate>Sat, 19 Jun 2010 14:34:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Run OS X System Profiler From Terminal</title>
		<link>http://blog.jerodsanto.net/2009/09/run-os-x-system-profiler-from-terminal/</link>
		<comments>http://blog.jerodsanto.net/2009/09/run-os-x-system-profiler-from-terminal/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 13:46:38 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://blog.jerodsanto.net/?p=661</guid>
		<description><![CDATA[OS X&#8217;s built-in System Profiler provides a great graphical display of pretty much anything you&#8217;ll want to know about your Mac. That&#8217;s cool and all, but what if you want to access that information programmatically? Turns out you can also run the System Profiler from the terminal by executing this command: jerod@mbp:~$ /usr/sbin/system_profiler What&#8217;s great [...]]]></description>
			<content:encoded><![CDATA[<p>OS X&#8217;s built-in <strong><em>System Profiler</em></strong> provides a great graphical display of pretty much anything you&#8217;ll want to know about your Mac.</p>
<p><img src="http://blog.jerodsanto.net/wp-content/uploads/2009/09/profiler.png" alt="profiler" title="profiler" width="640" height="216" class="aligncenter size-full wp-image-664" /></p>
<p>That&#8217;s cool and all, but what if you want to access that information programmatically? Turns out you can also run the <strong><em>System Profiler</em></strong> from the terminal by executing this command:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">jerod@mbp:~$ /usr/sbin/system_profiler</pre></div></div>

<p>What&#8217;s great about this access method is that it allows you to slurp that data into any other program and have your way with it! For instance, I wanted to track my <a href="http://twitter.com/sant0sk1/status/3780056282" rel="external">new battery&#8217;s</a> cycle count and charge capacity over time. Why? I dunno, because I&#8217;m a geek, okay, get off my back!&#8230; Anyways, with the <strong><em>system_profiler</em></strong> command I simply run this little Ruby script every day:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color: #0086B3;">require</span> <span style="color: #D14;">'date'</span>
&nbsp;
data      = <span style="color: #D14;">`/usr/sbin/system_profiler SPPowerDataType`</span>
cycles    = data<span style="color: #000;">&#91;</span><span style="color: #000;">/</span>Cycle count: <span style="color: #000;">&#40;</span>\d<span style="color: #000;">+</span><span style="color: #000;">&#41;</span><span style="color: #000;">/</span>, <span style="color:#006666;">1</span><span style="color: #000;">&#93;</span>
condition = data<span style="color: #000;">&#91;</span><span style="color: #000;">/</span>Condition: <span style="color: #000;">&#40;</span>\w<span style="color: #000;">+</span><span style="color: #000;">&#41;</span><span style="color: #000;">/</span>, <span style="color:#006666;">1</span><span style="color: #000;">&#93;</span>
capacity  = data<span style="color: #000;">&#91;</span><span style="color: #000;">/</span>Full charge capacity \<span style="color: #000;">&#40;</span>mAh\<span style="color: #000;">&#41;</span>: <span style="color: #000;">&#40;</span>\d<span style="color: #000;">+</span><span style="color: #000;">&#41;</span><span style="color: #000;">/</span>, <span style="color:#006666;">1</span><span style="color: #000;">&#93;</span>
&nbsp;
<span style="color: #009926;">File</span>.<span style="color: #0086B3;">open</span><span style="color: #000;">&#40;</span><span style="color: #D14;">'/Users/jerod/Documents/battery_history.csv'</span>, <span style="color: #D14;">&quot;a&quot;</span><span style="color: #000;">&#41;</span> <span style="color: #000; font-weight: bold;">do</span> <span style="color: #000;">|</span>file<span style="color: #000;">|</span>
  file.<span style="color: #0086B3;">puts</span> <span style="color: #D14;">&quot;#{Date.today},#{cycles},#{capacity},#{condition}&quot;</span>
<span style="color: #000; font-weight: bold;">end</span></pre></td></tr></table></div>

<p>Ruby uses the (possibly familiar) backticks (line 3) to capture output from a shell command. All that was left for me to do was to parse the raw data and save it to a CSV file.</p>
<p>Finally, note that the my script is passing <strong><em>SPPowerDataType</em></strong> as an argument which narrows down the returned results. You can learn more about how to use the <strong><em>system_profiler</em></strong> command by readings its manual. Just:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">jerod@mbp:~$ man system_profiler</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2009/09/run-os-x-system-profiler-from-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill Snow Leopard&#8217;s Blue Ring of Expos&#233;</title>
		<link>http://blog.jerodsanto.net/2009/09/kill-snow-leopards-blue-ring-of-expose/</link>
		<comments>http://blog.jerodsanto.net/2009/09/kill-snow-leopards-blue-ring-of-expose/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:55:43 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[snowleopard]]></category>

		<guid isPermaLink="false">http://blog.jerodsanto.net/?p=625</guid>
		<description><![CDATA[Looks like I&#8217;m not the only one who hates Snow Leopard&#8217;s blue ring around selected windows in Expos&#233;. Thankfully, we don&#8217;t have to live with such monstrosities. Here&#8217;s a quick fix to free yourself from the blue haze. Fire up Terminal.app, then: 1 2 3 4 cd /System/Library/CoreServices/Dock.app/Contents/Resources/ sudo mv expose-window-selection-big.png expose-window-selection-big.ugly sudo mv expose-window-selection-small.png [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like <a href="http://twitter.com/dougneiner/status/3679180990" rel="external">I&#8217;m not the only one</a> who hates Snow Leopard&#8217;s blue ring around selected windows in Expos&eacute;.</p>
<p>Thankfully, we don&#8217;t have to live with such monstrosities. Here&#8217;s a quick fix to free yourself from the blue haze. Fire up Terminal.app, then:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">cd /System/Library/CoreServices/Dock.app/Contents/Resources/
sudo mv expose-window-selection-big.png expose-window-selection-big.ugly
sudo mv expose-window-selection-small.png expose-window-selection-small.ugly
sudo killall Dock</pre></td></tr></table></div>

<p>This will disable the blue rings altogether, but you may want to replace these two images with some custom ones that look a little cooler instead.</p>
<p>Let me know via the comments or on <a href="http://twitter.com/sant0sk1" rel="external">Twitter</a> if you find some replacement images!</p>
<p><strong>***UPDATE***</strong></p>
<p><a href="http://www.google.com/profiles/douglasneiner" rel="external">My friend Doug</a> provided some <a href='http://blog.jerodsanto.net/wp-content/uploads/2009/09/expose-rings.zip' rel="external">drop-in replacement images</a> that are a huge improvement. Just drop them into the directory after renaming the default images. So after step #3 above, do:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">open .</pre></td></tr></table></div>

<p>This will open Finder in the current directory. Now drag the replacement images into this directory, provide your password, and kill the Dock.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>5
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">sudo killall Dock</pre></td></tr></table></div>

<p>Voilà!</p>
<p><a href='http://blog.jerodsanto.net/wp-content/uploads/2009/09/expose-rings.zip' rel="external">DOWNLOAD HERE</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2009/09/kill-snow-leopards-blue-ring-of-expose/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP5 with readline support on OS X</title>
		<link>http://blog.jerodsanto.net/2009/06/php5-with-readline-support-on-os-x/</link>
		<comments>http://blog.jerodsanto.net/2009/06/php5-with-readline-support-on-os-x/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 16:38:53 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[readline]]></category>

		<guid isPermaLink="false">http://blog.jerodsanto.net/?p=442</guid>
		<description><![CDATA[OS X ships with PHP5 installed but it does not have readline() support compiled in. Anybody using PHP from the command-line will want this, as it allows handy things such as tab completion and scrolling through command history using the up arrow. Thankfully, MacPorts has a readline variant that can be easily installed: sudo port [...]]]></description>
			<content:encoded><![CDATA[<p>OS X ships with PHP5 installed but it does not have readline() support compiled in. Anybody using PHP from the command-line will want this, as it allows handy things such as tab completion and scrolling through command history using the up arrow.</p>
<p>Thankfully, <a href="http://www.macports.org/">MacPorts</a> has a readline variant that can be easily installed:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">sudo port install php5 +readline</pre></div></div>

<p>If you execute the command above, apache2 will come along for the ride because it&#8217;s a default variant for the PHP5 port. If you don&#8217;t want apache2 (OS X ships with apache2 anyways), modify the command to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">sudo port install php5 -apache2 +readline</pre></div></div>

<p>Not sure if your PHP install has readline support? Execute this one-liner to find out:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000; font-weight: bold;">echo</span> <span style="color: #0086B3;">function_exists</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'readline'</span><span style="color: #000;">&#41;</span> ? <span style="color: #D14;">&quot;yes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000;">:</span> <span style="color: #D14;">&quot;no<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #000;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2009/06/php5-with-readline-support-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweetie Has Arrived</title>
		<link>http://blog.jerodsanto.net/2009/04/tweetie-has-arrived/</link>
		<comments>http://blog.jerodsanto.net/2009/04/tweetie-has-arrived/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 15:54:52 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[iusethis]]></category>

		<guid isPermaLink="false">http://blog.jerodsanto.net/?p=235</guid>
		<description><![CDATA[The anointing of an OS X application:]]></description>
			<content:encoded><![CDATA[<p>The anointing of an OS X application:<br />
<img src="http://blog.jerodsanto.net/wp-content/uploads/2009/04/dockit.png" alt="dockit" title="dockit" width="261" height="206" class="alignleft size-full wp-image-236" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2009/04/tweetie-has-arrived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Perfect OS X FTP Server</title>
		<link>http://blog.jerodsanto.net/2008/07/my-perfect-os-x-ftp-server/</link>
		<comments>http://blog.jerodsanto.net/2008/07/my-perfect-os-x-ftp-server/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 19:47:00 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[ftp]]></category>

		<guid isPermaLink="false">http://0/2008/07/17/my-perfect-os-x-ftp-server</guid>
		<description><![CDATA[I don&#8217;t like FTP. Reasons abound, but to list a couple: Too complex to configure Insecure by default But lets face it, sometimes you need to set up a quick and dirty FTP server for one-time use. Sure, OS X supports FTP file sharing natively but its a bit clunky because you have to either [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like FTP. Reasons abound, but to list a couple:</p>
<ol>
<li>Too complex to configure</li>
<li>Insecure by default</li>
</ol>
<p>But lets face it, sometimes you need to set up a quick and dirty FTP server for one-time use. Sure, OS X supports FTP file sharing natively but its a bit clunky because you have to either A) allow Anonymous access, or B) create a user account on your system and set up sharing on it. Lame.</p>
<p>There are many freeware,and shareware FTP clients but not too many servers. After a cursory review of all the offerings on <a href="http://osx.iusethis.com">IUseThis</a>, I settled on <a href="http://jeanmatthieu.free.fr/pureftpd/">PureFTPd Manager</a> which is a free and open-source front-end for <a href="http://www.pureftpd.org/project/pure-ftpd">PureFTPd</a>&#8230;and what a great choice I made.</p>
<p>Why does this app rock my socks off?</p>
<ol>
<li>Dead simple configuration &#8211; nice GUI walks you through everything</li>
<li>Virtual users &#8211; one new system account and endless virtual users it can represent</li>
<li>Logs and live status updates from GUI</li>
<li>Uninstalls in a few clicks</li>
<li>SSL/TLS support</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2008/07/my-perfect-os-x-ftp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10.5.3 Fixes Spaces</title>
		<link>http://blog.jerodsanto.net/2008/05/10-5-3-fixes-spaces/</link>
		<comments>http://blog.jerodsanto.net/2008/05/10-5-3-fixes-spaces/#comments</comments>
		<pubDate>Sat, 31 May 2008 19:46:00 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[leopard]]></category>

		<guid isPermaLink="false">http://0/2008/05/31/10-5-3-fixes-spaces</guid>
		<description><![CDATA[If you&#8217;re like me then one desktop just doesn&#8217;t cut it anymore. Leopard&#8217;s Spaces is Apple&#8217;s attempt at a virtual desktop management app and it has lacked one very crucial feature until the .3 release of the operating system which was pushed last week. Its a difficult feature to explain but it basically allows your [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me then one desktop just doesn&#8217;t cut it anymore. Leopard&#8217;s Spaces is Apple&#8217;s attempt at a virtual desktop management app and it has lacked one very crucial feature until the .3 release of the operating system which was pushed last week.</p>
<p>Its a difficult feature to explain but it basically allows your to divide your spaces by task instead of by application. I was dying for this fix because everytime I would switch to an application in a space that didn&#8217;t have it open already, I would be whisked away to another space that I did not want to be in.</p>
<p>To activate this feature just open the <strong>Expos&#233; and Spaces</strong> preferences pane and unclick the following checkbox:</p>
<p><img src="http://blog.jerodsanto.net/assets/2008/5/31/spaces.jpg" alt="" /></p>
<p>Read <a href="http://daringfireball.net/2008/05/spaces">Gruber&#8217;s post</a> on this for a more eloquent and thorough explanation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2008/05/10-5-3-fixes-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
