<?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>Joe's Blog! &#187; Dev</title>
	<atom:link href="http://www.joeandmotorboat.com/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joeandmotorboat.com</link>
	<description></description>
	<lastBuildDate>Fri, 08 Jan 2010 00:00:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fun with the CouchDB _changes feed and RabbitMQ.</title>
		<link>http://www.joeandmotorboat.com/2010/01/01/fun-with-the-couchdb-_changes-feed-and-rabbitmq/</link>
		<comments>http://www.joeandmotorboat.com/2010/01/01/fun-with-the-couchdb-_changes-feed-and-rabbitmq/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 23:14:01 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=962</guid>
		<description><![CDATA[I was recently introduced to yajl-ruby, ruby bindings to the C based yajl json parsing/encoding libraries. After discovering that it can parse HTTP streams it seemed like it would be a perfect fit for use with CouchDB. A while back I wrote some code to push update notifications to RabbitMQ and a commenter mentioned using [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently <a href="http://ozmm.org/posts/2009_open_source_top_ten.html">introduced</a> to <a href="http://github.com/brianmario/yajl-ruby">yajl-ruby</a>, ruby bindings to the C based yajl json parsing/encoding libraries. After discovering that it can parse HTTP streams it seemed like it would be a perfect fit for use with <a href="http://couchdb.apache.org/">CouchDB</a>. A while back I wrote <a href="http://www.joeandmotorboat.com/2009/06/05/sending-couchdb-update-notifications-to-rabbitmq/">some code to push update notifications</a> to RabbitMQ and a commenter mentioned using the <a href="http://books.couchdb.org/relax/reference/change-notifications">_changes feed</a> instead. Combining the _changes feed and yajl-ruby&#8217;s HttpStream seemed like a good way to do it.</p>
<p>The _changes feed is a running list of all the documents that have changed in a database listed in order by sequence number. This is similar to update notifications but gives more information such as the document IDs and is HTTP based (with multiple feed styles) rather than stdout. Additionally you can create design document filters which can be specified as a query parameter to give you only the parts of the feed you want. All in all _changes is a pretty powerful feature.</p>
<p>Now for the fun stuff, the code. There are a few dependencies I used to do this, specifically focused on making it fast. As such I used EventMachine based libraries for <a href="http://github.com/tmm1/amqp/">AMQP</a> and <a href="http://github.com/igrigorik/em-http-request/">HTTP requests</a>. The first bit of code takes the _changes feed for the &#8220;test&#8221; database, parses the feed, uses the document ID to request that document and publish it to the queue. One key item to note is that this code <strong>requires the latest yajl-ruby</strong> from github to run properly. Additionally, this works nicely with <em>feed=continuous</em> so it grabs the documents as they are changed without a need for polling.</p>
<p><script src="http://gist.github.com/266991.js?file=changes_pub.rb"></script> Note that there is a variable for <em>since</em>, this allows you to start from a specific sequence number so you can skip over old changes.</p>
<p>The next bit of code works from the other side of the queue. It subscribes to the queue, parses the JSON, performs some operations on it and puts the results back into another CouchDB database called &#8220;results&#8221;.  <script src="http://gist.github.com/266991.js?file=changes_sub.rb"></script></p>
<p>What could it be used for? My first thought is some sort of parallel computation, boot up a few dozen EC2 nodes and start dumping data into CouchDB. Have all those nodes pop messages off the queue, process them and dump the results back into Couch. Legitimately one could chain these together to process the results again. The queue ends up being a simple job management system with the EC2 nodes popping new messages as they finish processing them. With a little bit of work, features and the right use case I think could be a pretty powerful system.</p>
<p>Check out the <a href="http://gist.github.com/266991">code</a>, <a href="http://github.com/joewilliams">my other projects</a> and follow me on twitter <a href="http://twitter.com/williamsjoe">@williamsjoe</a>.</p>
<p><em>[edit: made a slight improvement to changes_sub.rb on 20100107]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2010/01/01/fun-with-the-couchdb-_changes-feed-and-rabbitmq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baracus.</title>
		<link>http://www.joeandmotorboat.com/2009/11/05/baracus/</link>
		<comments>http://www.joeandmotorboat.com/2009/11/05/baracus/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 20:04:39 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=949</guid>
		<description><![CDATA[Just did my first official Cloudant blog post on a project I created called Baracus. It&#8217;s an httperf wrapper for benchmarking CouchDB, check it out on github.
]]></description>
			<content:encoded><![CDATA[<p>Just did my <a href="http://blog.cloudant.com/benchmarking-couchdb-with-baracus">first official Cloudant blog post</a> on a project I created called Baracus. It&#8217;s an <a href="http://www.hpl.hp.com/research/linux/httperf/">httperf</a> wrapper for benchmarking <a href="http://couchdb.apache.org/">CouchDB</a>, check it out on <a href="http://github.com/joewilliams/baracus">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/11/05/baracus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Black Trees.</title>
		<link>http://www.joeandmotorboat.com/2009/09/19/red-black-trees/</link>
		<comments>http://www.joeandmotorboat.com/2009/09/19/red-black-trees/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 16:34:16 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=945</guid>
		<description><![CDATA[Been reading up on Red-black trees, a self-balancing binary tree. Here are some resources I found interesting.

Multiple posts at Fuad AlTabba, with an erlang implementation.
Ruby rbtree library (uses C).
An implementation in Ruby.
Trees in Erlang.
Red-black trees in two hours, with a link to Chris Okaski&#8217;s Red-Black Trees in a Functional Setting with implementation in Haskell.

]]></description>
			<content:encoded><![CDATA[<p>Been reading up on <a href="http://en.wikipedia.org/wiki/Red_black_tree">Red-black trees</a>, a self-balancing binary tree. Here are some resources I found interesting.</p>
<ul>
<li>Multiple posts at <a href="http://www.altabba.org/">Fuad AlTabba</a>, with an <a href="http://www.cs.auckland.ac.nz/~fuad/rbtree.erl">erlang implementation</a>.</li>
<li>Ruby <a href="http://rubyforge.org/projects/rbtree/">rbtree library</a> (uses C).</li>
<li>An <a href="http://www.dmh2000.com/cjpr/RBRuby.html">implementation</a> in Ruby.</li>
<li><a href="http://mark.aufflick.com/blog/2007/11/30/trees-in-erlang">Trees in Erlang</a>.</li>
<li><a href="http://semanticvector.blogspot.com/2008/05/red-black-tree-in-2-hours.html">Red-black trees in two hours</a>, with a link to Chris Okaski&#8217;s <a name="jfp99"><em>Red-Black Trees in a Functional Setting </em>with implementation in Haskell.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/09/19/red-black-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HAProxy Stats Socket and fun with socat.</title>
		<link>http://www.joeandmotorboat.com/2009/08/20/haproxy-stats-socket-and-fun-with-socat/</link>
		<comments>http://www.joeandmotorboat.com/2009/08/20/haproxy-stats-socket-and-fun-with-socat/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 22:22:40 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=935</guid>
		<description><![CDATA[I&#8217;ve been debugging issues with HTTP, my backend servers and HAProxy. After a quick email to the HAProxy mailing list I found out about a configuration option stats socket PATH. This will create a socket you can send commands to and get more information out of HAProxy. To do this I just used some simle [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been debugging issues with HTTP, my backend servers and HAProxy. After a quick email to the HAProxy mailing list I found out about a configuration option <em>stats socket PATH</em>. This will create a socket you can send commands to and get more information out of HAProxy. To do this I just used some simle unix tools, the key is <a href="http://www.dest-unreach.org/socat/">socat</a>. From the man:</p>
<blockquote><p>
socat is a relay for bidirectional data transfer between two independent data channels. Each of these data channels may be a file, pipe, device (serial line etc. or a pseudo terminal), a socket (UNIX, IP4, IP6 &#8211; raw, UDP, TCP), an SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU line editor (readline), a program, or a combination of two of these. These modes include generation of &#8220;listening&#8221; sockets, named pipes, and pseudo terminals.
</p></blockquote>
<p>Here are a few examples of how to use the stats socket. First, you need to add <em>stats socket PATH</em> to your configuration and restart haproxy. You should then find a socket located at the path specified, I used <em>/tmp/haproxy</em>. Now you can send it commands to get more information and stats from HAProxy.<br />
<code><br />
echo "show stat" | socat unix-connect:/tmp/haproxy stdio<br />
</code></p>
<p>This will give you stats on all of your backends and frontends, some of the same stuff you see on the stats page enabled by the <em>stats uri</em> configuration. As an added bonus it&#8217;s all in CSV.<br />
<code><br />
echo "show errors" | socat unix-connect:/tmp/haproxy stdio<br />
</code></p>
<p><em>show errors</em> will give you a capture of last error on each backend/frontend.<br />
<code><br />
echo "show info" | socat unix-connect:/tmp/haproxy stdio<br />
</code></p>
<p>This will give you information about the running HAProxy process such as pid, uptime and etc.<br />
<code><br />
echo "show sess" | socat unix-connect:/tmp/haproxy stdio<br />
</code></p>
<p>This will dump (possibly huge) info about all know sessions.</p>
<p>For more details check out <a href="http://haproxy.1wt.eu/download/1.3/doc/configuration.txt">the docs</a> section 9 and <em>stats socket</em> in section 3.1.</p>
<p><strong>Bonus socat fun.</strong></p>
<p>socat is a more full featured cousin of <a href="http://netcat.sourceforge.net/">netcat</a>. Both can be used in similar ways, one thing I use them for occasionally is debugging REST and etc. This was a real help when working with an API that didn&#8217;t have a library, I could test things out without needing to make erroneous calls to the API. In the simplest case you can have either of them listen on a port and output all the details of the request. To do this with socat run:</p>
<p><code>socat tcp-listen:8000 stdio</code></p>
<p>This will listen for connections on port 8000. Doing the same thing with netcat is easy as well:</p>
<p><code>netcat -l -p 8000</code></p>
<p>For instance you can see the output from creating a document in CouchDB.</p>
<p>In one terminal:<br />
<code><br />
$ irb<br />
irb(main):001:0> require 'rubygems'<br />
=> true<br />
irb(main):002:0> require 'rest_client'<br />
=> true<br />
irb(main):003:0> RestClient.put("http://localhost:8000/somedb/somedoc", "{\"somekey\": \"somevalue\"}", :content_type => "application/json")<br />
</code></p>
<p>In another run your mock server:<br />
<code><br />
$ socat tcp-listen:8000 stdio<br />
PUT /somedb/somedoc HTTP/1.1<br />
Accept: application/xml<br />
Content-Type: application/json<br />
Accept-Encoding: gzip, deflate<br />
Content-Length: 24<br />
Host: localhost:8000</p>
<p>{"somekey": "somevalue"}<br />
</code></p>
<p>Oh! By the way, if you install netcat from source, don&#8217;t compile with <em>-DGAPING_SECURITY_HOLE</em> unless you know what you are doing. <img src='http://www.joeandmotorboat.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/08/20/haproxy-stats-socket-and-fun-with-socat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tens3 : dead simple s3 backups</title>
		<link>http://www.joeandmotorboat.com/2009/07/29/tens3-dead-simple-s3-backups/</link>
		<comments>http://www.joeandmotorboat.com/2009/07/29/tens3-dead-simple-s3-backups/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:16:53 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=933</guid>
		<description><![CDATA[I recently needed some simple scripts to backup files on various machines, stuff like configs and even some small CouchDB files. Not finding something already out there I put together tens3, two simple scripts to get and put files to Amazon S3. They provide the following:

uses s3 to backup a directory of files (no subdirectories)
uses [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed some simple scripts to backup files on various machines, stuff like configs and even some small CouchDB files. Not finding something already out there I put together <a href="http://github.com/joewilliams/tens3/tree/master">tens3</a>, two simple scripts to get and put files to Amazon S3. They provide the following:</p>
<ul>
<li>uses s3 to backup a directory of files (no subdirectories)</li>
<li>uses fadvise to be easy on filesystem caches and disks</li>
<li>purges files after X days</li>
<li>streams files rather than loading them entirely into memory</li>
</ul>
<p>They are very simple to use, just create a configuration file together:<br />
<code><br />
amazon_access_key_id: "someid"<br />
amazon_secret_access_key: "somekey"<br />
backup_dir: "/some/path/"<br />
purge_threshold: 3<br />
bucket_name: "somebucket"<br />
</code></p>
<p>Backup a directory of files:</p>
<p><code>$ ./tens3_put tens3.conf</code></p>
<p>Restore a file from a backup:</p>
<p><code>$ ./tens3_get tens3.conf date somefile ./somefile</code></p>
<p>The date is the date that the file was backed up in a YYYYMMDD format.</p>
<p>Enjoy and let me know if you find any bugs or want new features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/07/29/tens3-dead-simple-s3-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boston Meet-up.</title>
		<link>http://www.joeandmotorboat.com/2009/07/21/boston-meet-up/</link>
		<comments>http://www.joeandmotorboat.com/2009/07/21/boston-meet-up/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 17:01:25 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=929</guid>
		<description><![CDATA[Headed to Boston next week, planning to meet-up next Tuesday (7/28) 7pm at Cambridge Brewing Co. Drop by for a beer, food and maybe a little Erlang.
]]></description>
			<content:encoded><![CDATA[<p>Headed to Boston next week, planning to meet-up next Tuesday (7/28) 7pm at <a href="http://www.cambrew.com/">Cambridge Brewing Co</a>. Drop by for a beer, food and maybe a little Erlang.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/07/21/boston-meet-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing haproxy_join, and how to use it with Chef.</title>
		<link>http://www.joeandmotorboat.com/2009/07/01/introducing-haproxy_join-and-how-to-use-it-with-chef/</link>
		<comments>http://www.joeandmotorboat.com/2009/07/01/introducing-haproxy_join-and-how-to-use-it-with-chef/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 21:24:01 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=923</guid>
		<description><![CDATA[Inspired by Holger Just&#8217;s haproxy configuration tool I decided to write one my own that worked better for my setup and haproxy_join was born. It&#8217;s a simple Ruby script that allows you to break up a monolithic haproxy configuration file in to pieces.
haproxy_join expects files and directories to be in the following scheme:

HAPROXY_PATH/conf/global.cfg (file)
HAPROXY_PATH/conf/defaults.cfg (file)
HAPROXY_PATH/conf/frontend.cfg [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by <a href="http://github.com/finnlabs/haproxy/tree/master">Holger Just&#8217;s haproxy configuration tool</a> I decided to write one my own that worked better for my setup and <a href="http://github.com/joewilliams/haproxy_join/tree/master">haproxy_join</a> was born. It&#8217;s a simple Ruby script that allows you to break up a monolithic haproxy configuration file in to pieces.</p>
<p>haproxy_join expects files and directories to be in the following scheme:<br />
<code><br />
HAPROXY_PATH/conf/global.cfg (file)<br />
HAPROXY_PATH/conf/defaults.cfg (file)<br />
HAPROXY_PATH/conf/frontend.cfg (file)<br />
HAPROXY_PATH/conf/frontend.d (dir of frontend configs)<br />
HAPROXY_PATH/conf/backend.d (dir backend configs)<br />
</code></p>
<p>The HAPROXY_PATH and resulting configuration file are specified when running the haproxy_join command. On most systems it would look like the following, all you need to do is break up your current config and put it in the above structure.<br />
<code><br />
haproxy_join haproxy.cfg /etc/haproxy/<br />
</code></p>
<p>haproxy_join will also attempt to backup your configuration file before writing a new one.</p>
<p>This works great in tandem with a tool like <a href="http://wiki.opscode.com/display/chef/Home">Chef</a>, allowing you to have Chef manage each small configuration file with a template and haproxy_join to concatenate them together each time they are changed. You can achieve this by using a Chef recipe based on the default opscode haproxy recipe and a slightly modified haproxy init script based on Holger Just&#8217;s haproxy init script. The recipe will notify haproxy Chef to restart haproxy if a configuration has changed and the init script will run haproxy_join before it restarts haproxy. I have posted an example of the <a href="http://gist.github.com/139042">cookbook recipe</a> and the <a href="http://gist.github.com/139064">init script</a>. Neither of these have been heavily used/tested so try them out before you put them into production.</p>
<p>Hope this helps anyone with large haproxy configurations. Let me know if you have any questions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/07/01/introducing-haproxy_join-and-how-to-use-it-with-chef/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending CouchDB Update Notifications to RabbitMQ.</title>
		<link>http://www.joeandmotorboat.com/2009/06/05/sending-couchdb-update-notifications-to-rabbitmq/</link>
		<comments>http://www.joeandmotorboat.com/2009/06/05/sending-couchdb-update-notifications-to-rabbitmq/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 06:09:29 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=913</guid>
		<description><![CDATA[Working at Cloudant I use CouchDB on a daily basis. This evening for fun I decided to write some Ruby to take update notifications and push them into RabbitMQ. There are other examples of using the update notifications and Ruby in Couch such as the view updater out on the Couch wiki.  It turned [...]]]></description>
			<content:encoded><![CDATA[<p>Working at <a href="http://cloudant.com/">Cloudant</a> I use <a href="http://couchdb.apache.org/">CouchDB</a> on a daily basis. This evening for fun I decided to write some <a href="http://www.ruby-lang.org/en/">Ruby</a> to take update notifications and push them into <a href="http://www.rabbitmq.com/">RabbitMQ</a>. There are other examples of using the update notifications and Ruby in Couch such as the <a href="http://wiki.apache.org/couchdb/Regenerating_views_on_update">view updater out on the Couch wiki</a>.  It turned out super simple. There are a few AMQP libraries for Ruby, in this example I am going to use <a href="http://github.com/famoseagle/carrot/tree/master">carrot</a>.  It&#8217;s based on the  <a href="http://github.com/tmm1/amqp/tree/master">amqp</a> library without all the <a href="http://rubyeventmachine.com/">eventmachine</a> stuff. So here it goes:</p>
<p><strong><a href="http://gist.github.com/124716">couch_amqp.rb</a></strong> :</p>
<blockquote><p>#!/usr/bin/ruby</p>
<p>require &#8216;rubygems&#8217;<br />
require &#8216;carrot&#8217;</p>
<p>def main<br />
queue = &#8220;couchdb&#8221;<br />
run = true<br />
couchq = Carrot.queue(:queue =&gt; queue)</p>
<p>while run do</p>
<p>notifications = gets</p>
<p>if notifications == nil<br />
run = false<br />
else<br />
couchq.publish(notifications)<br />
end</p>
<p>end<br />
end</p>
<p>main</p></blockquote>
<p>As you can tell we connect to a queue called &#8220;couchdb&#8221; on by default this is on localhost. Next we have a loop that continually runs and grabs updates from stdin. I then publish each notification to the queue and that&#8217;s that. To get the messages out of the queue I used irb and carrot.</p>
<blockquote><p>[user@host ~]$ irb<br />
irb(main):001:0&gt; require &#8216;rubygems&#8217;<br />
=&gt; true<br />
irb(main):002:0&gt; require &#8216;carrot&#8217;<br />
=&gt; true<br />
irb(main):003:0&gt; couchq = Carrot.queue(:queue =&gt; &#8220;couchdb&#8221;)<br />
=&gt; #&lt;Carrot::AMQP::Queue:0&#215;7f8d2284b640 &lt;snip&gt;<br />
irb(main):004:0&gt; couchq.pop<br />
=&gt; &#8220;{\&#8221;type\&#8221;:\&#8221;updated\&#8221;,\&#8221;db\&#8221;:\&#8221;test1\&#8221;}\n&#8221;</p></blockquote>
<p>So yeah, pretty simple stuff. Go ahead relax! <img src='http://www.joeandmotorboat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>[EDIT 06/05/2009 2326 PST : Don't forget to add the entry to your local.ini]</em></p>
<blockquote><p>[update_notification]</p>
<p>couch_amqp=/PATH/TO/couch_amqp.rb<em><br />
</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/06/05/sending-couchdb-update-notifications-to-rabbitmq/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Claws Mail.</title>
		<link>http://www.joeandmotorboat.com/2009/05/30/claws-mail/</link>
		<comments>http://www.joeandmotorboat.com/2009/05/30/claws-mail/#comments</comments>
		<pubDate>Sat, 30 May 2009 18:49:12 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=904</guid>
		<description><![CDATA[I recently switched to using Claws Mail from Mozilla Thunderbird. This was mostly to try something new and because of the seeming stagnation of the Thunderbird project. So far so good, here are a couple things that I think are cool.
Lots of plugins and themes. Claws Mail has for all sorts of tasks and features. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched to using <a href="http://www.claws-mail.org/">Claws Mail</a> from <a href="http://www.mozillamessaging.com/en-US/thunderbird/">Mozilla Thunderbird</a>. This was mostly to try something new and because of the seeming stagnation of the Thunderbird project. So far so good, here are a couple things that I think are cool.</p>
<p>Lots of <a href="http://www.claws-mail.org/plugins.php?section=downloads">plugins</a> and <a href="http://www.claws-mail.org/themes.php?section=downloads">themes</a>. Claws Mail has for all sorts of tasks and features. The ones that I think are key are GTKHTML, Notification (libnotify/notify-osd) and SpamAssassin. SpamAssassin in interesting because it actually uses a full SpamAssassin installation like you would see on a mail server. The plugin connects to the spamd daemon running on your system and you can teach it what is spam and ham. If you are running Ubuntu all/most of the plugins are available in the normal repositories.</p>
<p><img src="http://joeandmotorboat.com/images/plugins.png" alt="claws plugins" /></p>
<p>Also very cool is its auto-generated mail filters. Basically you can right click any email and create a filter based on the headers. This worked great for all the mailing lists and ticketing systems I use.</p>
<p><img src="http://joeandmotorboat.com/images/filter.png" alt="claws filter" width="495" height="539" /></p>
<p>Claws also has a network log which worked great for diagnosing issues with an IMAP or SMTP session.</p>
<p><img src="http://joeandmotorboat.com/images/log.png" alt="claws net log" width="539" height="390" /></p>
<p>There are a few quirks, the first that I noticed was that when Claws is checking the mail servers for new mail it locks out some of the menu items. This is annoying if an automatic check happens when you are trying to change a config item. Another annoyance is when using the up and down keys to go through messages you either have to click on the message or hit enter to view it. It would be nice if they loaded as soon as you arrowed to it. Lastly, the interface seems a little less polished than Thunderbird but that may be just because I am more accustomed to TBird after years of use.</p>
<p>If you are interested in trying Claws out and use Ubuntu I recommend adding the <a href="https://launchpad.net/~claws-mail/+archive/ppa">Claws PPA</a> to your apt sources to get the latest version and claws-mail-extra-plugins.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/05/30/claws-mail/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Nginx and Passenger, Gateway Timeout Fix</title>
		<link>http://www.joeandmotorboat.com/2009/04/24/nginx-and-passenger-gateway-timeout-fix/</link>
		<comments>http://www.joeandmotorboat.com/2009/04/24/nginx-and-passenger-gateway-timeout-fix/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 23:03:51 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.joeandmotorboat.com/?p=890</guid>
		<description><![CDATA[I recently switched an application I am working on from nginx and mongrel to nginx and passenger. The setup is easy as can be but I noticed an issue on one of my long running operations. I have a controller that spawns some threads, performs operations and returns back a result to the page. Sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched an application I am working on from nginx and mongrel to nginx and <a href="http://www.modrails.com/">passenger</a>. The setup is easy as can be but I noticed an issue on one of my long running operations. I have a controller that spawns some threads, performs operations and returns back a result to the page. Sometimes this takes a minute and using mongrel you would just increase the <em>proxy_read_timeout</em> in nginx. With passenger it times out after 60 seconds. There is not a configuration parameter for adjusting this. I found that adjusting <em>upstream.read_timeout</em> and <em>upstream.send_timeout</em> in <em>/usr/lib/ruby/gems/1.8/gems/passenger-2.2.1/ext/nginx/Configuration.c</em> (below) to a higher value and reinstalling the passenger module solves the problem. </p>
<p><strong><em>/usr/lib/ruby/gems/1.8/gems/passenger-2.2.1/ext/nginx/Configuration.c</em></strong></p>
<blockquote><p>::snip::<br />
    ngx_conf_merge_msec_value(conf->upstream.send_timeout,<br />
                              prev->upstream.send_timeout, 60000);</p>
<p>    ngx_conf_merge_msec_value(conf->upstream.read_timeout,<br />
                              prev->upstream.read_timeout, 60000);<br />
::snip::
</p></blockquote>
<p>Thanks to the passenger team and the quick response on the mailing list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joeandmotorboat.com/2009/04/24/nginx-and-passenger-gateway-timeout-fix/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
