<?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>Martin&#039;s World &#187; Software</title>
	<atom:link href="http://www.freakent.co.uk/archives/category/software/feed" rel="self" type="application/rss+xml" />
	<link>http://www.freakent.co.uk</link>
	<description>Martin&#039;s world of Gadgets, Internet and Technology</description>
	<lastBuildDate>Sun, 14 Feb 2010 16:22:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iTunes Music Library.xml XPath Expression</title>
		<link>http://www.freakent.co.uk/archives/358</link>
		<comments>http://www.freakent.co.uk/archives/358#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:21:34 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/?p=358</guid>
		<description><![CDATA[Took me a few minutes using SketchPath to work this out. It&#8217;s the xpath expression to pull out all the location elements from the iTunes Music Library.xml file.
/plist/dict/dict/dict/key[text()='Location']/following-sibling::string[1]
The resultant string still needs to be URL decoded.
]]></description>
			<content:encoded><![CDATA[<p>Took me a few minutes using <a href="http://pgfearo.googlepages.com/downloads">SketchPath </a>to work this out. It&#8217;s the xpath expression to pull out all the location elements from the iTunes Music Library.xml file.<br />
<code>/plist/dict/dict/dict/key[text()='Location']/following-sibling::string[1]</code><br />
The resultant string still needs to be URL decoded.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/358/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the eBay SOAP API from Ruby-on-Rails</title>
		<link>http://www.freakent.co.uk/archives/341</link>
		<comments>http://www.freakent.co.uk/archives/341#comments</comments>
		<pubDate>Fri, 02 Oct 2009 11:41:28 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Ruby-on-Rails]]></category>
		<category><![CDATA[ebay]]></category>
		<category><![CDATA[ebay4r]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[soap4r]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/?p=341</guid>
		<description><![CDATA[This article applies to:
Rails 2.3.4, Ruby 1.8.6, soap4r gem 1.5.8, ebay4r 1.1

I have been taking a look at ways to integrate a Rails application with eBay. They support a number of different programming interfaces and, if you are using Javascript, PHP, Java or .Net, have some good examples to follow. I managed to get a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/i/logoEbayDev_x45_ss.gif" style="float:right"><em>This article applies to:<br />
Rails 2.3.4, Ruby 1.8.6, <a href="http://dev.ctor.org/soap4r">soap4r </a>gem 1.5.8, <a href="http://github.com/up_the_irons/ebay4r">ebay4r </a>1.1<br />
</em></p>
<p>I have been taking a look at ways to integrate a Rails application with eBay. They support a number of different programming interfaces and, if you are using Javascript, PHP, Java or .Net, have some good examples to follow. I managed to get a Javascript interface working quite easily from inside a Rails _form view, but it just does not feel like the most elegant solution to me. </p>
<p>Since eBay provide a well documented SOAP API I thought it would be a good opportunity to investigate Ruby&#8217;s support for SOAP.  SOAP support is a standard feature of Ruby and is provided by a library called <a href="http://dev.ctor.org/soap4r">soap4r</a>. I tried implementing my own call to eBay&#8217;s GetItem interface, but I encountered a few problems and soap4r&#8217;s documentation didn&#8217;t help much either. Then I discovered a library called <a href="http://github.com/up_the_irons/ebay4r">ebay4r </a>which is built on top of soap4r. The rest of this article describes how I successfully integrated my Rails application with eBay using ebay4r.</p>
<p><span id="more-341"></span></p>
<p><strong>Step 1) Load the gems into your Rails application</strong><br />
ebay4r needs a later version of the soap4r API than ships with Ruby. It&#8217;s easy to install the gem but there are some <a href="http://dev.ctor.org/soap4r/ticket/433">warnings </a>on the ebay4r and soap4r web sites about how to avoid API version conflicts caused by gem. Adding both via config.gem seems to avoid this problem completely so the workarounds suggested should not be needed.  Edit your environment.rb and add the two new config.gem lines shown below :<br />
<code>config.gem "soap4r", :lib => false<br />
config.gem "ebay", :lib=> false<br />
</code><br />
Next, use rake to ensure these gems are installed:<br />
<code>rake gems:install<br />
</code></p>
<p><strong>Step 2) Obtain eBay Authentication Keys<br />
</strong>The eBay SOAP api requires that you authenticate with a set of four keys; AppId, DevId, CertId and AuthToken. You get these authentication keys by signing on to the <a href="http://developer.ebay.com/">eBay Developers Program</a>. You should be able to view the first three keys from your <a href="https://developer.ebay.com/DevZone/account/Default.aspx">eBay Developer Account</a> page. The AuthToken is a little bit special. Whilst the other keys are used to authenticate your use of the API, the AuthToken is used to actually determine which user your API calls will run as. Without an AuthToken you can only retrieve public information. I&#8217;m not even sure if ebay4r supports making API calls without an AuthToken. To get your AuthToken, click on the &#8220;<a href="https://developer.ebay.com/DevZone/account/tokens/">get a user token</a>&#8221; link on your profile page and follow the instructions.</p>
<p><strong>Step 3) Set up eBay configuration parameters<br />
</strong>ebay4r suggests saving the four authentication keys in a Ruby file called &#8216;myCredentials.rb&#8217; and then loading the file to create some global variables. Whilst it works, it&#8217;s not very Rails. I created a custom initialiser and a yaml config file to hold my values.<br />
<code><br />
#config/initializers/ebay_config.rb<br />
require 'yaml'<br />
EBAY_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/ebay.yml")[RAILS_ENV]<br />
</code><br />
<code><br />
# config/ebay.yml<br />
common: &#038;common<br />
  DevId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
  AppId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
  CertId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
  AuthToken: xxxxxxxxxxxx ...more... xxxxxxxxxxx</p>
