<?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>chrisadams.me.uk &#187; Journal</title>
	<atom:link href="http://chrisadams.me.uk/category/journal/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisadams.me.uk</link>
	<description>Hoping to think more clearly, through thinking out loud</description>
	<lastBuildDate>Sun, 29 Aug 2010 09:29:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Quick heads up on a super handy cheat sheet for Drupal</title>
		<link>http://chrisadams.me.uk/2010/08/08/quick-heads-up-on-a-super-handy-cheat-sheet-for-drupal/</link>
		<comments>http://chrisadams.me.uk/2010/08/08/quick-heads-up-on-a-super-handy-cheat-sheet-for-drupal/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 19:11:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Journal]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[drupal php web development]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=357</guid>
		<description><![CDATA[I'm working with Drupal a lot at work now, and in the process of creating my last post, I stumbled across this cheat sheet for developing with Drupal. I had no idea could pull ddebug_backtrace() to get an instant stacktrace, or DARGS() to see the arguments being passing into a function at any point, or [...]]]></description>
			<content:encoded><![CDATA[<p>I'm working with Drupal a lot at work now, and in the process of creating my last post, I stumbled across this <a href="http://ratatosk.backpackit.com/pub/1836982-debugging-drupal">cheat sheet for developing with Drupal</a>.</p>
<p>I had no idea could pull <code>ddebug_backtrace()</code>  to get an instant stacktrace, or <code>DARGS()</code> to see the arguments being passing into a function at any point, or <code>DD()</code> to log directly to a text file (which you can tail in a terminal window to see stuff as it happens).</p>
<p>Now, if only Simpletest wasn't so depressingly slow...</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/08/08/quick-heads-up-on-a-super-handy-cheat-sheet-for-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup Snow Leopard for LAMP development and debugging</title>
		<link>http://chrisadams.me.uk/2010/08/08/how-to-setup-snow-leopard-lamp-for-debugging/</link>
		<comments>http://chrisadams.me.uk/2010/08/08/how-to-setup-snow-leopard-lamp-for-debugging/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 19:00:23 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Journal]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=358</guid>
		<description><![CDATA[Over this weekend, I've been looking at ways to make it easier for me to work with PHP, largely because I've been using it more and more at work, and I've felt spoilt by the tools available when using Ruby, like the [ruby debugger], or when playing with Django or Twisted, python's own interactive pdb [...]]]></description>
			<content:encoded><![CDATA[<p>Over this weekend,  I've been looking at ways to make it easier for me to work with PHP, largely because I've been using it more and more at work, and I've felt spoilt by the tools available when using Ruby, like the [ruby debugger], or when playing with Django or Twisted, python's own interactive <a href="http://aymanh.com/python-debugging-techniques" title="Python Debugging Techniques | Ayman Hourieh">pdb debugger</a>, so I decided to give <a href="http://www.bluestatic.org/software/macgdbp/" title="MacGDBp - Blue Static">MacGDBp</a> a try.</p>
<p>It's pretty handy - it allows you to step your code when things break, giving you an idea of what exactly is happening, under the hood, or letting you understand the actual a request takes through your code.</p>
<p>I'm not using MAMP, because where possible, I'm trying to minimise duplication of software on the my computer, and previously I've confused myself something horrible with trying to keep track of multiple instances of MySQL and Apache before, so if you're not using MAMP, following these instructions should help get you set up with a decent debugging tool, on Snow Leopard, and along the way get a fairly maintainable lamp stack, if you're not enamoured with MAMP.</p>
<h4>Get PHP 5.2</h4>
<p>This isn't strictly necessary, but right now, I've found PHP 5.2 to be less hassle when developing than 5.3, and for time being, Drupal and WordPress to be standardising on it first before moving to the newer version, which means I am too.</p>
<p>The best instructions I've found to do this are here <a href="http://boztek.net/blog/2009/10/07/install-lamp-stack-source-mac-os-x-106-snow-leopard-using-homebrew" title="Install LAMP stack from source on Mac OS X 10.6 Snow Leopard using Homebrew | boztek">PHP 5.2 for compatibility with Drupal</a>, and provide a good introduction to the amazing Homebrew, which you really should be using instead of Macports or Fink, if you're not already.</p>
<p>Lets get the hard commandline work out of the way first.</p>
<h4>Setup PEAR to complement Homebrew's PHP 5.2</h4>
<p>Just like how we have pip or easy_install with Python, CPAN for Perl, and Rubygems for Ruby, with PHP, we have PECL, and PEAR. PEAR is repository of PHP classes, like PHP Unit for unit testing, whereas PECL is a repository for C extensions like APC or Memcache, that help with performance, and caching, or link to other programs.</p>
<p>By default we do have PEAR and PECL installed, but in keeping with Homebrew's example of storing stuff in <code>/usr/local/</code> to avoid needless sudo'ing we're going to use our own versions of PEAR, using this handy one liner. What's happening here is that we're using curl to fetch the data at http://pear.php.net/go-pear, and then streaming it into the php command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    curl http:<span style="color: #000000; font-weight: bold;">//</span>pear.php.net<span style="color: #000000; font-weight: bold;">/</span>go-pear <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> php</pre></div></div>

<p>We'll be presented with some text, once we've entered our admin password, along the lines of:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">  Welcome to go-pear!
&nbsp;
  Go-pear will install the 'pear' command and all the files needed by
  it.  This command is your tool for PEAR installation and maintenance.
&nbsp;
  Go-pear also lets you download and install the following optional PEAR
  packages: PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2.
&nbsp;
  If you wish to abort, press Control-C now, or press Enter to continue: 
&nbsp;
  HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::</pre></div></div>

<p>We probably don't need a proxy, so you can just hit enter, at which point we'll be asked the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">  Below is a suggested file layout for your new PEAR installation.  To
  change individual locations, type the number in front of the
  directory.  Type 'all' to change all of them or simply press Enter to
  accept these locations.
&nbsp;
   1. Installation prefix ($prefix) : .
   2. Temporary files directory     : $prefix/temp
   3. Binaries directory            : $prefix/bin
   4. PHP code directory ($php_dir) : $prefix/PEAR
   5. Documentation base directory  : $php_dir/docs
   6. Data base directory           : $php_dir/data
   7. Tests base directory          : $php_dir/tests
&nbsp;
  1-7, 'all' or Enter to continue:</pre></div></div>

<p>We want to change the installation prefix, to make sure we're putting this stuff into <code>/usr/local</code> - I found that I had to do this explicitly, because the default value for <code>$prefix</code>, ended up with me getting build errors.</p>
<p>Once we've added this, we'll get a load of text flying past as PEAR is built, and end up with some text saying something like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">    WARNING!  The include_path defined in the currently used php.ini does not
    contain the PEAR PHP directory you just specified:
&nbsp;
    If the specified directory is also not in the include_path used by
    your scripts, you will have problems getting any PEAR packages working.
&nbsp;
    Would you like to alter php.ini ? [Y/n] :</pre></div></div>

<p>Why <em>yes</em>, we <em>would</em> like this added. This will add this snippet to your <code>php.ini</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">    ;***** Added by go-pear
    include_path=&quot;.:/usr/local/PEAR&quot;
    ;*****</pre></div></div>

<p>One important thing here - now that you have this, make sure your PEAR</p>
<p>Now, any thing you add to pear will be available in future, so installing PHP Unit for unit testing is as simple as calling this on the commandline (note):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  pear <span style="color: #c20cb9; font-weight: bold;">install</span> phpunit<span style="color: #000000; font-weight: bold;">/</span>PHPUnit</pre></div></div>

<p>In a similar fashion to Rubygems, these libraries of classes are available by calling <code>require_once</code> as if you were in the path <code>/usr/local/PEAR</code>, so to pull in PHP Unit, you just type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  require_once <span style="color: #ff0000;">'PHPUnit/Framework.php'</span>;</pre></div></div>

<h4>Setup PECL with PHP 5.2</h4>
<p>Now that we have PEAR setup, we should spend a it of time on making PECL simple to administer without sudo. All I needed to do here was check that everything in <code>/usr/local/Cellar/php52/</code> belonged to my normal user account, by calling:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>Cellar<span style="color: #000000; font-weight: bold;">/</span>php52<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>This does away with the need to compile things as root, and makes installing extensions like Memcache, Mongodb, APC, as simple as:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    pecl <span style="color: #c20cb9; font-weight: bold;">install</span> apc</pre></div></div>

<p>If you find yourself having trouble here, you may want to check the permissions on any extra directories created during the PECL installation process - I had a couple of issues because some extensions had been installed as root earlier when following <a href="http://www.cupcakewithsprinkles.com/setting-up-apache-php-python-mysql-on-mac-os-x-snow-leopard-10-6/#comments" title="Setting Up Apache-PHP-Python-MySQL on Mac OS X Snow Leopard 10.6 |  Cupcake With Sprinkles">Hunter Ford's instructions at Cupcake with Sprinkles</a>, which stopped my user account being able to install into the nested directory structure, because my account was trying to put files into directories owned by root.</p>
<h4>Fetch Xdebug</h4>
<p>If we didn't need xdebug, this would be all we needed, but sadly things aren't as simple as that. If we try calling something like <code>pecl install xdebug</code>, we DO get a version of debug installed, but it's not quite what we need, and doesn't seem to do anything useful. If we want this to work with <a href="http://www.bluestatic.org/software/macgdbp/" title="MacGDBp - Blue Static">MacGDBp</a>, we need to install the version compiled by the chaps at <a href="http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging">Active state from their Remote Debugging page</a>, that's designed to work with their own IDE, but also other tools. Once we've downloaded the tar file, we need to choose the correct version,</p>
<p>And then copy it to where the other extensions are:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #c20cb9; font-weight: bold;">cp</span> xdebug <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>Cellar<span style="color: #000000; font-weight: bold;">/</span>php52<span style="color: #000000; font-weight: bold;">/</span>5.2.13<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>extensions<span style="color: #000000; font-weight: bold;">/</span>xdebug.so</pre></div></div>

<p>And make the relevant changes in our <code>php.ini</code> file for them, to point to the xdebug shared object (that's the <code>.so</code> suffix on extensions), and provide a few defaults as directed on the <a href="http://www.bluestatic.org/software/macgdbp/help.php" title="MacGDBp - Help - Blue Static">MacGDBp help page</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">; Adding xdebug</span>
  <span style="color: #000099;">zend_extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">/usr/local/Cellar/php52/5.2.13/lib/php/extensions/xdebug.so</span>
  xdebug.remote_enable<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
  xdebug.remote_autostart<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">1</span>
  xdebug.remote_host<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">localhost</span>
  xdebug.remote_port<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">9000</span></pre></div></div>

<p>In short we're telling xdebug to switch on by default, and and listen on localhost:9000 for any clients that want to connect to it when we want to inspect what's happening with code.</p>
<h4>Finally turning on MacGDBp</h4>
<p>Still with me? Good. At long last, we can finally start looking through code in our debugger. Fire up MacGDBp, and when you run your next PHP script, you should get to see something like this pic pilfered from Particle Tree's own post on this subject:</p>
<p><a href="http://chrisadams.me.uk/wordpress/wp-content/uploads/2010/08/particle-tree-macgdbp.png"><img src="http://chrisadams.me.uk/wordpress/wp-content/uploads/2010/08/particle-tree-macgdbp.png" alt="" title="particle-tree-macgdbp" width="655" class="alignright size-full wp-image-364" /></a></p>
<p>There's far more to this, but in general the key to using the debugger is knowing how to set breakpoints, and remembering that your choices in the blue buttons are (from left to right)</p>
<ul>
<li>stepping <em>into</em> functions to see what's happening as a request is passed from function to function</li>
<li>stepping <em>out</em> when you no longer need to see what's happening in a particular function</li>
<li>...and stepping <em>past</em> a particular function, without needing to look into its working at all</li>
</ul>
<p>The green button is a fast-forward button, to take you to the next breakpoint you might have in the code, and the green power button is analogous to a power button, to refresh a connection to the debugger. You really, really should look into <a href="http://particletree.com/notebook/silence-the-echo-with-macgdbp/" title="Particletree  » Silence The Echo with MacGDBp">this post here by Tim Sabat at Particle Tree</a>, and this one here by <a href="http://technosophos.com/content/debugging-your-php-code-xdebug-mamp-textmate-and-macgdbp-support" title="Debugging your PHP Code: XDebug on MAMP with TextMate and MacGDBp Support | TechnoSophos">Matt Butcher, at TechnoSophos</a>.</p>
<h4>Debugging without MacGDBp</h4>
<p>Of course, you don't need to use MacGDBp all the time, In most cases, just having a stack trace will help find the source of the error. Once you've got xdebug setup, you <em>should</em> get a handy track trace whenever you throw an error - if not, be sure to make sure you have the display errors setting set to 'on' in your php.ini setting (it should be around line 370 in your file, normally):</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">    <span style="color: #000099;">display_errors</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On</span></pre></div></div>

<p>By the time you've followed these steps, you should have an easier to main installation of the LAMP stack, with a simple way to install extra PHP libraries and C extensions, a couple much more effective ways to debug than simply typing <code>echo $variable</code> everywhere, and an ideal environment to get on with hacking on Drupal, WordPress and any other PHP code in future.</p>
<h4>Phew!</h4>
<p>This guide is largely a synthesis of earlier blog posts about this subject by <a href="http://justinhileman.info/articles/building-a-lamp-development-environment-on-snow-leopard" title="Building a LAMP development environment on Snow Leopard | justin hileman dot info">Justin Hileman</a>, <a href="http://technosophos.com/content/debugging-your-php-code-xdebug-mamp-textmate-and-macgdbp-support" title="Debugging your PHP Code: XDebug on MAMP with TextMate and MacGDBp Support | TechnoSophos">Matt Butcher</a>, <a href="http://particletree.com/notebook/silence-the-echo-with-macgdbp/" title="Particletree  » Silence The Echo with MacGDBp">Tim Sabat</a>, <a href="http://www.cupcakewithsprinkles.com/setting-up-apache-php-python-mysql-on-mac-os-x-snow-leopard-10-6/#comments" title="Setting Up Apache-PHP-Python-MySQL on Mac OS X Snow Leopard 10.6 |  Cupcake With Sprinkles">Hunter Ford</a>, and <a href="http://boztek.net/blog/2009/10/07/install-lamp-stack-source-mac-os-x-106-snow-leopard-using-homebrew" title="Install LAMP stack from source on Mac OS X 10.6 Snow Leopard using Homebrew | boztek">Boris Gordon</a>, I'd recommend subscribing to their blogs, as they <em>definitely</em> know more about PHP than I do, and they're a great source of handy info.</p>
<p>If there's anything that isn't clear, please let me know, so I can improve this guide - I don't want anyone else to have to blunder through working out all this themselves in future, as working all this out has taken, far, far longer than I'd like, and well, it seems churlish not to share now that I've got a setup that seems fairly stable.</p>
<p>Now, time to actually do something useful with it...</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/08/08/how-to-setup-snow-leopard-lamp-for-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching iPhone contracts</title>
		<link>http://chrisadams.me.uk/2010/08/01/switching-iphone-contracts/</link>
		<comments>http://chrisadams.me.uk/2010/08/01/switching-iphone-contracts/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 00:36:25 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=347</guid>
		<description><![CDATA[I came across this video when trawling across web, researching which provider I wanted to leave O2's woeful reception for with my iphone contract, and while sadly it's not far from the current experience of using my iPhone now that I've upgraded to the new iPhone OS, it is funny enough to raise a smile [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this video when trawling across web, researching which provider I wanted to leave O2's woeful reception for with my iphone contract, and while sadly it's not far from the current experience of using my iPhone now that I've upgraded to the new iPhone OS, it <em>is</em> funny enough to raise a smile whenever my phone locks up when I do something <em>really</em> computationally expensive on the phone, like open up iTunes:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Pdk2cJpSXLg&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Pdk2cJpSXLg&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>It does feel at first like an extremely cynical move from Apple, degrading the user experience of an existing handset this dramatically around the same time as launching a another shiny new expensive handset with four times the memory - but truth be told this is nothing new with Apple - if you own a mac, you'll be aware of their 6 month product cycle already, so seeing this happen with the iPhone is hardly earth shattering. Lame yes, but not shocking. The main saving grace is that there is still a downgrade path back to iOS 3 if Apple can't release a new update in the coming few weeks that sorts out the performance issues.</p>
<p>In the meantime, there's <a href="http://lifehacker.com/5600825/how-can-i-make-ios-4-usable-on-my-iphone-3g?skyline=true&amp;s=i">a few steps here you can take to minimise the ridiculous slowness, listed on lifehacker</a> - there's no guarantee they'll work, but there seems to be at least some kind of placebo effect in place, since I switched off spotlight indexing when I tried a few of them just now.</p>
<h4>If the slowness of the new OS hasn't put you off of staying with your existing iPhone</h4>
<p>As I mentioned before, I took out a contract with 02 a little less than than two years ago now, and if like me you're looking for a sim only tariff, Orange and Vodafone both offer extremely similar deals, though it looks like Vodafone just about edge out Orange. Both offer tethering at a surprisingly reasonable rates.</p>
<p>You can pay a fiver for half a gig of tethered connectivity if need be, and 15 quid for 3Gb of data, which is the same as what they charge for internet access using their 3G dongles normally, but Vodafone's data cap is slightly higher at 1Gb per month instead of 750mb, and their network is generally seen as the most reliable in the UK .</p>
<p>If you want to lock yourself into a twelve month contract, you can get the sim only deal from Vodafone for a fiver less too, at £20 per month, which is about as reasonable as we're gonna see iPhone sim-only pricing get, while still providing some decent coverage.</p>
<p>Goodbye O2 - it's been a fun 4 or so years, but your network is just too flaky to see myself using in the near future. Lets talk again when you have reception again near Shad Thames.</p>
<p>_Update - I want with Vodafone in the end, and bought it through their website. I don't know why I waited so long until I did this to be honest...</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/08/01/switching-iphone-contracts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why it&#8217;s worth volunteering for medical science</title>
		<link>http://chrisadams.me.uk/2010/06/19/why-its-worth-volunteering-for-medical-science/</link>
		<comments>http://chrisadams.me.uk/2010/06/19/why-its-worth-volunteering-for-medical-science/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 22:36:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[medicine]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=335</guid>
		<description><![CDATA[Back in 2007, I volunteered to give a blood sample at Guys Hospital, as part of a research project called Indices of Renal Tolerance , which investigated how some kidney transplant patients recovered after operations. Normally after a transplant operation, our bodies' immune systems would attack any new organ placed inside a body because they [...]]]></description>
			<content:encoded><![CDATA[<p>Back in 2007, I volunteered to give a blood sample at Guys Hospital, as part of a research project called <em><a href="http://www.jci.org/articles/view/39933">Indices of Renal Tolerance</a></em> , which investigated how some kidney transplant patients recovered after operations.</p>
<p>Normally after a transplant operation, our bodies' immune systems would attack any new organ placed inside a body because they see it as a foreign body that must be destroyed before it can do any further damage to us, which is precisely what we don't want to happen when we've replaced a diseased malfunctioning one, with a new healthy one.</p>
<p>To avoid this, patients need to take immunosuppressant drugs, that, as you'd imagine form their name, inhibit these defence systems, allowing the new kidney to work without being rejected by the body.</p>
<h4>The problem with immunosuppressants</h4>
<p>Sadly these aren't without side effects, and as a rule, you really want to have your immune system at full strength to avoid infections or general illnesses. So transplant patients often end up spending the rest of their natural lives in a somewhat debilitated state as a result of these drugs.</p>
<p>Some people however, have immune systems can develop a tolerance to the newly transplanted organs, meaning they'd be free to live lives free of the side effects from the immunosuppressants, if it weren't for the fact that coming off medication runs carries the risk of killing them if it turns out that their bodies weren't as tolerant as they thought after all.</p>
<h4>Coming off the drugs</h4>
<p>However, one of the outcomes the research project I was in was the discovery of a chemical signature in patients who may carry this tolerant trait. As we get better at detecting this trait, more people may be able to live lives either free of these drugs, or with much lower dependencies on them.</p>
<h4>Why am I writing any this?</h4>
<p>To be honest, I had pretty much forgotten about being involved in this project, and the only memories I have are of almost passing out like a total pansy when giving the blood sample ( I needed to drink loads of sweet tea , and sit with my feet up until I felt well enough to stand...), but this month, I received a letter telling me that the study had been <a href="http://www.jci.org/articles/view/39933">published in the Journal of Clinical Investigation</a>, with a few snippets of the press coverage.</p>
<p>And, well... I <em>do</em> feel like a bit of a douche writing about this here, because it I can easily sound like <em>that guy</em> who reminds you about how much they give to charity they are, or how much they like to recycle and so on, and how wonderful a person they are.</p>
<p>But the pleasure and the feeling of pride from the letter far outweighs any potential embarrassment I might feel, especially if it helps persuade anyone else to volunteer for any similar medical research projects.</p>
<p>If you have the time, and you're a healthy person, I'd really recommend volunteering like this - it's incredibly fulfilling, and even including my comical fainting episode, we're talking a total time outlay of maybe two hours of my time, to help someone else live the rest of their life free from the side effects of drugs that they might not even need to to be taking.</p>
<p>So, in short - yay science!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/06/19/why-its-worth-volunteering-for-medical-science/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making sense of Rewritemaps in Apache</title>
		<link>http://chrisadams.me.uk/2010/05/24/making-sense-of-rewritemaps-in-apache/</link>
		<comments>http://chrisadams.me.uk/2010/05/24/making-sense-of-rewritemaps-in-apache/#comments</comments>
		<pubDate>Mon, 24 May 2010 08:12:08 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=298</guid>
		<description><![CDATA[Title: Using RewriteMap to ease site migrations Date: 2010-05-21 20:43:11 This post outlines the approach we took when migrating content from one site to another on a recent project, as the documentation available currently this could be much clearer, and this is clearly a problem that others working on the web are likely to have [...]]]></description>
			<content:encoded><![CDATA[<p>Title: Using RewriteMap to ease site migrations<br />
Date: 2010-05-21 20:43:11</p>
<p><em>This post outlines the approach we took when migrating content from one site to another on a recent project, as the documentation available currently this could be much clearer, and this is clearly a problem that others working on the web are likely to have in the near future, as people realise just how how much you can do with WordPress, and move more sites to it.</em></p>
<p>As mentioned before, we had to move a fairly large site across from one content management system based around ColdFusion a modified version of WordPress this month, making sure we didn't break any the links amassed over the last few years the site had been online.</p>
<p>If we were dealing with just a few urls, we could do this by hand using Apache's more well known [RewriteRule][] directives, but with than 5500 links to preserve, this approach just isn't realistic. We need a different tool for this.</p>
<h3>Enter RewriteMaps</h3>
<p>Fortunately, Apache RewriteMaps are designed specifically for these situations. As you'd expect from the name they allow you to map one url to another without needing to write the same ReWriteRule snippets thousands of times.</p>
<p>Anything that cuts repetition reduces the chances for typos to slip in, and makes it easier to maintain in the long run, so RewriteMaps are a handy tool to add to your reportoire.</p>
<h3>How to use a ReWritemap</h3>
<p>I find it helps to think of using a rewrite map as a 4 step process:</p>
<ul>
<li>
<p>create the rewritemap</p>
</li>
<li>
<p>define the rewritemap inside an apache conf file</p>
</li>
<li>
<p>define what conditions you want to test the map against</p>
</li>
<li>
<p>define what you want to do with the return value of the rewritemap, and redirect accordingly</p>
</li>
</ul>
<p>Now, in more detail....</p>
<h4>Create the rewritemap</h4>
<p>The mapping file cam be as simple a plain text file with pairs of values, separated by at least one space, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>content<span style="color: #000000; font-weight: bold;">/</span>press		        <span style="color: #000000;">22</span>
<span style="color: #000000; font-weight: bold;">/</span>content<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">jobs</span>		        <span style="color: #000000;">23</span>
<span style="color: #000000; font-weight: bold;">/</span>content<span style="color: #000000; font-weight: bold;">/</span>contact		    <span style="color: #000000;">24</span>
<span style="color: #000000; font-weight: bold;">/</span>content<span style="color: #000000; font-weight: bold;">/</span>accessibility		<span style="color: #000000;">25</span></pre></div></div>

<p>Whitespace isn't significant, so you can happily go for readability here.</p>
<h4>Define the RewriteMap</h4>
<p>Now that we have a mapping files we need to let Apache know that we'd like to us it:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&nbsp;
    <span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span>
&nbsp;
    <span style="color: #00007f;">RewriteMap</span> url_rewrite_map txt:/srv/html/domain.com/domain.migration.map</pre></div></div>

<p>We've told Apache to switch on its url rewriting features (<code>RewriteEngine On</code>), and declared the urls the text file as the patterns to match against.</p>
<h4>Define what conditions you to test the map against</h4>
<p>Now it's time to actually use the rewritemap:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&nbsp;
    <span style="color: #00007f;">RewriteCond</span> ${url_rewrite_map:$<span style="color: #ff0000;">1</span>|NOT_FOUND} !NOT_FOUND</pre></div></div>

<p>This condition definitely needs some unpacking.</p>
<p>RewriteConditions in Apache are designed as tests to see if a RewriteRule should be applied, depending on whether the expression they're testing returns true. RewriteMaps work by passing a value into them, like how we have with <code>S1</code>, but they also a fallback value in case an expression didn't match any of the patterns in the url map file declare earlier, which should explain that the <code>NOT_FOUND</code> is doing inside the curly braces.</p>
<p>So far, we're testing if we have a corresponding value for the captured pattern passed in (which would return true), and returning NOT_FOUND if there's nothing there.</p>
<p>However, we <em>only</em> want to apply the url rewrite if the we have a match in the map, and as it stands both values return will return 'true' here. This will create an infinite rewriting loop, so we need to add a ! operator to check if the value is NOTFOUND or not, and only rewrite the rules if the result is <code>!NOTFOUND</code>.</p>
<p>Yes, we really did just test for <code>not NOTFOUND</code>.</p>
<p>I'm sorry - I have a real problem with this; it's extremely confusing to read, and utterly unintuitive, as well as just being bad english.</p>
<p>Sadly, this seems to have become a fairly common Apache htaccess idiom, and right now, I can't think of another way to express this that works using Apache's syntax. Any other suggestions would be <em>gratefully</em> accepted.</p>
<p>Define what to do with the results</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&nbsp;
    <span style="color: #00007f;">RewriteRule</span> ^(.*) http://domain.com/?p=${url_rewrite_map:$<span style="color: #ff0000;">1</span>} [R=<span style="color: #ff0000;">301</span>]</pre></div></div>

<p>This rule uses a regular expression to match the request sent to us, (that's the <code>^(.*)</code> part), and then passes that through the urlmap, so a path for a content item with a unique of id "34", but a previous path along the lines of "/press/importantpressrelease" would have its numeric id returned again, giving us a rewritten url like "http://domain.com/?p=34".<br />
In our case, the unique numeric id was the only constant we could rely during migration from one system to another; thankfully WordPress has some handy built-in rules of it's own that can convert these numeric id requests into nice friendly urls, along the lines of "http://domain.com/press/2009/06/10/important-press-release".</p>
<p>We're using a permanent 301 redirect flag with this ReWriteRule (that's the <code>[R=301]</code>), so that search engine spiders know to follow the link, retaining any search engine mojo we may have had before..</p>
<h3>Conclusion</h3>
<p>So, using the url mapping here, we now have a sufficiently fast way to preserve the integrity of old urls, without locking us into this structure for the future, without diving too deep into the Apache directive rabbit whole.</p>
<p><!-- links --></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/24/making-sense-of-rewritemaps-in-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discovering the Walrus</title>
		<link>http://chrisadams.me.uk/2010/05/23/discovering-the-walrus/</link>
		<comments>http://chrisadams.me.uk/2010/05/23/discovering-the-walrus/#comments</comments>
		<pubDate>Sun, 23 May 2010 21:44:32 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=310</guid>
		<description><![CDATA[If you haven't heard of the Canadian Magazine The Walrus before, you could do a lot worse than read this article I found via Bruce Sterling's blog, Beyond the Beyond as introduction the quality of its writing - it's been one of the most refreshingly hopeful pieces about what I'm referring to (for want of [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven't heard of the Canadian Magazine <a href="http://www.walrusmagazine.com" title="The Walrus">The Walrus</a> before, you could do a lot worse than read this article I found via Bruce Sterling's blog, <a href="http://www.wired.com/beyond_the_beyond/" title="Beyond The Beyond">Beyond the Beyond</a> as introduction the quality of its writing - it's been one of the most refreshingly hopeful pieces about what I'm referring to (for want of a better phrase) as the Green Renaissance, where decisions by planners and policy makers to build cities around people instead of cars are leading to extraordinarily walkable, efficient and ultimately liveable cities:</p>
<blockquote>
<p>Gehl believes urban public space is the lifeblood of democracy, the essence of humanism, and the sine qua non of green-minded livability. “Throughout history,” he told me, “public space had three functions: it’s been the meeting place and the marketplace and the connection space. And what has happened in most cities is that we forgot about the meeting place, we moved the market space to somewhere else, and then we filled all the streets with connection, as if connection was the number one goal in city planning, in public space.”</p>
<p>What he means is that we replaced public squares with parking lots, enclosed and privatized our marketplaces as shopping malls, and then turned over our streets almost exclusively to rapid transportation by private vehicle. In so doing, we enslaved ourselves to oil, choked ourselves on exhaust, and shattered into a million fragments the public realm where civil society once flourished.</p>
<p>Copenhagen’s great lesson for the New Grand Tourist is that the essential first step, maybe the only critical one, in reassembling these shards and building the urban foundation of the Green Enlightenment is to put people ahead of their cars and public spaces ahead of private ones in the planning priorities of the city — of any city.</p>
</blockquote>
<p>In this shining upbeat, version of Europe, power comes from decentralised microgeneration in people's houses, or majestic power sources like the Grand Spires of Solùcar in Andalusia, that that use focussed sunlight on steam turbines to generate electricity:</p>
<blockquote>
<p>Solùcar looks like a sci-fi movie set, but it also comes off as ageless and permanent, almost obvious after a while. I was reminded of a one-liner I once heard the sustainable design guru William McDonough deliver. Whenever he meets skepticism about how far we can go with this Green Enlightenment, he said, he likes to point out that it took us 5,000 years to put wheels on our luggage. It took us only a couple of hundred to employ heat-concentrating mirrors in industrial power generation. The trail ahead is thick with low-hanging fruit. And the reason all of this is happening on the plain of Andalusia is not strictly nor even primarily because it is a very hot and sunny place; rather, it is because Spain was one of the first countries to pass a conscious imitation of Germany’s feed-in tariff.</p>
</blockquote>
<p>In all, it's about as attractive a version of our current society I can see that still revolves around economic growth as a way to fix the world's ills. I'm not convinced this is how things will pan out, and I'd like to know what the less upbeat scenarios are too, which is why I'll be heading to the Dark Mountain next weekend.</p>
<p>That said, I don't buy into a all of the apocalyptic narratives that are associated with the Dark Mountain camp; I think there's a middle ground between them and the Green Renaissance Utopia described above, and I think I might get a better idea of what that might be after the weekend.</p>
<p>Maybe I'll see you there.</p>
<p><!-- links --></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/23/discovering-the-walrus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The ForkBomb Tattoo</title>
		<link>http://chrisadams.me.uk/2010/05/23/the-forkbomb-tattoo/</link>
		<comments>http://chrisadams.me.uk/2010/05/23/the-forkbomb-tattoo/#comments</comments>
		<pubDate>Sun, 23 May 2010 19:18:12 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Journal]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[tattoos]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=302</guid>
		<description><![CDATA[This doesn't count for much, but I think this is one of the cleverest, geekiest, most elegant tattoos I've ever seen. Carving an Apple, Cisco or Nike Logo onto your body? That's really quite sad. But this is something different: Why do I like it? I think it's about as attractive as a code type [...]]]></description>
			<content:encoded><![CDATA[<p>This doesn't count for much, but I think this is one of the cleverest, geekiest, most elegant tattoos I've ever seen. Carving an <a href="http://www.flickr.com/groups/apple_tattoo/pool/">Apple</a>, <a href="http://www.readwriteweb.com/archives/the_30_best_and_worst_web_tech_tattoos.php">Cisco</a> or <a href="http://www.flickr.com/photos/bigmoontattoo/2514998242/">Nike Logo</a> onto your body? That's really quite sad. But this is something different:</p>
<p><a href="http://www.flickr.com/photos/silveiraneto/4033340711/"><img class="alignnone" title="Fork Bomb" src="http://farm3.static.flickr.com/2422/4033340711_543ef81df0_b.jpg" alt="" width="354" height="614" /></a></p>
<h3>Why do I like it?</h3>
<h4>I think it's about as attractive as a code type tattoo is going to get</h4>
<p>The proportions are well balanced, and there's a nice visual rhythm in there - this is largely down to the choice Bitstream Sans Mono, the typeface used for this. This typeface is a well loved font in programmer circles, who spend hours staring at monospace fonts - a lovely touch.</p>
<h4>It's actually executable code</h4>
<p>This particular incantation has its own story too - this cryptic combination of symbols is a working example of a <em>forkbomb</em>, and was presented as a piece of open source art back in 2002, by<a href="http://en.wikipedia.org/wiki/Jaromil"> Denis Jaromil Rojo</a>, an Italian Rastafarian developer and media activist now residing in Amsterdam. A forkbomb is a piece of self replicating code that when called, start forking itself relentlessly, until it  consumes all the resources on a computer system, rendering it unusable.</p>
<p>For the terminally curious, here's how it works:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
:<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>      <span style="color: #666666; font-style: italic;"># define ':' -- whenever we say ':', do this:</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>        <span style="color: #666666; font-style: italic;"># beginning of what to do when we say ':'</span>
    :    <span style="color: #666666; font-style: italic;"># load another copy of the ':' function into memory...</span>
    <span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #666666; font-style: italic;"># ...and pipe its output to...</span>
    :    <span style="color: #666666; font-style: italic;"># ...another copy of ':' function, which has to be loaded into memory</span>
         <span style="color: #666666; font-style: italic;"># (therefore, ':|:' simply gets two copies of ':' loaded whenever ':' is called)</span>
    <span style="color: #000000; font-weight: bold;">&amp;</span>amp;    <span style="color: #666666; font-style: italic;"># disown the functions -- if the first ':' is killed,</span>
         <span style="color: #666666; font-style: italic;">#     all of the functions that it has started should NOT be auto-killed</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>        <span style="color: #666666; font-style: italic;"># end of what to do when we say ':'</span>
;        <span style="color: #666666; font-style: italic;"># Having defined ':', we should now...</span>
:        <span style="color: #666666; font-style: italic;"># ...call ':', initiating a chain-reaction: each ':' will start two more.</span></pre></div></div>

<p>More on <a href="http://en.wikipedia.org/wiki/Fork_bomb">Forkbombs</a> here.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/23/the-forkbomb-tattoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enjoying BankSimple&#8217;s rhetoric</title>
		<link>http://chrisadams.me.uk/2010/05/18/enjoying-banksimples-rhetoric/</link>
		<comments>http://chrisadams.me.uk/2010/05/18/enjoying-banksimples-rhetoric/#comments</comments>
		<pubDate>Tue, 18 May 2010 22:46:27 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[banking disruption]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/2010/05/18/enjoying-banksimples-rhetoric/</guid>
		<description><![CDATA[If ever there was an sector that needs to be disrupted, it would be the banking sector, so I'm quite enthused by both the rhetoric, and the calibre of the team who are amassing around BankSimple. That doesn't happen in banking. The huge barriers to entry mean that the big guys can continue to screw [...]]]></description>
			<content:encoded><![CDATA[<p>If ever there was an sector that needs to be disrupted, it would be the banking sector, so I'm quite enthused by both the rhetoric, and the calibre of the team who are amassing around BankSimple.</p>
<blockquote>
<p>That doesn't happen in banking. The huge barriers to entry mean that the big guys can continue to screw you over, secure in the knowledge that no startup can compete for your business. And of course the government will bail them out if they get into trouble. Here at BankSimple, we are hoping to shake things up a little. While we sit atop existing banking systems, we've got some great technology that hides much of the underlying nastiness and lets us bank in a more real-time fashion.</p>
</blockquote>
<p>Moreover, their blog is already chock-full of great content, and actual useful analysis of the business now, and how the system currently works.</p>
<p>I have the same feeling about them, as I do about Dropbox - but sadly, I can't see the UK getting any clever financial services companies like this launch just yet (the closest would be Smile, but while their customer service is exemplary, they have the same creaking infrastructure that forces me to use wesabe and a load of other tools to make sense of what my money.</p>
<p>Check them out - I really think when they launch properly, you'll see some proper disruption in the financial sector at last.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/18/enjoying-banksimples-rhetoric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The phone tariff that should exist, but doesn&#8217;t</title>
		<link>http://chrisadams.me.uk/2010/05/18/the-phone-tariff-that-should-exist-but-doesnt/</link>
		<comments>http://chrisadams.me.uk/2010/05/18/the-phone-tariff-that-should-exist-but-doesnt/#comments</comments>
		<pubDate>Tue, 18 May 2010 22:37:04 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[mobil]]></category>
		<category><![CDATA[phones]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=287</guid>
		<description><![CDATA[I'm coming to the end of an 18 month contract with O2, where I ended up spending £45 per month, to essentially have more minutes and texts than God at my disposal, when really, all I cared about was having a handset designed by people who understand that user experience is more important than features [...]]]></description>
			<content:encoded><![CDATA[<p>I'm coming to the end of an 18 month contract with O2, where I ended up spending £45 per month, to essentially have more minutes and texts than God at my disposal, when really, all I cared about was having a handset designed by people who understand that user experience is more important than features , and having a dataplan that let me use it.</p>
<p>Now O2 (I've been with them for more than 5 years, easy) haven't been terrible, but I've had calls drop on me, and where I work in Tower Bridge, reception is atrocious, but the market has changed since I bought a phone now, and I think there's a gap in the market that mobile operators are either ignoring, or don't want to publicise too much.</p>
<p>I don't need a new handset (and when I say 'need' I'm using the first world definition of 'need' here) - nothing out now is better than the iPhone 3G to the extent that the iPhone was better than the rest of market when I bought my first phone, and I can't see that changing anytime soon.</p>
<p>Now I'm going to outline a plan that I think should exist, but I can't see anything that fits this description:</p>
<ol>
<li>I don't use the phone too much to actual phone conversations (no more than say 300 minutes tops probably)</li>
<li>I don't need visual voicemail or anything like this (Hullomail gives me everything I'd need now, and Google Voice as another alternative)</li>
<li>I <em>do</em> use my phone for watching videos, using twitter, and reading my choice of content online.</li>
<li>I'd like to use any data on my plan as a data I can use on when my laptop is tethered to it; I paid for it after all, right?</li>
<li>I'm okay with data not being 'unlimited' here, because I understand the how geeks are basically subsidised by lighter users anyway, but if I pay for a couple of gigs of data, _I want to be able to use it. _</li>
</ol>
<p>Generally, paying more than £40 per month feels like subsidised phone territory here; for £5 more, O2 were throwing in <em>a whole iPhone</em> on a previous contract 18 months ago for example, so paying that much for <em>just bits</em> leaves a terrible taste in my mouth.</p>
<p>The closest thing I see are <a href="http://shop.vodafone.co.uk/shop/sim-only-plans/all-sim-plans" title="SIM Cards: SIM-only contracts and mobile SIM cards - Vodafone">Vodafone's sim only tariffs</a>, but they're not clear about tethering with iPhones (point 4 above).</p>
<p>I can't be alone here in being a iPhone user who isn't slavishly devoted to the newest shiny from Apple, but doesn't want to pay over the odds for using my phone in a different way to how most operators expect me to, and would prefer to use what they have in smarter ways, rather than buying more gadgets and dongles that'll end up in landfill in about 18 months time.</p>
<p>Is there anything else like this hypothetical tariff around? I really think there should be, and I'd it did, I'd join it in heartbeat.</p>
<p><!-- links --></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/18/the-phone-tariff-that-should-exist-but-doesnt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tar is not zip</title>
		<link>http://chrisadams.me.uk/2010/05/17/tar-is-not-zip/</link>
		<comments>http://chrisadams.me.uk/2010/05/17/tar-is-not-zip/#comments</comments>
		<pubDate>Mon, 17 May 2010 01:40:54 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Journal]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://chrisadams.me.uk/?p=284</guid>
		<description><![CDATA[Today, I had to package up some code that was residing on a remote server that I had ssh access to, to send to someone who was probably on a windows box. This meant I had to use the zip tool, which I can never remember how to use, hence this memory jogging post. Now [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I had to package up some code that was residing on a remote server that I had ssh access to, to send to someone who was probably on a windows box.</p>
<p>This meant I had to use the <code>zip</code> tool, which I can never remember how to use, hence this memory jogging post.</p>
<p>Now if someone's using a Mac or is on Linux, the normal command line approach to to tar up a directory to send to someone goes like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cvzf</span> my_tarfile.tar.gz a_directory_to_tar and_otherone_here</pre></div></div>

<p>We're calling <code>tar</code> here, with the -create <em>(c)</em>, file <em>(f)</em>, compress <em>(z)</em> oh, and the verbose <em>(f)</em>, flag. Think of that string like saying to the computer: "create the tarfile <code>my_tarfile</code> putting it into a file we just created, verbosely, while compressing it, from <code>a_directory_to_tar</code> and <code>and_otherone_here</code>".</p>
<p>As commands go, the order feels a bit weird at first, but you get the hang eventually.</p>
<h4>Where zip is different</h4>
<p>Using <code>zip</code> isn't too different really, but it you need to remember to tell it to zip recursively (why is this not default behaviour?). If we call command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">zip</span> archive a_directory_to_tar and_otherone_here</pre></div></div>

<p>We'll end up with an rather useless empty file called <code>archive.zip</code>. We need to pass in the recursive flag</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">zip</span> <span style="color: #660033;">-r</span> archive a_directory_to_tar and_otherone_here</pre></div></div>

<p>There's also no need to add the <code>.zip</code> file extension - this is added for you as a courtesy. Well, after that ridiculous non-recursive default shenanigans, frankly that's the least it could do...</p>
<p>Anyway, there you have it. The differences you between them if you don't want to dive into the manpages just to package up a folder for somebody, or look at this <a href="http://linux.about.com/od/commands/a/blcmdl1_zipx.htm" title="Example uses of the Linux Command zip">linux.about.com</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://chrisadams.me.uk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://chrisadams.me.uk/2010/05/17/tar-is-not-zip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
