<?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>Shinji Kuwayama &#187; Tech Tips</title>
	<atom:link href="http://kuwayama.com/category/tech-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://kuwayama.com</link>
	<description>Articles on community development, Ruby on Rails, and SEO</description>
	<lastBuildDate>Sat, 13 Mar 2010 00:40:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Perl one-liner to extract email addresses from a text file</title>
		<link>http://kuwayama.com/perl-one-liner-to-extract-email-addresses-from-a-text-file</link>
		<comments>http://kuwayama.com/perl-one-liner-to-extract-email-addresses-from-a-text-file#comments</comments>
		<pubDate>Wed, 10 Mar 2010 18:35:21 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=245</guid>
		<description><![CDATA[I occasionally have to search log files for email addresses. Here&#8217;s the command I use to extract them all out quickly into another file.
perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&#38;\n"}' original.txt &#124; sort -u &#62; extracted_emails.txt
There&#8217;s probably room for improvement here—any ideas, please comment!
]]></description>
			<content:encoded><![CDATA[<p>I occasionally have to search log files for email addresses. Here&#8217;s the command I use to extract them all out quickly into another file.</p>
<p><code>perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&amp;\n"}' original.txt | sort -u &gt; extracted_emails.txt</code></p>
<p>There&#8217;s probably room for improvement here—any ideas, please comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/perl-one-liner-to-extract-email-addresses-from-a-text-file/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Writeboards and Basecamp</title>
		<link>http://kuwayama.com/on-writeboards-and-basecamp</link>
		<comments>http://kuwayama.com/on-writeboards-and-basecamp#comments</comments>
		<pubDate>Thu, 28 Jan 2010 17:42:27 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Clients]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=243</guid>
		<description><![CDATA[Basecamp makes things easy, and I love it. Here&#8217;s an odd example though: Basecamp makes it incredibly easy to post the wrong link to a Writeboard—one which prompts for a mysterious password that no one knows.
I know how to avoid this mistake and in a moment, so will you!
Writeboard and Basecamp are actually separate products, [...]]]></description>
			<content:encoded><![CDATA[<p>Basecamp makes things easy, and I love it. Here&#8217;s an odd example though: Basecamp makes it incredibly easy to post the wrong link to a Writeboard—one which prompts for a mysterious password that no one knows.</p>
<p>I know how to avoid this mistake and in a moment, so will you!</p>
<p><a href="http://writeboard.com/">Writeboard</a> and <a href="http://basecamphq.com/?referrer=SHINJIKUWAYAMA">Basecamp</a> are actually separate products, much as Highrise and Campfire are separate. Basecamp provides Writeboard integration, and most people I know just think of it as a Basecamp feature (which is fine).</p>
<p><img src="http://kuwayama.com/wp-content/uploads/2010/01/Writeboard_-Chapter-One_-A-Project-is-Born.jpg" alt="Writeboard_ Chapter One_ A Project is Born.jpg" border="0" width="691" height="290" /></p>
<p>See, this is actually a Writeboard URL, and we&#8217;re not in Basecamp right now. </p>
<p>If you copy-and-paste the URL from the Location: field, you&#8217;re actually capturing a link to your Writeboard account, and not your Basecamp project. That&#8217;s why 37signals provides the &#8220;Share this Writeboard&#8221; link. If you want to link to this document Basecamp-wise, you <strong>must</strong> right-click the &#8220;Share this Writeboard&#8221; link, and select &#8220;Copy this link&#8221; (on a Mac, that is). You do <strong>not</strong> want to copy the 123.writeboard.com URL.</p>
<p>This is oddly inscrutable for a 37signals product and I hope it gets improved someday. In the meantime, we&#8217;ll just have to suck it up and make ourselves remember to link to Writeboards the right way and not the wrong way. </p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/on-writeboards-and-basecamp/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Relic: &#8220;Mongrel count&#8221; vs &#8220;Instance count&#8221;</title>
		<link>http://kuwayama.com/new-relic-mongrel-count-vs-instance-count</link>
		<comments>http://kuwayama.com/new-relic-mongrel-count-vs-instance-count#comments</comments>
		<pubDate>Fri, 06 Nov 2009 15:29:28 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=235</guid>
		<description><![CDATA[
New Relic is the best way to track a Rails app&#8217;s performance, no question, but it still confounds me at times. Here&#8217;s something I learned today.

New Relic reports the number of instances per host; until today, I was reading this as the size of our mongrel pool.

It&#8217;s not, actually—it&#8217;s more like the ideal size of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://kuwayama.com/wp-content/uploads/2009/11/Production-New-Relic-RPM-4.jpg" alt="Production - New Relic RPM-4.jpg" border="0" width="198" height="187" align="right" style="margin-left:1em;" />
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><a href="http://newrelic.com">New Relic</a> is the best way to track a Rails app&#8217;s performance, no question, but it still confounds me at times. Here&#8217;s something I learned today.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">New Relic reports the number of instances per host; until today, I was reading this as the size of our mongrel pool.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">It&#8217;s not, actually—it&#8217;s more like the <strong>ideal</strong> size of the mongrel pool. New Relic is actually counting individual instantiations of mongrels, which is to say the number of mongrels which have run. If you&#8217;ve got a pool of 8 mongrels (who could ask for more?), and 2 of them have restarted, then New Relic is going to report that you had &#8220;10 instances&#8221;.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">It makes perfect sense in retrospect, but I didn&#8217;t realize this until Justin at New Relic pointed it out to me. They&#8217;re very responsive at <a href="http://support.newrelic.com">their support site</a>.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">I haven&#8217;t had the opportunity to see how New Relic displays instance counts for <a href="http://modrails.com/">Phusion Passenger</a> deployments; if you have anything to add, please post in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/new-relic-mongrel-count-vs-instance-count/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passenger+Apache Permission Error under Snow Leopard</title>
		<link>http://kuwayama.com/passengerapache-permission-error-under-snow-leopard</link>
		<comments>http://kuwayama.com/passengerapache-permission-error-under-snow-leopard#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:46:07 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=231</guid>
		<description><![CDATA[So I started getting an Apache permission error when trying to load up a Ruby on Rails app under Passenger:
"You don't have permission to access / on this server."
After spinning my wheels for a little while, I discovered it was because I had turned on FileVault (in Snow Leopard, but I believe it&#8217;ll happen the [...]]]></description>
			<content:encoded><![CDATA[<p>So I started getting an Apache permission error when trying to load up a Ruby on Rails app under Passenger:</p>
<p><code>"You don't have permission to access / on this server."</code></p>
<p>After spinning my wheels for a little while, I discovered it was because I had turned on FileVault (in Snow Leopard, but I believe it&#8217;ll happen the same way in Leopard).</p>
<p>The fix was simple:</p>
<p><code>chmod +a "www allow search" /Users/username</code></p>
<p>I hope this saves some Googler  a few minutes…</p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/passengerapache-permission-error-under-snow-leopard/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rolling mongrel restarts</title>
		<link>http://kuwayama.com/rolling-mongrel-restarts</link>
		<comments>http://kuwayama.com/rolling-mongrel-restarts#comments</comments>
		<pubDate>Fri, 26 Jun 2009 15:56:53 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=214</guid>
		<description><![CDATA[A lot of us are using haproxy to manage mongrel clusters; it&#8217;s sweet, because haproxy is smart enough to &#8220;skip&#8221; unresponsive mongrels and make sure users get served active ones.
One problem you may have seen is during a deploy &#8212; when all the mongrels are restarted at once, haproxy ends up running around in circles, [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of us are using <a href="http://haproxy.1wt.eu/">haproxy</a> to manage mongrel clusters; it&#8217;s sweet, because haproxy is smart enough to &#8220;skip&#8221; unresponsive mongrels and make sure users get served active ones.</p>
<p>One problem you may have seen is during a deploy &#8212; when all the mongrels are restarted at once, haproxy ends up running around in circles, unable to find anyone to serve the latest request. In such a situation, you might get the dreaded 503 Error.</p>
<p>Here&#8217;s a cool workaround &#8212; have <a href="http://www.capify.org/">Capistrano</a> reboot one mongrel at a time, so that haproxy always has something to hang its hat on:</p>
<pre>
namespace :mongrel do
  desc <<-DESC
  Rolling restart: 1 mongrel at a time.
  DESC
  task :rolling_restart do
    for i in 6000..6004 do
      ENV['HOSTS'] = ""
      find_servers(:roles => :app).each do |server|
        ENV['HOSTS'] = "#{server.host}:#{server.port}"
        puts "Restarting #{i} on #{server.host}:#{server.port}..."
        sudo "/usr/bin/monit restart mongrel_thepoint_#{i} ; true"
        puts "Sleeping 30 seconds before the next mongrel."
        sleep 30
      end
    end
  end
end

namespace :deploy do
  desc <<-DESC
    Deploy, with a rolling restart
  DESC
  task :rolling do
    update
    mongrel.rolling_restart
  end
end
</pre>
<p>There are two things you'd want to adjust here for your particular environment -- the <strong>number of mongrels</strong> in your cluster, and the <strong>number of seconds</strong> to wait between each restart request. (In this example, 5 and 30, respectively.)</p>
<p>There's a catch here -- this won't work if you have migrations to run, because you probably don't want stale mongrels hitting your newly-migrated database. </p>
<p>For now, we're just using this when there are no migrations, and using a conventional <em>deploy:long</em> when there are. </p>
<p>Can anyone suggest a way to adapt this approach in a way that could accommodate migrations?</p>
<p>Credit is due to <a href="http://www.engineyard.com">Engine Yard</a>, of course, for pointing us in the right direction. Thanks krutten!</p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/rolling-mongrel-restarts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Canonical URL tag</title>
		<link>http://kuwayama.com/canonical-url-tag</link>
		<comments>http://kuwayama.com/canonical-url-tag#comments</comments>
		<pubDate>Thu, 12 Feb 2009 21:40:32 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/?p=176</guid>
		<description><![CDATA[http://yoast.com/canonical-url-links/
Nice &#8212; this is going to be really easy to build into CMSs and best practices.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://yoast.com/canonical-url-links/">http://yoast.com/canonical-url-links/</a></p>
<p>Nice &#8212; this is going to be really easy to build into CMSs and best practices.</p>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/canonical-url-tag/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Royal Pingdom » 6 gotchas about web hosting quality and reliability</title>
		<link>http://kuwayama.com/links-for-2009-02-12</link>
		<comments>http://kuwayama.com/links-for-2009-02-12#comments</comments>
		<pubDate>Thu, 12 Feb 2009 17:19:19 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/links-for-2009-02-12</guid>
		<description><![CDATA[Royal Pingdom  » 6 gotchas about web hosting quality and reliability
Some useful perspective on Web hosting.

]]></description>
			<content:encoded><![CDATA[<p><a href="http://royal.pingdom.com/2009/02/11/6-gotchas-about-web-hosting-quality-and-reliability/">Royal Pingdom  » 6 gotchas about web hosting quality and reliability</a></p>
<p>Some useful perspective on Web hosting.</p>
<ul class="delicious"></ul>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/links-for-2009-02-12/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>links for 2009-02-09</title>
		<link>http://kuwayama.com/links-for-2009-02-09</link>
		<comments>http://kuwayama.com/links-for-2009-02-09#comments</comments>
		<pubDate>Tue, 10 Feb 2009 00:05:44 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/links-for-2009-02-09</guid>
		<description><![CDATA[

WWWJDIC: Word Search
(tags: japanese)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi">WWWJDIC: Word Search</a></div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/shinjikuwayama/japanese">japanese</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/links-for-2009-02-09/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>links for 2009-02-07</title>
		<link>http://kuwayama.com/links-for-2009-02-07</link>
		<comments>http://kuwayama.com/links-for-2009-02-07#comments</comments>
		<pubDate>Sun, 08 Feb 2009 00:34:10 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/links-for-2009-02-07</guid>
		<description><![CDATA[

“My Aircraft”
&#34;The airlines have since concluded that the least communicative pilots and crews in crises are the ones that fail the most[.]&#34;
(tags: community productivity)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.printthis.clickability.com/pt/cpt?action=cpt&amp;title=%26%238220%3BMy+Aircraft%26%238221%3B&amp;expire=&amp;urlID=33966427&amp;fb=Y&amp;url=http%3A%2F%2Fnymag.com%2Fnews%2Ffeatures%2F53788%2Findex1.html&amp;partnerID=73272">“My Aircraft”</a></div>
<div class="delicious-extended">&quot;The airlines have since concluded that the least communicative pilots and crews in crises are the ones that fail the most[.]&quot;</div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/shinjikuwayama/community">community</a> <a href="http://delicious.com/shinjikuwayama/productivity">productivity</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/links-for-2009-02-07/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>links for 2009-02-06</title>
		<link>http://kuwayama.com/links-for-2009-02-06</link>
		<comments>http://kuwayama.com/links-for-2009-02-06#comments</comments>
		<pubDate>Sat, 07 Feb 2009 00:35:24 +0000</pubDate>
		<dc:creator>Shinji Kuwayama</dc:creator>
				<category><![CDATA[Tech Tips]]></category>

		<guid isPermaLink="false">http://kuwayama.com/links-for-2009-02-06</guid>
		<description><![CDATA[

UserVoice
I like this idea; I imagine it has to be deployed very carefully so that the message doesn&#039;t get out of control. Anyone have experiences?
(tags: community)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://uservoice.uservoice.com/">UserVoice</a></div>
<div class="delicious-extended">I like this idea; I imagine it has to be deployed very carefully so that the message doesn&#039;t get out of control. Anyone have experiences?</div>
<div class="delicious-tags">(tags: <a href="http://delicious.com/shinjikuwayama/community">community</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kuwayama.com/links-for-2009-02-06/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
