<?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/"
	
xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
>

<channel>
	<title>Greg Benedict</title>
	<atom:link href="http://www.gregbenedict.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gregbenedict.com</link>
	<description>Thoughts on the web, development and creativity.</description>
	<lastBuildDate>Fri, 18 Sep 2015 12:31:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<site xmlns="com-wordpress:feed-additions:1">3288261</site>	<item>
		<title>Fixing Java on OS X 10.10 Yosemite</title>
		<link>http://www.gregbenedict.com/2014/10/19/fixing-java-on-os-x-10-10-yosemite/</link>
		<comments>http://www.gregbenedict.com/2014/10/19/fixing-java-on-os-x-10-10-yosemite/#comments</comments>
		<pubDate>Mon, 20 Oct 2014 02:08:04 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=276</guid>
		<description><![CDATA[After upgrading to Yosemite, I was unable to run Apache Solr as it could not find a version of Java installed. $java -version No Java runtime present, requesting install. I downloaded and installed the latest version of Java 8, but that didn&#8217;t work. I removed it and downloaded the latest version of Java 7.  Still &#8230; <a href="http://www.gregbenedict.com/2014/10/19/fixing-java-on-os-x-10-10-yosemite/" class="more-link">Continue reading<span class="screen-reader-text"> "Fixing Java on OS X 10.10 Yosemite"</span></a>]]></description>
				<content:encoded><![CDATA[<p>After upgrading to Yosemite, I was unable to run Apache Solr as it could not find a version of Java installed.</p>
<blockquote><p><em>$java -version</em></p>
<p>No Java runtime present, requesting install.</p></blockquote>
<p>I downloaded and installed the latest version of Java 8, but that didn&#8217;t work. I removed it and downloaded the latest version of Java 7.  Still no dice.</p>
<p>After a bit of digging around, I found a reference to installing <a href="http://support.apple.com/kb/DL1572?viewlocale=en_US&amp;locale=en_US">Java for OS X 2014-001</a>. While this is Java 6, it fixed my issue and allowed me to start Solr.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2014/10/19/fixing-java-on-os-x-10-10-yosemite/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">276</post-id>	</item>
		<item>
		<title>How to enable 1Password&#8217;s Safari extension on iOS 8</title>
		<link>http://www.gregbenedict.com/2014/09/17/how-to-enable-1passwords-safari-extension-on-ios-8/</link>
		<comments>http://www.gregbenedict.com/2014/09/17/how-to-enable-1passwords-safari-extension-on-ios-8/#comments</comments>
		<pubDate>Wed, 17 Sep 2014 17:59:14 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=258</guid>
		<description><![CDATA[It took me about 20 minutes this morning to figure out how to enable 1Password to work in Safari with iOS 8. It&#8217;s not obvious. Here&#8217;s how to do it. First, click the action button (box with arrow) at the bottom of the page. Next, swipe the bottom list (black &#38; white) from right to left. Then choose &#8230; <a href="http://www.gregbenedict.com/2014/09/17/how-to-enable-1passwords-safari-extension-on-ios-8/" class="more-link">Continue reading<span class="screen-reader-text"> "How to enable 1Password&#8217;s Safari extension on iOS 8"</span></a>]]></description>
				<content:encoded><![CDATA[<p>It took me about 20 minutes this morning to figure out how to enable 1Password to work in Safari with iOS 8. It&#8217;s not obvious. Here&#8217;s how to do it.</p>
<p><span id="more-258"></span></p>
<p>First, click the action button (box with arrow) at the bottom of the page.</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070.jpg"><img class="alignnone wp-image-259 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-169x300.jpg" alt="IMG_3070" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>Next, swipe the bottom list (black &amp; white) from right to left. Then choose More (&#8230;)</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3071.jpg"><img class="alignnone wp-image-260 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3071-169x300.jpg" alt="IMG_3071" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3071-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3071-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3071.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>Then, choose 1Password from the list and enable it. Click &#8216;Done&#8217; when finished.</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3072.jpg"><img class="alignnone wp-image-261 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3072-169x300.jpg" alt="IMG_3072" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3072-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3072-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3072.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>Now click on the action button again.</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070.jpg"><img class="alignnone wp-image-259 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-169x300.jpg" alt="IMG_3070" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3070.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>Then, choose 1Password from the list.</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3073.jpg"><img class="alignnone wp-image-262 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3073-169x300.jpg" alt="IMG_3073" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3073-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3073-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3073.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>Finally, enter your password to unlock the app and choose the item you want to fill.</p>
<p><a href="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3074.jpg"><img class="alignnone wp-image-263 size-medium" src="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3074-169x300.jpg" alt="IMG_3074" width="169" height="300" srcset="http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3074-169x300.jpg 169w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3074-576x1024.jpg 576w, http://www.gregbenedict.com/wp-content/uploads/2014/09/IMG_3074.jpg 640w" sizes="(max-width: 169px) 85vw, 169px" /></a></p>
<p>The only downside to this is that you have to enter your password every time. If you have an iPhone 5S or above, I would enable login via TouchID to make this process much easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2014/09/17/how-to-enable-1passwords-safari-extension-on-ios-8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">258</post-id>	</item>
		<item>
		<title>Hardwiring the Xantech ML85 IR Receiver to a Connecting Block</title>
		<link>http://www.gregbenedict.com/2014/08/26/hardwiring-the-xantech-ml85-ir-receiver-to-a-connecting-block/</link>
		<comments>http://www.gregbenedict.com/2014/08/26/hardwiring-the-xantech-ml85-ir-receiver-to-a-connecting-block/#respond</comments>
		<pubDate>Tue, 26 Aug 2014 13:29:44 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[home theater]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=253</guid>
		<description><![CDATA[I recently added a Xantech ML85K IR repeater kit to my theater room. All of my equipment sits in the back of the room and I needed a solution for my remotes to work while pointing them at the screen as one would normally do. The challenge with this kit is that the IR receiver comes with a standard &#8230; <a href="http://www.gregbenedict.com/2014/08/26/hardwiring-the-xantech-ml85-ir-receiver-to-a-connecting-block/" class="more-link">Continue reading<span class="screen-reader-text"> "Hardwiring the Xantech ML85 IR Receiver to a Connecting Block"</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently added a <a href="http://www.amazon.com/Xantech-ML85K-Proof-Micro-Receiver/dp/B004ED8CHM">Xantech ML85K IR repeater kit</a> to my theater room. All of my equipment sits in the back of the room and I needed a solution for my remotes to work while pointing them at the screen as one would normally do.</p>
<p>The challenge with this kit is that the IR receiver comes with a standard 1/8&#8243; (3.5mm) stereo mini plug designed to plug right into the 789-44 connecting block. Unfortunately, the cable in only 7 feet long and I needed to run over 30 feet through the walls and ceiling.</p>
<p>In this case I had two options:</p>
<ol>
<li>Use a 50ft stereo mini extender cable (or a 20ft and a 10ft)</li>
<li>Use CAT6 wire</li>
</ol>
<p>As I already had CAT6 laying around and it was better suited for in wall use, I decided to cut off the end of the IR receiver and splice the wires. The only problem is that Xantech doesn&#8217;t provide the mappings between wire color and function. They do however tell us what the tip, ring and sleeve of the mini-jack do.</p>
<p>So to make this work I did the only logical thing: I cut apart the mini jack to figure out the mappings my self. So you have them, here are the mappings:</p>
<ul>
<li>Tip &gt; White &gt; Signal</li>
<li>Ring &gt; Black &gt; Ground</li>
<li>Sleeve &gt; Red &gt; +12VDC</li>
</ul>
<p>While this works for the ML85, my guess is that it will work for other Xantech IR receivers as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2014/08/26/hardwiring-the-xantech-ml85-ir-receiver-to-a-connecting-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">253</post-id>	</item>
		<item>
		<title>Website Performance with Ruby on Rails</title>
		<link>http://www.gregbenedict.com/2013/10/29/website-performance-with-ruby-on-rails/</link>
		<comments>http://www.gregbenedict.com/2013/10/29/website-performance-with-ruby-on-rails/#respond</comments>
		<pubDate>Tue, 29 Oct 2013 21:20:43 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=238</guid>
		<description><![CDATA[Back in August I did a write up for my company, TGFI, talking about what we did to make BigSouthSports.com handle tens of thousands of concurrent users. The site quietly runs on two load balanced virtual machines and a database server with failover. In reality, we don&#8217;t even need that many servers. We could easily do &#8230; <a href="http://www.gregbenedict.com/2013/10/29/website-performance-with-ruby-on-rails/" class="more-link">Continue reading<span class="screen-reader-text"> "Website Performance with Ruby on Rails"</span></a>]]></description>
				<content:encoded><![CDATA[<p>Back in August I did a write up for my company, TGFI, talking about what we did to make BigSouthSports.com handle tens of thousands of concurrent users.</p>
<p><span id="more-238"></span>The site quietly runs on two load balanced virtual machines and a database server with failover. In reality, we don&#8217;t even need that many servers. We could easily do everything with one, but we wanted redundancy for failure built into the system. At our peaks we only use around 2% of the system&#8217;s capabilities.</p>
<p>You can read more about what we did here:</p>
<p><a href="http://www.tgfi.net/2013/08/16/building-a-website-with-performance-in-mind/">Building a Website with Performance in Mind</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2013/10/29/website-performance-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">238</post-id>	</item>
		<item>
		<title>Caching a Wildcard Domain Using Varnish with Multiple Virtual Hosts</title>
		<link>http://www.gregbenedict.com/2013/09/10/caching-a-wildcard-domain-using-varnish-with-multiple-virtual-hosts/</link>
		<comments>http://www.gregbenedict.com/2013/09/10/caching-a-wildcard-domain-using-varnish-with-multiple-virtual-hosts/#respond</comments>
		<pubDate>Tue, 10 Sep 2013 13:40:37 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=231</guid>
		<description><![CDATA[At my company, TGFI, we have a handful of sites that run through Varnish to cache images, css, javascript and even full pages in memory. To date, all of this had been done with known domains (domain.host, www.domain.host). This week, however, we have a new application going live in the system that uses a wildcard &#8230; <a href="http://www.gregbenedict.com/2013/09/10/caching-a-wildcard-domain-using-varnish-with-multiple-virtual-hosts/" class="more-link">Continue reading<span class="screen-reader-text"> "Caching a Wildcard Domain Using Varnish with Multiple Virtual Hosts"</span></a>]]></description>
				<content:encoded><![CDATA[<p>At my company, <a href="http://www.tgfi.net">TGFI</a>, we have a handful of sites that run through Varnish to cache images, css, javascript and even full pages in memory. To date, all of this had been done with known domains (domain.host, www.domain.host). This week, however, we have a new application going live in the system that uses a wildcard domain. Despite looking around, I was unable to find documentation on how to handle a wildcard domain when varnish is setup to handle multiple sites.</p>
<p><span id="more-231"></span>After a bit of playing around, here&#8217;s an example of how I ended up doing it:</p>
<pre><code>
backend backend1 {
  .host = "192.168.1.101";
}

backend backend2 {
  .host = "192.168.1.102";
}
backend backend3 {
  .host = "192.168.1.103";
}

# This allows you to hit multiple backends with one domain to balance across servers.
director director1 round-robin {
  { .backend = backend1; }
  { .backend = backend2; }
}

sub vcl_recv {

  # This site uses a director to hit multiple backend servers.
  if (req.http.host ~ "^www.domain1.com$" || req.http.host ~ "^domain1.com$") {
    set req.backend = director1;
  }

  # This site uses a wildcard domain to hit just one server. This is all RegEx based.
  if (req.http.host ~ "^domain2.com$" || req.http.host ~ "^.+\.domain2.com$") {
    set req.backend = backend3;
  }

}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2013/09/10/caching-a-wildcard-domain-using-varnish-with-multiple-virtual-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">231</post-id>	</item>
		<item>
		<title>Pain is a signal of improvement</title>
		<link>http://www.gregbenedict.com/2013/01/27/pain-is-a-signal-of-improvement/</link>
		<comments>http://www.gregbenedict.com/2013/01/27/pain-is-a-signal-of-improvement/#respond</comments>
		<pubDate>Mon, 28 Jan 2013 01:50:44 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=218</guid>
		<description><![CDATA[Be it programming or life, you have to push through your comfort zone to expand your capabilities. If you are unwilling to do that, you&#8217;ll lead a very unfulfilling life. It is a fundamental law of nature that to evolve one has to push one&#8217;s limits, which is painful, in order to gain strength—whether it&#8217;s &#8230; <a href="http://www.gregbenedict.com/2013/01/27/pain-is-a-signal-of-improvement/" class="more-link">Continue reading<span class="screen-reader-text"> "Pain is a signal of improvement"</span></a>]]></description>
				<content:encoded><![CDATA[<p>Be it programming or life, you have to push through your comfort zone to expand your capabilities. If you are unwilling to do that, you&#8217;ll lead a very unfulfilling life.</p>
<blockquote><p>It is a fundamental law of nature that to evolve one has to push one&#8217;s limits, which is painful, in order to gain strength—whether it&#8217;s in the form of lifting weights, facing problems head-on, or in any other way. Nature gave us pain as a messaging device to tell us that we are approaching, or that we have exceeded, our limits in some way. At the same time, nature made the process of getting stronger require us to push our limits. Gaining strength is the adaptation process of the body and the mind to encountering one&#8217;s limits, which is painful. In other words, both pain and strength typically result from encountering one&#8217;s barriers. When we encounter pain, we are at an important juncture in our decision-making process.</p></blockquote>
<p>Ray Dalio, <em><a href="http://www.bwater.com/Uploads/FileManager/Principles/Bridgewater-Associates-Ray-Dalio-Principles.pdf">Principles</a></em></p>
<p>Every day I try to push myself and challenge my beliefs from the day before. The more I read new topics or tackle difficult tasks, the better I feel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2013/01/27/pain-is-a-signal-of-improvement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">218</post-id>	</item>
		<item>
		<title>Progress and Persistence</title>
		<link>http://www.gregbenedict.com/2013/01/12/progress-and-persistence/</link>
		<comments>http://www.gregbenedict.com/2013/01/12/progress-and-persistence/#respond</comments>
		<pubDate>Sun, 13 Jan 2013 03:01:52 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[business]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/2013/01/12/progress-and-persistence/</guid>
		<description><![CDATA[This quote from Steve Jobs has nothing to do with product design and everything to do with moving society forward. Designing a product is keeping five thousand things in your brain and fitting them all together in new and different ways to get what you want. And every day you discover something new that is &#8230; <a href="http://www.gregbenedict.com/2013/01/12/progress-and-persistence/" class="more-link">Continue reading<span class="screen-reader-text"> "Progress and Persistence"</span></a>]]></description>
				<content:encoded><![CDATA[<p>This quote from Steve Jobs has nothing to do with product design and everything to do with moving society forward.</p>
<blockquote><p>Designing a product is keeping five thousand things in your brain and fitting them all together in new and different ways to get what you want. And every day you discover something new that is a new problem or a new opportunity to fit these things together a little differently. And it’s that process that is the magic.</p></blockquote>
<p>Don&#8217;t rest on your laurels. Keep pushing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2013/01/12/progress-and-persistence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">200</post-id>	</item>
		<item>
		<title>Backing Up Your Heroku Database with PGBackups</title>
		<link>http://www.gregbenedict.com/2010/12/13/heroku-database-backups/</link>
		<comments>http://www.gregbenedict.com/2010/12/13/heroku-database-backups/#respond</comments>
		<pubDate>Mon, 13 Dec 2010 15:19:27 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=187</guid>
		<description><![CDATA[Heroku recently announced that they are changing the way you backup your app&#8217;s database. They are deprecating their bundles add-on and have added a new PostgreSQL only backup feature. This is great news as the old bundles method included a copy of your source code as well. In one instance, our backups went from 90MB &#8230; <a href="http://www.gregbenedict.com/2010/12/13/heroku-database-backups/" class="more-link">Continue reading<span class="screen-reader-text"> "Backing Up Your Heroku Database with PGBackups"</span></a>]]></description>
				<content:encoded><![CDATA[<p>Heroku recently announced that they are changing the way you backup your app&#8217;s database. They are deprecating their bundles add-on and have added a new PostgreSQL only backup feature. This is great news as the old bundles method included a copy of your source code as well. In one instance, our backups went from 90MB compressed to just 17MB uncompressed.</p>
<h2>Installing the Heroku PGBackups Add-On</h2>
<p>First, you&#8217;ll need to install the latest version of the <em>heroku</em> gem.</p>
<p><code>sudo gem install heroku</code></p>
<p>Next, go into your project directory and install the pgbackups add-on.</p>
<p><code>cd ~/projects/MyProject/<br />
heroku addons:add pgbackups<br />
</code></p>
<p>Once installed you can easily make a backup to the cloud.</p>
<p><code>heroku pg:backups capture --expire</code></p>
<p>There are two things to note here:</p>
<ol>
<li>This backup now happens synchronously instead of in the background. This makes automation much easier as you don&#8217;t have to sleep for a few minutes and hope it&#8217;s done.</li>
<li>The <em>––expire</em> parameter automatically deletes the oldest backup, making historical cleanup a cinch.</li>
</ol>
<p>Once the backup completes you can fire the download command off. This will get a public url (<em>heroku pgbackups:url</em>) and download it using <em>curl</em> to a directory on your computer. The file is also renamed with a timestamp like 20101213 for easy sorting.</p>
<p><code>curl -o /MyComputer/Drobo/backups/MyProject/MyProject_pgbackup_`date '+%Y%m%d'`.sql `heroku pgbackups:url`</code></p>
<p>That&#8217;s it. They&#8217;ve really done a great job making it easier to backup your database and it works every time.</p>
<h2>What else can you do?</h2>
<p>For more information, checkout the <a href="http://docs.heroku.com/pgbackups">Heroku documentation on pgbackups</a>. They have a great example at the bottom for transferring your database between production and staging sites, something we do all the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2010/12/13/heroku-database-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">187</post-id>	</item>
		<item>
		<title>Installing PostgreSQL on Snow Leopard 10.6</title>
		<link>http://www.gregbenedict.com/2009/08/31/installing-postgresql-on-snow-leopard-10-6/</link>
		<comments>http://www.gregbenedict.com/2009/08/31/installing-postgresql-on-snow-leopard-10-6/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 16:23:27 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=154</guid>
		<description><![CDATA[Good news! Whether you are using PostgreSQL for general development, or need a version to match your setup on Heroku, getting PostgreSQL 8.3 installed on Snow Leopard is fairly straight forward. However, you&#8217;ll want to make some changes so that it works right for you. Installing PostgreSQL 8.3 First, you&#8217;ll need to install Xcode if &#8230; <a href="http://www.gregbenedict.com/2009/08/31/installing-postgresql-on-snow-leopard-10-6/" class="more-link">Continue reading<span class="screen-reader-text"> "Installing PostgreSQL on Snow Leopard 10.6"</span></a>]]></description>
				<content:encoded><![CDATA[<p>Good news! Whether you are using PostgreSQL for general development, or need a version to match your setup on <a href="http://www.heroku.com/"><strong>Heroku</strong></a>, getting PostgreSQL 8.3 installed on Snow Leopard is fairly straight forward. However, you&#8217;ll want to make some changes so that it works right for you.<br />
<span id="more-154"></span></p>
<h2>Installing PostgreSQL 8.3</h2>
<p>First, you&#8217;ll need to install Xcode if you haven&#8217;t already. This is available on the Snow Leopard DVD in the Optional Installs directory.</p>
<p>Second, if you aren&#8217;t already using it, download <a href="http://distfiles.macports.org/MacPorts/MacPorts-1.8.0-10.6-SnowLeopard.dmg">Mac Ports for Snow Leopard</a> and install it. Mac Ports has come a long way in the last few years and will make your life much easier.</p>
<p>Once those are installed, run the following command:<br />
<code>sudo port install postgresql83 postgresql83-server</code></p>
<h2>Setup Your First Database</h2>
<p>At the very end of the install it tells you how to setup your first database:</p>
<p><code>sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb</code><br />
<code>sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb</code><br />
<code>sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'</code></p>
<p>You&#8217;ll also want to setup Postgres to auto-run as a server on start up.</p>
<p><code>sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist</code></p>
<p>If you want to start it right now, you can either reboot or do the following:</p>
<p><code>sudo su postgres -c '/opt/local/lib/postgresql83/bin/postgres -D /opt/local/var/db/postgresql83/defaultdb'</code></p>
<h2>Make psql Available from the Command Line</h2>
<p>The executable files for PostgreSQL get shoved into a non-standard place (just like MySQL), so you&#8217;ll need to edit the default profile.</p>
<p><code>sudo vi /etc/profile</code></p>
<p>You can also do this using <code>sudo mate /etc/profile</code> if you aren&#8217;t comfortable in VI.</p>
<p>The <code>PATH=</code> line needs to be changed to include the PostgreSQL bin directory.</p>
<p>Mine was <code>PATH="/opt/local/bin:$PATH"</code> and is now:</p>
<p><code>PATH="/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin:$PATH"</code></p>
<p>If you open a new terminal window you can now type <code>psql</code> and it will find it.</p>
<h2>Create a New User and Database</h2>
<p>By default, PostgreSQL creates a <em>postgres</em> user for you. However, it&#8217;s not good practice to use the default and it&#8217;s a pain in the ass. Let&#8217;s just create a new database user to make it easier.</p>
<p><code>createuser --superuser macusername -U postgres</code></p>
<p>You need to change <code>macusername</code> to your mac username. This will make your life ALOT easier. Trust me here.</p>
<p>Next, create your database:</p>
<p><code>createdb my_database</code></p>
<h2>Installing the PostgreSQL Ruby Gem</h2>
<p><strike>Unlike the MySQL driver, we don&#8217;t need to pass the ARCHFLAGS variable as 64 bit. PostgreSQL comes with both 32 and 64-bit versions. Yeah!</strike></p>
<p><strike><code>sudo gem install postgres-pr</code></strike></p>
<p>Per Tom&#8217;s comment below, we should be using the native driver for better performance.</p>
<p><code>sudo env ARCHFLAGS="-arch x86_64" gem install pg</code></p>
<h2>Configuring your Rails Application</h2>
<p>Inside your Ruby on Rails application, open up config/database.yml and change your development adapter to be similar to the following:</p>
<p><code>development:<br />
  adapter: postgresql<br />
  database: defaultdb<br />
  username: defaultdb<br />
</code></p>
<p>You can change <code>defaultdb</code> to the name you need for your application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2009/08/31/installing-postgresql-on-snow-leopard-10-6/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">154</post-id>	</item>
		<item>
		<title>Fixing Ruby Gems, MySQL and Passenger Phusion on Snow Leopard 10.6</title>
		<link>http://www.gregbenedict.com/2009/08/29/fixing-ruby-gems-mysql-and-passenger-phusion-on-snow-leopard-10-6/</link>
		<comments>http://www.gregbenedict.com/2009/08/29/fixing-ruby-gems-mysql-and-passenger-phusion-on-snow-leopard-10-6/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 00:57:54 +0000</pubDate>
		<dc:creator><![CDATA[Greg Benedict]]></dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[thin]]></category>

		<guid isPermaLink="false">http://www.gregbenedict.com/?p=121</guid>
		<description><![CDATA[One of the first things I noticed after upgrading to Snow Leopard is that my Passenger based sites stopped working. I use this heavily for Rails development, so I needed it fixed. The first thing I tried was reinstalling Passenger Phusion, which led to an error. ERROR: Error installing passenger: ERROR: Failed to build gem &#8230; <a href="http://www.gregbenedict.com/2009/08/29/fixing-ruby-gems-mysql-and-passenger-phusion-on-snow-leopard-10-6/" class="more-link">Continue reading<span class="screen-reader-text"> "Fixing Ruby Gems, MySQL and Passenger Phusion on Snow Leopard 10.6"</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the first things I noticed after upgrading to Snow Leopard is that my Passenger based sites stopped working. I use this heavily for Rails development, so I needed it fixed. The first thing I tried was reinstalling Passenger Phusion, which led to an error.<br />
<span id="more-121"></span><br />
<code>ERROR:  Error installing passenger:<br />
ERROR: Failed to build gem native extension.<br />
</code><br />
<code>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install passenger<br />
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h</code></p>
<p>Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/passenger-2.2.4 for inspection.<br />
Results logged to /Library/Ruby/Gems/1.8/gems/passenger-2.2.4/ext/phusion_passenger/gem_make.out</p>
<p>There are several reasons for this.</p>
<ol>
<li>You have a new operating system with new binaries. Things don&#8217;t line up anymore.</li>
<li>You have a new version of Ruby (1.8.7 instead of 1.8.6) and you may need updated gems.</li>
<li>The upgrade deletes your mysql symlink</li>
</ol>
<p>Here are the steps to take to fix the issues.</p>
<h2>Install Xcode</h2>
<p>This is available on the Snow Leopard DVD in the Optional Installs directory.</p>
<h2>Install the iPhone SDK</h2>
<p>If you have previously installed the iPhone SDK for Leopard, you&#8217;ll need to reinstall. You can <a href="http://developer.apple.com/iphone/index.action#downloads">download</a> and Install the iPhone SDK for Snow Leopard. It is build specific to Snow Leopard, so be sure to grab the right dmg file.</p>
<h2>Install MySQL 64-bit</h2>
<p>If you are running 64-bit hardware, OS X is now fully 64-bit compliant and your MySQL libraries probably aren&#8217;t! You&#8217;ll need to <a href="http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.37-osx10.5-x86_64.dmg/from/pick#mirrors">download</a> the 64-bit version and reinstall.</p>
<p>Next we are going to move the default data files out and restore our original data files that the install moved.</p>
<p>First, go stop mysql using the preference pane. I&#8217;ll wait.</p>
<p>Ok, now go run the following commands:</p>
<p><strong>Note:</strong> You need to tailor the last command to pull from the previously installed version of MySQL. You can do an <code>ls /usr/local/</code> directory to find out.</p>
<p><code>sudo mv /usr/local/mysql/data /usr/local/mysql/data.default</code><br />
<code>sudo mv /usr/local/mysql-5.0.67-osx10.5-x86/data /usr/local/mysql/data</code></p>
<p>You&#8217;ll also need to recreate the symlink for you socket.</p>
<p><code>sudo ln -s /var/mysql/mysql.sock /tmp/mysql.sock</code></p>
<h2>Re-Install Your Broken Gems</h2>
<p>Any gem that requires compilation (passenger, mysql, RedCloth, thin and hpricot are good examples) must be recompiled using the new gcc compiler that is installed with XCode.</p>
<p><code>sudo gem install passenger</code><br />
<code>sudo gem uninstall mysql</code><br />
<code>sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</code></p>
<p>You still need to pass the ARCHFLAGS command like you did under 10.5 Leopard.</p>
<h2>More to Come?</h2>
<p>Probably, but that&#8217;s it so far. I&#8217;ll update this post if I find any more issues.</p>
<h2>Update 1a: Passenger PrefPane</h2>
<p>It doesn&#8217;t load and reinstalling it doesn&#8217;t work for me. <span style="text-decoration: line-through;">It appears to be an issue with RubyCocoa, but not sure yet. In the mean time, just add your *.local domains to to your /etc/hosts file.</span> Thanks to David for the fix in the comments.</p>
<p>Once you install Ruby Cocoa 0.13.2 with the plist change (allows you to install on 10.6) you may need to change your pref pane entries. I added a letter to the alias of each, then deleted it back out and applied the change.</p>
<p><code>sudo apachectl restart</code></p>
<p>After that it picked the local domains right up and I was good to go.</p>
<h2>Update 1b: Passenger PrefPane 1.3 is Out!</h2>
<p>Eloy has release a new update that is compatible with Snow Leopard. Great work! Read more about it and <a href="http://www.fngtps.com/2009/09/new-os-more-pane-passenger-preference-pane-v1-3">download it on his blog</a>.</p>
<h2>Update 2: ImageMagick and RMagick</h2>
<p>So the upgrade toasts Mac Ports and ImageMagick.</p>
<p>Yep, blow it all away. It&#8217;s too much of a pain.</p>
<p><code>rm -rf /opt/local</code></p>
<p>Now download <a href="http://distfiles.macports.org/MacPorts/MacPorts-1.8.0-10.6-SnowLeopard.dmg">Mac Ports for Snow Leopard</a> and install.</p>
<p>You might want to go eat or get a beer for this next step. <span style="text-decoration: line-through;">Then again, maybe not. You have a faster OS now!</span> Nope, you still need that beer.</p>
<p><code>sudo port install libxml2</code><br />
<code>sudo port install ImageMagick</code><br />
<code>sudo gem install rmagick</code></p>
<h2>Update 3: Git</h2>
<p>I just don&#8217;t trust potential binary issues and am upgrading to the latest. <span style="text-decoration: line-through;"><a href="http://git-scm.com/">You should too</a>. <strong>WARNING</strong>: As of 8/29/2009 expat is not the correct architecture and you can&#8217;t install git yet so wait a few days. I did some testing and git seems good to go. I will upgrade as soon as this is fixed though.</span></p>
<p>Blowing away Mac Ports in Update 2 solves the issue!</p>
<p>If you were using Mac Ports previously, you&#8217;ll have problems you need to fix.</p>
<p><code>sudo port install git-core +bash_completion +doc</code></p>
<p>or via downloaded file</p>
<p><code>cd /download/and/untarred/folder/</code><br />
<code>./configure</code><br />
<code>make</code><br />
<code>sudo make install</code></p>
<h2>Update 4: Fixing an Incorrect DirectoryIndex in Apache</h2>
<p>We came across an issue this morning with Apache not using the correct DirectoryIndex (default document such as index.php). It seems the code to include the passenger prefpane vhosts has changed slightly.</p>
<p>In the <code>/etc/apache2/httpd.conf</code> file they added three new lines. It was this:</p>
<p><code>&lt;IfModule passenger_module&gt;</code><br />
<code> NameVirtualHost *:80</code><br />
<code> Include /private/etc/apache2/passenger_pane_vhosts/*.conf</code><br />
<code>&lt;/IfModule&gt;</code></p>
<p>and is now this:</p>
<p><code>&lt;IfModule passenger_module&gt;</code><br />
<code> NameVirtualHost *:80</code><br />
<code> &lt;VirtualHost *:80&gt;</code><br />
<code> ServerName _default_</code><br />
<code> &lt;/VirtualHost&gt;</code><br />
<code> Include /private/etc/apache2/passenger_pane_vhosts/*.conf</code><br />
<code>&lt;/IfModule&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gregbenedict.com/2009/08/29/fixing-ruby-gems-mysql-and-passenger-phusion-on-snow-leopard-10-6/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">121</post-id>	</item>
	</channel>
</rss>
