<?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>Shlrm.org Blag &#187; David Kowis</title>
	<atom:link href="http://shlrm.org/wordpress/author/dkowis/feed/" rel="self" type="application/rss+xml" />
	<link>http://shlrm.org/wordpress</link>
	<description>Linux, Java, Ruby, and Politics.</description>
	<lastBuildDate>Mon, 10 Oct 2011 18:50:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hibernate 3 Maven Plugin hbm2ddl Goal and Hate</title>
		<link>http://shlrm.org/wordpress/2011/10/10/hibernate-3-maven-plugin-hbm2ddl-goal-and-hate/</link>
		<comments>http://shlrm.org/wordpress/2011/10/10/hibernate-3-maven-plugin-hbm2ddl-goal-and-hate/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:50:48 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Coding!]]></category>
		<category><![CDATA[Gripes]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=492</guid>
		<description><![CDATA[What happens when your build fails because it cannot talk to the internet anymore? You have DTD issues. I detail a solution specifically for the hibernate3-maven-plugin and it's hbm2ddl goal.]]></description>
			<content:encoded><![CDATA[<p>Over the weekend the Jenkins build started failing. The error leads me to believe that someone didn&#8217;t verify their build before committing code, and that the configuration file now has a problem:</p>
<pre class="brush: text; gutter: false; first-line: 1">org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl (create-schema) on project incident-service:
   Execution create-schema of goal org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl failed:
    Could not parse configuration: file:/var/lib/jenkins/jobs/IncidentService/workspace/target/classes/hibernate.cfg.xml</pre>
<p>Except, there were no changes to the code; nothing changed in this file, and it&#8217;s been working fine for about a month or two. The environment the build server is on changed however. It cannot get to certain parts of the internet:</p>
<pre class="brush: text; gutter: false; first-line: 1"></pre>
<pre class="brush: text; gutter: false; first-line: 1">jenkins@hudson1:~$ wget http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd
--2011-10-10 10:48:06--  http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd
Resolving www.hibernate.org... 209.132.182.21
Connecting to www.hibernate.org|209.132.182.21|:80... failed: Connection timed out.
Retrying.</pre>
<p>It&#8217;s not actually able to get to the internet to validate the DTD within that hibernate.cfg.xml file. This should not break our build. It was a source of much frustration for about 4 hours of the day. Various <a href="https://forum.hibernate.org/viewtopic.php?f=1&amp;t=949031">hibernate forums</a> were of limited help.</p>
<p>Apparently it should get it from the jar, rather than the internet, if the jar is available on the class path and the DTD matches. First our DTD was incorrect. Rectified that, and yet it still tried to get it off the internet. WTF?</p>
<p>Turns out the hibernate3-maven-plugin doesn&#8217;t include any hibernate jars when it executes.</p>
<p><a href="http://shlrm.org/wordpress/wp-content/uploads/2011/10/le-sigh.jpg"><img class="size-medium wp-image-495 alignnone" title="le sigh" src="http://shlrm.org/wordpress/wp-content/uploads/2011/10/le-sigh-300x207.jpg" alt="*le sigh*" width="300" height="207" /></a></p>
<p>Solution is to duplicate the necessary hibernate dependencies for the plugin to have the necessary DTD data available:</p>
<pre class="brush: xml; gutter: true; first-line: 1">&lt;dependencies&gt;
  &lt;!--
    Need to include the following hibernate dependencies so that it can find the DTD
    without having to get it off the internet.
  --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
    &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
    &lt;version&gt;${hibernate.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
    &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
    &lt;version&gt;4.0.0.GA&lt;/version&gt;
    &lt;exclusions&gt;
      &lt;exclusion&gt;
        &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
        &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
      &lt;/exclusion&gt;
    &lt;/exclusions&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
     &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
     &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
     &lt;version&gt;1.0.0.Final&lt;/version&gt;
  &lt;/dependency&gt;
&lt;/dependencies&gt;</pre>
<p>So some context: This is to support preventing the hibernate3-maven-plugin from going to the internet to get the DTD every time it parses that hibernate.cfg.xml file. There&#8217;s no data in this file, only a shell of a hibernate.cfg.xml; just enough of a placeholder to keep the hbm2ddl Goal from failing, as we&#8217;ll eventually have it build DDL for us.</p>
<p>Content:</p>
<pre class="brush: xml; gutter: true; first-line: 1">&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;

&lt;hibernate-configuration&gt;

    &lt;session-factory&gt;
        &lt;!-- specify annotated classes here, because the hbm2ddl plugin isn't capable of searching for them :( --&gt;
    &lt;/session-factory&gt;

&lt;/hibernate-configuration&gt;</pre>
<p>Quite an irritating error for something that seems to actually do nothing. Apparently it does. Stupid XML</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/10/10/hibernate-3-maven-plugin-hbm2ddl-goal-and-hate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The value of project automation</title>
		<link>http://shlrm.org/wordpress/2011/10/02/the-value-of-project-automation/</link>
		<comments>http://shlrm.org/wordpress/2011/10/02/the-value-of-project-automation/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 18:00:00 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Coding!]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=489</guid>
		<description><![CDATA[Failing to have an automated deployment script results in much more pain than it would've taken to build the script in the first place.]]></description>
			<content:encoded><![CDATA[<p>Particularly deployment automation, in my case something like capistrano. It goes further than just the application, however. It goes into being able to ensure that the deployment environment, including the database and the application container all behave nicely. I have failed in this aspect, as my rails app is no longer behaving, and I&#8217;ve been reduced to updating things in the hopes that one of the things will fix it :(</p>
<p><span id="more-489"></span>I updated my <a href="http://www.postgresql.org/">postgresql</a> database, as it was version 8 and version 9 has been out for quite a while. <a href="http://www.postgresql.org/docs/9.1/static/upgrading.html">That actually went painlessly</a>. Backup the SQL, terminate the db server, build/install the new one, and restore the SQL. Then tewak configuration files to get everything back the way it was before. No problem.</p>
<p>Then realized I needed to rebuild a pg gem on the deployed host so that it&#8217;d talk to postgresql 9 now. Did that. Suddenly the app server no longer responds. it just sits there forever waiting on &#8230; something. No amount of debugging output from <a href="http://modrails.com/">Passenger</a> will help. It must be something else. So now I&#8217;m updating ruby and rebuilding a new Passsenger against it in the hopes that it&#8217;s a bug in ruby that I&#8217;ve encountered that evidences itself with postgresql 9 or something. Otherwise, I might be spending the day getting the newer revision of my application ready to go a bit earlier than I had planned.</p>
<p>Had I had an automated deployment script built in, I could&#8217;ve just clobbered the environment and redeployed within the new fresh environment. Instead I&#8217;m having to monkey around getting everything to behave well, and generally failing at it.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/10/02/the-value-of-project-automation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thank you FedEx for failing to deliver a package a day early</title>
		<link>http://shlrm.org/wordpress/2011/09/14/thank-you-fedex-for-failing-to-deliver-a-package-a-day-early/</link>
		<comments>http://shlrm.org/wordpress/2011/09/14/thank-you-fedex-for-failing-to-deliver-a-package-a-day-early/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 23:44:42 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Gripes]]></category>
		<category><![CDATA[fedex]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[shipping]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=476</guid>
		<description><![CDATA[FedEx fails to deliver a package early. Thanks.]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s not something you have to do. But when it arrives an entire ay early, would it be that difficult to put it on the truck and deliver it?<a href="http://shlrm.org/wordpress/wp-content/uploads/2011/09/FedexFail.png"><img class="size-medium wp-image-477 alignright" title="FedexFail" src="http://shlrm.org/wordpress/wp-content/uploads/2011/09/FedexFail-300x255.png" alt="" width="300" height="255" /></a></p>
<p>Instead, it&#8217;s simply &#8220;not due for delivery,&#8221; and so you keep it. I wish I&#8217;d checked before I left work, then I could&#8217;ve gone and picked it up, because you&#8217;re too lazy to get it to my house today.</p>
<p>If you weren&#8217;t better than UPS at smashing boxes for me, I&#8217;d have shipped it UPS, and they&#8217;d have delivered it a day early.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/09/14/thank-you-fedex-for-failing-to-deliver-a-package-a-day-early/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using cuke4duke and working around rubygems issues</title>
		<link>http://shlrm.org/wordpress/2011/09/13/using-cuke4duke-and-working-around-rubygems-issues/</link>
		<comments>http://shlrm.org/wordpress/2011/09/13/using-cuke4duke-and-working-around-rubygems-issues/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 21:05:13 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[jruby]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=471</guid>
		<description><![CDATA[Getting gems installed for use with cuke4duke.]]></description>
			<content:encoded><![CDATA[<p><a href="https://groups.google.com/d/msg/cukes/KZ2U04UA6MM/JEZ58kBtkcgJ">cuke4duke support has been dropped in favor of work on cucumber-jvm.</a> Which is all well and good, except that cucumber-jvm isn&#8217;t fully baked yet. It&#8217;s not quite there regarding features, but it&#8217;s getting there fast.</p>
<p>Unfortunately, that means for those that are still using cuke4duke, you&#8217;ve got problems to deal with. The voodoo magic that is cuke4duke does not install gems very well. I don&#8217;t know precisely why this is, but it ends up with many problems. Things that will install just fine using a jruby command line, or in native ruby barf a horrible death. Often regarding some YAML::Syck thing.</p>
<pre class="brush: text; gutter: false; first-line: 1">ERROR:  While executing gem ... (ArgumentError)
      undefined class/module YAML::Syck::DefaultKey</pre>
<p>Really sucks and makes it difficult to actually use cuke4duke unless you&#8217;ve already got all the gems you need installed.</p>
<p>After much investigation, I discovered that cuke4duke uses a GEM_HOME of ~/.m2/repository/.jruby . So a simple command can get the gems you want installed into that folder:</p>
<pre class="brush: text; gutter: false; first-line: 1">java -jar jruby-complete-1.6.4.jar -S gem install json --version=1.5.4 --no-rdoc --no-ri -i /home/dkowis/.m2/repository/.jruby</pre>
<p>Unfortunately, if there&#8217;s another &#8220;gem&#8221; command in your path, it will use that instead of the one in your jar file, so you have to munge your path as well to prevent it from doing so.</p>
<p>Finally, I needed a way to get this into our project&#8217;s Maven POM so that we could easily set up other peoples boxes and the configuration isn&#8217;t lost in some terribly manual process of running that command over and over.</p>
<p>This is the solution I came up with:</p>
<pre class="brush:xml wp_syntax">        &lt;profile&gt;
            &lt;id&gt;install-gems&lt;/id&gt;
            &lt;build&gt;
                &lt;plugins&gt;
                    &lt;plugin&gt;
                        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                        &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
                        &lt;version&gt;1.6&lt;/version&gt;
                        &lt;executions&gt;
                            &lt;execution&gt;
                                &lt;phase&gt;generate-test-resources&lt;/phase&gt;
                                &lt;configuration&gt;
                                    &lt;target&gt;
                                        &lt;property file="gems.properties"/&gt;
                                        &lt;macrodef name="install-gem"&gt;
                                            &lt;attribute name="gem"/&gt;
                                            &lt;attribute name="version"/&gt;
                                            &lt;sequential&gt;
                                                &lt;java jar="${maven.dependency.org.jruby.jruby-complete.jar.path}"
                                                      fork="true"
                                                      failonerror="true"
                                                      maxmemory="64m"
                                                      newenvironment="true"&gt;
                                                    &lt;arg value="-S"/&gt;
                                                    &lt;arg value="gem"/&gt;
                                                    &lt;arg value="install"/&gt;
                                                    &lt;arg value="@{gem}"/&gt;
                                                    &lt;arg value="--version=@{version}"/&gt;
                                                    &lt;arg value="-i"/&gt;
                                                    &lt;arg value="${user.home}/.m2/repository/.jruby"/&gt;
                                                    &lt;env key="PATH" path="${java.home}/bin"/&gt;
                                                &lt;/java&gt;
                                            &lt;/sequential&gt;
                                        &lt;/macrodef&gt;
                                        &lt;install-gem gem="json" version="1.5.4"/&gt; &lt;!-- needed to get json to behave with jruby --&gt;
                                        &lt;install-gem gem="cucumber" version="1.0.3"/&gt;
                                        &lt;install-gem gem="cuke4duke" version="${gem.cuke4duke.version}"/&gt;
                                        &lt;install-gem gem="nokogiri" version="${gem.nokogiri.version}"/&gt;
                                        &lt;install-gem gem="rspec" version="${gem.rspec.version}"/&gt;
                                        &lt;install-gem gem="rest-client" version="${gem.restclient.version}"/&gt;
                                        &lt;install-gem gem="jruby-openssl" version="${gem.jrubyopenssl.version}"/&gt;
                                    &lt;/target&gt;
                                &lt;/configuration&gt;
                                &lt;goals&gt;
                                    &lt;goal&gt;run&lt;/goal&gt;
                                &lt;/goals&gt;
                            &lt;/execution&gt;
                        &lt;/executions&gt;
                    &lt;/plugin&gt;
                &lt;/plugins&gt;
            &lt;/build&gt;
        &lt;/profile&gt;</pre>
<p>One can then run the command &#8216;mvn test -Pinstall-gems&#8217; and the gems will be installed as part of the test-resource-generation phase. This only has to be done once whenever new gems are added, or on initial setup. Once it&#8217;s done, you&#8217;re good to go with the normal cuke4duke workflow.</p>
<p>Hopefully this will save other people some time :)</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/09/13/using-cuke4duke-and-working-around-rubygems-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing collectd for gcc &gt; 4.3.3</title>
		<link>http://shlrm.org/wordpress/2011/09/10/fixing-collectd-for-gcc-4-3-3/</link>
		<comments>http://shlrm.org/wordpress/2011/09/10/fixing-collectd-for-gcc-4-3-3/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 01:50:42 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Source Mage]]></category>
		<category><![CDATA[gcc]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=467</guid>
		<description><![CDATA[Fixing collectd 4.10.3 to build on newer gcc as well as handling conflicts with libiptc.]]></description>
			<content:encoded><![CDATA[<p>Blarg. Gcc.</p>
<p>I kept having a horrible error building collectd 4.10.x on my <a href="http://www.sourcemage.org">Source Mage</a> servers:</p>
<p>libiptc.c:85: error: redefinition of &#8216;struct xt_error_target&#8217;</p>
<p>The internets couldn&#8217;t really help me with the error, I think I was searching for the wrong words. There was also issues regarding warnings that gcc now treats as errors.</p>
<p>I ended up spending probably about an hour cloning their git repo, cherry-picking a few commits into the 4.10.3 tag, and then submitting the patches to <a href="http://collectd.org/bugs/view.php?id=41">the bug I created</a>.</p>
<p>End result is that collectd-4.10.3 now builds on gcc 4.4.3 and 4.6.1. The fix is in the Grimoire on Source Mage, and should trickle out to stable eventually. I think I&#8217;m the only one who uses collectd, so it&#8217;s not all that important, heh.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/09/10/fixing-collectd-for-gcc-4-3-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Apache, mod_rewrite, mod_proxy and lighttpd</title>
		<link>http://shlrm.org/wordpress/2011/09/07/fun-with-apache-mod_rewrite-mod_proxy-and-lighttpd/</link>
		<comments>http://shlrm.org/wordpress/2011/09/07/fun-with-apache-mod_rewrite-mod_proxy-and-lighttpd/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 21:34:54 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Source Mage]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=460</guid>
		<description><![CDATA[Creating a nice custom mod_rewrite rule to mimic Apache's Alias behavior whilst instead proxying to a Lighttpd server to do the heavy lifting.]]></description>
			<content:encoded><![CDATA[<p>Lighttpd does a <strong>much</strong> better job generating an index page for lots of files. 12,049 files to be precise, at time of writing. I had set up a long time ago my website to be a fallback mirror for Source Mage, so if a source file got moved, lost, deleted, or the site hosting it went down, away forever, whatever. I remember disabling Apache&#8217;s Indexes option on that file list because it would take <em>forever</em>to get anything rendered, as well as consuming plenty of CPU and resources.</p>
<p>Well, I was using an internal lighttpd to render the same thing internally, and I didn&#8217;t disable its directory listing at all. Whilst I was working on setting up collectd to monitor my Apache scoreboards, I noticed that it could also monitor the lighttpd scoreboard. So I was going about the config to set that up, and I noticed that the Apache wasn&#8217;t proxying it&#8217;s requests through to lighttpd, and was taking a lot of time and resources to do something simple.</p>
<p>Welp, having ADD like I do, I got sidetracked on doing that instead and started to rewrite my configs to not serve files directly, but proxy it to the lighttpd internally.</p>
<p>Originally, I had two aliases set up &#8220;/sourcemage&#8221; and &#8220;/sourcemage/fallback&#8221; which both pointed to the same spot on disk, This way you could reference things using &#8220;/sourcemage/file.tar.bz2&#8243; or &#8220;/sourcemage/fallback/file.tar.bz2&#8243;. The reasoning behind this is simple: I set up my fallback mirror before Source Mage standardized on a fallback URL, and I wanted to keep both paths functional. Easy to do with aliases. Oh, and I also have an alias to &#8220;/sourcemage/codex&#8221; for all my local codex needs.</p>
<p>Switching to a proxied setup was a bit more complicated than I anticipated. The alias stuff doesn&#8217;t work the same way everything else does, in that what it finds first it goes with. I needed to have mod_rewrite rules wired in to properly redirect things and manipulate the URL sufficiently. But I have two special cases. I can&#8217;t simply redirect everything &#8220;/sourcemage/*&#8221; to &#8220;/sourcemage/fallback.&#8221; Also, I wanted to be able to continue to use &#8220;/sourcemage/file.tar.bz2&#8243;</p>
<p>My solution is relatively simple and follows:</p>
<pre class="brush: text; gutter: false; first-line: 1">#aliases
Alias /sourcemage/codex    "/srv/webMirrors/sourcemage.org/codex"
#rewrite /sourcemage/ to /sourcemage/fallback
#some very fancy rewrite rules to keep the old alias functionality
RewriteEngine On
RewriteRule ^/sourcemage/?$ /sourcemage/fallback/ [R]
RewriteRule ^/sourcemage/codex/?$ - [L]
RewriteRule ^/sourcemage/([a-zA-Z0-9.i_\-+]+)$ /sourcemage/fallback/$1 [R]
# do the actual passing through to the lighttpd (which handles huge
# directory listing much much better
ProxyPass /sourcemage/fallback http://fallback.shlrm.org/
ProxyPassReverse /sourcemage/fallback http://fallback.shlrm.org/

# old notes kept here for reference as to what the above rewrite
# rules are doing -- dkowis 2011-09-07
# going to proxy these to the lighttpd
#Alias /sourcemage/fallback "/var/spool/sorcery/"
#Alias /sourcemage          "/var/spool/sorcery/"
# directories!
#&lt;Directory "/var/spool/sorcery/" &gt;
#       Options none
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#&lt;/Directory&gt;

&lt;Directory "/srv/webMirrors/sourcemage.org/codex/" &gt;
        Options Indexes
        Order allow,deny
        Allow from all
&lt;/directory&gt;

# vi: set ft=apache:</pre>
<p>The rewriting rules are the most complicated part of this. The trick was getting it not to try to rewrite anything when the url matched &#8220;/sourcemage/codex&#8221; After that, the rest was really easy. Some matching logic to pick up on &#8220;/sourcemage/file.tar.bz2&#8243; and redirect that to &#8220;/sourcemage/fallback/$1&#8243; and everything worked as it did before, except way faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/09/07/fun-with-apache-mod_rewrite-mod_proxy-and-lighttpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New theme!</title>
		<link>http://shlrm.org/wordpress/2011/09/03/new-theme-2/</link>
		<comments>http://shlrm.org/wordpress/2011/09/03/new-theme-2/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 06:04:38 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[W00t!]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=456</guid>
		<description><![CDATA[New Theme!]]></description>
			<content:encoded><![CDATA[<p>Yay there&#8217;s a new theme! It&#8217;s a bit nicer than the old one; less fancy graphics and a better layout.</p>
<p>Far more customizable also. I&#8217;m satisfied.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/09/03/new-theme-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding additional recipes to your Capistrano deploy.rb</title>
		<link>http://shlrm.org/wordpress/2011/08/21/adding-additional-recipes-to-your-capistrano-deploy-rb/</link>
		<comments>http://shlrm.org/wordpress/2011/08/21/adding-additional-recipes-to-your-capistrano-deploy-rb/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 00:23:07 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[capistrano]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=451</guid>
		<description><![CDATA[This was unbelievably difficult to find on the internet. Perhaps I didn&#8217;t know the right things to look for. I wanted to figure out how to require/load/import additional files into the deploy.rb file so that I would be able to drop recipes in to a config/recipes directory. Turns out this is the solution. I ended <a href='http://shlrm.org/wordpress/2011/08/21/adding-additional-recipes-to-your-capistrano-deploy-rb/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This was unbelievably difficult to find on the internet. Perhaps I didn&#8217;t know the right things to look for.</p>
<p>I wanted to figure out how to require/load/import additional files into the deploy.rb file so that I would be able to drop recipes in to a config/recipes directory.</p>
<p>Turns out <a href="http://stackoverflow.com/questions/5365950/require-in-capistrano-deploy-rb-cannot-find-file">this is the solution</a>.</p>
<p>I ended up using this to simply load all the recipes in the recipes directory:</p>
<pre class="brush:ruby">#load in all the other recipes
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'recipes')
Dir['config/recipes/**/*.rb'].each { |recipe| require  File.basename(recipe, '.rb') }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/08/21/adding-additional-recipes-to-your-capistrano-deploy-rb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s dangerous to code alone</title>
		<link>http://shlrm.org/wordpress/2011/05/25/its-dangerous-to-code-alone/</link>
		<comments>http://shlrm.org/wordpress/2011/05/25/its-dangerous-to-code-alone/#comments</comments>
		<pubDate>Wed, 25 May 2011 22:58:22 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Coding!]]></category>
		<category><![CDATA[Funneh!]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=448</guid>
		<description><![CDATA[Take this]]></description>
			<content:encoded><![CDATA[<p>Take this</p>
<p><img class="alignnone" title="Master Ruby" src="http://i.imgur.com/RGH7El.jpg" alt="" width="640" height="400" /></p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/05/25/its-dangerous-to-code-alone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing API calls using Cucumber and Rails 3</title>
		<link>http://shlrm.org/wordpress/2011/04/30/testing-api-calls-using-cucumber-and-rails-3/</link>
		<comments>http://shlrm.org/wordpress/2011/04/30/testing-api-calls-using-cucumber-and-rails-3/#comments</comments>
		<pubDate>Sun, 01 May 2011 02:23:14 +0000</pubDate>
		<dc:creator>David Kowis</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[capybara]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://shlrm.org/wordpress/?p=443</guid>
		<description><![CDATA[After many hours of searching, found a solution to Cucumber testing of API calls with Cucumber-rails Capybara backend.]]></description>
			<content:encoded><![CDATA[<p>As it turns out, in Rails 3.x, webrat and cucumber don&#8217;t play along so well. You start getting horribly annoying, and <a href="http://stackoverflow.com/questions/3546011/undefined-webrat-methods-in-cucumber-step-definitions">difficult to solve error messages</a>. The solution in that link is to change the testing method from Rails to Rack. That works, for things like visiting pages, but it broke all of my API tests, where I verify the response code of the body and the JSON that I get back.</p>
<p>I looked into upgrading cucumber-rails, and apparently they <a href="https://github.com/aslakhellesoy/cucumber-rails">recommend using Capybara instead of webrat</a> for Rails 3. So I make the necessary changes. Unfortunately Capybara <strong>only</strong> has a get method. You can only visit pages. Any posts should be exercised by the web forms. This is far less than useful. It has proven to be a huge pain the butt. Hours of trying to find how people do this to no avail. Until I find an <a href="http://stackoverflow.com/questions/1182377/testing-restful-api-with-cucumber-in-a-front-end-less-application/5788530#5788530">obscure answer</a>, at the bottom of a <a href="http://stackoverflow.com/questions/1182377/testing-restful-api-with-cucumber-in-a-front-end-less-application">StackOverflow posting</a>.</p>
<p>That <a href="https://github.com/jayzes/cucumber-api-steps">code on github</a> is the key to testing APIs. It appears to use some of the more internal guts of the Capybara page drivers to accomplish it&#8217;s goal. Works for me.</p>
<p>I am surprised to see that there are few integration test frameworks that support this kind of web service test. Especially since where I work, this is what we build. Having Cucumber features describing those API calls makes everyone&#8217;s job easier. I find it unfortunate that it seems to be somewhat ignored by the testing community. Hopefully this will contain the necessary words for other people that are searching for the same thing I spent hours searching for, and will find it in far less time.</p>
]]></content:encoded>
			<wfw:commentRss>http://shlrm.org/wordpress/2011/04/30/testing-api-calls-using-cucumber-and-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

