<?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>Jabbering Giraffe &#187; blogs</title>
	<atom:link href="http://happygiraffe.net/blog/tag/blogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://happygiraffe.net/blog</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 20:49:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Typo 4.0ish</title>
		<link>http://happygiraffe.net/blog/2006/07/30/typo-4-0ish/</link>
		<comments>http://happygiraffe.net/blog/2006/07/30/typo-4-0ish/#comments</comments>
		<pubDate>Sun, 30 Jul 2006 23:37:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/07/30/typo-4-0ish/</guid>
		<description><![CDATA[I&#8217;ve upgraded this blog to typo 4.0.1(ish). The process was slightly less harrowing than previously as I decided to switch to using svk to manage mirroring the typo trunk. Previously, I had been using subversion vendor branches, but a couple &#8230; <a href="http://happygiraffe.net/blog/2006/07/30/typo-4-0ish/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded this blog to typo 4.0.1(ish).  The process was slightly less harrowing than previously as I decided to switch to using <a href="http://svk.elixus.org/">svk</a> to manage mirroring the typo trunk.  Previously, I had been using subversion <a href="http://svnbook.red-bean.com/en/1.1/ch07s05.html">vendor branches</a>, but a couple of odd fluctuations in the typo source made that choke (files that turned into directories and vice versa).  <span class="caps">SVK</span> appears to be more intelligent.  Hurrah.</p>
<p>Anyway, typo 4 definitely appears to be shinier than the last release by a long way.  It&#8217;s got tags (which I&#8217;ve had for a while), a revamped admin interface, better support for draft articles and <a href="http://scottstuff.net/blog/articles/2006/07/22/typo-4-0-0">lots more</a>.  It also appears that it&#8217;s less inclined to spout reams of garbage into the logs, which is nice.</p>
<p>As usual, please let me know if something is acting up.  I&#8217;ll do my best to fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/07/30/typo-4-0ish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Buttons</title>
		<link>http://happygiraffe.net/blog/2006/06/04/blog-buttons/</link>
		<comments>http://happygiraffe.net/blog/2006/06/04/blog-buttons/#comments</comments>
		<pubDate>Sun, 04 Jun 2006 16:37:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/06/04/blog-buttons/</guid>
		<description><![CDATA[I&#8217;ve seen links to &#8220;add this to del.icio.us&#8221; for some time now. I never use them. It&#8217;s a complete waste of time, my links toolbar is perfectly adequate. A couple of months ago, I saw that people started adding more &#8230; <a href="http://happygiraffe.net/blog/2006/06/04/blog-buttons/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen links to &#8220;add this to del.icio.us&#8221; for some time now.  I never use them.  It&#8217;s a complete waste of time, my links toolbar is perfectly adequate.</p>
<p>A couple of months ago, I saw that people started adding more buttons to their blog posts.  &#8220;Add to del.icio.us.&#8221;  &#8220;Digg This!&#8221;  &#8220;Reddit?&#8221;</p>
<p>Again, all a complete waste of time, and precious page space.</p>
<p>Unfortunately, today I have just <a href="http://photowebs.blogspot.com/2006/03/transparent-butterfly.html">witnessed</a> this vile insanity:</p>
<div style="" class="flickrplugin"><a href="http://www.flickr.com/photos/happygiraffe/160031500"><img src="http://farm1.static.flickr.com/44/160031500_fb11a74f41_o.png" width="351" height="48" alt="Blog Buttons" title="Blog Buttons"/></a></div>
<p>I mean, really, what the hell are all those little things?  And more to the point, who cares?</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/06/04/blog-buttons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Typo Upgrade</title>
		<link>http://happygiraffe.net/blog/2006/04/17/typo-upgrade/</link>
		<comments>http://happygiraffe.net/blog/2006/04/17/typo-upgrade/#comments</comments>
		<pubDate>Mon, 17 Apr 2006 14:35:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[sitemaps]]></category>
		<category><![CDATA[svk]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/04/17/typo-upgrade/</guid>
		<description><![CDATA[I&#8217;ve finally bit the bullet and upgraded Typo to the trunk, so I can get everything up to Rails 1.1. Unfortunately, this was quite a painful process&#8230; Normally, I track bits of software I might want to hack on in &#8230; <a href="http://happygiraffe.net/blog/2006/04/17/typo-upgrade/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally bit the bullet and upgraded Typo to the trunk, so I can get everything up to Rails 1.1.  Unfortunately, this was quite a painful process&#8230;</p>
<p>Normally, I track bits of software I might want to hack on in a <a href="http://svnbook.red-bean.com/en/1.0/ch07s04.html">vendor branch</a> in subversion, and use svn_load_dirs.pl to update to new releases.  This works extremely well with wordpress at work, for instance.</p>
<p>Sadly, svn_load_dirs.pl couldn&#8217;t cope with the typo trunk, as a directory got replaced by a symlink.  Ooops.  I tried working around it, but eventually, it was easier to give up and start afresh, redoing the changes I&#8217;d already made in subversion.  I suppose it would have been a lot easier with <a href="http://svk.elixus.org/"><span class="caps">SVK</span></a>.</p>
<p>Unfortunately, a number of things haven&#8217;t caught up with the latest typo changes.  In particular, the origami theme that I was using needs some loving attention.  So it&#8217;s back to the default theme, &#8220;azure&#8221; for the moment, until I can spend some time on it.</p>
<p>Also, I couldn&#8217;t figure out how to make the google sitemaps patch work, so that&#8217;s another &#8220;gone for now&#8221; feature.</p>
<p>Please let me know if you spot anything else&#8230;</p>
<p><strong>Update</strong>: Comments now enabled.  Sorry about that.</p>
<p><strong>Update#2</strong>: I&#8217;ve now fixed the comments feed a bit.  It turns out that one of the migrations missed out on creating guids for all the comments&#8230;</p>
<pre>
  % ruby script/console production
  &gt;&gt; comments = Comment.find_all
  &gt;&gt; comments.reject { |c| c.guid }.each { |c| c.create_guid; c.save }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/04/17/typo-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Typo Times Fix</title>
		<link>http://happygiraffe.net/blog/2006/02/17/typo-times-fix/</link>
		<comments>http://happygiraffe.net/blog/2006/02/17/typo-times-fix/#comments</comments>
		<pubDate>Fri, 17 Feb 2006 13:56:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/02/17/typo-times-fix/</guid>
		<description><![CDATA[After a bit of searching, I&#8217;ve found the problems with the odd times on this weblog. It&#8217;s a problem with ActiveRecord (part of Rails) and in particular, PostgreSQLAdaptor. Basically, it computes a default value once, inside Ruby, and then caches &#8230; <a href="http://happygiraffe.net/blog/2006/02/17/typo-times-fix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a bit of searching, I&#8217;ve found the problems with the odd times on this weblog.  It&#8217;s a problem with ActiveRecord (part of Rails) and in particular, <a href="http://dev.rubyonrails.org/browser/tags/rel_1-0-0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb">PostgreSQLAdaptor</a>.</p>
<p>Basically, it computes a default value once, inside Ruby, and then caches it.  Which is a bit odd, to say the least.</p>
<p>There are a number of open tickets related to this: <a href="http://dev.rubyonrails.org/ticket/2873">2873</a>, <a href="http://dev.rubyonrails.org/ticket/2877">2877</a>, <a href="http://dev.rubyonrails.org/ticket/2257">2257</a> and probably more.  But looking at them, it seems that the problem will be fixed in Rails 1.1, which should be released &#8220;soon&#8221;.</p>
<p>Meanwhile, I&#8217;ll patch this particular instance of Typo to update the time on create.  This is what I&#8217;ve used, and it seems to be working ok.</p>
<pre>
Index: app/models/article.rb
===================================================================
--- app/models/article.rb       (revision 727)
+++ app/models/article.rb       (working copy)
@@ -94,6 +94,9 @@
     self.extended_html = HtmlEngine.transform(extended, self.text_filter)
   end

+  # Work around PostgreSQL adaptor (http://dev.rubyonrails.org/ticket/2873)
+  before_create { |art| art.created_at = Time.now }
+
   def self.time_delta(year, month = nil, day = nil)
     from = Time.mktime(year, month || 1, day || 1)

Index: app/models/comment.rb
===================================================================
--- app/models/comment.rb       (revision 727)
+++ app/models/comment.rb       (working copy)
@@ -29,4 +29,7 @@
     self.body_html = HtmlEngine.transform(body, config["comment_text_filter"], [:filter_html])
   end

+  # Work around PostgreSQL adaptor (http://dev.rubyonrails.org/ticket/2873)
+  before_create { |art| art.created_at = Time.now }
+
 end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/02/17/typo-times-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Locomotive / Typo bug</title>
		<link>http://happygiraffe.net/blog/2006/02/12/locomotive-typo-bug/</link>
		<comments>http://happygiraffe.net/blog/2006/02/12/locomotive-typo-bug/#comments</comments>
		<pubDate>Sun, 12 Feb 2006 11:09:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/02/12/locomotive-typo-bug/</guid>
		<description><![CDATA[I&#8217;ve been trying to get typo working on my mac, using the very shiny Locomotive. Sadly, I kept getting display errors in my sidebar. After spending 3 hours looking at it last night, I&#8217;m now pretty sure that it&#8217;s a &#8230; <a href="http://happygiraffe.net/blog/2006/02/12/locomotive-typo-bug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to get <a href="http://www.typosphere.org/trac/">typo</a> working on my mac, using the very shiny <a href="http://locomotive.raaum.org/home/show/HomePage">Locomotive</a>.  Sadly, I kept getting display errors in my sidebar.  After spending 3 hours looking at it last night, I&#8217;m now pretty sure that it&#8217;s a bug in <code>YAML::load</code>, which is called from inside <code>ActiveRecord::Base#object_from_yaml</code>.  It works fine on my FreeBSD server running ruby 1.8.4.  But under Locomotive (ruby 1.8.2), Instead of getting back a hash, I get some internal <span class="caps">YAML</span> class.  Hmmm.</p>
<p>Thankfully, a simple patch is all that&#8217;s required to get things working properly.</p>
<pre>
Index: app/models/sidebar.rb
===================================================================
--- app/models/sidebar.rb       (revision 724)
+++ app/models/sidebar.rb       (working copy)
@@ -27,7 +27,10 @@
   end

   def active_config
-    self[:active_config]||{}
+    ac = self[:active_config]||{}
+    # XXX Work around a bug in some versions of Ruby / YAML.
+    ac = ac.value if ac.respond_to? "value"
+    ac
   end

   def html_id
</pre>
<p>I&#8217;m <em>so</em> glad that I imported typo into subversion on a vendor branch.  It makes this sort of thing a heck of a lot easier.</p>
<p>I should go and file a bug in the typo trac.  But I have to admit to not being sure that it&#8217;s up and running properly yet&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/02/12/locomotive-typo-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Makeovers</title>
		<link>http://happygiraffe.net/blog/2006/02/06/makeovers/</link>
		<comments>http://happygiraffe.net/blog/2006/02/06/makeovers/#comments</comments>
		<pubDate>Mon, 06 Feb 2006 20:01:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/02/06/makeovers/</guid>
		<description><![CDATA[I&#8217;ve just switched the theme on this blog to Origami, winner of the typo theme contest. Whilst I think it looks good, it feels a bit slow. And I really dislike the Flash technique for replacing the texts of the &#8230; <a href="http://happygiraffe.net/blog/2006/02/06/makeovers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just switched the theme on this blog to <a href="http://typo.leevigraham.com/">Origami</a>, winner of the typo theme contest.  Whilst I think it looks good, it feels a bit slow.  And I really dislike the Flash technique for replacing the texts of the headlines.  It means you can&#8217;t select the text properly any more.  So the theme may change again shortly.  Given my level of artistic inability, it&#8217;s won&#8217;t be an original creation though.</p>
<p>Meanwhile, Jeremy Keith has given his blog engine a makeover&#8212;<a href="http://adactio.com/journal/1077">Everything old is new again</a>.  It looks exactly the same as before, but now comes with added searchy goodness.  Of course, he used MySQL instead of a <a href="http://www.postgresql.org/">real database</a>, but we can forgive small foibles.  <code> <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </code></p>
<p>My only minor critique is that a permanent redirect should be set up on the <span class="caps">RSS</span> feed to direct clients towards the new <span class="caps">URL</span>.  Something like this in <code>.htaccess</code> should do the trick.</p>
<pre>
  Redirect permanent /journal/journal.rss  http://adactio.com/journal/rss
</pre>
<p>I never understood why Apache required you to specify an absolute <span class="caps">URL</span> for the destination there.  It should be able to work it out if you&#8217;ve left the hostname and scheme off&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/02/06/makeovers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Typo TimeZones</title>
		<link>http://happygiraffe.net/blog/2006/01/24/typo-timezones/</link>
		<comments>http://happygiraffe.net/blog/2006/01/24/typo-timezones/#comments</comments>
		<pubDate>Tue, 24 Jan 2006 00:09:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/01/24/typo-timezones/</guid>
		<description><![CDATA[One minor annoyance that I&#8217;ve noticed since I started using typo is that the times are out by about 8 hours. For instance, this post probably says &#8220;created 8 hours ago&#8221;, even though I created it only a few minutes &#8230; <a href="http://happygiraffe.net/blog/2006/01/24/typo-timezones/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One minor annoyance that I&#8217;ve noticed since I started using <a href="http://typo.leetsoft.com/">typo</a> is that the times are out by about 8 hours.  For instance, this post probably says &#8220;created 8 hours ago&#8221;, even though I created it only a few minutes ago.  Looking at the previous post in the database, which has never been edited:</p>
<pre>
created_at     | 2006-01-24 00:29:00
updated_at     | 2006-01-24 08:52:04
</pre>
<p>The <em>updated_at</em> field is correct.</p>
<p>So now I have to figure out which of the many components is defaulting to Eastern Standard Time.  Could it be Ruby?  Rails?  PostgreSQL?  Apache? JavaScript?  Safari?  Who knows, I have to go to work now&#8230;</p>
<p><strong>Update:</strong> It turns out that <a href="http://wiki.rubyonrails.com/rails/pages/HowtoSetDefaultTimeZone">HowtoSetDefaultTimeZone</a> has the answer.  Put this into <code>config/environment.rb</code>:</p>
<pre>
ActiveRecord::Base.default_timezone = :utc
</pre>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/01/24/typo-timezones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moved to Typo</title>
		<link>http://happygiraffe.net/blog/2006/01/10/moved-to-typo/</link>
		<comments>http://happygiraffe.net/blog/2006/01/10/moved-to-typo/#comments</comments>
		<pubDate>Tue, 10 Jan 2006 09:22:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2006/01/10/moved-to-typo/</guid>
		<description><![CDATA[After much delay, I&#8217;ve finally moved this blog to typo. It&#8217;s a good example of running rails in &#8220;production&#8221; mode. Now I just need to find a good blog editor client. It&#8217;d be nice if it supported Textile, which I&#8217;ve &#8230; <a href="http://happygiraffe.net/blog/2006/01/10/moved-to-typo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After much delay, I&#8217;ve <em>finally</em> moved this blog to <a href="http://typo.leetsoft.com/">typo</a>. It&#8217;s a good example of running rails in &#8220;production&#8221; mode.</p>
<p>Now I just need to find a good blog editor client.  It&#8217;d be nice if it supported <a href="http://textism.com/tools/textile/">Textile</a>, which I&#8217;ve recently been converted to.</p>
<p>Oh, and it&#8217;d be really cute if I could figure out how to get tags like <a href="http://bofh.org.uk/">pdcawley</a>.  I suspect that I need to run the trunk of typo to get that though.  Or maybe there&#8217;s a plugin somewhere&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2006/01/10/moved-to-typo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FastCGI</title>
		<link>http://happygiraffe.net/blog/2005/12/21/fastcgi/</link>
		<comments>http://happygiraffe.net/blog/2005/12/21/fastcgi/#comments</comments>
		<pubDate>Wed, 21 Dec 2005 09:03:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2005/12/21/fastcgi/</guid>
		<description><![CDATA[I spent a little while yesterday attempting to work out how to get FastCGI installed. Unfortunately, because I&#8217;m using Apache 2.2, this wasn&#8217;t straightforward. In fact, I&#8217;d pretty much given up. Later on, I found this patch on the fastcgi-devel &#8230; <a href="http://happygiraffe.net/blog/2005/12/21/fastcgi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spent a little while yesterday attempting to work out how to get FastCGI installed.  Unfortunately, because I&#8217;m using Apache 2.2, this wasn&#8217;t straightforward.  In fact, I&#8217;d pretty much given up.  Later on, I found <a href="http://fastcgi.com/archives/fastcgi-developers/2005-December/004060.html">this patch</a> on the fastcgi-devel list, which purports to work (and looks like it will, given my experiences yesterday).</p>
<p>All this is just so that I can sensibly run <a href="http://typo.leetsoft.com/">Typo</a>, a <a href="http://rubyonrails.org/">rails</a> app.  There are other ways to do it, but they&#8217;re less preferrable.  I could use plain <span class="caps">CGI</span>, but that&#8217;s dog-slow.  I could set up <a href="http://www.lighttpd.net/">lighttpd</a>, but I&#8217;d rather not, seeing as I&#8217;m already running Apache for so many other services.  I suppose that I could run the standalone <code>script/server</code> tool and use mod_proxy to connect to it.  But I that means that I then have to ensure that the process stays up the whole time and gets started correctly.  Overall, FastCGI seems like the best choice.</p>
<p>So, today I&#8217;ll have a go at plumbing that patch into the FreeBSD port.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2005/12/21/fastcgi/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Blogging Software</title>
		<link>http://happygiraffe.net/blog/2005/12/19/blogging-software/</link>
		<comments>http://happygiraffe.net/blog/2005/12/19/blogging-software/#comments</comments>
		<pubDate>Mon, 19 Dec 2005 22:46:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/2005/12/19/blogging-software/</guid>
		<description><![CDATA[It started innocently enough, but as usual turned into yak shaving rather quickly. I wanted to try out some graphical editors for posting to my blog. Sounds simple enough. Except that a while back, I chose wordpress-pg. Its a version &#8230; <a href="http://happygiraffe.net/blog/2005/12/19/blogging-software/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It started innocently enough, but as usual turned into yak shaving rather quickly.  I wanted to try out some graphical editors for posting to my blog.  Sounds simple enough.  Except that a while back, I chose <a href="http://wordpress-pg.sourceforge.net/">wordpress-pg</a>.  Its a version of <a href="http://www.wordpress.org/">wordpress</a>, but it talks to PostgreSQL instead.  Except that for some reason, my copy doesn&#8217;t have the xmlrpc.php file needed.  So heading over to the wordpress-pg site, I am greeted by this lovely message.</p>
<blockquote><p><span class="caps">WARNING</span>! This version is probably subject to flaws in xmlrpc handling. Delete xmlrpc.php if present in your install.  This flaw can allows outside attackers to execute arbitrary commands as the user your web server runs as.</p></blockquote>
<p>Oh dear.  So I won&#8217;t be doing that then.  But part of the problem is that it&#8217;s already fixed in wordpress 1.5 (MySQL edition).  Sadly, wordpress-pg is a very inactive project.  I know, it&#8217;s open source, fix it yourself.  But right now, I more or less just want something to work.  And I don&#8217;t want to delve into scary php if I can help it (I know, that&#8217;s rich coming from a Perl programmer).  So what are the choices?</p>
<p>I could look at getting MySQL installed and moving over to wordpress proper.  Well, I&#8217;ve finally gotten around to doing some MySQL at work and I now understand it a little bit, even if I don&#8217;t like it that much.  But I still have  to get the actual database ported from PostgreSQL to MySQL somehow, which seems jolly arduous.</p>
<p>The alternative is to take a look at <a href="http://typo.leetsoft.com/">Typo</a>, a Rails powered blogging engine.  The selling points are that it appears to be actively maintained, it&#8217;s written in Rails (which I wish to play with) and also that it has a wordpress import script.  So I&#8217;ve just spent an hour attempting to convert my wordpress-pg install over to typo.  And I have to say that it works pretty well.  Here&#8217;s what I found.</p>
<p>Firstly, I followed the basic install to get typo up and running.  I saw Piers <a href="http://www.bofh.org.uk/articles/2005/12/09/out-of-box-experience">complaining</a> about it, but it&#8217;s reasonable for me.  But I&#8217;ve used rails before, so I&#8217;m probably not the target market.  Anyway, I got to the admin screens and set up a test account pretty quickly.  I then ran the <a href="http://typo.leetsoft.com/trac/browser/trunk/db/converters/wordpress.rb">import script</a> giving it my old wordpress database name.  Needless to say, it didn&#8217;t work first time.  I had to make these changes to the script:</p>
<ol>
<li>Get rid of all backquotes, that&#8217;s some weird MySQLism.</li>
<li>I had to change all <code>entry['ID']</code> to <code>entry['id']</code>.  PostgreSQL downcases things.</li>
<li>I had to rework the trackback support slightly.  Because wordpress-pg is based on wordpress 1.2, trackbacks are stored as a comment that starts with <code>&amp;lt;trackback /&amp;gt;</code> at the beginning.  So I had to change <code>comment_type = 'trackback'</code> into <code>comment_content LIKE '&amp;lt;trackback /&amp;gt;%'</code></li>
<li>The import script runs in the dev environment by default, but I had been testing in the production environment.  This meant I had no users set up in my dev environment.  Consequently, I had to patch up the relationships between the users and the articles afterwards (<code>update articles set user_id=1;</code>).  Actually, looking at the script, it doesn&#8217;t seem to make those links anyway&#8230;</li>
</ol>
<p>The biggest problem was actually getting the script to access the original data.  The script assumes that you can do the MySQLish thing of accessing another database by specifying <em>dbname.table</em>.  This doesn&#8217;t work in PostgreSQL.  But, you can take advantage of the fact that PostgreSQL does support schemas, so instead, you can create a schema called wordpress and load a dump of the main database into there.  I had to make a few edits to the dumpfile before loading it in though.</p>
<ol>
<li>Get rid of the stuff about plpgsql at the top.  I don&#8217;t use it.</li>
<li>Add <code>CREATE SCHEMA wordpress</code> and <code>SET search_path = wordpress, public, pg_catalog</code>.</li>
<li>Comment out all the <code>ALTER foo SET OWNER TO wordpress</code> lines.  You have to import it as the typo user and don&#8217;t want that changing behind your back.</li>
</ol>
<p>After the import you can just run <code>DROP SCHEMA wordpress CASCADE</code> to clean up.</p>
<p>After that, I now have a working blog with all my old content.  Hurrah!  Not simple, but not too difficult either.</p>
<p>Now before I get this main blog converted over, I just need to work out how to run FastCGI scripts from Apache, something I haven&#8217;t done before.  And then I&#8217;ll be away, and I can uninstall wordpress-pg.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2005/12/19/blogging-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