<p>development:<br />
  << : *common</p>
<p>test:<br />
  << : *common</p>
<p>production:<br />
  << : *common<br />
</code></p>
<p><strong>Step 4) Create an application model to represent the eBay Interface<br />
</strong>Whilst I could just invoke the ebay4r methods directly from my business logic, I prefer to insulate the rest of my code from an external API. I created an EbayTrader class in my application's models directory:<br />
<code># app/models/ebay_trader.rb<br />
require 'eBayAPI'</p>
<p>class EbayTrader</p>
<p>  attr_accessor :eBay</p>
<p>  def initialize<br />
    @eBay = EBay::API.new(EBAY_CONFIG['AuthToken'], EBAY_CONFIG['DevId'], EBAY_CONFIG['AppId'], EBAY_CONFIG['CertId'])<br />
  end</p>
<p>  def test<br />
    @eBay.GeteBayOfficialTime<br />
  end</p>
<p>end<br />
</code><br />
Two things to notice:</p>
<ol>
<li> the <em>test</em> method. Throughout the eBay API documentation you will see the GeteBayOfficialTime call being used to test the interface is configured correctly. My test method does exactly the same and makes it easy to test in the script/console.</li>
<li> the EBAY_CONFIG built in step 3 is used to provide the authentication keys during initialisation. </li>
</ol>
<p><strong>Step 5) Test Your eBay API Configuration<br />
</strong>Before we go any further it's worthwhile testing to make sure you can actually connect to eBay. Use script/console to run our test method.<br />
<code>$ script/console<br />
Loading Development Environment (Rails 2.3.4)<br />
>> et=EbayTrader.new<br />
...<br />
>> et.test<br />
...</code></p>
<p>You should see irb output to indicate that the code connected to eBay and returned the eBay Official Time. If not check the errors and try again.</p>
<p><strong>Step 6) Implement Specific Calls to the API<br />
</strong>Now we are ready to put our set up to work. The ebay4r library makes calling the eBay APIs very simple. The full list of API calls available can be found on the <a href="http://developer.ebay.com/support/docs/Default.aspx">eBay Developer Program Documentation</a> pages. </p>
<p>eBay are very careful to version their API so that you will be less affected by any changes they make. The underlying SOAP API requires you to specify which version of the API you are using when you make an API call. Version 1.1 of ebay4r was built for eBay API v583, so just make sure that the API call and the parameters you want to use are supported by v583 of the eBay API. Rebuilding ebay4r for the latest eBay API should be straightforward (thanks to soap4r) but is beyond the scope of this article. </p>
<p>I want to use the API to get detailed information about an auction item. The underlying eBay API for this is <a href="http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetItem.html">GetItem</a>, which is part of the Trading API set. If you take a look at the API documentation you can see the in and out parameters for the API call. For GetItem the main in parameter is ItemID, most of the others are optional. ebay4r allows parameters to be passed to an API call as a Ruby symbol. The out parameters are converted you object methods making the results very easy to navigate.  So in our model we can use:<br />
<code># app/models/ebay_trader.rb<br />
...<br />
  def get_item(item_id)<br />
    result = @eBay.GetItem(:ItemID => item_id)<br />
    result.item<br />
  end<br />
