<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Luke Bennett</title>
	<atom:link href="https://blog.lukebennett.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lukebennett.com</link>
	<description>No such word as can&#039;t!</description>
	<lastBuildDate>Tue, 05 Dec 2017 17:04:42 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">12258343</site>	<item>
		<title>Docker service fails to start when using devicemapper</title>
		<link>https://blog.lukebennett.com/2017/12/05/docker-service-fails-to-start-when-using-devicemapper/</link>
					<comments>https://blog.lukebennett.com/2017/12/05/docker-service-fails-to-start-when-using-devicemapper/#respond</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Tue, 05 Dec 2017 17:04:42 +0000</pubDate>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=293</guid>

					<description><![CDATA[This has tripped me up too many times now, I need to make a note for future reference. With Ubuntu 16.04 and devicemapper as the docker storage driver, occasionally after a system boot the docker service won&#8217;t startup. The logs (systemd status docker.service) show something like: Dec 05 15:18:23 xxx systemd[1]: Failed to start Docker Application [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This has tripped me up too many times now, I need to make a note for future reference.</p>
<p>With Ubuntu 16.04 and devicemapper as the docker storage driver, occasionally after a system boot the docker service won&#8217;t startup. The logs (<code>systemd status docker.service</code>) show something like:</p>
<pre>Dec 05 15:18:23 xxx systemd[1]: Failed to start Docker Application Container Engine.
Dec 05 15:18:23 xxx systemd[1]: docker.service: Unit entered failed state.
Dec 05 15:18:23 xxx systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 05 15:18:23 xxx systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Dec 05 15:18:23 xxx systemd[1]: Stopped Docker Application Container Engine.
Dec 05 15:18:23 xxx systemd[1]: docker.service: Start request repeated too quickly.
Dec 05 15:18:23 xxx systemd[1]: Failed to start Docker Application Container Engine.
Dec 05 15:18:39 xxx systemd[1]: Stopped Docker Application Container Engine.
</pre>
<p>You can react to this one of two ways. Spend ages poking around, trying to start the service and find an explanation, or just run <code>lvscan</code> and discover that that volume being used by devicemapper is inactive and docker therefore can&#8217;t start:</p>
<pre>  ACTIVE            '/dev/ubuntu-vg/root' [51.76 GiB] inherit
  ACTIVE            '/dev/ubuntu-vg/swap_1' [8.00 GiB] inherit
  inactive          '/dev/docker/thinpool' [57.00 GiB] inherit
</pre>
<p>The solution is to run <code>vgchange -ay &lt;name_of_volume_group&gt;</code> (or just <code>vgchange -ay</code> if you don&#8217;t need to be specific) which activates the volume and will then allow you to start the docker service. <code>&lt;name_of_volume_group&gt;</code> can be retrieved via <code>vgs</code>.</p>
<p>Worth noting that the fix here is nothing magical, it&#8217;s just the standard way you activate a volume. The crux of the issue is why the volume was deactivated in the first place &#8211; it&#8217;s seemingly a race condition during the boot process (I&#8217;ve seen suggestions of various culprits), but I&#8217;ve yet to pin down the exact context.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2017/12/05/docker-service-fails-to-start-when-using-devicemapper/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">293</post-id>	</item>
		<item>
		<title>Thoughts on the journey towards containers</title>
		<link>https://blog.lukebennett.com/2016/06/11/thoughts-on-the-journey-towards-containers/</link>
					<comments>https://blog.lukebennett.com/2016/06/11/thoughts-on-the-journey-towards-containers/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Sat, 11 Jun 2016 11:41:29 +0000</pubDate>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[microservices]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=284</guid>

					<description><![CDATA[I spent a couple of days this week at ContainerSched 2016 where I took part in a panel discussion, sharing insights from our journey into containerisation. All the sessions are available to watch online. The event wrapped up with a cracking keynote by Adrian Colyer entitled &#8220;Making sense of it all&#8221; in which he presented [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I spent a couple of days this week at <a href="https://skillsmatter.com/conferences/7429-containersched-2016-the-container-and-scheduler-conference">ContainerSched 2016</a> where I took part in a panel discussion, sharing insights from our journey into containerisation. All the sessions are available to <a href="https://skillsmatter.com/conferences/7429-containersched-2016-the-container-and-scheduler-conference#program">watch online</a>.</p>
<p>The event wrapped up with a cracking keynote by <a href="https://blog.acolyer.org/">Adrian Colyer</a> entitled &#8220;<a href="https://skillsmatter.com/skillscasts/7896-keynote-making-sense-of-it-all#video">Making sense of it all</a>&#8221; in which he presented his perspective on where the world of containerisation is today, and where it&#8217;s headed, supported by evidence gleaned through direct discussions with many movers and shakers in the industry. You should definitely go check out <a href="https://skillsmatter.com/skillscasts/7896-keynote-making-sense-of-it-all#video">the recording</a>!</p>
<p>Having spent more time talking about containers in two days than the last two months, I thought I&#8217;d share some thoughts based on takeaways from the conference and my own experience, in case it helps others undertaking a similar journey. There&#8217;s a TL;DR at the end if you need it <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<h2>Containers are in production</h2>
<p>A common concern about using containers is that they&#8217;re simply not ready for mainstream production use yet &#8211; they&#8217;re too new, too immature, too insecure etc. That&#8217;s simply not the case. An <a href="https://www.oreilly.com/ideas/3-challenges-for-using-docker">O&#8217;Reilly survey</a> carried out in May last year found 40% of respondents were using containers in production, with more than half planning to enter production within 6-12 months.</p>
<p>A <a href="https://clusterhq.com/assets/pdfs/state-of-container-usage-june-2015.pdf">similar survey</a> by <a href="https://clusterhq.com">ClusterHQ</a> around the same time found similar results, with 38% of respondents currently in production. Their 2016 survey (due for release shortly) shows this figure to have climbed to 76%, supporting last year&#8217;s predictions (see <a href="https://skillsmatter.com/skillscasts/7896-keynote-making-sense-of-it-all#video">Adrian&#8217;s talk</a> for more details).</p>
<p>So containers are no longer confined to dev/QA environments &#8211; they&#8217;re very much out there in the wild.</p>
<h2>Beware the concept count</h2>
<p>For many (most?) people, the first encounter they have with containers will be via <a href="https://docker.com">Docker</a>. When you read/watch the various <a href="https://docs.docker.com/engine/userguide/containers/usingdocker/">introductory Docker tutorials</a> out there, it can seem pretty simple to spin one up. There is a huge difference between running a container on your laptop and deploying a containerised application stack to production however.</p>
<p>Once you start down the containerisation path, the concepts come thick and fast, with an ever-increasing number of concerns you have to investigate, learn, make judgments and decisions about, and build confidence in (both within your team and the wider organisation). You need solutions to networking, security, service discovery, storage, logging, monitoring and so on.</p>
<p>Don&#8217;t underestimate the learning curve. If you, your team or your organisation shies away from learning new things, or has a tight deadline, chances are it&#8217;s not the right time for you to explore containers. If you don&#8217;t have the problems that containers solve, then it&#8217;s <i>definitely</i> not the right time.</p>
<h2>Be pragmatic</h2>
<p>As alluded to above, the Docker/container ecosystem is huge, with new tools and approaches emerging every day. It can be tempting to feel like you have to learn <i>everything</i>.</p>
<p>The reality is you don&#8217;t need everything. As exciting and shiny as a solution may seem, do you actually have the problem it&#8217;s trying to solve? A funky auto-scaling setup may sound perfect, but if your fluctuations are mild and predictable enough, then maybe a manual approach would suffice for now, leaving you with one less concept to care about?</p>
<p>Just because there are lots of people choosing Kubernetes, or extolling the virtues of <a href="https://www.weave.works">Weave</a>, or advocating <a href="https://www.projectcalico.org">Project Calico</a> doesn&#8217;t mean that each of those is suitable or essential for your circumstances, especially if your environment is relatively simple rather than involving 1000s of containers across dozens of hosts.</p>
<p>Speaking for myself, after surveying the various options, I settled on <a href="https://rancher.com">Rancher</a> for our particular orchestration needs &#8211; it&#8217;s pretty simple to setup, with a lot of stuff available out of the box (overlay network, service discovery, load balancing, clean UI). Sure there are lots of capabilities it doesn&#8217;t have that you can find elsewhere, some of which a very strong case could be made for. However we just don&#8217;t need anything more right now, so the added complexity has no justification.</p>
<p>Obviously Rancher might not be right for you &#8211; ultimately there is no single &#8220;best solution&#8221;. Context is king &#8211; be realistic about what your needs really are and take care not to over-engineer.</p>
<h2>Miniliths vs microservices</h2>
<p>No that isn&#8217;t a typo, it&#8217;s a word I made up… One of the main drivers for the adoption of containers is the adoption of a <a href="http://martinfowler.com/articles/microservices.html">microservices architecture</a> in place of a monolithic one. However, just like containers, microservices bring with them a whole world of <a href="http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html">painful overheads</a>. For every microservice you introduce, there&#8217;s a cost to pay, and you need to be careful any benefits aren&#8217;t swallowed by the downsides.</p>
<p>Where appropriate, consider a &#8220;minilith&#8221; approach i.e. keep the number of microservices to a minimum, grouping related functionality as pragmatically as possible whilst leaving doors open to allow them to be split out further later if required (which may possibly be never).</p>
<p>Yes, this won&#8217;t be pure microservices, and it may hurt a bit inside, but it&#8217;ll mean reduced complexity with fewer processes to monitor, log, deploy, recover, scale and so on.</p>
<h2>Stand on the shoulders of giants</h2>
<p>With the ecosystem moving so fast, rolling your own solutions should be a last resort. It might be tempting to build a custom orchestration framework, but unless you keep it actively developed it won&#8217;t take long until it falls behind third party solutions and you&#8217;ll miss out on capabilities you would otherwise get for free. Not to mention having a harder job of getting others up to speed on how it works.</p>
<p>Once the pace of change slows down and the ecosystem matures, then sure, give it a go (if you&#8217;re sure it&#8217;s absolutely essential). But until then, don&#8217;t be tempted into striking out alone unless you can clearly quantify the benefits.</p>
<h2>Don&#8217;t forget the humans</h2>
<p>All the talk of automation makes it easy to overlook the human element of developing and maintaining systems. However slick a solution you may have in mind, without the right culture and mindset amongst your teams, you&#8217;re going to have problems.</p>
<p>Remember that DevOps is about <a href="http://martinfowler.com/bliki/DevOpsCulture.html">communication and collaboration</a> as much as automation, and can require a cultural shift to facilitate this. Having people on your team who don&#8217;t work well with others is a much more important problem to solve than a bit of automation. And if you can&#8217;t change behaviours, perhaps it&#8217;s time to manage people out.</p>
<h2>Networking (the human kind)</h2>
<p>Watching session recordings, reading blog posts etc is all well and good, but you really can&#8217;t beat networking with others and sharing thoughts and experiences. This might sound obvious &#8211; you could say the same about any topic. However, given how early-on we are in the process of adopting containers, it feels especially applicable at the moment.</p>
<p>There&#8217;s a lot of collective wisdom that is yet to be distilled down into blog posts and best practices that you can only really access by talking to people who have been there and done it (and quite possibly got burnt by it!). Put aside your British reserve (if you are British, obviously) and get out there and interact!</p>
<h2>Storage is a persistent problem</h2>
<p>When asked in the panel discussion which area we felt Docker is most lacking in, each of the three of us picked storage. This was a common theme amongst the many discussions I had too &#8211; it&#8217;s pain that is clearly widely felt. Even something as simple as inspecting the contents of a Docker volume from the command line is harder than it needs to be.</p>
<p>Yes, there are various storage solutions out there (e.g. <a href="https://www.gluster.org/">Gluster</a>, <a href="https://clusterhq.com">ClusterHQ</a>, <a href="https://github.com/rancher/convoy">Convoy</a>), and <a href="https://coreos.com/blog/torus-distributed-storage-by-coreos.html">new ones</a> entering the market all the time. But this is a <a href="http://pl.atyp.us/2016-06-torus.html">tough problem</a> to solve &#8211; if you want distributed storage you have to bear in mind the laws of physics in terms of latency and architect your application to handle your use cases and available IO accordingly.</p>
<p>Basically, for anything stateful, your life is going to be much harder than if it was stateless. Where possible, farm data off somewhere to a non-containerised external service.</p>
<h2>Finding good people is hard</h2>
<p>I suspect I&#8217;m preaching to the choir here (literally everybody I speak to has agreed with this), but one trend that just won&#8217;t go away is that finding good people with relevant skills is <i>hard</i>. Even harder than building distributed storage systems. Bearing in mind how new the ecosystem is, most knowledge and experience lives within developers and engineers that are not yet ready to re-enter the job market.</p>
<p>Consequently this means if you need extra pairs of hands, you&#8217;re most likely going to need to turn to the contractor or consultant markets. Which may not be the end of the world (though possibly the end of your budget). But don&#8217;t rely on filling a permanent vacancy in a hurry, especially if you&#8217;re outside London.</p>
<p>This is another reason to keep your concept count as low as possible and lean on third party offerings &#8211; if somebody on your team leaves, how quickly will it take somebody new to get fully up to speed?</p>
<h2>TL;DR</h2>
<p>I appreciate much of this is fairly conventional wisdom that could be applied to many more areas than containers. But given the penchant developers have for shiny things, it&#8217;s easy for it to fall by the wayside sometimes.</p>
<p>The world of containers is huge and can feel daunting, possibly a mountain you daren&#8217;t tackle. It&#8217;s definitely not a silver bullet, but once you cut through the hype and take the knife to the concept count to eliminate anything you really don&#8217;t need, it becomes far more approachable. Don&#8217;t be afraid to give it a go (if appropriate), but keep your eyes open and talk to others. And make sure you get that culture right.</p>
<p>I&#8217;d love to hear about your experiences &#8211; feel free to comment or contact me via whichever channel you prefer.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2016/06/11/thoughts-on-the-journey-towards-containers/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">284</post-id>	</item>
		<item>
		<title>Show hidden files in Atom sidebar</title>
		<link>https://blog.lukebennett.com/2015/09/21/show-hidden-files-in-atom-sidebar/</link>
					<comments>https://blog.lukebennett.com/2015/09/21/show-hidden-files-in-atom-sidebar/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Mon, 21 Sep 2015 18:13:48 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[atom]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=266</guid>

					<description><![CDATA[By default, the&#160;Atom&#160;editor hides files in its sidebar that match your&#160;VCS ignore file. This can be frustrating, as a hidden file isn&#8217;t necessarily one you don&#8217;t care about &#8211; for example, the node_modules folder will typically be excluded from a Node.js application, but you may wish to jump in and examine a module, do some [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>By default, the&nbsp;<a href="http://atom.io">Atom</a>&nbsp;editor hides files in its sidebar that match your&nbsp;VCS ignore file. This can be frustrating, as a hidden file isn&#8217;t necessarily one you don&#8217;t care about &#8211; for example, the node_modules folder will typically be excluded from a Node.js application, but you may wish to jump in and examine a module, do some debugging etc.</p>
<p>I wanted to show hidden files, so naturally I went to Preferences to look for an appropriate setting and found one that looked just the ticket: <strong>Settings &gt; Core Settings &gt; Exclude VCS Ignored Paths</strong>.</p>
<p><img data-recalc-dims="1" fetchpriority="high" decoding="async" data-attachment-id="274" data-permalink="https://blog.lukebennett.com/2015/09/21/show-hidden-files-in-atom-sidebar/atom-global-ignore-setting/" data-orig-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?fit=890%2C439&amp;ssl=1" data-orig-size="890,439" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="atom-global-ignore-setting" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?fit=300%2C148&amp;ssl=1" data-large-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?fit=540%2C266&amp;ssl=1" class="aligncenter size-full wp-image-274" src="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?resize=540%2C266" alt="atom-global-ignore-setting" width="540" height="266" srcset="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?w=890&amp;ssl=1 890w, https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?resize=300%2C148&amp;ssl=1 300w, https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-global-ignore-setting.png?resize=720%2C355&amp;ssl=1 720w" sizes="(max-width: 540px) 100vw, 540px" /></p>
<p>I figured that unticking this setting would do the job, but it made no difference &#8211; confusingly, it turns out that this&nbsp;is a global setting used by functionality&nbsp;such as fuzzy searching, and there is <em>another</em> setting that overrides this for the sidebar (a.k.a. tree view). Because Atom is modular, most of its components exist as independent&nbsp;packages. The setting you need is found in <strong>Settings &gt; Packages &gt; Core Packages &gt; <a href="https://atom.io/packages/tree-view">Tree View</a></strong>:</p>
<p><img data-recalc-dims="1" decoding="async" data-attachment-id="275" data-permalink="https://blog.lukebennett.com/2015/09/21/show-hidden-files-in-atom-sidebar/atom-tree-view-ignore-setting/" data-orig-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?fit=892%2C507&amp;ssl=1" data-orig-size="892,507" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="atom-tree-view-ignore-setting" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?fit=300%2C171&amp;ssl=1" data-large-file="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?fit=540%2C307&amp;ssl=1" class="aligncenter size-full wp-image-275" src="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?resize=540%2C307" alt="atom-tree-view-ignore-setting" width="540" height="307" srcset="https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?w=892&amp;ssl=1 892w, https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/blog.lukebennett.com/files/2015/09/atom-tree-view-ignore-setting.png?resize=720%2C409&amp;ssl=1 720w" sizes="(max-width: 540px) 100vw, 540px" /></p>
<p>Here you&#8217;ll find &#8220;<strong>Hide Ignored Names</strong>&#8221; and &#8220;<strong>Hide VCS Ignored Files</strong>&#8221; settings &#8211; the latter is the one you want to stop the sidebar from ignoring files that your VCS ignores.</p>
<p>The first setting relates to another of the settings back on the main Settings panel (see first screenshot above) &#8211; <b>Preferences &gt; Settings &gt; Core Settings &gt; Ignored Names</b>.&nbsp;This allows you to globally ignore file/folder patterns regardless of VCS ignore files. You probably want to leave this on unless you really want to be able to dig around in your `.git` folder within the editor.</p>
<p>Hope this saves somebody a bit of time&nbsp;and frustration as it took me ages to figure out! And I&#8217;m <a href="https://github.com/atom/atom/issues/8276">clearly</a> <a href="https://github.com/atom/atom/issues/5423">not</a> <a href="https://github.com/atom/atom/issues/4203">the only one</a>, so hopefully Github will sort this soon.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2015/09/21/show-hidden-files-in-atom-sidebar/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">266</post-id>	</item>
		<item>
		<title>Make Docker play nicely with UFW</title>
		<link>https://blog.lukebennett.com/2015/09/13/make-docker-play-nicely-with-ufw/</link>
					<comments>https://blog.lukebennett.com/2015/09/13/make-docker-play-nicely-with-ufw/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Sun, 13 Sep 2015 22:41:28 +0000</pubDate>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=262</guid>

					<description><![CDATA[I&#8217;ve been spending a lot of time working with Docker over the last year, primarily in Ubuntu environments. So long in fact, that I seem to have forgotten this blog exists 🙂 Something it took me a while to figure out was how to stop Docker from bypassing UFW and exposing mapped ports to the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been spending a lot of time working with Docker over the last year, primarily in Ubuntu environments. So long in fact, that I seem to have forgotten this blog exists <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Something it took me a while to figure out was how to stop Docker from bypassing UFW and exposing mapped ports to the world (due to specifying its own iptables chain). More often than not, I want containers to be restricted to private network access only. One option is to <a href="http://docs.docker.com/reference/run/#expose-incoming-ports">specify an ip address</a> when mapping ports, but that&#8217;s a bit clunky and doesn&#8217;t work so well when you want to be able access the ports via multiple private ip addresses.</p>
<p>The challenge was making sure not to block outbound or inter-container connectivity in the process.</p>
<p>Having had to set up a number of servers and keep finding myself forgetting one of the steps, I figured it was about time I put this blog to good use and list the necessary commands here:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
sudo ufw allow in on docker0
sudo sed -i s/DEFAULT_FORWARD_POLICY=\&quot;DROP\&quot;/DEFAULT_FORWARD_POLICY=\&quot;ACCEPT\&quot;/ /etc/default/ufw
sudo ufw enable
iptables -t nat -A POSTROUTING ! -o docker0 -s 172.17.0.0/16 -j MASQUERADE
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2015/09/13/make-docker-play-nicely-with-ufw/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">262</post-id>	</item>
		<item>
		<title>C# compiler error CS0182 when building via TeamCity</title>
		<link>https://blog.lukebennett.com/2013/06/18/c-compiler-error-cs0182-when-building-via-teamcity/</link>
					<comments>https://blog.lukebennett.com/2013/06/18/c-compiler-error-cs0182-when-building-via-teamcity/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Tue, 18 Jun 2013 10:05:47 +0000</pubDate>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[teamcity]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=217</guid>

					<description><![CDATA[When running a build via TeamCity, I started to get the following exception: CSC error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type The same code built fine in Visual Studio 2012, and nothing had changed on the build server so clearly something [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When running a build via TeamCity, I started to get the following exception:</p>
<blockquote><p>CSC error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type</p></blockquote>
<p>The same code built fine in Visual Studio 2012, and nothing had changed on the build server so clearly something in the most recent commits was triggering a difference in behaviour between the two environments.</p>
<p>It turns out that there&#8217;s a compiler bug in C# 4.0 (which our TeamCity server was using) involving null default parameters for attributes (an instance of which had been introduced in a recent commit) e.g.:</p>
<pre class="brush: csharp; title: ; notranslate">public SomeAttribute(SomeType someParameter = null)</pre>
<p>When an attribute contains a parameter in its constructor that defaults to null, the compiler incorrectly treats this as being a typeless null literal rather than a constant expression and throws the exception in question.</p>
<p>The proper fix for this is to upgrade the compiler on the build server. However, as that isn&#8217;t always immediately practical, as a workaround you can simply cast the null parameter to the type in question e.g.:</p>
<pre class="brush: csharp; title: ; notranslate">public SomeAttribute(SomeType someParameter = (SomeType)null)</pre>
<p>Eric Lippert provides more information about this particular bug in <a title="Attribute argument must be a constant error when using an optional parameter in the attribute constructor" href="http://stackoverflow.com/a/8299981/17602">this StackOverflow answer</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2013/06/18/c-compiler-error-cs0182-when-building-via-teamcity/feed/</wfw:commentRss>
			<slash:comments>34</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">217</post-id>	</item>
		<item>
		<title>Disabling a previously specified max-width</title>
		<link>https://blog.lukebennett.com/2012/08/07/disabling-a-previously-specified-max-width/</link>
					<comments>https://blog.lukebennett.com/2012/08/07/disabling-a-previously-specified-max-width/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Tue, 07 Aug 2012 16:50:58 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[css]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=211</guid>

					<description><![CDATA[I just did something stupid with my CSS but it had me scratching my head for a while. If you have a max-width set and need to disable it in a cascaded style, you need to set it to none rather than auto i.e.: img { max-width:100%; } #some-other-selector img { max-width:none; } This sounds [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I just did something stupid with my CSS but it had me scratching my head for a while.</p>
<p>If you have a max-width set and need to disable it in a cascaded style, you need to set it to <strong>none</strong> rather than <strong>auto</strong> i.e.:</p>
<pre class="brush: plain; title: ; notranslate">
img {
    max-width:100%;
}

#some-other-selector img {
    max-width:none;
}
</pre>
<p>This sounds obvious (and it is really), but because you usually use width:auto to override a previously specified width, I found myself inadvertantly doing the same with max-width and it took a while to realise what I&#8217;d done.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2012/08/07/disabling-a-previously-specified-max-width/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">211</post-id>	</item>
		<item>
		<title>TeamCity 7 upgrade &#8220;failed to install tomcat service&#8221;</title>
		<link>https://blog.lukebennett.com/2012/07/23/teamcity-7-upgrade-failed-to-install-tomcat-service/</link>
					<comments>https://blog.lukebennett.com/2012/07/23/teamcity-7-upgrade-failed-to-install-tomcat-service/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Mon, 23 Jul 2012 16:00:21 +0000</pubDate>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[teamcity]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=204</guid>

					<description><![CDATA[I was just (somewhat belatedly) upgrading to TeamCity 7.0 from 6.5 on a Windows Server 2008 box when I got an error. I&#8217;ve upgraded numerous times in the past without any problem, but this time I got the message &#8220;failed to install tomcat service&#8220;. I was advised to check my permissions and settings and either [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I was just (somewhat belatedly) upgrading to TeamCity 7.0 from 6.5 on a Windows Server 2008 box when I got an error. I&#8217;ve upgraded numerous times in the past without any problem, but this time I got the message &#8220;<strong>failed to install tomcat service</strong>&#8220;. I was advised to check my permissions and settings and either abort, retry or ignore, with the latter being deemed inadvisable.</p>
<p>Googling didn&#8217;t turn up much, but after digging around I discovered that the &#8220;TeamCity Web Server&#8221; service was in a &#8220;Disabled&#8221; state. Attempts to do anything with it gave me the message &#8220;This service is marked for deletion.&#8221;</p>
<p>With the help of <a title=".net - How to force uninstallation of windows service" href="http://stackoverflow.com/a/1638044/17602">this StackOverflow answer</a>, I quickly figured out that I&#8217;d started the upgrade process with Windows&#8217; Services viewer open. For whatever reason, this kept a hook into the outgoing TeamCity service which couldn&#8217;t be fully uninstalled as a result.</p>
<p>The solution was simple &#8211; close the Services window and retry. The installation completed without any further issue.</p>
<p>Whilst this is a bit of an edge case, the fact that the TeamCity error message didn&#8217;t directly reference the &#8220;TeamCity Web Server&#8221; service didn&#8217;t help. A clearer message would have sped up the diagnosis.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2012/07/23/teamcity-7-upgrade-failed-to-install-tomcat-service/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">204</post-id>	</item>
		<item>
		<title>Useful links for getting started with web development</title>
		<link>https://blog.lukebennett.com/2012/02/05/useful-links-for-getting-started-with-web-development/</link>
					<comments>https://blog.lukebennett.com/2012/02/05/useful-links-for-getting-started-with-web-development/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Sun, 05 Feb 2012 09:06:16 +0000</pubDate>
				<category><![CDATA[Careers]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=189</guid>

					<description><![CDATA[Update 06/02/14: I&#8217;ve just done a quick review of this post and made some changes. There&#8217;s loads more I could add but time doesn&#8217;t permit right now 🙂 Every couple of years I go back to my old school to participate in a careers convention, where people from a range of industries get together to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><em><strong>Update 06/02/14</strong>: I&#8217;ve just done a quick review of this post and made some changes. There&#8217;s loads more I could add but time doesn&#8217;t permit right now <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></em></p>
<p>Every couple of years I go back to my <a title="Bablake School" href="http://www.bablake.com">old school</a> to participate in a careers convention, where people from a range of industries get together to dish out tips and advice to pupils trying to make career choices. A great cause, especially with uni now being a more challenging prospect here in the UK due to the huge hike in tuition fees. Youngsters really need all the help they can get to make sure they pick the path that&#8217;s right for them.</p>
<p>I promised those I spoke to this year that I would post a list of links on my blog as a follow-up to find out more about web development. I should stress that this list is by no means exhaustive; I put it together quite quickly and there&#8217;s plenty more I could have included. For example, whilst I&#8217;ve tried to include links relating to a range of technologies, inevitably there&#8217;s more about the areas I have more experience with. Hopefully though it can still provide plenty of reading material and food for thought to help in evaluating whether web development is a subject worth investigating further as a potential career or perhaps just as a hobby.</p>
<p>I&#8217;ll try to update the list from time to time when I think of more (suggestions also welcome via the comments). I&#8217;m also hoping to follow this blog post up with some further thoughts on choosing web development as a career.</p>
<p>Without further ado, here are the links:</p>
<p><strong>Programming Languages / Frameworks</strong></p>
<ul>
<li>HTML5/CSS/JavaScript – Open technologies at the heart of the web &#8211; learn these first!</li>
<li><a title="Node.js" href="http://nodejs.org/">Node.js</a> – Increasingly popular serverside JavaScript platform</li>
<li><a title="Ruby" href="http://ruby-lang.org/">Ruby</a> – Widely used</li>
<li><a title="Ruby on Rails" href="http://rubyonrails.org/">Ruby on Rails</a> – One of the most popular web frameworks, built on Ruby</li>
<li><a title="Python" href="http://python.org/">Python</a> – A good starter language, often taught on uni courses etc.</li>
<li><a title="PHP" href="http://php.net/">PHP</a> – Been around a long time and still widely used, though not considered too cutting edge these days</li>
<li><a title="ASP.NET" href="http://microsoft.com/web/">ASP.NET</a> – Microsoft’s web platform, used a lot in the enterprise (see also <a href="http://asp.net/">http://asp.net/</a> and <a href="http://msdn.com/">http://msdn.com/</a>)</li>
<li><a title="Java" href="http://java.oracle.com/">Java</a> – Mostly found in the enterprise, not a good choice if you want to keep ahead of the curve!</li>
</ul>
<p><strong>Online video/interactive training</strong></p>
<ul>
<li><a title="Treehouse" href="http://teamtreehouse.com/">Treehouse</a> – Web design &amp; development<strong></strong></li>
<li><a title="Codecademy" href="http://codecademy.com/">Codecademy</a> – Interactive coding courses in a range of languages including JavaScript, HTML/CSS and Ruby</li>
<li><a title="CodeYear" href="http://codeyear.com/">CodeYear</a> – Learn to program in a year (part of Codecademy)</li>
<li><a title="PluralSight" href="http://pluralsight.com/">PluralSight</a> – Large library of videos for a range of technologies, not free but reasonably priced</li>
<li><del><a title="TekPub" href="http://tekpub.com/">TekPub</a> – Screencasts on a range of topics, some of which are free</del> (<strong>update</strong>: has been bought out by PluralSight)</li>
<li><a title="appendTo" href="http://learn.appendto.com/">appendTo</a> – jQuery/JavaScript training</li>
<li><a title="NodeTuts" href="http://nodetuts.com/">NodeTuts</a> &#8211; Node.js screencasts</li>
<li><a title="RailsCasts" href="http://railscasts.com/">RailsCasts</a> &#8211; Ruby on Rails screencasts</li>
</ul>
<p><strong>(e)Books</strong></p>
<p>Look out for deals of the day from most of these &#8211; they tend to have an ebook or two available each day for around £7-£10 (see my <a title="@developerluke - ebooks" href="http://twitter.com/developerluke/ebooks/">Twitter list</a> covering many of the ebook publishers).</p>
<ul>
<li><a title="O'Reilly" href="http://oreilly.com/">O&#8217;Reilly</a> – My favourite, some great <a title="JavaScript Development and Resources" href="http://oreilly.com/javascript/index.html">JavaScript books</a> such as Douglas Crockford&#8217;s &#8220;<a title="JavaScript: The Good Parts" href="http://shop.oreilly.com/product/9780596517748.do">Javascript: The Good Parts</a>&#8220;</li>
<li><a title="Manning Publications" href="http://manning.com/">Manning Publications</a></li>
<li><a title="The Pragmatic Bookshelf" href="http://pragprog.com">The Pragmatic Bookshelf</a></li>
<li><a title="Apress" href="http://apress.com/">Apress</a></li>
<li><a title="InformIT" href="http://informit.com/">InformIT</a></li>
<li>Also take a look at <a title="List of free programming books" href="http://resrc.io/list/10/list-of-free-programming-books/">this huge list of free programming books</a></li>
</ul>
<p><strong>Resources</strong></p>
<ul>
<li><a title="Move the web forward" href="http://movethewebforward.org/">Move the Web Forward</a> – One stop shop for keeping abreast of web standards and getting involved in the community</li>
<li><a title="Webmaker" href="https://webmaker.org/">Webmaker</a> &#8211; A Mozilla project &#8220;dedicated to helping you create something amazing on the web&#8221;</li>
<li><a title="frontend-dev-bookmarks" href="https://github.com/dypsilon/frontend-dev-bookmarks">frontend-dev-bookmarks</a> &#8211; A huge list of frontend development resources</li>
<li><a title="jQuery" href="http://jquery.org/">jQuery</a> – Most popular JavaScript library for rapid web development (though use with caution &#8211; easy to produce spaghetti code if you&#8217;re not careful)</li>
<li><a title="Twitter Bootstrap" href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a> – UI framework that makes it really easy to get a good UI up and running very quickly</li>
<li><del><a title="Google Reader" href="http://reader.google.com/">Google Reader</a> – RSS aggregator – subscribe to blogs and news sites and have all articles brought together in one place to save having to check each site manually</del> (<strong>update</strong>: service has closed)</li>
<li><a title="Feedly" href="http://feedly.com">Feedly</a> &#8211; A drop-in replacement for Google Reader, a good way to aggregate articles from across the web into a single feed (or multiple if you prefer)</li>
<li><a title="TweetDeck" href="http://tweetdeck.com/">TweetDeck</a> – Useful Twitter client for monitoring topics and lists of accounts to help breakdown the wealth of information that flows through Twitter</li>
</ul>
<p><strong>Databases</strong></p>
<ul>
<li><a title="MySQL" href="http://mysql.com/">MySQL</a> – Most popular open source relational database server (free)</li>
<li><a title="PostgreSQL" href="http://postgresql.org">PostgreSQL</a> – Another popular open source relational database (free)</li>
<li><a title="SQL Server" href="http://microsoft.com/sqlserver/">SQL Server</a> – Microsoft’s SQL database, common in the enterprise (free cutdown editions available &#8211; Express and Compact Edition)</li>
<li><a title="MongoDB" href="http://mongodb.org/">MongoDB</a> – Popular open source &#8220;NoSQL&#8221; database (free) – an alternative approach to &#8220;traditional&#8221; databases (has pros and cons)</li>
<li><a title="CouchDB" href="http://couchdb.org">CouchDB</a> – Another popular NoSQL database</li>
</ul>
<p><strong>News / Views / Tutorials</strong></p>
<ul>
<li><a title="Hacker News" href="http://news.ycombinator.org/">Hacker News</a> – Anything and everything of interest to a techie</li>
<li><a title="Reddit /r/Programming" href="http://reddit.com/r/Programming/">Reddit Programming</a> – As above – see <a href="http://reddit.com/r/LearnProgramming/">http://reddit.com/r/LearnProgramming/</a> and other related sections also</li>
<li><a title="Smashing Magazine" href="http://smashingmagazine.com/">Smashing Magazine</a> &#8211; Large selection of articles, resources etc relating to web design</li>
<li><a title="HTML5 Rocks" href="http://html5rocks.com/">HTML5 Rocks </a>&#8211; Google resource with a host of articles, tutorials and resources on HTML5 and modern browser techniques</li>
<li><a title="DailyJS" href="http://dailyjs.org/">DailyJS</a> – JavaScript/Node.js news</li>
<li><a title="Ruby Inside" href="http://rubyinside.com/">Ruby Inside</a> – Ruby news and tutorials</li>
<li><a title="General tech news" href="http://techmeme.com/">Techmeme</a> – General tech news, usually one of the first places you&#8217;ll find the big stories<strong></strong></li>
<li><a title="Twitter" href="http://twitter.com">Twitter</a> – One of the best ways of keeping on top of everything – many blogs tend to post on their Twitter feeds when new articles are posted, plus there&#8217;s an endless stream of useful links being shared</li>
</ul>
<p><strong>Help</strong></p>
<ul>
<li><a title="StackOverflow" href="http://stackoverflow.com/">StackOverflow</a> – Q&amp;A site for developers with specific problems, usually related to specific source code</li>
<li><a title="Programmers" href="http://programmers.stackexchange.com/">Programmers</a> – Q&amp;A site for programmers with higher-level conceptual problems</li>
</ul>
<p><strong>Mailing Lists</strong></p>
<ul>
<li><a title="JavaScript Weekly" href="http://javascriptweekly.com/">JavaScript Weekly</a></li>
<li><a title="HTML5 Weekly" href="http://html5weekly.com/">HTML5 Weekly</a></li>
<li><a title="Ruby Weekly" href="http://rubyweekly.com/">Ruby Weekly</a></li>
</ul>
<p><strong>Podcasts</strong></p>
<ul>
<li><a title="Herding Code" href="http://herdingcode.com/">Herding Code</a> – Weekly podcast on a range of topics</li>
<li><a title="Boagworld" href="http://boagworld.com/podcast/">Boagworld</a> – Longest running web design podcast</li>
<li><a title="The Changelog" href="http://changelogshow.com/">The Changelog</a> – Weekly podcast on the world of Open Source</li>
<li><a title=".NET Rocks!" href="http://dotnetrocks.com/">.NET Rocks!</a> – .NET</li>
<li><a title="Hanselminutes" href="http://hanselminutes.com/">Hanselminutes</a> – .NET/Windows focus</li>
<li><a title="NodeUp" href="http://nodeup.com/">NodeUp</a> – Node.js</li>
<li><a title="5by5" href="http://5by5.tv">5by5</a> – A number of podcasts on a range of topics</li>
</ul>
<p><strong>Web Hosts</strong></p>
<ul>
<li><a title="Heroku" href="http://heroku.com/">Heroku</a> – For Ruby, Node.js, Python, Java and more (requires understanding of source control &#8211; see below)</li>
<li><a title="AppHarbor" href="http://appharbor.com/">AppHarbor</a> – For .NET (requires understanding of source control &#8211; see below)</li>
<li><a title="Amazon Web Services" href="http://aws.amazon.com">Amazon Web Services (AWS)</a> &#8211; Amazon&#8217;s cloud platform, a more granular and pay-as-you-go way of choosing your hosting infrastructure</li>
<li><a title="Azure" href="http://azure.com">Azure</a> &#8211; As above, but Microsoft&#8217;s equivalent platform</li>
<li><a title="WebHostingTalk" href="http://webhostingtalk.com/">WebHostingTalk</a> – Great forums to help find/discuss any type of web host</li>
<li><a title="Low End Box" href="http://lowendbox.com">LowEndBox</a> &#8211; Useful place to find a really cheap and basic (but functional) server to manage yourself</li>
</ul>
<p><strong>Jobs</strong></p>
<ul>
<li><a title="StackOverflow Careers" href="http://careers.stackoverflow.com/">StackOverflow Careers</a></li>
<li><del><a title="CoderStack" href="http://coderstack.co.uk/">CoderStack</a></del> (<strong>update</strong>: service has closed)</li>
<li><a title="CW Jobs" href="http://cwjobs.co.uk/">CW Jobs</a></li>
<li>Also see <a title="Frontend developer interview questions" href="https://github.com/darcyclarke/Front-end-Developer-Interview-Questions">this huge list of frontend developer interview questions</a></li>
</ul>
<p><strong>Source Code / Version Control</strong></p>
<ul>
<li><a title="Git" href="http://git-scm.com/">Git</a> – One of the most popular version control systems out there</li>
<li><a title="Mercurial" href="http://mercurial.selenic.com/">Mercurial</a> – Similar to Git, slightly easier learning curve</li>
<li><a title="Github" href="http://github.com/">Github</a> – The most popular source code host, based on Git</li>
<li><a title="Bitbucket" href="http://bitbucket.org/">BitBucket</a> – Supports Git and Mercurial</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2012/02/05/useful-links-for-getting-started-with-web-development/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">189</post-id>	</item>
		<item>
		<title>Handling the proprietary CSS filter attribute in dotless</title>
		<link>https://blog.lukebennett.com/2012/01/31/handling-the-proprietary-css-filter-attribute-in-dotless/</link>
					<comments>https://blog.lukebennett.com/2012/01/31/handling-the-proprietary-css-filter-attribute-in-dotless/#comments</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Tue, 31 Jan 2012 23:38:06 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[less]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=185</guid>

					<description><![CDATA[I&#8217;m a big fan of the LESS CSS library &#8211; a fantastic way of simplifying the process of writing CSS by offering a number of basic programming capabilities such as variables, functions and mixins. There are a number of implementations available for different platforms, and the purpose of this blog post is to highlight a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m a big fan of the <a title="LESS - the dynamic stylesheet language" href="http://lesscss.org/">LESS CSS library</a> &#8211; a fantastic way of simplifying the process of writing CSS by offering a number of basic programming capabilities such as variables, functions and mixins.</p>
<p>There are a number of implementations available for different platforms, and the purpose of this blog post is to highlight a feature in <a title=".Less - dynamic CSS for .NET" href="http://dotlesscss.org/">dotless</a> &#8211; the .NET implementation &#8211; which I&#8217;ve had to call on occasionally but often forget about in the interim, so I&#8217;m hoping this will stop me from forgetting <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>From time to time (when needs absolutely must) it&#8217;s necessary to use the proprietary <code>filter</code> attribute to accommodate IE (much better if you can use something like <a title="PIE - progressive internet explorer" href="http://css3pie.com">CSS3 PIE</a> but like I say, sometimes needs must). For example:</p>
<pre class="brush: plain; title: ; notranslate">
.some-class {
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=15, Direction=0, Color='#000');
}
</pre>
<p>However, because of the abnormal syntax this involves, it causes parsing issues with dotless. I&#8217;ve read about a number of ways of working around this, but the only one I&#8217;ve found to be properly reliable (e.g. including the ability to use variables within the filter) is the use of dotless&#8217; <code>formatString</code> function (which appears to be undocumented).</p>
<p>This has a similar signature to <a title="String.Format Method" href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx">String.Format</a> i.e. it takes as its first argument a string containing placeholders where values need inserting ({0}, {1} etc) followed by an argument for each value to be substituted. So using the above example, your CSS would look something like this:</p>
<pre class="brush: plain; title: ; notranslate">
.some-class {
    filter: formatString(&quot;progid:DXImageTransform.Microsoft.Shadow(Strength={0}, Direction={1}, Color={2})&quot;, @strength, @direction, @color);
}
</pre>
<p>Or perhaps more usefully, making use of a mixin:</p>
<pre class="brush: plain; title: ; notranslate">
.some-class(@strength = 15, @direction = 0, @color = '#000') {
    filter: formatString(&quot;progid:DXImageTransform.Microsoft.Shadow(Strength={0}, Direction={1}, Color={2})&quot;, @strength, @direction, @color);
}
</pre>
<p>Obviously <code>formatString</code> can be used for much more than this particular scenario, it&#8217;s usefulness isn&#8217;t restricted to working around annoying proprietary CSS attributes that really are way past their sell by date&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2012/01/31/handling-the-proprietary-css-filter-attribute-in-dotless/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">185</post-id>	</item>
		<item>
		<title>TeamCity unable to load changes from Git due to an existing remote</title>
		<link>https://blog.lukebennett.com/2011/08/03/teamcity-unable-to-load-changes-from-git-due-to-an-existing-remot/</link>
					<comments>https://blog.lukebennett.com/2011/08/03/teamcity-unable-to-load-changes-from-git-due-to-an-existing-remot/#respond</comments>
		
		<dc:creator><![CDATA[Luke Bennett]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 09:31:53 +0000</pubDate>
				<category><![CDATA[Fixes]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[teamcity]]></category>
		<guid isPermaLink="false">http://blog.lukebennett.com/?p=179</guid>

					<description><![CDATA[I&#8217;ve recently been doing a lot of work in TeamCity, including switching over from SVN to Git (more to come on that in future blog posts). I&#8217;ve just had to deal with an odd issue which was entirely my fault but took a bit of head-scratching to figure out. I got the following exception (where [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve recently been doing a lot of work in TeamCity, including switching over from SVN to Git (more to come on that in future blog posts). I&#8217;ve just had to deal with an odd issue which was entirely my fault but took a bit of head-scratching to figure out.</p>
<p>I got the following exception (where &lt;URL_TO_GIT_REPOSITORY&gt; is a placeholder I&#8217;ve substituted for the original URL):</p>
<blockquote><p>jetbrains.buildServer.VCS &#8211; Error while loading changes for root &lt;URL_TO_GIT_REPOSITORY&gt; #master {instance id=43, parent id=3}, cause: &#8216;git fetch&#8217; command failed.<br />
stderr: The repository at directory &#8216;D:\Development\Infrastructure\.BuildServer\system\caches\git\git-4D05D25B.git&#8217; cannot be opened or created, reason: The specified directory D:\Development\Infrastructure\.BuildServer\system\caches\git\git-4D05D25B.git is already used for another remote &lt;URL_TO_GIT_REPOSITORY&gt; and cannot be used for others (&lt;URL_TO_GIT_REPOSITORY&gt; ). Please specify the other directory explicitly.</p></blockquote>
<p>What this essentially seems to be saying is that it can&#8217;t checkout changes from my remote Git repository because its local repository is currently tracking a different remote repository&#8230; which just happens to have the same URL! This didn&#8217;t make any sense &#8211; why was it thinking there were two different URLs here when they were clearly the same?</p>
<p>Well the eagle-eyed amongst you may spot that there is actually a subtle difference between the two reported URLs &#8211; the one in brackets has a trailing space after it. Turns out that I was setting the VCS root URL via a build parameter and had accidentally left the trailing space in there for one of my build configurations, giving me two different values in theory, even though to a human eye they looked the same. Clearly TeamCity doesn&#8217;t trim whitespace from VCS root URLs, otherwise it would have normalised them and treated them as one and the same.</p>
<p>Needless to say, removing the trailing space prompted everything to spring back into life.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lukebennett.com/2011/08/03/teamcity-unable-to-load-changes-from-git-due-to-an-existing-remot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">179</post-id>	</item>
	</channel>
</rss>
