<?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>The House of Ding &#187; Mac</title>
	<atom:link href="http://www.houseofding.com/category/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.houseofding.com</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 03:08:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>My iTunes veto list</title>
		<link>http://www.houseofding.com/2009/08/my-itunes-veto-list/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-itunes-veto-list</link>
		<comments>http://www.houseofding.com/2009/08/my-itunes-veto-list/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 14:15:19 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=237</guid>
		<description><![CDATA[I’ve actually been using this iTunes veto script for a few months now and it’s been so satisfying to hear silence every time these songs are played on the radio: Green Day — Know Your Enemy Green Day — Horseshoes and Handgrenades U2 — I’ll Go Crazy If I Don’t Go Crazy Tonight Bob Dylan [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve actually been using <a href="http://www.houseofding.com/2009/06/itunes-veto-avoid-those-overplayed-new-songs/">this iTunes veto script</a> for a few months now and it’s been so satisfying to hear silence every time these songs are played on the radio:</p>
<ul>
<li>Green Day — Know Your Enemy</li>
<li>Green Day — Horseshoes and Handgrenades</li>
<li>U2 — I’ll Go Crazy If I Don’t Go Crazy Tonight</li>
<li>Bob Dylan — It’s All Good</li>
<li>Bob Dylan — Beyond Here Lies Nothin’</li>
<li>Iron and Wine — Love Vigilantes</li>
<li>Discovery — Orange Shirt</li>
</ul>
<p>Ahh…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2009/08/my-itunes-veto-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Veto: avoid those overplayed new songs</title>
		<link>http://www.houseofding.com/2009/06/itunes-veto-avoid-those-overplayed-new-songs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=itunes-veto-avoid-those-overplayed-new-songs</link>
		<comments>http://www.houseofding.com/2009/06/itunes-veto-avoid-those-overplayed-new-songs/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:10:18 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=217</guid>
		<description><![CDATA[I listen to a stream of The Current almost all day, every day. I love this station, but I cringe every time they play that new Green Day song or when I hear Bono sing, well, anything. No longer! I’ve written a set of Ruby scripts that’ll let me veto away the ugliness so that [...]]]></description>
			<content:encoded><![CDATA[<p>I listen to a stream of <a href="http://minnesota.publicradio.org/tools/play/streams/the_current.pls">The Current</a> almost all day, every day. I love this station, but I cringe every time they play that new Green Day song or when I hear Bono sing, well, anything. No longer! I’ve written a set of Ruby scripts that’ll let me veto away the ugliness so that I’ll never get nasty songs stuck in my head again.</p>
<p>I should point out that these scripts assume you’re running Mac OS X 10.5 with Developer Tools installed. Both scripts use the <code>osx/cocoa</code> library to interact with iTunes.</p>
<h3>veto</h3>
<p>the <code>veto</code> script pulls the track title that iTunes is currently streaming and appends it to <code>~/.itunes_vetoes_songs</code>.</p>
<pre>
#!/usr/bin/env ruby -w

require 'osx/cocoa'
include OSX
OSX.require_framework 'ScriptingBridge'

itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
`echo "#{itunes.currentStreamTitle}" >> ~/.itunes_vetoed_songs`
</pre>
<h3>veto_watcher</h3>
<p><code>veto_watcher</code> runs in the background and looks for vetoes songs to appear the iTunes stream. When they do, it turns down the volume and spares your ears. When the vetoed track is done, the volume goes back up. Note: this <em>should</em> return the volume to it’s previous setting, but the instance variable kept breaking, so it just goes back up to 100%—careful!</p>
<pre>
#!/usr/bin/env ruby -w

# start a new thread
pid = fork do

  require 'osx/cocoa'
  include OSX
  OSX.require_framework 'ScriptingBridge'

  @itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")

  def itunes_is_running?
    return !`ps -A -o comm | grep iTunes.app`.empty?
  end

  def mute
    @itunes.soundVolume = 0 if @itunes.soundVolume > 0
  end

  def unmute
    @itunes.soundVolume = 100 if @itunes.soundVolume == 0
  end

  def check_for_veto
    vetoes = `cat ~/.itunes_vetoed_songs`.split("\n")

    if vetoes.index(@itunes.currentStreamTitle)
      mute
    elsif @itunes.soundVolume == 0
      unmute
    end
  end

  # main loop: check for a veto every 5 seconds
  loop do
    check_for_veto if itunes_is_running?
    sleep(5)
  end

end

Process.detach(pid)
</pre>
<p>I have the <code>veto_watcher</code> script start up when I log in and I’ve set up a Quicksilver trigger to run the <code>veto</code> script. What’s up now, Bono?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2009/06/itunes-veto-avoid-those-overplayed-new-songs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://minnesota.publicradio.org/tools/play/streams/the_current.pls" length="0" type="audio/x-scpls" />
		</item>
		<item>
		<title>Screen lock keyboard shortcut for your Mac</title>
		<link>http://www.houseofding.com/2009/01/screen-lock-keyboard-shortcut-for-you-mac/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=screen-lock-keyboard-shortcut-for-you-mac</link>
		<comments>http://www.houseofding.com/2009/01/screen-lock-keyboard-shortcut-for-you-mac/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 08:52:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=41</guid>
		<description><![CDATA[I’ve always been slightly annoyed by the lack of a keyboard shortcut to lock the screen on my Mac. There are several popular solutions out there (screensaver activated by hot corners, a lock icon in menu bar, etc), but I really missed my Windows-style Windows key+L keyboard shortcut. I’ve finally found a suitable solution with [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve always been slightly annoyed by the lack of a keyboard shortcut to lock the screen on my Mac.  There are several popular solutions out there (screensaver activated by hot corners, a lock icon in menu bar, etc), but I really missed my Windows-style Windows key+L keyboard shortcut. I’ve finally found a suitable solution with a combination of a Terminal command and <a href="http://www.blacktree.com/">Quicksilver</a>’s trigger functionality.</p>
<h3>Command-line script</h3>
<p>It turns out there’s a simple terminal command to do exactly what we want.  The following command will hide your desktop contents and display a login window (along with a fancy screen-rotating animation).</p>
<p>Open your favorite text editor and save a file called <code>lockscreen</code> with the contents below.  I saved mine in a directory called <code>~/bin/</code>, but you can put yours anywhere. (Note: ignore the text wrap below—there is no line break in the command)</p>
<p class="code"><code>#!/bin/sh<br />
/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend</code></p>
<p>Now, we have to make the <code>lockscreen</code> file executable. In Terminal, type:</p>
<p class="code"><code>chmod 754 ~/bin/lockscreen</code></p>
<h3>Set up a Quicksilver trigger</h3>
<p>The built-in keyboard shortcut system in OS X can’t easily trigger a command-line script like our <code>lockscreen</code> script. We’ll set up a trigger in Quicksilver to accomplish the same effect.</p>
<p>In Quicksilver, go to the Catalog and add a your lockscreen script.</p>
<p>Next, go the Triggers section in Quicksilver. Add a new HotKey under the Custom Triggers section.  Type <code>lockscreen</code> under ‘Select an item’ and click Save (it should automatically find this from the catalog). Then click on the Trigger column to set the keyboard shortcut.  I went with Ctrl+Option+Command+L, but choose whichever combination you like.</p>
<p>That’s it—close the Quicksilver window and try out your new keyboard shortcut!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2009/01/screen-lock-keyboard-shortcut-for-you-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing local development websites on your Mac</title>
		<link>http://www.houseofding.com/2008/11/managing-local-development-websites-on-your-mac/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managing-local-development-websites-on-your-mac</link>
		<comments>http://www.houseofding.com/2008/11/managing-local-development-websites-on-your-mac/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 04:48:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=15</guid>
		<description><![CDATA[I recently had my hard drive fail in my MacBook Pro I use for work, which, while a little painful, gave me the opportunity get a fresh, clean install of everything—especially my Apache config files.  Like a lot of developers, my Apache config files had been hacked to pieces.  This was a great time to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had my hard drive fail in my MacBook Pro I use for work, which, while a little painful, gave me the opportunity get a fresh, clean install of everything—especially my Apache config files.  Like a lot of developers, my Apache config files had been hacked to pieces.  This was a great time to re-think how I was doing things.</p>
<h3>Apache according to Apple</h3>
<p>My previous strategy of ignoring every line Apple included in httpd.conf and trying to write my own super genius configuration was a nightmare.  My new strategy would be to follow the guidelines and files that Apple includes with the 10.5 Apache.</p>
<h3>Configuration files</h3>
<p>As of 10.5, Apple arranges Apache configuration files in the following manner:</p>
<ul>
<li>/etc/apache2/httpd.conf — the über config file</li>
<li>/etc/apache2/extras/httpd-vhosts.conf — virtual hosts</li>
<li>/etc/apache2/users/<em>your_user_name</em>.conf — options and access control (IP exceptions)</li>
</ul>
<p>We’ll use only these files to set up an individual site for each development app/website.</p>
<h3>First things first</h3>
<p>Before you start editing files, turn on your local web server by going to <em>System Preferences</em> &gt; <em>Sharing</em> and checking the <em>Web Sharing</em> checkbox.</p>
<h3>Clean up httpd.conf</h3>
<p>Assuming you’ll want to do local Ruby on Rails (via Passenger), SSL (with a <a href="http://www.houseofding.com/2008/11/generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac/">self-signed certificate</a>), and PHP development, make the following changes to you /etc/apache2/httpd.conf:</p>
<p class="code">
<code>Listen 443<br />
LoadModule php5_module libexec/apache2/libphp5.so<br />
Include /private/etc/apache2/extra/httpd-vhosts.conf<br />
# Rails via Phusion Passenger (mod_rails)<br />
LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so<br />
RailsSpawnServer /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server<br />
RailsRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby</code></p>
<p>Add these lines to the end or your httpd.conf or just download this version with the changes already in place.</p>
<h3>Add some virtual hosts</h3>
<p>We’ll set up virtual hosts that respond to re-routed local DNS requests like acoolwebsite.local or companysite.local.  To do this, we’ll have to first add some lines to the /etc/hosts file to pick up these requests.</p>
<h3>/etc/hosts</h3>
<p>Add any local development websites to your /etc/hosts file and point them to the loopback IP address, 127.0.0.1:</p>
<p class="code">
<code>127.0.0.1 sslwebsite.local<br />
127.0.0.1 companywebsite.local</code>
</p>
<h3>/etc/apache2/extra/httpd-vhosts.conf</h3>
<p>Now we’ll add corresponding virtual host entries in /etc/apache2/extra/httpd-vhosts.conf:</p>
<p class="code">
<code>NameVirtualHost *:443<br />
&lt;VirtualHost *:443&gt;<br />
&nbsp;&nbsp;DocumentRoot /Users/your_user_name/Sites/sslwebsite<br />
&nbsp;&nbsp;ServerName sslwebsite.local<br />
&lt;/VirtualHost&gt;<br />
&lt;VirtualHost *:80&gt;<br />
&nbsp;&nbsp;DocumentRoot /Users/your_user_name/Sites/companywebsite<br />
&nbsp;&nbsp;ServerName companywebsite.local<br />
&lt;/VirtualHost&gt;</code>
</p>
<h3>Access control</h3>
<p>Since you’re the only one developing on your machine, you can safely open up all Apache options and enable overrides in /etc/apache2/users/<em>your_user_name</em>.conf:</p>
<p class="code">
<code>&lt;Directory "/Users/your_user_name/Sites/"&gt;<br />
&nbsp;&nbsp;Options All<br />
&nbsp;&nbsp;AllowOverride All<br />
&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;Allow from 127.0.0.1<br />
&nbsp;&nbsp;Allow from 72.14.207.99 # Joe's computer<br />
&nbsp;&nbsp;# Order allow,deny<br />
&nbsp;&nbsp;# Allow from all<br />
&lt;/Directory&gt;</code>
</p>
<p>This only allows requests to be made from your own machine. You can add IP exceptions to allow access from coworkers’ machines or for demoing purposes. I leave the last two lines commented in case I need to temporarily open a site up to the world or if I don’t know the IP of a demo machine.</p>
<h3>Restart Apache</h3>
<p>That’s it—restart Apache with <code>sudo apachectl restart</code> and you should be in business.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2008/11/managing-local-development-websites-on-your-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate a self-signed SSL certificate for local development on a Mac</title>
		<link>http://www.houseofding.com/2008/11/generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac</link>
		<comments>http://www.houseofding.com/2008/11/generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 06:02:12 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=16</guid>
		<description><![CDATA[Generate a host key First, make a home for the new SSL files—I use /etc/apache2/ssl.  Open up a terminal window, cd to the new directory and issue the following command to create a host key file. sudo ssh-keygen -f host.key Generate a certificate request file This command will create a certificate request file. A certificate [...]]]></description>
			<content:encoded><![CDATA[<h3>Generate a host key</h3>
<p>First, make a home for the new SSL files—I use /etc/apache2/ssl.  Open up a terminal window, cd to the new directory and issue the following command to create a host key file.</p>
<p><code>sudo ssh-keygen -f host.key</code></p>
<h3>Generate a certificate request file</h3>
<p>This command will create a certificate request file. A certificate request file contains information about your organization that will be used in the SSL certificate. The command will ask you a bunch of questions; because this is for local development, nonsense will suffice.</p>
<p><code>sudo openssl req -new -key host.key -out request.csr</code></p>
<h3>Create the SSL certificate</h3>
<p>Create a self-signed SSL certificate using the request file.</p>
<p><code>sudo openssl x509 -req -days 365 -in request.csr -signkey host.key -out server.crt</code></p>
<h3>Apache</h3>
<p>Add the following to your Apache configuration to use the new certificate:</p>
<p><code>SSLEngine on<br />
SSLCertificateFile /etc/apache2/ssl/server.crt<br />
SSLCertificateKeyFile /etc/apache2/ssl/server.key</code></p>
<p>Restart Apache with <code>sudo apachectl restart</code> and try our your new certificate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2008/11/generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fix for Mac 10.5.5 ssh, scp, sftp</title>
		<link>http://www.houseofding.com/2008/10/fix-for-mac-1055-ssh-scp-sftp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fix-for-mac-1055-ssh-scp-sftp</link>
		<comments>http://www.houseofding.com/2008/10/fix-for-mac-1055-ssh-scp-sftp/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 16:56:00 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.houseofding.com/?p=13</guid>
		<description><![CDATA[The 10.5.5 update for Mac has apparently broken ssh. Until Apple fixes this, the best option seems to be to compile a patched version of OpenSSH. I’ve written this script to automate the downloading, compilation, and aliasing. This process leaves the existing ssh intact, but aliases the ssh, scp, and sftp commands to the newer [...]]]></description>
			<content:encoded><![CDATA[<p>The 10.5.5 update for Mac has apparently broken ssh.  Until Apple fixes this, the best option seems to be to compile a patched version of OpenSSH. I’ve written <a href="http://www.houseofding.com/fix_openssh">this script</a> to automate the downloading, compilation, and aliasing. This process leaves the existing ssh intact, but aliases the ssh, scp, and sftp commands to the newer working versions.  When Apple does release a fix, just remove the alias lines in your ~/.bash_login file to use the original version.</p>
<h3>Important!</h3>
<p>Please note that this script generate a LOT of files during the compilation. Create a temporary directory and execute this script from there. That way you easily delete the whole mess when you’re done.</p>
<h3>fix_openssh source</h3>
<pre>#!/usr/bin/env ruby -w

`curl -O ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.1p1.tar.gz`
`tar -zxvf openssh-5.1p1.tar.gz`
`openssh-5.1p1/configure`
`cd openssh-5.1p1 &amp; make`
`cd openssh-5.1p1 &amp; sudo make install`
`echo "#fix ssh bug in 10.5.5... temporarily change this to /opt/local/bin/ssh" &gt;&gt; ~/.bash_login`
`echo "alias ssh='/opt/local/bin/ssh'" &gt;&gt; ~/.bash_login`
`echo "alias ssh='/opt/local/bin/scp'" &gt;&gt; ~/.bash_login`
`echo "alias ssh='/opt/local/bin/sftp'" &gt;&gt; ~/.bash_login`</pre>
<p>I know—there’s really nothing Ruby about this.  I guess it could just be a shell script.</p>
<h3>Update 10/10/08</h3>
<p>My machine installs files to /opt/local/bin/, but it appears that on most Macs, it’ll install your new binaries to /opt/local/bin/.  If this is that case on yours, just change the alias path in your ~/.bash_login.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.houseofding.com/2008/10/fix-for-mac-1055-ssh-scp-sftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