...<br />
</code> </p>
<p><strong>Summary</strong><br />
That's the basic eBay integration done. Accessing the EbayTrader model from a controller or some other piece of business logic should be straight forward. I will add a step 7 to this article in the not too distant future to demonstrate this and to explain more about how to access the results of an Ebay API call.  In the mean time just take a look at the examples provided by ebay4r.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/341/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails validation error messages</title>
		<link>http://www.freakent.co.uk/archives/326</link>
		<comments>http://www.freakent.co.uk/archives/326#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:52:47 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Ruby-on-Rails]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.chart-geek.com/?p=326</guid>
		<description><![CDATA[There&#8217;s no denying that Rails&#8217; built-in Forms Helpers are incredibly good. However if they have one flaw, it is the way error messages from validations are handled. The default messages generated by Rails are terse to say the least! If you provide your own message (with :message=>&#8221;blah blah&#8221;, Rails automatically appends the name of the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubyonrails.org/images/rails.png" alt="Rails" style="float:right"/>There&#8217;s no denying that Rails&#8217; built-in Forms Helpers are incredibly good. However if they have one flaw, it is the way error messages from validations are handled. The default messages generated by Rails are terse to say the least! If you provide your own message (with :message=>&#8221;blah blah&#8221;, Rails automatically appends the name of the underlying field to the front of the message, which is restrictive and looks ugly. </p>
<p>I spent some time looking around for a good solution to this problem. I assumed it would be a simple configuration issue but it turns out the format of these messages is hard baked into the ActiveRecord::Errors.full_messages method.</p>
<p><span id="more-326"></span></p>
<p>The best solution by a mile that I found was on <a href="http://adamhooper.com/eng/articles/5">Adam Hooper&#8217;s blog</a>. Adam quite rightly points out that this is a fundamental internationalisation (&#8221;i18n&#8221;) issue. Although his solution might seem a little more long winded than some, it is the only solution that I found that would work with multiple languages, leveraging Rails&#8217; i18n features.</p>
<p>Here is the full link to the article on Adam&#8217;s blog.<br />
<a href="http://adamhooper.com/eng/articles/5">http://adamhooper.com/eng/articles/5</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/326/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Ruby-on-Rails and Phusion Passenger (mod_rails) on Ubuntu 9.04</title>
		<link>http://www.freakent.co.uk/archives/306</link>
		<comments>http://www.freakent.co.uk/archives/306#comments</comments>
		<pubDate>Wed, 26 Aug 2009 12:43:22 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby-on-Rails]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.chart-geek.com/?p=306</guid>
		<description><![CDATA[The following is how I installed and configured Ruby-on-Rails on my Ubuntu 9.04 Server (x86 64 bit).
1. Update Ubuntu before we start
$ sudo apt-get update
$ sudo apt-get upgrade
2. Check whether MySQL is already installed
 $ mysql --version
mysql  Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (x86_64) using readline 5.2
MySQL was already installed so OK to proceed.
2. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubyonrails.org/images/rails.png" alt="Rails" style="float:right"/>The following is how I installed and configured Ruby-on-Rails on my Ubuntu 9.04 Server (x86 64 bit).</p>
<p><strong>1. Update Ubuntu before we start</strong><br />
<code>$ sudo apt-get update<br />
$ sudo apt-get upgrade</code></p>
<p><strong>2. Check whether MySQL is already installed</strong><br />
<code> $ mysql --version<br />
mysql  Ver 14.12 Distrib 5.0.75, for debian-linux-gnu (x86_64) using readline 5.2</code><br />
MySQL was already installed so OK to proceed.</p>
<p><strong>2. Install Ruby</strong><br />
<code>$ sudo apt-get install ruby irb rdoc</code><br />
$ ruby -v<br />
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]</code></p>
<p><strong>4. Install Ruby Gems (the Ruby package management system)</strong><br />
There are two ways to install Ruby Gems on Ubuntu, either through apt-get or by downloading the Gem archive and running the set up script. I tried the apt-get method as that looked quicker:</p>
<p><code>$ sudo apt-get install rubygems1.8<br />
$ sudo gem update --system</code></p>
<p>Unfortunately the apt-get package disables the <code>gem update --system</code> and insists that you use apt to update instead. This might be more preferable to the Linux Sysadmin crowd but I prefer to keep everything pure Ruby. It's a few extra commands but nothing too bad. </p>
<p><code>$ wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz<br />
$ tar xzvf rubygems-1.3.5.tgz<br />
$ cd rubygems-1.3.5/<br />
$ sudo ruby setup.rb<br />
$ gem -v<br />
$ sudo gem update --system</code></p>
<p><strong>5. Install and test Rails</strong><br />
<code>$ sudo gem install rails<br />
$ cd<br />
$ rails hello<br />
$ cd hello<br />
$ script/server<br />
...<br />
/usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:271:in `require_frameworks': no such file to load -- net/https (RuntimeError)</code></p>
<p>A quick Google of this error message revealed that I probably should have installed the Ruby OpenSSL library when I originally installed Ruby.<br />
<code>$ sudo apt-get install libopenssl-ruby<br />
$ script/server</code><br />
This time the Mongrel server started fine. </p>
<p><strong>6. Install Passenger (mod_rails)</strong><br />
The Rails community seem to all be switching from Mongrel to Passanger, the mod_rails Apache plug-in module. I was keen to see how a Passenger deployment compares to Mongrel.<br />
<code>$ sudo gem install passenger<br />
...<br />
Failed to build gem native extension.</code><br />
Apparently the libraries needed to build a Gem that contains native code isn't included with the main Ruby package, you need to install the Ruby Dev package too (something else I should have installed when I installed Ruby).<br />
<code>$ sudo apt-get install ruby1.8-dev<br />
$ sudo gem install passenger<br />
$ sudo passenger-install-apache2-module<br />
</code><br />
Following the prompts and messages on screen it turned out I didn't have a number of Apache libraries. The passenger installer is very good and gives you the exact commands to run:<code><br />
 * To install Apache 2 development headers:<br />
   Please run apt-get install apache2-prefork-dev as root.<br />
 * To install Apache Portable Runtime (APR) development headers:<br />
   Please run apt-get install libapr1-dev as root.<br />
 * To install Apache Portable Runtime Utility (APU) development headers:<br />
   Please run apt-get install libaprutil1-dev as root.<br />
</code><br />
I only needed to run the first command as the other two packages must have been pulled in as dependencies.</p>
<p><code><br />
$ sudo passenger-install-apache2-module<br />
...<br />
The Apache 2 module was successfully installed.</p>
<p>Please edit your Apache configuration file, and add these lines:</p>
<p>   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4/ext/apache2/mod_passenger.so<br />
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.4<br />
   PassengerRuby /usr/bin/ruby1.8</p>
<p>...</p>
<p><strong>7. Adding Passenger to the Ubuntu Apache2 Configuration</strong><br />
Whilst you could just add the Passenger configuration to your apache2.conf file, the Debian/Ubuntu way is to have a separate file for each module. So create a new file called passenger.load in /etc/apache2/mods-available and add the lines provided by the Passenger installer above. Then run the a2enmod to enable the Passenger module. This little script actually creates links in the mods-enabled subdirectory which are then picked up by the main Apache configuration file.<br />
<code>$sudo a2enmod<br />
Which module would you like to enable?<br />
Your choices are: actions asis auth_anon auth_dbm auth_digest auth_ldap cache cern_meta cgid cgi dav_fs dav deflate disk_cache expires ext_filter file_cache headers imap include info ldap mem_cache mime_magic <strong>passenger</strong> php5 proxy_connect proxy_ftp proxy_http proxy rewrite speling ssl suexec unique_id userdir usertrack vhost_alias<br />
          Module name? passenger<br />
          Module passenger installed; run /etc/init.d/apache2 force-reload to enable.<br />
...<br />
</code><br />
To finish enabling your Passenger module you just need to tell Apache to reload.<br />
<code>    $ sudo /etc/init.d/apache2 reload<br />
</code></p>
<p><strong>8. Adding Your Rails App to Passenger</strong><br />
Again, you could just add your site to the Apache config file using a <code>virtual host<code> directive, but the Debian/Ubuntu way is to use a sites-available/sites-enabled set up, similar to the Apache modules set up. A default web site was configured using <code>/etc/apache2/sites-available/default</code>, which publishes the directory <code>/var/www</code> via Apache. </p>
<p>I wanted to make my Rails app available as a subdirectory off the server's domain, e.g. http://server.local/testapp. All you have to do is create a soft link from your Rails app's public directory to the /var/www directory and the tell Passenger to treat this direftory as a Rails app.</p>
<p><code>$ ln -s /usr/martin/testapp/public /var/www/testapp</code></p>
<p>Add the following to <code>/etc/apache2/sites-available/default</code>:<br />
<code>...<br />
RailsBaseURI /testapp<br />
</code><br />
<em>If you want to use http://testapp.domain/ then you'll have to check the documentation on the <a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_to_a_virtual_host_8217_s_root">Phusion Passenger</a> site and create a new sites_available file.  </em> </p>
<p><strong>Useful Resources</strong><br />
<a href="http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/">Blog entry on installing and configuring Passenger on Ubuntu 7.10.</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/306/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svnsync with PuTTY on Windows</title>
		<link>http://www.freakent.co.uk/archives/131</link>
		<comments>http://www.freakent.co.uk/archives/131#comments</comments>
		<pubDate>Sat, 16 Feb 2008 08:12:22 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/131</guid>
		<description><![CDATA[Objective:
Maintain a copy of my local Subversion repository on my hosting server ready for deployment of my application using Capistrano.
Steps:

Create remote svn repository
Set up svn+ssh using PuTTY on Windows

Download plink.exe and puttygen.exe to you local machine.
run puttygen and generate a public/private key pair
Don&#8217;t set a pass phrase and svn will not prompt you for it [...]]]></description>
			<content:encoded><![CDATA[<p>Objective:</p>
<p>Maintain a copy of my local Subversion repository on my hosting server ready for deployment of my application using Capistrano.</p>
<p><span id="more-131"></span>Steps:</p>
<ol>
<li>Create remote svn repository</li>
<li>Set up svn+ssh using PuTTY on Windows
<ol>
<li>Download plink.exe and puttygen.exe to you local machine.</li>
<li>run puttygen and generate a public/private key pair<br />
Don&#8217;t set a pass phrase and svn will not prompt you for it later.</li>
<li>Save the private key to keyfile.ppk on your local hard disk.</li>
<li>On the remote host open a file ~/.ssh/authorized_keys and paste in the public key from puttygen.<br />
Make sure the string fits on a single continuous line.</li>
<li>In the file abov, pre-pend <em>command=&#8221;svnserve -t&#8221;</em> to the start of the public key.<br />
This forces the svnserve process to run when ever someone connects using this key pair. Having no passphrase on the key pair isn&#8217;t great for security but at least you are restricting access to just svn and not the whole shell.</li>
<li>On the local Windows machine, edit <em>%Application Data%\Subversion\config</em>, under the [tunnels] section add<br />
<em>[tunnels]</em><br />
<em>ssh =plink -i \path\to\keyfile.ppk<br />
(use back slashes / despite it being on Windows)<br />
</em></li>
<li>Test using <em>svn info svn+ssh://username@host.com/home/username/svn-repos/application</em></li>
</ol>
</li>
<li>Set up two environment variables to save on the typing<br />
<em>set torepos=svn+ssh://username@host.com/home/username/svn-repos/application<br />
set fromrepos=file:///s:/svn-repos</em></li>
<li>Initialise the synchronisation set up<br />
<em>svnsync init %torepos% %fromrepos%</em></li>
<li>Check the synchronisation parameters have been correctly set on the remote repository<br />
<em>svn proplist &#8211;revprop -r 0 %to%<br />
svn propget svn:sync-from-url &#8211;revprop -r 0 %torepos%</em></li>
<li>Now do the sync<br />
<em>svnsync sync %torepos%</em></li>
<li>Sit back and wait, or in my case, go to bed.</li>
</ol>
<p>Sources of inspiration:</p>
<ul>
<li><a href="http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/">http://journal.paul.querna.org/articles/2006/09/14/using-svnsync/</a></li>
<li><a href="http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html#svn.reposadmin.maint.replication">http://svnbook.red-bean.com/en/1.4/svn.reposadmin.maint.html#svn.reposadmin.maint.replication</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/131/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Background Jobs and Queues with Ruby On Rails</title>
		<link>http://www.freakent.co.uk/archives/130</link>
		<comments>http://www.freakent.co.uk/archives/130#comments</comments>
		<pubDate>Sun, 16 Dec 2007 08:13:21 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby-on-Rails]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/130</guid>
		<description><![CDATA[http://labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging
http://rubyforge.org/projects/backgroundrb/
http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage
http://cleanair.highgroove.com/articles/2006/06/23/running-background-jobs
]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubyonrails.org/images/rails.png" alt="Rails" style="float:right"/>http://labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging</p>
<p>http://rubyforge.org/projects/backgroundrb/</p>
<p>http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage</p>
<p>http://cleanair.highgroove.com/articles/2006/06/23/running-background-jobs</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 704 on VMWare &#8211; Increase root partition size</title>
		<link>http://www.freakent.co.uk/archives/128</link>
		<comments>http://www.freakent.co.uk/archives/128#comments</comments>
		<pubDate>Wed, 10 Oct 2007 16:50:54 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/128</guid>
		<description><![CDATA[The root partition of my Ubuntu 704 Server Virtual Machine was only 5GB and was filling up regularly. Incresing the size is quite complex as you have to increase the size of the VMWare disk file, then increase the size of the file system partition within the disk file. Here are the steps I went [...]]]></description>
			<content:encoded><![CDATA[<p>The root partition of my Ubuntu 704 Server Virtual Machine was only 5GB and was filling up regularly. Incresing the size is quite complex as you have to increase the size of the VMWare disk file, then increase the size of the file system partition within the disk file. Here are the steps I went through and a few hints and tips along the way.</p>
<p><span id="more-128"></span>1. On the host system, increase size of VMWare disk files</p>
<p><em>(I added the VMWare folder to my PATH first)</em></p>
<p><code>D:\VMWare\ubuntu704server&gt;vmware-vdiskmanager -x 10GB Ubuntu.vmdk</code></p>
<p>I also changed the file type to dynamically extend (that&#8217;s the -t 0), which renames the file in the process. This is an optional step as it can affect the performance of the VM.</p>
<p><code>D:\VMWare\ubuntu704server&gt;vmware-vdiskmanager -r Ubuntu.vmdk -t 0 Ubuntu-000001.vmdk</code></p>
<p>2. Download the latest <a href="http://gparted.sourceforge.net/livecd.php">gparted livecd</a> and save to host&#8217;s file system</p>
<p>gparted is a GUI tool for manipulating partitions. I tried a number of different tools before the <strong>gparted livecd</strong>, including <strong>qtparted </strong>on the latest <strong>Knoppix livecd</strong>. With the <strong>Knoppix qtparted</strong>, the resize option was continually greyed out. I did some digging and it seems the underlying <strong>parted </strong>didn&#8217;t like whatever Ubuntu do to the ext3 file system, so any tools on top (such as <strong>qtparted</strong>) can&#8217;t resize. The <strong>gparted livecd</strong> worked perfectly so I didn&#8217;t investigate further.</p>
<p>3. In the VM settings, change the VM&#8217;s CDROM to point to the newly downloaded gparted livecd iso image</p>
<p>4. Boot the VM, but press Esc asap and tell the VMWare bios to boot from CD first</p>
<p>5. Reboot the VM into the <strong>gparted livecd</strong></p>
<p>6. When it eventually loads,  point <strong>gparted </strong>at the disk device (/dev/sda). Delete the swap partition (/dev/sda5) and then delete the logical partition (/dev/sda2). /dev/sda5 was &#8220;inside&#8221; /dev/sda2.</p>
<p>The /dev/sda5 swap partition was at the end of the original 5GB drive, but was now sitting in the middle of my 10GB. I couldn&#8217;t figure out how to move the swap back so it was just easier to drop it and recreate it after I resized the main /dev/sda1 partition.</p>
<p>7. Resize the 1st partition to almost fill the available space, saving 512MB for a new swap partition</p>
<p>8. Create a new logical partition in the available space, gparted should automatically name this /dev/sda2 when you commit changes.</p>
<p>9. Create a new linux-swap partition inside the /dev/sda2 partition, gparted should automatially name this /dev/sda5 when you commit changes.</p>
<p>10. Reboot the VM, enter the VMWare BIOS and change boot priority so that the VM will boot from it&#8217;s disk.</p>
<p>That&#8217;s it !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/128/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON &#8211; the 2nd ‘J’ in Ajax</title>
		<link>http://www.freakent.co.uk/archives/127</link>
		<comments>http://www.freakent.co.uk/archives/127#comments</comments>
		<pubDate>Wed, 19 Sep 2007 06:20:35 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/127</guid>
		<description><![CDATA[I stumbled across this new web technology called JSON whilst reading about the performance features being introduced into by AJAX web development tool I use.  Essentially they replaced the XML interface between the server and browser based JavaScript client with JSON. JSON is a way of expressing complex data structures which is less verbose [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.json.org"><img src="http://www.json.org/img/json160.gif" border="0" alt="" width="125" height="125" align="right" /></a>I stumbled across this new web technology called JSON whilst reading about the performance features being introduced into by AJAX web development tool I use.  Essentially they replaced the XML interface between the server and browser based JavaScript client with JSON. JSON is a way of expressing complex data structures which is less verbose than XML and is supported natively by JavaScript which makes it much more performant in those environments.  The home of JSON on the web is <a href="http://www.json.org" target="_blank">www.json.org</a>, where there is an article called &#8220;<a href="http://www.json.org/fatfree.html" target="_blank">The Fat Free Alternative to XML</a>&#8221; that does an excellent job of explaining the benefits of JSON. There are also links to JSON libraries for just about every programming language that ever existed. So the question is, will the web community now have to change the name of Ajax ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/127/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vnc4server on Ubuntu 704 server</title>
		<link>http://www.freakent.co.uk/archives/126</link>
		<comments>http://www.freakent.co.uk/archives/126#comments</comments>
		<pubDate>Fri, 14 Sep 2007 13:16:46 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/126</guid>
		<description><![CDATA[Now I have my Gnome desktop running on my sever I&#8217;d like to be able to access it without using the vmware console. I installed vnc4server using synaptic. Under my user I type vncserver and then connect to the server using the vnc client from my Windows desktop. By default I get a plain grey [...]]]></description>
			<content:encoded><![CDATA[<p>Now I have my Gnome desktop running on my sever I&#8217;d like to be able to access it without using the vmware console. I installed vnc4server using <em>synaptic</em>. Under my user I type <em>vncserver</em> and then connect to the server using the vnc client from my Windows desktop. By default I get a plain grey X window and a basic xterm window.</p>
<p><span id="more-126"></span>To set up a better desktop, edit the file ~/.vnc/xstartup and uncomment the first two lines, as follows:</p>
<p><code>#!/bin/sh<br />
# Uncomment the following two lines for normal desktop:<br />
unset SESSION_MANAGER<br />
exec /etc/X11/xinit/xinitrc</code></p>
<p><code>#[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br />
#[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br />
#xsetroot -solid grey<br />
#vncconfig -iconic &amp;<br />
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;<br />
#twm &amp;</code></p>
<p>Thanks to a bug in the vnc4server version that is currently being distributed with 704 &#8220;Feisty Fawn&#8221;, you need to do two more things</p>
<p>1) <code>sudo chmod +x /etx/X11/xinit/xinitrc</code></p>
<p>2) edit the vncserver script and add the <strong>&#8220;-extension XFIXES&#8221; </strong>line, as follows :<br />
<code><br />
$cmd .= " -rfbauth $vncUserDir/passwd";<br />
$cmd .= " -rfbport $vncPort";<br />
$cmd .= " -pn";<br />
$cmd .= " -extension XFIXES";</code></p>
<p># Add font path and color database stuff here, e.g.:<br />
#</p>
<p>See <a href="https://bugs.launchpad.net/ubuntu/+source/vnc4/+bug/78282" target="_blank">here</a> and in particular <a href="https://bugs.launchpad.net/ubuntu/+source/vnc4/+bug/78282/comments/72" target="_blank">here</a> for more info on this bug.</p>
<p>To Start the vnc server just type:</p>
<p><code>$ vncserver</code></p>
<p>Assuming it started a session on :1, you can kill that session with</p>
<p><code>$ vncserver -kill :1</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/126/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A GUI for Ubuntu 704 Server ?</title>
		<link>http://www.freakent.co.uk/archives/125</link>
		<comments>http://www.freakent.co.uk/archives/125#comments</comments>
		<pubDate>Thu, 13 Sep 2007 09:58:57 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.freakent.co.uk/archives/125</guid>
		<description><![CDATA[I installed Ubuntu Server because I wanted a minimal install befitting a server.  No OpenOffice, games or any other stuff. I know my way around a unix command line but it&#8217;s just so much quicker to get things done in Windows. Now I think I&#8217;d like a light weight GUI on my server that [...]]]></description>
			<content:encoded><![CDATA[<p>I installed Ubuntu Server because I wanted a minimal install befitting a server.  No OpenOffice, games or any other stuff. I know my way around a unix command line but it&#8217;s just so much quicker to get things done in Windows. Now I think I&#8217;d like a light weight GUI on my server that I can start just when I need it. So I need X, Gnome, no login manager and Synaptic for package management.<br />
I&#8217;m hoping this should work&#8230; Need to look at what&#8217;s included in gnome-core.</p>
<p><code>$ sudo aptitude install xorg gnome-core </code><tt>synaptic</tt></p>
<p><code>$ startx</code><code></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.freakent.co.uk/archives/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
