<?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 Amazing Technicolor Weblog &#187; Code</title>
	<atom:link href="http://slagwerks.com/blog/index.php/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://slagwerks.com/blog</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jul 2010 22:31:13 +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>Tip for New Sinatra Deployers</title>
		<link>http://slagwerks.com/blog/index.php/2010/07/23/tip-for-new-sinatra-deployers/</link>
		<comments>http://slagwerks.com/blog/index.php/2010/07/23/tip-for-new-sinatra-deployers/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 22:30:39 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[error messages]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=377</guid>
		<description><![CDATA[If you get the error undefined method `application' for Sinatra:Module and your config.ru includes the line run Sinatra.application, try changing that to run Sinatra::Application and it should actually&#160;work. (via&#160;http://www.sinatrarb.com/one-oh-faq)]]></description>
			<content:encoded><![CDATA[<p>If you get the error <code>undefined method `application' for Sinatra:Module</code> and your config.ru includes the line <code>run Sinatra.application</code>, try changing that to <code>run Sinatra::Application</code> and it should actually&nbsp;work.</p>
<p>(via&nbsp;http://www.sinatrarb.com/one-oh-faq)</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2010/07/23/tip-for-new-sinatra-deployers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby &amp; NoSQL @ Vermonster</title>
		<link>http://slagwerks.com/blog/index.php/2010/04/02/ruby-nosql-vermonster/</link>
		<comments>http://slagwerks.com/blog/index.php/2010/04/02/ruby-nosql-vermonster/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 14:20:08 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=356</guid>
		<description><![CDATA[Update: Vermonster has a nice recount, chock full of code &#38;&#160;explanations. A fine time was had the other night in the offices of Boston&#8217;s Vermonster, when a few Vermonsters generously helped some folks from Boston.rb get up to speed on the use of some NoSQL projects from&#160;Ruby. Up until now, I&#8217;ve been a little leery of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: Vermonster has a <a href="http://vermonster.com/2010/03/31/nosql-workshop-featuring-riak-and-couchdb/">nice recount</a>, chock full of code <span class="amp">&amp;</span>&nbsp;explanations.</p>
<p>A fine time was had the other night in the offices of Boston&#8217;s <a href="http://vermonster.com/">Vermonster</a>, when a few Vermonsters generously helped some folks from <a href="http://bostonrb.org/">Boston.rb</a> get up to speed on the use of some NoSQL projects from&nbsp;Ruby.</p>
<p>Up until now, I&#8217;ve been a little leery of NoSQL. Probably due to painful past experience with <a href="http://en.wikipedia.org/wiki/ZODB"><span class="caps">ZODB</span></a> failing to keep up with moderate loads, and reading too many Philip Greenspun essays at an impressionable age. Happily, it appears that the projects collected under the NoSQL banner can actually walk and chew gum at the same time, without rendering your data unreasonably&nbsp;inconsistent.</p>
<p>The whole question of the Consistency of one&#8217;s data is addressed by the <a href="http://www.julianbrowne.com/article/viewer/brewers-cap-theorem"><span class="caps">CAP</span></a> theory, which I understand to roughly&nbsp;say</p>
<blockquote><p>Consistency, Availability, Partitionability: pick (at most) two, particularly under certain challenging conditions such as running Google or&nbsp;Amazon.</p></blockquote>
<p>Even if you aren&#8217;t running something quite that big, there seem to be some situations where you&#8217;d want to think about this stuff&thinsp;&#8212;&thinsp;for example, running an app on Google&#8217;s App Engine (right? Haven&#8217;t yet myself.) Plus, all the cool kids are into&nbsp;it.</p>
<p>We worked with the locally-written <a href="http://riak.basho.com/">Riak</a> (looks like it&#8217;s the topic of the April Boston.rb meeting!) and with CouchDB. Both are ridiculously easy to get running locally, have Ruby client libraries, and are powered mainly by Erlang, with javascript Map/Reduce. For the latter, we used the couch_potato library, which seems to do a nice job of writing your javascript for you in the most common&nbsp;cases.</p>
<p>We wrapped the evening up with a coding challenge. My brain was fried <span class="amp">&amp;</span> I gave up 2/3rds of the way through, but still had a blast <span class="amp">&amp;</span> learned plenty. As a side benefit, beyond the exposure to the NoSQL, my state-of-the-art-circa-2008 Ruby habits got challenged by working with RSpec, 1.9.1, and <span class="caps">RVM</span>, all of which will should prove handy for future&nbsp;things.</p>
<p>Big ups to Vermonster for hosting, feeding, and educating us. They are good guys, skilled teachers, and have excellent taste in&nbsp;beverages.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2010/04/02/ruby-nosql-vermonster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>python script for importing maildirs to gmail</title>
		<link>http://slagwerks.com/blog/index.php/2009/11/05/python-script-for-importing-maildirs-to-gmail/</link>
		<comments>http://slagwerks.com/blog/index.php/2009/11/05/python-script-for-importing-maildirs-to-gmail/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:57:07 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=330</guid>
		<description><![CDATA[In fact the script in question should work also for mboxes and for other SMTP servers, but maildir-to-gmail was the problem I was trying to&#160;solve. The most promising starting point was an old script by Mark Lyon. After a little rejiggering so I could see what error was coming back from Google, I made a [...]]]></description>
			<content:encoded><![CDATA[<p>In fact <a href="http://github.com/jslag/gml">the script in question</a> should work also for mboxes and for other <span class="caps">SMTP</span> servers, but maildir-to-gmail was the problem I was trying to&nbsp;solve.</p>
<p>The most promising starting point was an <a href="http://marklyon.org/gmail/old/default.htm">old script by Mark Lyon</a>. After a little rejiggering so I could see what error was coming back from Google, I made a couple of more tweaks to use <span class="caps">TLS</span> <span class="amp">&amp;</span> to take the user&#8217;s&nbsp;password.</p>
<p>If anyone&#8217;s interested in what seemed to me a strange hoop to hop through before connecting, <a href="http://github.com/jslag/gml/blob/master/gml.py#L72">check the&nbsp;src</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2009/11/05/python-script-for-importing-maildirs-to-gmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Considering how to reliably jam stuff into FileMaker from the web</title>
		<link>http://slagwerks.com/blog/index.php/2009/10/23/considering-how-to-reliably-jam-stuff-into-filemaker-from-the-web/</link>
		<comments>http://slagwerks.com/blog/index.php/2009/10/23/considering-how-to-reliably-jam-stuff-into-filemaker-from-the-web/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 16:43:52 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[FileMaker]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=322</guid>
		<description><![CDATA[I&#8217;m sure I&#8217;m not the only person with this&#160;situation: FileMaker database sitting behind a firewall (though similar issues would pertain for other internal databases /&#160;services) Website hosted elsewhere (i.e. other side of&#160;firewall) Need to get data from #2 to #1 reliably and&#160;securely Up until today, I&#8217;ve only had one instance of #2 in this situation. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure I&#8217;m not the only person with this&nbsp;situation:</p>
<ol>
<li>FileMaker database sitting behind a firewall (though similar issues would pertain for other internal databases /&nbsp;services)</li>
<li>Website hosted elsewhere (i.e. other side of&nbsp;firewall)</li>
<li>Need to get data from #2 to #1 reliably and&nbsp;securely</li>
</ol>
<p>Up until today, I&#8217;ve only had one instance of #2 in this situation. I dealt with it by storing data collected on the website (which happened to be written in Rails) in a database on the web server, and then running a periodic <span class="caps">PHP</span> script on the FileMaker server that connects to the Rails app via <a href="http://github.com/lux/phpactiveresource">phpactiveresource</a>, pulls in pending data, and inserts it into FileMaker via its <span class="caps">PHP</span>&nbsp;api.</p>
<p>That instance was such a roaring success that the requests have been pouring in for more of the same. Some of the new requests will be handled by a site running <span class="caps">PHP</span>, so I&#8217;ve got a bit of rewiring to do&thinsp;&#8212;&thinsp;I can&#8217;t see any sense in the getting the data from the <span class="caps">PHP</span> app into something the Active Resource client can talk&nbsp;to.</p>
<p>Stepping back and looking at the bigger picture, issues here&nbsp;include:</p>
<ul>
<li>the connection from the website to the FileMaker server could be down, so data collected by the website needs to be stored until it can be confirmed to have made it to&nbsp;FileMaker.</li>
<li>it would be nice for this to happen in a timely&nbsp;fashion</li>
<li>multiple technologies on the web side (<span class="caps">PHP</span> <span class="amp">&amp;</span> ruby) are going to be collecting data to be submitted to FileMaker, so it&#8217;d be nice if the transfer machinery can be agnostic and just accept <span class="caps">JSON</span> or <span class="caps">XML</span> or&nbsp;something.</li>
</ul>
<p>Sounds like a problem for a queue system, huh? So my current plan is to run a <a href="http://kr.github.com/beanstalkd/">beanstalkd</a> instance on the webserver, deposit <span class="caps">JSON</span>-endocded data into it from the web sites, and run workers that write to FileMaker using the <a href="http://github.com/lardawge/rfm">Ruby <span class="caps">FM</span> <span class="caps">API</span></a>. I have no experience with beanstalkd, but a bit of googling suggests that it&#8217;s at a nice point in simplicity to configure <span class="amp">&amp;</span> run, maturity, light weight, and easy access from <span class="caps">PHP</span> <span class="amp">&amp;</span>&nbsp;Ruby.</p>
<p>A further benefit of working in beanstalkd is that, based on a quick perusal of the <a href="http://async-observer.rubyforge.org/">recommended Rails integration</a>, it should be really easy to break Observers out to async code, thus making my rails apps&nbsp;snappier.</p>
<p>Any advice to the contrary is of course welcome. I&#8217;ll try to remember to update y&#8217;all on how this turns&nbsp;out.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2009/10/23/considering-how-to-reliably-jam-stuff-into-filemaker-from-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom flickr sidebar via wget, cron &amp; PHP</title>
		<link>http://slagwerks.com/blog/index.php/2009/07/29/custom-flickr-sidebar-via-wget-cron-php/</link>
		<comments>http://slagwerks.com/blog/index.php/2009/07/29/custom-flickr-sidebar-via-wget-cron-php/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:33:15 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=305</guid>
		<description><![CDATA[The new site launched with a sidebar that shows two random photos from our flickr account, using their javascript widget. This was a great way to get things going, but now we&#8217;ve developed slightly more involved needs and I&#8217;ve had to come up with a custom&#160;solution. Getting the list of&#160;photos You need a flickr API [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://thefoodproject.org/">The new site</a> launched with a sidebar that shows two random photos from our flickr account, using their javascript widget. This was a great way to get things going, but now we&#8217;ve developed slightly more involved needs and I&#8217;ve had to come up with a custom&nbsp;solution.</p>
<h3>Getting the list of&nbsp;photos</h3>
<p>You need a flickr <span class="caps">API</span> key, which is quick <span class="amp">&amp;</span> easy to get. Then wget <span class="amp">&amp;</span> cron to get &#8216;em: <code>wget --quiet 'http://api.flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=YOUR_API_KEY&amp;user_id=YOUR_USER_ID&amp;tags=website&amp;per_page=500' -O&nbsp;photos.xml</code></p>
<p>Note that this includes a <em>tags</em> argument. The thing that pushed me to switch the workflow was the desire to be able to upload photos to our flickr account that don&#8217;t necessarily fit into the sidebar format, such as panoramics. To handle this, everything that belongs on the website gets the tag <em>website</em>, and we only fetch those ones. We&#8217;ve also talked about just getting landscape oriented photos, but haven&#8217;t implemented&nbsp;that.</p>
<p>I&#8217;m running this daily, which is plenty often to update the available photo list. I believe this gets the newest 500, which seems more than adequate, particularly since we don&#8217;t have close to 500 photos&nbsp;yet.</p>
<h3>Parsing the list <span class="amp">&amp;</span> generating the&nbsp;<span class="caps">HTML</span></h3>
<p><span class="caps">PHP5</span>&#8217;s SimpleXML is pretty nice&thinsp;&#8212;&thinsp;here&#8217;s what we&#8217;re doing:<br />
<code> </code></p>
<pre>try {
  $xml = new SimpleXMLElement(file_get_contents('photos.xml'));
    $number_of_photos = count($xml-&gt;photos-&gt;photo);
    $displayed_photos = array();
    array_push(
      $displayed_photos,
      $xml-&gt;photos-&gt;photo[rand(0, $number_of_photos - 1)]);
    array_push(
      $displayed_photos,
      $xml-&gt;photos-&gt;photo[rand(0, $number_of_photos - 1)]);
    foreach ($displayed_photos as $photo) { ?&gt;
  &lt;div&gt;
&lt;?php
      print "&lt;a href=\"http://www.flickr.com/photos/8562013@N07/" .
        $photo['id'] . "\"&gt;&lt;img src=\"http://farm" . $photo['farm'] .
        ".static.flickr.com/" . $photo['server'] . "/" . $photo['id'] . "_" .
        $photo['secret'] .  "_m.jpg\" alt=\"" . $photo['title'] . "\" /&gt;&lt;/a&gt;";
?&gt;
  &lt;/div&gt;
&lt;?php
 }
} catch (Exception $e) {
  error_log("flickr badge had some troubles: " .
    $e-&gt;getMessage());
}</pre>
<p>This snippet takes my laptop less than 1/20th of a second to run from the command line, which suits me fine. The actual code sits in&nbsp;<code>page.tpl.php</code>.</p>
<p><a href="http://www.flickr.com/services/api/">Flickr&#8217;s <span class="caps">API</span> docs</a>, in particular the <span class="caps">API</span> Explorer, were awful handy in figuring this all&nbsp;out.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2009/07/29/custom-flickr-sidebar-via-wget-cron-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Joe&#8217;s hacky approach to getting arbitrary behavior out of Drupal</title>
		<link>http://slagwerks.com/blog/index.php/2009/07/28/joes-hacky-approach-to-getting-arbitrary-behavior-out-of-drupal/</link>
		<comments>http://slagwerks.com/blog/index.php/2009/07/28/joes-hacky-approach-to-getting-arbitrary-behavior-out-of-drupal/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 20:42:39 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=257</guid>
		<description><![CDATA[Wherein I disqualify myself for work as a &#8220;drupal&#160;developer&#8221; Self indulgent history&#160;part Way back in 1999 when I started out writing web apps, Embperl seemed like the logical tool to use&#8201;&#8212;&#8201;so I&#8217;m used to having direct access to every step in the request-to-response process. In years since, I&#8217;ve progressed through a bunch of different tools [...]]]></description>
			<content:encoded><![CDATA[<p><em>Wherein I disqualify myself for work as a &#8220;drupal&nbsp;developer&#8221;</em></p>
<h3>Self indulgent history&nbsp;part</h3>
<p>Way back in 1999 when I started out writing web apps, <a href="http://perl.apache.org/embperl/">Embperl</a> seemed like the logical tool to use&thinsp;&#8212;&thinsp;so I&#8217;m used to having direct access to every step in the request-to-response process. In years since, I&#8217;ve progressed through a bunch of different tools and approaches, which have included writing a few rudimentary content management systems and using a bunch of prexisting&nbsp;ones.</p>
<p>Over the last few years I&#8217;ve become a big fan of ruby on rails, so if a site does much of anything (simple, recent example: The Food Project&#8217;s online <a href="http://apply.thefoodproject.org">summer program application</a>), that&#8217;d be my starting&nbsp;point.</p>
<h3>so, why use&nbsp;Drupal?</h3>
<p>Even so, when a site is basically about some content that&#8217;s written and edited on an ongoing basis by other folks, Drupal starts looking like a reasonable tool. It&#8217;s pretty easy to get it to generate semantic output with reasonable URLs, and the editor-facing <span class="caps">UI</span> does a fair job of offerring a large degree of control and customizability without being overwhelmingly&nbsp;complex.</p>
<p>Despite having done some <a href="http://jamaicaplaingazette.com/node/2568">custom work</a> <a href="http://womenslunchplace.org/biographical-sketch-sharon-reilly">on a few</a> live Drupal sites, I still get confused about the best way to do some of the arbitrary web interaction tasks that were so straightforward back in the Embperl days. There are a billion modules in the Drupal ecosystem, but I often find that it takes more time to figure out if there is an appropriate one for my task <span class="amp">&amp;</span> if it works with the current version of Drupal than it would to code up a solution on my own. Also, while I&#8217;ve made several attempts to solve programming tasks in what I understand to be the Drupal way, wrapping my head around all the relevant APIs (which can totally change every 6-12 months, with each Drupal release) similarly tends to take more time than bypassing Drupal&#8217;s functionality <span class="amp">&amp;</span> handling things in Plain Old&nbsp;<span class="caps">PHP</span>.</p>
<p>Here&#8217;s a common approach I&#8217;ll take, then. I have no interest in extensive coding through a web browser (i.e. <a href="http://drupal.org/handbook/customization/php-snippets">putting a bunch of <span class="caps">PHP</span> in a node or block</a>), so I&#8217;ll set up a Drupal module to hold my application&#8217;s arbitrary php functions. Then I&#8217;ll create a page at the desired <span class="caps">URL</span> and enter a line of <span class="caps">PHP</span> to route the <span class="caps">GET</span> and/or <span class="caps">POST</span> to my code, as&nbsp;appropriate.</p>
<h3>Example</h3>
<p>I&#8217;m working on an email list signup that needs to communicate with a FileMaker database. An <span class="caps">HTML</span> form POSTs to http://thefoodproject.org/mailing_list_signup, which is just a Drupal page using the <span class="caps">PHP</span> input filter (which you now need to turn on via admin settings) containing <code>&lt;?php tfp_process_list_signup($_POST); </code> The code for that function lives in sites/all/modules/tfp/tfp.module, and does the normal PHP things to pull information out of the POST <span class="amp">&amp;</span> hand that info off to the FileMaker database. Here&#8217;s a bit of&nbsp;it:</p>
<p><code>
<pre>function tfp_process_list_signup($_POST) {
  $reply = '';
  $sent_plausible_address = FALSE;
  if ($_POST['email']) {
    $supplied_email = $_POST['email'];
    if (preg_match(PLAUSIBLE_EMAIL, $supplied_email)) {
      $sent_plausible_address = TRUE;
      $reply = "Thanks! We'll add your to our mailing list.";
    } else {
      $reply = "'$supplied_email' doesn't look like an email address to me. ";
    }
    //. . .
  }
  return $reply;
}</pre>
<p></code></p>
<p>On the upside, this is quick <span class="amp">&amp;</span> easy. The downside with this approach vs. writing a module the Drupal way is that I&#8217;m losing out on Drupal&#8217;s <a href="http://api.drupal.org/api/file/developer/topics/forms_api.html">form <span class="caps">API</span></a> and its associated validation, antispoofing, etc. services. On the upside, last time I checked the linked documentation for the form <span class="caps">API</span>, it&nbsp;said</p>
<blockquote><p><strong>Warning - this page has only been partially updated for the Drupal 6.x <span class="caps">API</span><br />
</strong>Until it has been fully updated, reference this page as well:  <a href="http://drupal.org/node/144132">Drupal 5.x to 6.x FormAPI&nbsp;changes</a></p></blockquote>
<p>so I&#8217;m quite happy to not have to wade through all of that!<span id="more-257"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2009/07/28/joes-hacky-approach-to-getting-arbitrary-behavior-out-of-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTrack: new go-to program for web mirroring / archiving</title>
		<link>http://slagwerks.com/blog/index.php/2009/04/02/httrack-new-go-to-program-for-web-mirroring-archiving/</link>
		<comments>http://slagwerks.com/blog/index.php/2009/04/02/httrack-new-go-to-program-for-web-mirroring-archiving/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 19:10:44 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[httrack]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=265</guid>
		<description><![CDATA[Faced with a big site full of URLs like http://mysite.com/Internal1.asp?id=357 to mirror &#38; archive, I recently tried out a new (to me) tool, HTTrack. I&#8217;ve fiddled with wget for this sort of job in the past, but it always takes me ages of man-page reading to get my options right, and even then not everything [...]]]></description>
			<content:encoded><![CDATA[<p>Faced with a big site full of URLs like <code>http://mysite.com/Internal1.asp?id=357</code> to mirror <span class="amp">&amp;</span> archive, I recently tried out a new (to me) tool, <a href="http://www.httrack.com/">HTTrack</a>. I&#8217;ve fiddled with wget for this sort of job in the past, but it always takes me ages of man-page reading to get my options right, and even then not everything seems to work&nbsp;out.</p>
<p>This time around, for example, I&#8217;d convinced myself that <code>wget -r -N -l inf --no-remove-listing -E -k -p http://mysite.com</code> would do the trick. It mostly did, except for seemingly random pages that didn&#8217;t get all of their links&nbsp;converted.</p>
<p>HTTrack, on the other hand, did The Right Thing without any switches or arguments whatsoever. It was a bit more of a pain to get running; even though it&#8217;s in macports, right now the port is lagging behind the available versions, so I had to actually type <code>./configure</code> and <code>./make</code> myself. Well worth it for a usable&nbsp;mirror.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2009/04/02/httrack-new-go-to-program-for-web-mirroring-archiving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from mongrel to passenger</title>
		<link>http://slagwerks.com/blog/index.php/2008/12/24/migrating-from-mongrel-to-passenger/</link>
		<comments>http://slagwerks.com/blog/index.php/2008/12/24/migrating-from-mongrel-to-passenger/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 16:56:07 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=224</guid>
		<description><![CDATA[In short, I&#8217;m happy to report that passenger a.k.a. mod_rails is awesome. I see no need to fiddle with mongrel, mongrel_cluster &#38; mod_proxy for future rails&#160;apps. Miscellaneous notes from the&#160;project: My environment is now ubuntu server 8.04, on slicehost. This project finally prompted me to upgrade from 7.10, which went very smootly&#8201;&#8212;&#8201;the long-term support releases [...]]]></description>
			<content:encoded><![CDATA[<p>In short, I&#8217;m happy to report that <a href="http://www.modrails.com/">passenger</a> a.k.a. mod_rails is awesome. I see no need to fiddle with mongrel, mongrel_cluster <span class="amp">&amp;</span> mod_proxy for future rails&nbsp;apps.</p>
<p>Miscellaneous notes from the&nbsp;project:</p>
<ul>
<li>My environment is now ubuntu server 8.04, on slicehost. This project finally prompted me to upgrade from 7.10, which went very smootly&thinsp;&#8212;&thinsp;the long-term support releases of Ubuntu seem like the way to go for most server&nbsp;situations.</li>
<li>How to handle the apache config? We have some php stuff running on this server, too, so the 3rd party <a href="http://wiki.brightbox.co.uk/docs:phusion-passenger">ubuntu passenger package</a>, which wants to use the worker mpm, isn&#8217;t the hot ticket. No problem, passenger&#8217;s default gem-based install is smooth as butter.<br />
This configuration also seems to require <code>RailsAutoDetect off</code>, which had the side benefit of letting me leave an existing mongrel-using configuration alone until I had a few <span style="text-decoration: line-through;">minutes</span> hours to upgrade it to rails 2.2.2, then switch it over to git <span class="amp">&amp;</span>&nbsp;passenger.</li>
<li>Slicehost has decent docs for this, in particular <a href="http://articles.slicehost.com/2008/5/1/ubuntu-hardy-mod_rails-installation">ubuntu-hardy-mod_rails-installation</a> and <a href="http://articles.slicehost.com/2008/5/1/ubuntu-hardy-using-mod_rails-to-serve-your-application">ubuntu-hardy-using-mod_rails-to-serve-your-application</a> <span class="amp">&amp;</span> its&nbsp;comments.</li>
<li><a href="http://jimneath.org/2008/05/10/using-capistrano-with-passenger-mod_rails/">Capistrano mods for&nbsp;passenger</a></li>
<li>This was also my first git-powered rails app, which proved a little challenging to get going with cap, but has turned out really nicely. Very fast deployments.<br />
Along the way, having a plugin as a git submodule proved to be more trouble than it was with, though I&#8217;m not sure if that&#8217;d apply to my final configuration, which involves checking the project out from the same server as it&#8217;s deployed on,  <a href="http://tomcopeland.blogs.com/juniordeveloper/2008/05/capistrano-loca.html">using the :local_repository argument</a> to&nbsp;capistrano.</li>
<li>This project helped me realize that having a deployed app as a public github project is more trouble than it&#8217;s worth, what with the various configuration informations that I&#8217;d rather have under <span class="caps">SCM</span> but don&#8217;t want to&nbsp;share.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2008/12/24/migrating-from-mongrel-to-passenger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>slightly updated us_state_select plugin</title>
		<link>http://slagwerks.com/blog/index.php/2008/12/04/slightly-updated-us_state_select-plugin/</link>
		<comments>http://slagwerks.com/blog/index.php/2008/12/04/slightly-updated-us_state_select-plugin/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 19:47:08 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=211</guid>
		<description><![CDATA[I&#8217;ve used technoweenie&#8217;s handy us_state_select rails plugin in past projects. Just tried it out on a new rails 2.2 project &#38; found out that the call to InstanceTag needed to be updated, and since technoweenie&#8217;s SVN version of the plugin seems moribund, I thought I&#8217;d take 30 extra seconds to put it up on github. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/"><img class="alignright" title="github logo" src="https://github.com/images/modules/header/logo.png" alt="" width="157" height="60" /></a>I&#8217;ve used technoweenie&#8217;s handy <a href="http://svn.techno-weenie.net/projects/plugins/us_states/">us_state_select rails plugin</a> in past projects. Just tried it out on a new rails 2.2 project <span class="amp">&amp;</span> found out that the call to InstanceTag needed to be updated, and since technoweenie&#8217;s <span class="caps">SVN</span> version of the plugin seems moribund, I thought I&#8217;d take 30 extra seconds to <a href="http://github.com/jslag/us-state-select-plugin/tree/master">put it up on github</a>. Fork&nbsp;away!</p>
<p><span class="caps">P.S.</span> github is way&nbsp;cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2008/12/04/slightly-updated-us_state_select-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FileMaker error 100</title>
		<link>http://slagwerks.com/blog/index.php/2008/11/21/filemaker-error-100/</link>
		<comments>http://slagwerks.com/blog/index.php/2008/11/21/filemaker-error-100/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 11:29:54 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[FileMaker]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://slagwerks.com/blog/?p=208</guid>
		<description><![CDATA[or, Why To Use Dedicated Layouts When Connecting To FileMaker Via&#160;PHP I&#8217;d read that it&#8217;s a good practice to always use a dedicated layout for any PHP scripts you have that are talking to a FileMaker database. While I&#8217;d seen reasons of efficiency and reliability, today I learned another reason that&#8217;s true: it can eliminate [...]]]></description>
			<content:encoded><![CDATA[<p><em>or, Why To Use Dedicated Layouts When Connecting To FileMaker Via&nbsp;<span class="caps">PHP</span></em></p>
<p>I&#8217;d read that it&#8217;s a good practice to always use a dedicated layout for any <span class="caps">PHP</span> scripts you have that are talking to a FileMaker database. While I&#8217;d seen reasons of efficiency and reliability, today I learned another reason that&#8217;s true: it can eliminate otherwise hard-to-debug&nbsp;problems.</p>
<p>At first when working on my current FileMaker &lt;-&gt; <span class="caps">PHP</span> project, I was attempting to reuse an existing layout that had all the info I needed. While my permissions seemed to be fine for the data file and layout I was attempting to access, actually running the script kept resulting in &#8220;Error 100: File is missing&#8221; coming back at me as soon as I added any criteria to my search. FileMaker doesn&#8217;t bother putting anything useful in its server logs, either, so it wouldn&#8217;t have been much fun picking through the layout <span class="amp">&amp;</span> figuring what linkage(s) were to&nbsp;blame.</p>
<p>However, by simply creating a dedicated layout, everything started working as planned. A practice I&#8217;ll be following in the&nbsp;future.</p>
]]></content:encoded>
			<wfw:commentRss>http://slagwerks.com/blog/index.php/2008/11/21/filemaker-error-100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
