<?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>Dan Hart</title>
	<atom:link href="http://www.danhart.co.uk/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.danhart.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Wed, 12 Dec 2012 18:26:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Git show the conflicting commit during a rebase</title>
		<link>http://www.danhart.co.uk/blog/git-show-the-conflicting-commit-during-a-rebase?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-show-the-conflicting-commit-during-a-rebase</link>
		<comments>http://www.danhart.co.uk/blog/git-show-the-conflicting-commit-during-a-rebase#comments</comments>
		<pubDate>Wed, 12 Dec 2012 18:26:18 +0000</pubDate>
		<dc:creator>Dan Hart</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.danhart.co.uk/blog/?p=56</guid>
		<description><![CDATA[To view the failed patch&#8217;s commit you can use the following bash function: Put it in your .bash_profile or similar. Example useage: Copy the patch number from git&#8217;s output message e.g. &#8220;Patch failed at 0001&#8243;]]></description>
				<content:encoded><![CDATA[<p>To view the failed patch&#8217;s commit you can use the following bash function:</p>
<pre class="brush: plain; title: ; notranslate">
function show_patch() {
  git show $(head -1 .git/rebase-apply/${1} | awk '{ print $2 }')
}
</pre>
<p>Put it in your .bash_profile or similar.</p>
<p>Example useage:</p>
<pre class="brush: plain; title: ; notranslate">
show_patch 0001
</pre>
<p>Copy the patch number from git&#8217;s output message e.g. &#8220;Patch failed at 0001&#8243;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danhart.co.uk/blog/git-show-the-conflicting-commit-during-a-rebase/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My first chef cookbook to add locales to a Debian Vagrant VM</title>
		<link>http://www.danhart.co.uk/blog/created-my-first-chef-cookbook-to-add-locales-to-a-debian-vagrant-vm?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=created-my-first-chef-cookbook-to-add-locales-to-a-debian-vagrant-vm</link>
		<comments>http://www.danhart.co.uk/blog/created-my-first-chef-cookbook-to-add-locales-to-a-debian-vagrant-vm#comments</comments>
		<pubDate>Mon, 28 Nov 2011 05:46:01 +0000</pubDate>
		<dc:creator>Dan Hart</dc:creator>
				<category><![CDATA[Chef Cookbooks]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vagrant]]></category>

		<guid isPermaLink="false">http://www.danhart.co.uk/blog/?p=49</guid>
		<description><![CDATA[My Vagrant VM base box only has en_US.UTF-8 installed by default and I recently required en_GB.UTF-8. So I created this chef cookbook to install the locale automatically. It has the ability to take an array of locales via the default[:localegen][:lang] &#8230; <a href="http://www.danhart.co.uk/blog/created-my-first-chef-cookbook-to-add-locales-to-a-debian-vagrant-vm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>My Vagrant VM base box only has en_US.UTF-8 installed by default and I recently required en_GB.UTF-8. So I created this chef cookbook to install the locale automatically. It has the ability to take an array of locales via the default[:localegen][:lang] attribute.<span id="more-49"></span></p>
<p>You can get a copy of it here:<br />
<a href="https://github.com/danhart/locale-gen" target="_blank">https://github.com/danhart/locale-gen</a></p>
<p>Or here:<br />
<a href="http://community.opscode.com/cookbooks/locale-gen" target="_blank">http://community.opscode.com/cookbooks/locale-gen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.danhart.co.uk/blog/created-my-first-chef-cookbook-to-add-locales-to-a-debian-vagrant-vm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vagrant and VirtualBox, modified files do not update when viewed in either NGINX or Apache</title>
		<link>http://www.danhart.co.uk/blog/vagrant-virtualbox-modified-files-not-updating-via-nginx-apache?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vagrant-virtualbox-modified-files-not-updating-via-nginx-apache</link>
		<comments>http://www.danhart.co.uk/blog/vagrant-virtualbox-modified-files-not-updating-via-nginx-apache#comments</comments>
		<pubDate>Tue, 15 Nov 2011 19:53:06 +0000</pubDate>
		<dc:creator>Dan Hart</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NGINX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Vagrant]]></category>

		<guid isPermaLink="false">http://www.danhart.co.uk/blog/?p=25</guid>
		<description><![CDATA[I recently got to grips with using Vagrant for web development. The VM environment I was able to create mirrors the one I created on our production servers at work. I also decided to go the whole-hog and create my &#8230; <a href="http://www.danhart.co.uk/blog/vagrant-virtualbox-modified-files-not-updating-via-nginx-apache">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently got to grips with using Vagrant for web development. The VM environment I was able to create mirrors the one I created on our production servers at work. I also decided to go the whole-hog and create my own Debian Squeeze <a href="http://vagrantup.com/docs/base_boxes.html">base box from scratch</a> with the latest versions of VirtualBox Guest Additions, Ruby, OS updates etc. For a copy of it feel free to <a href="mailto:dan@danhart.co.uk">email me</a>.<span id="more-25"></span></p>
<p>However, at the end of the process I encountered one problem. When I modified a file locally in the VirtualBox Shared Folder (/vagrant in the VM) and then loaded it through the web server (e.g. http://localhost:1337/css/styles.css) it would not show the changes I had made to the file. Instead I would just receive the old version of the file.</p>
<p>After some investigation and googling I discovered the problem is that VirtualBox&#8217;s Shared Folders do not fully support sendfile(). At the time of writing VirtualBox is on version 4.1.6.</p>
<p>The problem is easily fixed by disabling sendfile support in your HTTP server.<br />
<strong>Apache:</strong></p>
<pre><span class="Apple-style-span" style="font-family: 'Courier 10 Pitch', Courier, monospace; font-size: 13px; line-height: 19px; white-space: pre; background-color: #f4f4f4;">EnableSendfile off</span></pre>
<p><strong>NGINX:</strong></p>
<pre>sendfile off;</pre>
<p>sendfile() is an optimisation for reading and transmitting file contents. Disabling it within a development environment will not cause any compatibility issues and will only cause a completely negligible performance decrease. More information <a href="https://www.kernel.org/doc/man-pages/online/pages/man2/sendfile.2.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danhart.co.uk/blog/vagrant-virtualbox-modified-files-not-updating-via-nginx-apache/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Modern NGINX default server definition, with hostname automatically mapped to a directory</title>
		<link>http://www.danhart.co.uk/blog/modern-nginx-default-server-definition-with-hostname-automatically-mapped-to-a-directory?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=modern-nginx-default-server-definition-with-hostname-automatically-mapped-to-a-directory</link>
		<comments>http://www.danhart.co.uk/blog/modern-nginx-default-server-definition-with-hostname-automatically-mapped-to-a-directory#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:11:52 +0000</pubDate>
		<dc:creator>Dan Hart</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[NGINX]]></category>

		<guid isPermaLink="false">http://www.danhart.co.uk/blog/?p=12</guid>
		<description><![CDATA[When I first decided to switch my primary web server from Lighttpd to NGINX I attempted to mimic the setup I had achieved in Lighttpd. As such, one of my first initial gripes with NGINX is that I had to &#8230; <a href="http://www.danhart.co.uk/blog/modern-nginx-default-server-definition-with-hostname-automatically-mapped-to-a-directory">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When I first decided to switch my primary web server from Lighttpd to NGINX I attempted to mimic the setup I had achieved in Lighttpd. As such, one of my first initial gripes with NGINX is that I had to create a new Virtual Host server definition for <strong>every</strong> new site I wished to add. What I really wanted was a default catch-all definition that mapped the hostname (without the www.) to a directory, while also retaining the ability to have additional site-specific definitions when needed.<span id="more-12"></span> However, after spending a significant amount of time trying to find an existing solution, I found none that were perfect. So here is what I finally came up with myself:</p>
<pre class="brush: plain; title: ; notranslate">
server {
  listen 80 default;

  # Requires NGINX &gt;= 0.8.25
  server_name ~^(www\.)?(?&lt;domain&gt;.+)$;

  root /var/www/vhosts/$domain;

  access_log /var/log/nginx/default.access.log;

  index index.php index.html index.htm;

  server_name_in_redirect off;

  # Enable rewrites for WordPress (only works if WordPress is in the site's root directory)
  try_files $uri $uri/ /index.php?q=$uri&amp;$args;

  # Serve static files directly
  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|mp3|wav|swf|zip|pdf|htc|flv|f4v|mov|mp4|wmv|avi|mpg|woff)$ {
    access_log off;
    expires max;
    add_header Cache-Control public;
  }

  # Pass to php
  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/tmp/php.socket;
  }

  location ~ /\.ht {
    deny all;
  }

}
</pre>
<p>It should be noted that this config requires an NGINX version &gt;= 0.8.25.</p>
<p>Also, since NGINX loads its virtual host files alphabetically, I suggest inserting this code into a file named 000-default. <img src='http://www.danhart.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.danhart.co.uk/blog/modern-nginx-default-server-definition-with-hostname-automatically-mapped-to-a-directory/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
