<?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>Justin Britten</title>
	<atom:link href="http://www.justinbritten.com/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinbritten.com/work</link>
	<description>Ruby on Rails web application design, development and consulting</description>
	<lastBuildDate>Sat, 11 Sep 2010 20:36:19 +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>A Simple Formula for Evaluating Risk</title>
		<link>http://www.justinbritten.com/work/2010/09/a-simple-formula-for-evaluating-risk/</link>
		<comments>http://www.justinbritten.com/work/2010/09/a-simple-formula-for-evaluating-risk/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 20:33:34 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=391</guid>
		<description><![CDATA[Having been on the startup roller-coaster for over two years a lot of people assume I have a high tolerance for risk.  I don&#8217;t.  However, I do have a fairly simple formula for evaluating any situation in my life. Given the scenario, can you bear the worst possible outcome? It&#8217;s not rocket-science.  Most people over-complicate [...]]]></description>
			<content:encoded><![CDATA[<p>Having been on the startup roller-coaster for over two years a lot of people assume I have a high tolerance for risk.  I don&#8217;t.  However, I do have a fairly simple formula for evaluating any situation in my life.</p>
<pre>
    <strong>Given the scenario, can you bear the worst possible outcome?</strong>
</pre>
<p>It&#8217;s not rocket-science.  Most people over-complicate their risk evaluation by either immediately withdrawing out of fear, or spending hours enumerating the pros and cons.</p>
<p>Take a situation where you&#8217;re about to part with $10,000.  What is the worst possible outcome?  Perhaps it&#8217;s that you lose the $10k.  So, what does that mean?  Perhaps it won&#8217;t affect you at all.  Maybe it will sting, but life will go on.  Maybe it means that you&#8217;ll homeless and forced to sell your car.  Maybe it means some thug will break your legs.  Or, maybe the money doesn&#8217;t matter, but your reputation is on the line.  Either way, define the worst possible outcome and answer the question, &#8220;can you bear it?&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2010/09/a-simple-formula-for-evaluating-risk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not Having a Plan B Makes Plan A More Successful</title>
		<link>http://www.justinbritten.com/work/2010/08/productcamp-austin-summer-2010/</link>
		<comments>http://www.justinbritten.com/work/2010/08/productcamp-austin-summer-2010/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 02:10:44 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=382</guid>
		<description><![CDATA[Today, I attended ProductCamp Austin, an unconference about Marketing and Product Management.  One of the best presentations of the day was Entrepreneurship in a Down Economy by Yuen Yung, Co-founder and CEO of How Do You Roll.  Yuen is responsible for the title of this post, as I found his quote quite meaningful, and humorous. [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I attended <a title="ProductCamp Austin Summer 2010" href="http://barcamp.org/ProductCampAustinSummer2010" target="_blank">ProductCamp Austin</a>, an unconference about Marketing and Product Management.  One of the best presentations of the day was <em>Entrepreneurship in a Down Economy</em> by Yuen Yung, Co-founder and CEO of <a title="How Do You Roll sushi" href="http://www.howdoyouroll.com" target="_blank">How Do You Roll</a>.  Yuen is responsible for the title of this post, as I found his quote quite meaningful, and humorous.</p>
<p>Yuen&#8217;s restaurant concept is basically Subway for sushi &#8212; you build your own sushi roll &#8212; and his mission is to &#8220;make the world a better place, one stomach at a time.&#8221;  Yuen had no presentation, it was just him telling the story of how he found himself in the unexpected circumstance of starting a restaurant weeks after the economy started to take a nose dive.  Investing his life savings, to the tune of a half million dollars, he had no other alternative then to keep moving forward towards Plan A.  Banks had no money and he tapped out friends and family.</p>
<p>However, the down economy provided some benefits to Yuen, who believes that there are always two sides to every situation.  He was able to hire over-qualified staff.  Vendors were working to attract his business and accommodate his needs.  His marketing budget was quickly lost to higher than estimated equipment costs.  He rebounded by personally introducing himself to every customer, explaining his mission, and asking that they provide feedback and tell their friends.</p>
<p>It was interesting to hear Yuen talk about how he is applying Lean Startup principles to his restaurant business.  Lean Startup has attracted a lot of interest from hi-tech and web startups, but the concepts of minimum viable product, customer driven development, and learning and reacting fast can easily be applied to any business.</p>
<p>After hearing Yuen talk, it&#8217;s clear he is going to be successful.  He has charisma, is determined and dedicated to his mission, has integrity, and cares about people and building relationships.  It also doesn&#8217;t hurt that his restaurant&#8217;s sushi rolls are delicious, inexpensive, and made to my exact specifications.</p>
<p>There is so much truth in Yuen&#8217;s words.  To reach your end-goal as an entrepreneur, especially when bootstrapping your company, you have to commit yourself to your plan.  Sure, you can make adjustments to Plan A along the way.  The path is never a straight one.  However, Plan B just might be a pessimistic distraction and a parachute that you open too early.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2010/08/productcamp-austin-summer-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Rails API Authentication Using restful-authentication</title>
		<link>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/</link>
		<comments>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/#comments</comments>
		<pubDate>Sat, 16 May 2009 22:06:35 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=224</guid>
		<description><![CDATA[You&#8217;ve got a Rails application and you&#8217;d like to add an API. This tutorial assumes you are using restful-authentication. Creating the API key You&#8217;ll need to add a new column, api_key, to your users table. This field will store the unique API key used for authentication. ./script/generate migration AddApiKeyToUsers class AddApiKeyToUsers &#60; ActiveRecord::Migration def self.up [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve got a Rails application and you&#8217;d like to add an API.  This tutorial assumes you are using <a href="http://github.com/technoweenie/restful-authentication/tree/master" target="_blank">restful-authentication</a>.</p>
<h2>Creating the API key</h2>
<p>
  You&#8217;ll need to add a new column, api_key, to your users table.  This field will store the unique API key used for authentication.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>generate migration AddApiKeyToUsers</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> AddApiKeyToUsers <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Migration</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span>
    add_column <span style="color:#ff3333; font-weight:bold;">:users</span>, <span style="color:#ff3333; font-weight:bold;">:api_key</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>, <span style="color:#ff3333; font-weight:bold;">:limit</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">40</span>, <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">down</span>
    remove_column <span style="color:#ff3333; font-weight:bold;">:users</span>, <span style="color:#ff3333; font-weight:bold;">:api_key</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  The API key is a simple SHA hash based on the current time and a random number &#8212; we need this to be unique.  We&#8217;re not going to enable the API for a user by default, though you could easily do this using <em>before_create</em>.  Instead, we&#8217;ll let the user enable or disable the API using the API Keys Controller, which we&#8217;ll create next.
</p>
<p>
  Make the following changes to your <em>app/models/user.rb</em> file:
</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> User <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> enable_api!
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">generate_api_key</span>!
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> disable_api!
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">update_attribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:api_key</span>, <span style="color:#996600;">&quot;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> api_is_enabled?
    !<span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">api_key</span>.<span style="color:#9900CC;">empty</span>?
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  protected
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> secure_digest<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">*</span>args<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#6666ff; font-weight:bold;">Digest::SHA1</span>.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span>args.<span style="color:#9900CC;">flatten</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'--'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> generate_api_key!
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">update_attribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:api_key</span>, secure_digest<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>, <span style="color:#006600; font-weight:bold;">&#40;</span>1..10<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#CC0066; font-weight:bold;">rand</span>.<span style="color:#5A0A0A; font-weight:bold;">to_s</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  Now, let&#8217;s create the API Keys Controller, which we&#8217;ll use to allow the user to create, re-generate, and delete their API Key.  This effectively allows the user to enable and disable API access to their account.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>generate controller APIKeys</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> APIKeysController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
  <span style="color:#5A0A0A; font-weight:bold;">before_filter</span> <span style="color:#ff3333; font-weight:bold;">:login_from_cookie</span>
  <span style="color:#5A0A0A; font-weight:bold;">before_filter</span> <span style="color:#ff3333; font-weight:bold;">:login_required</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Create or re-generate the API key</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> create
    current_user.<span style="color:#9900CC;">enable_api</span>!
&nbsp;
    <span style="color:#5A0A0A; font-weight:bold;">respond_to</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#5A0A0A; font-weight:bold;">redirect_to</span> edit_user_path<span style="color:#006600; font-weight:bold;">&#40;</span>current_user<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Delete the API key</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#5A0A0A; font-weight:bold;">destroy</span>
    current_user.<span style="color:#9900CC;">disable_api</span>!
&nbsp;
    <span style="color:#5A0A0A; font-weight:bold;">respond_to</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#5A0A0A; font-weight:bold;">redirect_to</span> edit_user_path<span style="color:#006600; font-weight:bold;">&#40;</span>current_user<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  Add the resource to <em>config/routes.rb</em>
</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">map.<span style="color:#9900CC;">resource</span> <span style="color:#ff3333; font-weight:bold;">:api_key</span></pre></div></div>

<p>
  You&#8217;ll need to allow the user to enable and disable the API, as well as re-generate their API key if they feel it&#8217;s been compromised.  Add something like this to <em>app/views/users/edit.html.erb</em>:
</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">api_is_enabled</span>? <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;p&gt;
    Your API Key:
    (<span style="color:#006600; font-weight:bold;">&lt;%</span>= link_to <span style="color:#996600;">&quot;re-generate&quot;</span>, api_key_path, <span style="color:#ff3333; font-weight:bold;">:method</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:post</span> <span style="color:#006600; font-weight:bold;">%&gt;</span> | <span style="color:#006600; font-weight:bold;">&lt;%</span>= link_to <span style="color:#996600;">&quot;disable&quot;</span>, api_key_path, <span style="color:#ff3333; font-weight:bold;">:method</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:delete</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>)
  &lt;/p&gt;
  &lt;p&gt;
    &lt;strong&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">api_key</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/strong&gt;
  &lt;/p&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">else</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;p&gt;
    You'll need a unique key to make calls to the API.  Remember to keep this key a secret as it can be used to access your account.
  &lt;/p&gt;
  &lt;p&gt;
    <span style="color:#006600; font-weight:bold;">&lt;%</span>= link_to<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Get a key&quot;</span>, api_key_path, <span style="color:#ff3333; font-weight:bold;">:method</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:post</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;/p&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<h2>Authenticating the API Key</h2>
<p>
  Add the following to <em>lib/authenticated_system.rb</em>:
</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> login_from_api_key
  <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">current_user</span> = User.<span style="color:#9900CC;">find_by_api_key</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:api_key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:api_key</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">empty</span>?
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  Modify <em>lib/authenticated_system.rb</em> to add <em>login_from_api_key</em> as follows:
</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> current_user
  <span style="color:#0066ff; font-weight:bold;">@current_user</span> <span style="color:#006600; font-weight:bold;">||</span>= <span style="color:#006600; font-weight:bold;">&#40;</span>login_from_session <span style="color:#006600; font-weight:bold;">||</span> login_from_api_key <span style="color:#006600; font-weight:bold;">||</span> login_from_basic_auth <span style="color:#006600; font-weight:bold;">||</span> login_from_cookie<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#0066ff; font-weight:bold;">@current_user</span> == <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  Optionally, if you&#8217;d also like to support access to the API via HTTP Basic Authentication using the API key in addition to a user&#8217;s login and password, you can make the following change to <em>app/models/user.rb</em>:</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">authenticate</span><span style="color:#006600; font-weight:bold;">&#40;</span>login, password<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">nil</span> <span style="color:#9966CC; font-weight:bold;">if</span> login.<span style="color:#9900CC;">blank</span>? <span style="color:#006600; font-weight:bold;">||</span> password.<span style="color:#9900CC;">blank</span>?
  <span style="color:#9966CC; font-weight:bold;">if</span> password.<span style="color:#9900CC;">downcase</span> == <span style="color:#996600;">&quot;x&quot;</span>
    <span style="color:#008000; font-style:italic;"># This is an API request</span>
    u = find_by_api_key<span style="color:#006600; font-weight:bold;">&#40;</span>login<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">else</span>
    u = find_by_login<span style="color:#006600; font-weight:bold;">&#40;</span>login.<span style="color:#9900CC;">downcase</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    u <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> u.<span style="color:#9900CC;">authenticated</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>password<span style="color:#006600; font-weight:bold;">&#41;</span> ? u : <span style="color:#0000FF; font-weight:bold;">nil</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>
  When prompted to log in using HTTP Basic Authentication, use the API Key as the login and &#8216;X&#8217; as the password.
</p>
<h2>Testing it Out</h2>
<p>
  Assuming you have a RESTful resource called Items, you should be able to use curl as so:
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl http:<span style="color: #000000; font-weight: bold;">//</span>www.yoursite.com<span style="color: #000000; font-weight: bold;">/</span>items<span style="color: #000000; font-weight: bold;">/</span>1.xml?<span style="color: #007800;">api_key</span>=356a192b</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>God Init.d Script for CentOS</title>
		<link>http://www.justinbritten.com/work/2009/05/god-initd-script-for-centos/</link>
		<comments>http://www.justinbritten.com/work/2009/05/god-initd-script-for-centos/#comments</comments>
		<pubDate>Fri, 15 May 2009 21:00:31 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=319</guid>
		<description><![CDATA[This is the /etc/init.d/god script we are using for God on CentOS 5. Get God sudo gem install god Create a Default Config File sudo touch /etc/god.conf Create the Init Script Put this in /etc/init.d/god #!/bin/bash # # God # # chkconfig: - 85 15 # description: start, stop, restart God # &#160; RETVAL=0 &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>
This is the <em>/etc/init.d/god</em> script we are using for <a href="http://god.rubyforge.org" target="_blank">God</a> on CentOS 5.
</p>
<h2>Get God</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">sudo gem install god</pre></div></div>

<h2>Create a Default Config File</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">sudo touch /etc/god.conf</pre></div></div>

<h2>Create the Init Script</h2>
<p>Put this in <em>/etc/init.d/god</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># God</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: - 85 15</span>
<span style="color: #666666; font-style: italic;"># description: start, stop, restart God</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">0</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>god <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>god.pid <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>god.log
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>god load <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>god.conf
      <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  <span style="color: #000000; font-weight: bold;">;;</span>
    stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>god.pid<span style="color: #000000; font-weight: bold;">`</span>
      <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  <span style="color: #000000; font-weight: bold;">;;</span>
    restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>god.pid<span style="color: #000000; font-weight: bold;">`</span>
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>god <span style="color: #660033;">-P</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>god.pid <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>god.log
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>god load <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>god.conf
      <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  <span style="color: #000000; font-weight: bold;">;;</span>
    status<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
  <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: god {start|stop|restart|status}&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
  <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$RETVAL</span></pre></div></div>

<h2>Make it Executable</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">sudo chmod a+x /etc/init.d/god</pre></div></div>

<h2>Ensure God Launches on System Boot</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">sudo chkconfig --add god
sudo chkconfig --level 345 god on</pre></div></div>

<h2>Fire it Up</h2>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">sudo /etc/init.d/god start</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2009/05/god-initd-script-for-centos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Private, Authenticated RSS Feeds in Rails</title>
		<link>http://www.justinbritten.com/work/2009/02/private-secure-authenticated-rss-feeds-in-rails/</link>
		<comments>http://www.justinbritten.com/work/2009/02/private-secure-authenticated-rss-feeds-in-rails/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 04:09:19 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=247</guid>
		<description><![CDATA[So, you want to allow your users to access a RSS feed of private data in their account.  Something like, http://subdomain.yoursite.com/comments/123abc/feed.rss, where &#8220;123abc&#8221; is a secret token. Here&#8217;s how to do this in Rails 2.1.2, though it will most likely work in other versions of Rails.  In this example, each Account has_many Comments, and we&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to allow your users to access a RSS feed of private data in their account.  Something like,</p>
<p>http://subdomain.yoursite.com/comments/123abc/feed.rss, where &#8220;123abc&#8221; is a secret token.</p>
<p>Here&#8217;s how to do this in Rails 2.1.2, though it will most likely work in other versions of Rails.  In this example, each Account has_many Comments, and we&#8217;d like to get a RSS feed of comments.</p>
<p>1.  Create a route for the feed in your routes.rb file.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">map.<span style="color:#9900CC;">resources</span> <span style="color:#ff3333; font-weight:bold;">:accounts</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>account<span style="color:#006600; font-weight:bold;">|</span>
  account.<span style="color:#9900CC;">comments_feed</span> <span style="color:#996600;">'comments/:token/feed.:format'</span>, <span style="color:#ff3333; font-weight:bold;">:controller</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'comments'</span>, <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'feed'</span>, <span style="color:#ff3333; font-weight:bold;">:token</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">nil</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>2.  Create a new migration and add the feed_token to the Account.</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> AddFeedTokenToAccount <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Migration</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span>
    add_column <span style="color:#ff3333; font-weight:bold;">:accounts</span>, <span style="color:#ff3333; font-weight:bold;">:feed_token</span>, <span style="color:#ff3333; font-weight:bold;">:string</span>, <span style="color:#ff3333; font-weight:bold;">:limit</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">40</span>, <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">down</span>
    remove_column <span style="color:#ff3333; font-weight:bold;">:accounts</span>, <span style="color:#ff3333; font-weight:bold;">:feed_token</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>3.  When a new Account is created, create the feed_token.  We&#8217;ll just use a standard SHA1 hash of the current time and the account id.  This should be unique enough.  Let&#8217;s also create a method to validate the feed token.  All of this goes in app/models/account.rb</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Account <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  <span style="color:#5A0A0A; font-weight:bold;">before_create</span> <span style="color:#ff3333; font-weight:bold;">:create_feed_token</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> valid_feed_token?<span style="color:#006600; font-weight:bold;">&#40;</span>token<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">feed_token</span> == token
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  protected
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> create_feed_token
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">feed_token</span> = <span style="color:#6666ff; font-weight:bold;">Digest::SHA1</span>.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#5A0A0A; font-weight:bold;">to_s</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">id</span>.<span style="color:#5A0A0A; font-weight:bold;">to_s</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>4.  Add a new feed method to your Comments controller.  This goes in app/controllers/comments_controller.rb</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> feed
  <span style="color:#0066ff; font-weight:bold;">@account</span> = Account.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span>account_id<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#0066ff; font-weight:bold;">@comments</span> = <span style="color:#0066ff; font-weight:bold;">@account</span>.<span style="color:#9900CC;">comments</span>
  <span style="color:#0066ff; font-weight:bold;">@token</span> = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:token</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
  <span style="color:#5A0A0A; font-weight:bold;">respond_to</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@account</span>.<span style="color:#9900CC;">valid_feed_token</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>@token<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">rss</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#5A0A0A; font-weight:bold;">render</span> <span style="color:#ff3333; font-weight:bold;">:layout</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">else</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">rss</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#5A0A0A; font-weight:bold;">render</span> <span style="color:#ff3333; font-weight:bold;">:nothing</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#ff3333; font-weight:bold;">:status</span> <span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#ff3333; font-weight:bold;">:forbidden</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>5.  Create the file app/views/comments/feed.rss.builder.  This is what generates the RSS feed.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">xml.instruct! :xml, :version =&gt; &quot;1.0&quot;
xml.rss :version =&gt; &quot;2.0&quot; do
  xml.channel do
    xml.title &quot;Comments&quot;
    xml.description &quot;A bunch of comments&quot;
    xml.link account_comments_url(@account)
&nbsp;
    for comment in @comments
      xml.item do
        xml.title comment.title
        xml.description comment.body
        xml.pubDate comment.created_at.to_s(:rfc822)
        xml.link account_comments_url(@account)
      end
    end
  end
end</pre></div></div>

<p>6.  Link to the comments RSS feed somewhere on your site.  For example, somewhere in app/views/comments/index.html.erb place the following link:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;%= link_to 'Subscribe', account_comments_feed_path(@account, :format =&gt; :rss, :token =&gt; @account.feed_token)) %&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2009/02/private-secure-authenticated-rss-feeds-in-rails/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Private Web Beta in Seconds with Prefinery</title>
		<link>http://www.justinbritten.com/work/2009/02/manage-private-web-beta-with-prefinery/</link>
		<comments>http://www.justinbritten.com/work/2009/02/manage-private-web-beta-with-prefinery/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 20:41:32 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Prefinery]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=225</guid>
		<description><![CDATA[Don&#8217;t write it yourself You&#8217;ve got some slick new Web site and you&#8217;d like to run a private beta.  Maybe this is because you&#8217;re convinced your site is so awesome you&#8217;re going to get more traffic than your ready for.  Or, maybe you&#8217;d just like to work out the bugs with a small, select group [...]]]></description>
			<content:encoded><![CDATA[<h2>Don&#8217;t write it yourself</h2>
<p>You&#8217;ve got some slick new Web site and you&#8217;d like to run a private beta.  Maybe this is because you&#8217;re convinced your site is so awesome you&#8217;re going to get more traffic than your ready for.  Or, maybe you&#8217;d just like to work out the bugs with a small, select group of users.  Either way, you need a process for collecting the e-mail addresses for people who are interested in signing up, generating unique invitation codes, and sending an e-mail invitation.</p>
<p>This process is a pain in the ass, and not something core to your awesome new web site.  Heck, you&#8217;ll probably only be in private beta for a few months so you&#8217;ll end up throwing away all the code you write to manage the private beta.</p>
<p><a title="Create a private beta for your web site in seconds with Prefinery." href="http://www.prefinery.com" target="_blank">Prefinery</a> can manage this entire process for you.  Here&#8217;s how it works &#8230;</p>
<h3>1.  Sign up for a free Prefinery account</h3>
<p>You specify what contact information (name, email, address, phone, etc.) must be gathered when users request an invitation code.</p>
<h3>2.  Install the invitation widget</h3>
<p>This is as easy as copying and pasting a few lines of Javascript.</p>
<h3>3.  Users visit your web site and request an invitation code</h3>
<p>The Prefinery invitation widget gets launched when a user clicks a link or image on your site.  Your users never leave your web site!</p>
<h3>4.  Poof, an invitation code is generated</h3>
<p>You log into Prefinery where you see the thousands of people who are begging to use your awesome new site.  Approving access is as easy as clicking a button.  Once access is approved, an e-mail (from your address, of course) is sent to the user.</p>
<h3>5.  Users sign up on your site</h3>
<p>We give you the secret formula so that you can decode a Prefinery invitation code when users sign up on your site. We provide code samples in various languages, including Ruby, PHP, and Python.  In most cases this process is as simple as one line of source code.</p>
<h2>Learn more</h2>
<p>You can learn more about Prefinery by taking the <a title="Take a tour of Prefinery for private web betas." href="http://www.prefinery.com/tour" target="_self">tour</a>, checking out the <a title="View screenshots of Prefinery for private web betas." href="http://www.prefinery.com/tour/web" target="_self">screenshots</a>, or signing up for a <a title="Sign up for a free Prefinery account and create a private web beta in seconds." href="http://www.prefinery.com/signup/web/free" target="_self">free account</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2009/02/manage-private-web-beta-with-prefinery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup Your WordPress Blog to Amazon S3 using Ruby</title>
		<link>http://www.justinbritten.com/work/2009/01/backup-your-wordpress-blog-to-amazon-s3-using-ruby/</link>
		<comments>http://www.justinbritten.com/work/2009/01/backup-your-wordpress-blog-to-amazon-s3-using-ruby/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 21:54:14 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=218</guid>
		<description><![CDATA[I&#8217;ve been running this blog for months without a backup solution.  Mostly because I didn&#8217;t really care for any of the existing solutions which required me to do too many manual steps.  I wanted something completely hands-off (automatically run every night), secure and reliable (store the backups on Amazon&#8217;s S3). So, enjoy wordpress-s3-backup.  Use it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been running this blog for months without a backup solution.  Mostly because I didn&#8217;t really care for any of the existing solutions which required me to do too many manual steps.  I wanted something completely hands-off (automatically run every night), secure and reliable (store the backups on Amazon&#8217;s S3).</p>
<p>So, enjoy <a title="WordPress S3 Backups with Ruby" href="http://github.com/jbritten/wordpress-s3-backup/tree/master" target="_blank">wordpress-s3-backup</a>.  Use it to backup your WordPress blog &#8212; both the database and the site.  It&#8217;s a Ruby Rake script and you&#8217;ll need the AWS-S3 gem.  Stick it in your crontab to run nightly and move on with your life.</p>
<p><a title="WordPress S3 Backups with Ruby" href="http://github.com/jbritten/wordpress-s3-backup/tree/master" target="_blank">Get it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2009/01/backup-your-wordpress-blog-to-amazon-s3-using-ruby/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Set an Expires Header in Apache</title>
		<link>http://www.justinbritten.com/work/2008/12/how-to-set-an-expires-header-in-apache/</link>
		<comments>http://www.justinbritten.com/work/2008/12/how-to-set-an-expires-header-in-apache/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:40:48 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=197</guid>
		<description><![CDATA[Setting an Expires (or Cache-Control) header in Apache will help speed up your Web site.  We&#8217;re running Apache 2.x, and define an expires header for all of our static assets (images, stylesheets, and scripts). Just add the following to your &#60;VirtualHost&#62; section of your Apache configuration: ExpiresActive On ExpiresByType image/png &#8220;now plus 365 days&#8221; ExpiresByType [...]]]></description>
			<content:encoded><![CDATA[<p>Setting an Expires (or Cache-Control) header in Apache will help speed up your Web site.  We&#8217;re running Apache 2.x, and define an expires header for all of our static assets (images, stylesheets, and scripts).</p>
<p>Just add the following to your &lt;VirtualHost&gt; section of your Apache configuration:</p>
<p style="padding-left: 60px;">ExpiresActive On<br />
ExpiresByType image/png &#8220;now plus 365 days&#8221;<br />
ExpiresByType image/jpeg &#8220;now plus 365 days&#8221;<br />
ExpiresByType image/gif &#8220;now plus 365 days&#8221;<br />
ExpiresByType application/javascript &#8220;now plus 365 days&#8221;<br />
ExpiresByType application/x-javascript &#8220;now plus 365 days&#8221;<br />
ExpiresByType text/javascript &#8220;now plus 365 days&#8221;<br />
ExpiresByType text/css &#8220;now plus 365 days&#8221;</p>
<p>You can read all about expires headers by reading Yahoo!&#8217;s <a href="http://developer.yahoo.com/performance/rules.html#expires" target="_blank">Best Practices for Speeding Up Your Website </a>guide.</p>
<p>Also, be sure to check out our post on how to speed up your Website by <a href="http://www.justinbritten.com/work/2008/12/apache-gzip-configuration">Configuring Apache to Gzip Your Components</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2008/12/how-to-set-an-expires-header-in-apache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Configure Apache to Gzip Your Components</title>
		<link>http://www.justinbritten.com/work/2008/12/apache-gzip-configuration/</link>
		<comments>http://www.justinbritten.com/work/2008/12/apache-gzip-configuration/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 20:40:42 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=207</guid>
		<description><![CDATA[Compressing your Web components will help speed up your Website.  The majority of your visitors will benefit as most all Web browsers support gzip compression.  You&#8217;ll want to compress all text, which includes html, css, javascript, xml, json, etc. Apache 2.x uses mod_deflate, and all you need to do is add the following to your [...]]]></description>
			<content:encoded><![CDATA[<p>Compressing your Web components will help speed up your Website.  The majority of your visitors will benefit as most all Web browsers support gzip compression.  You&#8217;ll want to compress all text, which includes html, css, javascript, xml, json, etc.</p>
<p>Apache 2.x uses mod_deflate, and all you need to do is add the following to your &lt;VirtualHost&gt; section of your Apache configuration:</p>
<p style="padding-left: 60px;">AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip<br />
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</p>
<p>All you truly need is the first line.  The BrowserMatch lines are there to handle issues with old browsers.</p>
<p>You can read all about gzipping by reading Yahoo!&#8217;s <a href="http://developer.yahoo.com/performance/rules.html#gzip" target="_blank">Best Practices for Speeding Up Your Website</a> guide.</p>
<p>Also, be sure to check out our post on <a href="http://www.justinbritten.com/work/2008/12/how-to-set-an-expires-header-in-apache">How to Set an Expires Header in Apache</a>, which will also help speed up your Website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2008/12/apache-gzip-configuration/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Announcing Major Enhancements for Prefinery</title>
		<link>http://www.justinbritten.com/work/2008/11/major-enhancements-for-prefinery-beta-management-software/</link>
		<comments>http://www.justinbritten.com/work/2008/11/major-enhancements-for-prefinery-beta-management-software/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 17:50:43 +0000</pubDate>
		<dc:creator>jbritten</dc:creator>
				<category><![CDATA[Prefinery]]></category>

		<guid isPermaLink="false">http://www.justinbritten.com/work/?p=177</guid>
		<description><![CDATA[Some major enhancements are coming to Prefinery on December 10, 2008.  Here&#8217;s the complete run-down: Personalized subdomains Every company account gets a free, personalized subdomain.  In addition to giving you the opportunity to add a bit of branding to the URL, you will now log in to administer your betas using this new subdomain.  For [...]]]></description>
			<content:encoded><![CDATA[<p>Some major enhancements are coming to Prefinery on December 10, 2008.  Here&#8217;s the complete run-down:</p>
<h2 style="padding-left: 30px;">Personalized subdomains</h2>
<p style="padding-left: 30px;">Every company account gets a free, personalized subdomain.  In addition to giving you the opportunity to add a bit of branding to the URL, you will now log in to administer your betas using this new subdomain.  For example, if your subdomain is &#8220;adobe&#8221; you will now log in at http://adobe.prefinery.com/admin</p>
<h2 style="padding-left: 30px;">Separate administrator and tester areas</h2>
<p style="padding-left: 30px;">As an administrator of a beta program, you will log into Prefinery using your personalized subdomain (e.g., http://adobe.prefinery.com/admin) and will interact with a management console.  Testers will access your beta at a separate location and view a unique set of pages that you have customized.</p>
<h2 style="padding-left: 30px;">Complete user interface redesign</h2>
<p style="padding-left: 30px;">The first thing you&#8217;ll notice when you log in is that Prefinery has received a major facelift.  We&#8217;re not talking a nip here and a tuck there.  We mean Prefinery fled to a country without extradition and got a brand new identity.</p>
<h2 style="padding-left: 30px;">Landing / Welcome page</h2>
<p style="padding-left: 30px;">Create a custom landing page for your testers using our easy to use Web page editor.  You don&#8217;t need to know any HTML to create a beautiful welcome page.  We&#8217;ll add generic log in and join links to the page, but the rest of the content is up to you.</p>
<h2 style="padding-left: 30px;">Improved custom branding</h2>
<p style="padding-left: 30px;">When you subscribe to a plan with custom branding, you&#8217;ll be getting a blank slate.  You&#8217;ll have complete control over the content and styling of the page so that you may provide your testers with a familiar experience.  In fact, once you add your logo to the page, testers may not even realize they&#8217;re not on your site.</p>
<h2 style="padding-left: 30px;">Guestbook creation</h2>
<p style="padding-left: 30px;">Specify what contact information is required to be gathered from testers when they join your beta.  Pick from email address, name, address, employer, job title, and telephone.</p>
<h2 style="padding-left: 30px;">Require a survey to join</h2>
<p style="padding-left: 30px;">Require testers to take one of your surveys prior to joining your beta.  Perfect if you want to collect more information than the guestbook supports.  Also a great way to attach a sign up application to your beta.</p>
<h2 style="padding-left: 30px;">Require a survey to download files</h2>
<p style="padding-left: 30px;">Require testers to take one of your surveys prior to downloading a specific file.  Perhaps anyone can download version 1.0, but you want to require the survey &#8220;1.0 Feedback&#8221; prior to downloading version 2.0.</p>
<h2 style="padding-left: 30px;">Sexy survey results</h2>
<p style="padding-left: 30px;">We&#8217;re using a whole new package for our graphs and charts.  They&#8217;re faster, interactive, and look great when sporting your data.</p>
<h2 style="padding-left: 30px;">Bugs, comments consolidated</h2>
<p style="padding-left: 30px;">We&#8217;ve combined bugs and comments.  Prefinery is not competing in the bug tracking and ticket management space.  Plenty of excellent tools already exist.  So, we&#8217;ve merged bugs and comments since both are nothing more than tester feedback.  You&#8217;ll still be able to export the data.</p>
<h2 style="padding-left: 30px;">Plus, dozens of tiny improvements</h2>
<p>We hope you enjoy these additions and enhancements.  We&#8217;d love to hear your feedback!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.justinbritten.com/work/2008/11/major-enhancements-for-prefinery-beta-management-software/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
