<?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>SickBiscuit</title>
	<atom:link href="http://sickbiscuit.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sickbiscuit.com/blog</link>
	<description>The personal blog of Steven Wilkin</description>
	<lastBuildDate>Sun, 01 Aug 2010 21:51:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Is it raining in Belfast? Redux</title>
		<link>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/</link>
		<comments>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 21:51:30 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=493</guid>
		<description><![CDATA[Last year I created a nano-app which attempted to answer the question, is it raining in Belfast?
I was never completely pleased with it but the objective was to get something done and get it done fast, which was achieved.
This weekend I&#8217;ve been tinkering with another project and hit a bit of a stumbling block getting [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I created a <a href="/blog/2009/01/26/nano-apps/">nano-app</a> which attempted to answer the question, <a href="http://isitraininginbelfast.com/">is it raining in Belfast?</a></p>
<p>I was never completely pleased with it but the objective was to get something done and get it done fast, which was achieved.</p>
<p>This weekend I&#8217;ve been tinkering with another project and hit a bit of a stumbling block getting various pieces of software to co-exist.</p>
<p>I decided a break from the problem would be beneficial but I still wanted to have some sense of achievement from the weekend and redeveloping this app seemed a good idea.</p>
<p>Some quick research showed that the <a href="http://weather.yahoo.com/northern-ireland/belfast/belfast-44544">Yahoo! weather report for Belfast</a> could provide the necessary information so I hacked up an RSS processing script and converted the old PHP frontend to a quick and simple Sinatra app.</p>
<p>The app now operates as originally envisioned: it answers the question with a straightforward yes or no. Hopefully it will be accurate as well <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The app is hosted at <a href="http://isitraininginbelfast.com">isitraininginbelfast.com</a> and the code is on <a href="http://github.com/stevenwilkin/isitraininginbelfast.com">GitHub</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/08/01/is-it-raining-in-belfast-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An experimental lifestream app</title>
		<link>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/</link>
		<comments>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 21:48:49 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=480</guid>
		<description><![CDATA[Some time ago DW and myself had an enthusiastic conversation about logging various aspects of our electronic lives: emails sent and received, RSS feeds read, incoming and outgoing phone calls, the list goes on.
At that time I&#8217;d already started tinkering with apps to track my efforts in the gym and changes in my bodyweight, I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago <a href="http://twitter.com/davidbelfast">DW</a> and myself had an enthusiastic conversation about logging various aspects of our electronic lives: emails sent and received, RSS feeds read, incoming and outgoing phone calls, the list goes on.</p>
<p>At that time I&#8217;d already started tinkering with apps to track my efforts in the gym and changes in my bodyweight, I&#8217;ve used notebooks for this for years and thought it&#8217;d be interesting to have this information in electronic form.</p>
<h3>Sharpening skills</h3>
<p>While I was on the bench waiting for my current contract to start I was sharpening my skills through developing some small projects with the technologies I&#8217;d be using. One of those technologies was <a href="http://www.sqlite.org/">SQLite</a> which I knew of but didn&#8217;t have much hands on experience with.</p>
<p>I started by playing with the <a href="http://github.com/luislavena/sqlite3-ruby">Ruby interface to SQLite</a>, using it to insert and retrieve data from a simple database. I&#8217;ve since grown to love the simplicity and flexibility of SQLite and will no doubt use it again in the future.</p>
<p>I needed a practical application and thought back to my intentions to track my online activities. Now was as good a time as any to to tick this off the list of potential projects.</p>
<p>When I&#8217;d glued together some Ruby to parse the RSS feed of this blog I knew the basics were in place so I started on a simple Sinatra app to act as a web interface.</p>
<h3>Stumbling block</h3>
<p>I scoured the web for design inspiration and got a good start to the visual aspect of this project but couldn&#8217;t make my mind up over a few subtle items. Next thing my agent called: the purchase order finally came through and my contract was to start the next day.</p>
<p>The demands of adjusting to a new work environment meant I felt little motivation to work on anything on my own time and I became more interested in funneling my excess income into the stockmarket. The project joined those other half-finished unfortunates.</p>
<h3>A fresh jolt of motivation</h3>
<p>After a couple of months on the contract I started feeling a renewed motivation to get something of my own out there. I couldn&#8217;t  bare the thought of starting another project to not finish it so I set out to to whip this latest app into shape and release it as soon as possible and no later.</p>
<p>I dug through the uncommited changes in my working copy and made some arbitrary decisions which resulted in a design I felt was &#8220;good enough.&#8221; I modified my RSS parsing script to feed into SQLite and extended it to process my <a href="http://delicious.com/stevebiscuit">Delicious bookmarks</a> and <a href="http://www.last.fm/user/ahSyd">loved tracks on Last.fm</a>. I created pagination links, wrote a README and sorted out the hosting and cron jobs. Bingo.</p>
<h3>Check it out</h3>
<p>My original intention was to track much more of my online life and there&#8217;s some details I&#8217;d like to change but I love releasing code and I&#8217;m pleased with this first iteration.</p>
<p>The app is hosted at <a href="http://life.stevenwilkin.com">life.stevenwilkin.com</a> and the code is available on <a href="http://github.com/stevenwilkin/life.stevenwilkin.com">GitHub</a>, I hope you like it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/06/27/an-experimental-lifestream-app/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rails 3 Hello World</title>
		<link>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/</link>
		<comments>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 21:51:06 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=472</guid>
		<description><![CDATA[The past while I&#8217;ve been busy providing technical consultancy to BT and haven&#8217;t had much drive to work on anything on my own time. The itch has returned the past couple of weeks though so I thought I&#8217;d see what I&#8217;ve been missing in the Rails world and in what better way than getting a [...]]]></description>
			<content:encoded><![CDATA[<p>The past while I&#8217;ve been busy providing technical consultancy to <a href="http://bt.com">BT</a> and haven&#8217;t had much drive to work on anything on my own time. The itch has returned the past couple of weeks though so I thought I&#8217;d see what I&#8217;ve been missing in the Rails world and in what better way than getting a basic Rails 3 app up and running.</p>
<p>My environment was already setup for Rails 2.3.* and <a href="http://yehudakatz.com/2009/12/31/spinning-up-a-new-rails-app/">Yehuda Katz&#8217; post</a> served as a guide to get me up to speed with the beta loveliness.</p>
<h3>RubyGems 1.3.7 along with Thor and Bundler gems required</h3>
<p>My installed version of RubyGems was a couple of point releases behind, so I updated that and installed the necessary gems</p>
<pre>sudo gem update --system
sudo gem install thor bundler</pre>
<h3>Clone Edge Rails from GitHub</h3>
<pre>mkdir -p ~/code/rails/rails
git clone http://github.com/rails/rails.git ~/code/rails/rails</pre>
<h3>Generate a fresh app and install dependencies with Bundler</h3>
<pre>mkdir ~/code/rails/rails-3-demo
cd !$
ruby ~/code/rails/rails/bin/rails new . --dev
bundle install</pre>
<h3>Launch the web server</h3>
<pre>./script/rails server</pre>
<p>Browse to <a href="http://0.0.0.0:3000">http://0.0.0.0:3000</a> and you&#8217;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/06/08/rails-3-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home time revisited &#8211; redeveloping a CakePHP application with Sinatra</title>
		<link>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/</link>
		<comments>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:26:50 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=466</guid>
		<description><![CDATA[I&#8217;ve just released the latest iteration of hometi.me, a little nano-app I&#8217;ve mentioned before.
Deliberate Practice
It&#8217;s only a trivial app but I&#8217;ve a bit of free time before the start of a contract so I thought it would be good practice to redevelop it, a task I&#8217;d been ignoring for a long time.
Goodbye CakePHP, Hello Sinatra
The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released the latest iteration of <a href="http://hometi.me">hometi.me</a>, a little <a href="http://sickbiscuit.com/blog/2009/01/26/nano-apps/">nano-app</a> I&#8217;ve <a href="http://sickbiscuit.com/blog/2008/08/12/is-it-home-time-yet/">mentioned</a> <a href="http://sickbiscuit.com/blog/2008/09/09/home-time-is-a-little-closer/">before</a>.</p>
<h3>Deliberate Practice</h3>
<p>It&#8217;s only a trivial app but I&#8217;ve a bit of free time before the start of a contract so I thought it would be good practice to redevelop it, a task I&#8217;d been ignoring for a long time.</p>
<h3>Goodbye CakePHP, Hello Sinatra</h3>
<p>The original app was put together quickly with <a href="http://cakephp.org/">CakePHP</a>, a PHP-based framework I&#8217;ve used since my first paid programming gig. Since then though my interest and proficiency with Ruby and it&#8217;s frameworks has come more to the forefront. By choosing <a href="http://sinatrarb.com">Sinatra</a>, the app was given access to the rich Ruby ecosystem, including the joyful <a href="http://haml-lang.com/">HAML</a> and <a href="http://sass-lang.com/">SASS</a>.</p>
<p>The interesting aspect of this release is that all the logic is now implemented on the client-side using <a href="http://jquery.com/">Javascript</a>. Originally the countdown was calculated on the server-side and passed to the client with an AJAX call, but the server is more-or-less just hosting the markup, stylesheets and Javascript files required to get the app up and running in the browser.</p>
<h3>Heroku</h3>
<p>As this app doesn&#8217;t make use of a database or Cron jobs etc I thought I&#8217;d take the opportunity to move it from my own infrastructure and onto the awesomeness of <a href="http://heroku.com/">Heroku</a> whose free offering is a lot more performant than my little <a href="http://vpslink.com/?ref=CM6S0S">VPS</a>. Heroku is a service I&#8217;ve been playing with for a while now and it makes deploying a Ruby web app into production a breeze, assuming your project can work within it&#8217;s limitations.</p>
<p>All that&#8217;s left now is for the DNS changes to propagate. I&#8217;d like to show a bit more love to this app in the future, the controls to specify your own home time could be more intuitive for instance, but for now I&#8217;m content with the improvements I&#8217;ve made to it and it&#8217;s new home.</p>
<p>Is it passed your home time yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/03/24/home-time-revisited-redeveloping-a-cakephp-application-with-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>node-shoutbox &#8211; a simple node.js demo</title>
		<link>http://sickbiscuit.com/blog/2010/03/19/node-shoutbox-a-simple-node-js-demo/</link>
		<comments>http://sickbiscuit.com/blog/2010/03/19/node-shoutbox-a-simple-node-js-demo/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 16:36:34 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=454</guid>
		<description><![CDATA[Last month, at the inaugural Super Happy Dev Castle, my buddy Dave Rice told me about a project he was working on involving node.js, an event-based I/O system for Javascript.
Javascript outside of the browser?
This concept seemed almost ridiculous to me at that time but I thought it was worth a look and cobbled together a [...]]]></description>
			<content:encoded><![CDATA[<p>Last month, at the inaugural <a href="http://www.superhappydevcastle.org/">Super Happy Dev Castle</a>, my buddy <a href="http://twitter.com/davidjrice">Dave Rice</a> told me about a project he was working on involving <a href="http://github.com/ry/node">node.js</a>, an event-based I/O system for Javascript.</p>
<h3>Javascript outside of the browser?</h3>
<p>This concept seemed almost ridiculous to me at that time but I thought it was worth a look and cobbled together a quick &#8220;Hello World.&#8221; I was greatly amused by creating a command-line app with Javascript but did nothing more about it until last week. I&#8217;m currently starting out as an independant contractor &#038; have a bit of spare bandwidth so I thought I&#8217;d put together something a bit meatier in order to learn more about this system &#038; to also sharpen up my Javascript skills.</p>
<p>Dave had shown me <a href="http://github.com/felixge/node-comment">node-comment</a> and I also studied <a href="http://github.com/ry/node_chat">node_chat</a>. From there I had just enough reference material to understand the mechanics of <a href="http://en.wikipedia.org/wiki/Push_technology#Long_polling">long-polling</a> and to start piecing together a simple real-time commenting system.</p>
<h3>What is node?</h3>
<p>In and of itself, node is not a web development stack. It provides an I/O platform of which HTTP handling is a part. People are building blogging and wiki engines, FTP servers and command-line tools with this thing, anything I/O based is possible and thankfully micro-frameworks like <a href="http://github.com/jed/fab/">(fab)</a> can ease the pain of creating web apps.</p>
<p>Node is still very young software, which I have felt the pain of. To serve up static content I wanted to use <a href="http://github.com/felixge/node-paperboy">paperboy</a> as it can be used as middleware within (fab), however mere days after the last update to the project the API it was relying upon in node changed fundamentally. Despite being new to node development I was able to <a href="http://github.com/stevenwilkin/node-paperboy">patch paperboy to work with node v0.1.31</a> and get on with my actual project. Another sticking point was the inability of (fab) to handle POSTed form variables, this functionality is planned for it&#8217;s next release though.</p>
<h3>Fun</h3>
<p>Ultimately, my app is of little practical use: it doesn&#8217;t make use of persistance or moderation and node&#8217;s suitability for the production environment may itself be questionable at this time, but it was quite a fun experience. From something I more-or-less despised a decade ago I&#8217;ve come to develop a real affection for coding Javascript over the past few years.</p>
<p>When I had the basics of the app laid-down I eagerly awaiting the moment when I could have it open in two browser windows and enter a comment into one and see it appear in the second. That moment came and it brought a smile to my face. I suggest you give it a go <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Get the code</h3>
<p>As a wise man once said, code speaks louder than words, so please be my guest and <a href="http://github.com/stevenwilkin/node-shoutbox">clone my demo on GitHub<a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/03/19/node-shoutbox-a-simple-node-js-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A dummy datasource for CakePHP</title>
		<link>http://sickbiscuit.com/blog/2010/02/14/a-dummy-datasource-for-cakephp/</link>
		<comments>http://sickbiscuit.com/blog/2010/02/14/a-dummy-datasource-for-cakephp/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 18:10:54 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=443</guid>
		<description><![CDATA[I was recently developing a project at work which at the beginning didn&#8217;t need a database. However, Cake was still testing the database connection and issuing a warning as a result when it couldn&#8217;t connect. My solution was to create a dummy datasource which silenced the warnings and allowed me to get on with the [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently developing a project at <a href="http://rehabstudio.com/">work</a> which at the beginning didn&#8217;t need a database. However, <a href="http://cakephp.org">Cake</a> was still testing the database connection and issuing a warning as a result when it couldn&#8217;t connect. My solution was to create a dummy datasource which silenced the warnings and allowed me to get on with the rest of development in relative peace.</p>
<p>The scope of the project changed and a database was required. The dummy datasource had to go so I thought I&#8217;d share it here before it was thrown to the winds.</p>
<p>Here&#8217;s the datasource, which belongs in <code>models/datasources/dbo/dbo_dummy.php</code>:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> DboDummy <span style="color: #000000; font-weight: bold;">extends</span> DboSource <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> connect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connected</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> disconnect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connected</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
<p>To use the datasource use the following in your <code>config/database.php</code>:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> DATABASE_CONFIG <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000033;">$default</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
                <span style="color: #0000ff;">'driver'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dummy'</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'login'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
                <span style="color: #0000ff;">'database'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/02/14/a-dummy-datasource-for-cakephp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating a WordPress database between domains</title>
		<link>http://sickbiscuit.com/blog/2010/01/05/migrating-a-wordpress-database-between-domains/</link>
		<comments>http://sickbiscuit.com/blog/2010/01/05/migrating-a-wordpress-database-between-domains/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 12:20:59 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=433</guid>
		<description><![CDATA[Occassionally I find myself developing a WordPress theme which will then require moving from development into production or otherwise having to move a blog between domains.
Apart from the transfer of the files, including plugins, theme and core WordPress installation, there is only 1 slightly gotcha: the database. I&#8217;ve never been quite sure why but WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>Occassionally I find myself developing a <a href="http://wordpress.org/">WordPress</a> theme which will then require moving from development into production or otherwise having to move a blog between domains.</p>
<p>Apart from the transfer of the files, including plugins, theme and core WordPress installation, there is only 1 slightly gotcha: the database. I&#8217;ve never been quite sure why but WordPress stores the URL of the blog in it&#8217;s database, not once, but twice. For the blog to be migrated the database needs a slight tweak.</p>
<p>As always, create a backup before doing anything. This can be done with phpMyAdmin or using the <em>mysqldump</em> command like so:<br />
<code><br />
$ mysqldump -uUSER -pPASSWORD DATABASE &gt; /path/to/backup.sql<br />
</code></p>
<p>If the database is to be hosted on a different machine you can then import this dump using using which ever method you&#8217;re comfortable with. Finally, run the following query on the database, subsituting your own domain name:</p>
<pre>UPDATE
	wp_options
SET
	option_value = 'http://DOMAIN.TLD'
WHERE
	option_name IN ('siteurl', 'home')<SEMI></pre>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/01/05/migrating-a-wordpress-database-between-domains/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL database backup with remote storage</title>
		<link>http://sickbiscuit.com/blog/2010/01/04/mysql-database-backup-with-remote-storage/</link>
		<comments>http://sickbiscuit.com/blog/2010/01/04/mysql-database-backup-with-remote-storage/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:37:28 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=418</guid>
		<description><![CDATA[Prevent a disaster
After reading Jeff Atwood&#8217;s backup failure last month I decided to finally get around to doing something I&#8217;d been intending to do &#8220;one of these days&#8221; but had in actual fact been putting off for years.
Here&#8217;s the steps I took to ensure the databases on my webserver were backed up every night and [...]]]></description>
			<content:encoded><![CDATA[<h3>Prevent a disaster</h3>
<p>After reading <a href="http://www.codinghorror.com/blog/archives/001315.html">Jeff Atwood&#8217;s backup failure</a> last month I decided to finally get around to doing something I&#8217;d been intending to do &#8220;one of these days&#8221; but had in actual fact been putting off for <em>years</em>.</p>
<p>Here&#8217;s the steps I took to ensure the databases on my webserver were backed up every night and copies of the dumps stored remotely.</p>
<h3>On the remote storage machine</h3>
<p>Generate an ssh key pair with and empty password and put the public key on the remote server. This will give our script access to the server without requiring you to enter a password each time:<br />
<code><br />
$ ssh-keygen -t rsa -f /home/steve/code/db_backup/id_rsa<br />
$ scp /home/steve/code/db_backup/id_rsa.pub REMOTEHOST:<br />
</code></p>
<p>This script will fetch all the backups, logging in as the <em>rsync</em> user and using the private key just generated. It&#8217;s located at <em>/home/steve/code/db_backup/sync_backups.sh</em>:</p>
<pre class="bash"><span style="color: #666666; font-style: italic;">#!/usr/bin/env bash</span>
rsync -e <span style="color: #ff0000;">&quot;ssh -l rsync -i /home/steve/code/db_backup/id_rsa&quot;</span> -avz REMOTEHOST:mysql<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>primary<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span></pre>
<p>Have this happen automatically daily at 12:20am:<br />
<code><br />
$ crontab -l<br />
# m h  dom mon dow   command<br />
20	0	*	*	*	/home/steve/code/db_backup/sync_backups.sh<br />
$<br />
</code></p>
<h3>On the machine to be backed up</h3>
<p>Create a new user and allow ssh access with the previously generated key:<br />
<code><br />
# adduser rsync<br />
# mkdir ~rsync/.ssh<br />
# mv ~steve/id_rsa.pub ~rsync/.ssh/authorized_keys<br />
# chown rsync:rsync ~rsync/.ssh/authorized_keys<br />
# chmod 400 ~rsync/.ssh/authorized_keys<br />
</code></p>
<p>This script will dump all available databases and is located at <em>/root/bin/backup_databases.sh</em>:</p>
<pre class="bash"><span style="color: #666666; font-style: italic;">#!/usr/bin/env bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># dump all available databases</span>
<span style="color: #666666; font-style: italic;"># SJW</span>
&nbsp;
<span style="color: #007800;">AUTH=</span><span style="color: #ff0000;">'-uroot -pROOTPASSWORD'</span>
<span style="color: #007800;">DBS=</span><span style="color: #000000; font-weight: bold;">`</span>mysql <span style="color: #007800;">$AUTH</span> --skip-column-names -e <span style="color: #ff0000;">'SHOW DATABASES;'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">BACKUPS=</span><span style="color: #ff0000;">'/home/rsync/mysql/'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> DB <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$DBS</span>
<span style="color: #000000; font-weight: bold;">do</span>
	mysqldump <span style="color: #007800;">$AUTH</span> <span style="color: #007800;">$DB</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$BACKUPS</span><span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">`</span>_<span style="color: #007800;">$DB</span>.sql
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># delete backups older than 5 days</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$BACKUPS</span> -mtime <span style="color: #000000;">+5</span> -type f <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;rm &quot;$1}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sh</span></pre>
<p>Have the script run nightly at 12:10am via cron:<br />
<code><br />
# crontab -l<br />
# m h  dom mon dow   command<br />
10  0 * * * /root/bin/backup_databases.sh<br />
#<br />
</code></p>
<h3>Closing thoughts</h3>
<p>This approach is realtively straight forward, everything happens automatically and it could easily be extended to cover mailboxes, source code repositories, uploaded content etc. However, for mission-critical databases <a href="http://dev.mysql.com/doc/refman/5.0/en/replication.html">master-slave replication</a> may be more appropriate. For further reading you may enjoy <a href="http://jwz.livejournal.com/801607.html">JWZ&#8217;s thoughts on backups</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2010/01/04/mysql-database-backup-with-remote-storage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>6 months of Rehab</title>
		<link>http://sickbiscuit.com/blog/2009/12/13/6-months-of-rehab/</link>
		<comments>http://sickbiscuit.com/blog/2009/12/13/6-months-of-rehab/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 02:18:53 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Clerical]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=404</guid>
		<description><![CDATA[I find it hard to believe, but I crossed the 6 month milestone at Rehab this week.
The time has went in quickly, with a fast-pace and quick turnaround times being the norm. The vibe in the office has been great, with a decent soundsystem pumping out dance music all day and my producer Gary, aka [...]]]></description>
			<content:encoded><![CDATA[<p>I find it hard to believe, but I crossed the <a href="/blog/2009/06/16/developer-rehab/">6 month milestone</a> at <a href="http://rehabstudio.com/">Rehab</a> this week.</p>
<p>The time has went in quickly, with a fast-pace and quick turnaround times being the norm. The vibe in the office has been great, with a decent soundsystem pumping out dance music all day and my producer Gary, aka <a href="http://djgaryquinn.com/">DJ Gary Quinn</a>, dropping in a few choice chunes.</p>
<p>The guys here have a real passion for the web and enjoy a good laugh, for instance, this week we had a challenge to wear a different hat each day. Here&#8217;s Iain and Jurgen in their full cowboy glory:</p>
<p><img src="/blog/wp-content/uploads/2009/12/rehab_cowboys_iain_and_jurgen-400x300l.jpg" alt="" title="Rehab Cowboys Iain and Jurgen" width="400" height="300" class="alignnone size-full wp-image-407" /></p>
<p>I spend most of my days wrangling <a href="http://cakephp.org">CakePHP</a>, the PHP framework I started developing with <a href="/blog/2007/02/07/cakephp/">nearly 3 years ago</a> now. I also do most of the administration of the Linux boxes used to host the client sites and automate as much as I can with handy bash scripts, all from the comfort of this shiny iMac:</p>
<p><img src="/blog/wp-content/uploads/2009/12/rehab_imac_300x400.jpg" alt="" title="Rehab iMac" width="300" height="400" class="alignnone size-full wp-image-406" /></p>
<p>On the downside the standard working hours are 9 to 6, which is longer than I&#8217;m accustomed to. You can&#8217;t have it all <img src='http://sickbiscuit.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2009/12/13/6-months-of-rehab/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mashing up Twitter Trends and Google Images</title>
		<link>http://sickbiscuit.com/blog/2009/09/15/mashing-up-twitter-trends-and-google-images/</link>
		<comments>http://sickbiscuit.com/blog/2009/09/15/mashing-up-twitter-trends-and-google-images/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 09:50:40 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://sickbiscuit.com/blog/?p=397</guid>
		<description><![CDATA[I recently released the latest entry in my series of nano-apps.
As with my previous efforts, istrending.com serves serves no real purpose other than as an act of deliberate practice: going through the process of coming up with an idea, writing code, registering domain names, setting up Cron jobs and configuring deployment systems to get it [...]]]></description>
			<content:encoded><![CDATA[<p>I recently released the latest entry in my series of <a href="/blog/2009/01/26/nano-apps/">nano-apps</a>.</p>
<p>As with my previous efforts, <a href="http://istrending.com">istrending.com</a> serves serves no real purpose other than as an act of deliberate practice: going through the process of coming up with an idea, writing code, registering domain names, setting up Cron jobs and configuring deployment systems to get it all up and running in a production environment.</p>
<p>I questioned why I was even bothering with an app that was likely not going to see any traffic or be of use to people and when I hit a minor javascript problem the project was shelved for a few months. I recently had a fresh burst of enthusiasm though and got the usual sense of achievement when I deemed the code &#8220;ready enough&#8221; and a quick <code>cap deploy</code> took care of the rest.</p>
<p>The main problem I&#8217;ve faced with this app concerns the script used to update the list of trending topics: the Twitter search api has a known issue of returning HTML instead of JSON, which has on occasion caused my inbox to be filled with emails from the Cron daemon alerting me to failed jobs. I&#8217;m also not very happy with how the javascript carousel functions, so there&#8217;s some scope for improvement there.</p>
<p>The code is available on <a href="http://github.com/stevenwilkin/istrending.com">GitHub</a> as usual.</p>
<p>Next up is probably something bigger, very likely involving Rails. I&#8217;ve been reading up on the various testing methodologies used in the Ruby world and have written my first set of RSpec tests so I hoping my next release will at least have some test coverage. Other than that I&#8217;ll just have to see what ideas come to mind between now and then.</p>
<p>Any suggestions on what I should do next?</p>
]]></content:encoded>
			<wfw:commentRss>http://sickbiscuit.com/blog/2009/09/15/mashing-up-twitter-trends-and-google-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
