<?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>Peter Blair</title>
	<atom:link href="http://petermblair.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://petermblair.com</link>
	<description>&#34;When in doubt, use brute force.&#34; -- Ken Thompson</description>
	<lastBuildDate>Wed, 02 Nov 2011 13:40:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Faking decorators in Ruby for authentication</title>
		<link>http://petermblair.com/2011/11/faking-decorators-in-ruby-for-authentication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faking-decorators-in-ruby-for-authentication</link>
		<comments>http://petermblair.com/2011/11/faking-decorators-in-ruby-for-authentication/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 13:40:47 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1103</guid>
		<description><![CDATA[I just wrote a complementary ruby script for decorator-style authentication requirements.]]></description>
			<content:encoded><![CDATA[<p>I just wrote a complementary ruby script for decorator-style authentication requirements.</p>
<script src="http://gist.github.com/1333638.js"></script>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/11/faking-decorators-in-ruby-for-authentication/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/11/faking-decorators-in-ruby-for-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using python decorators for authentication checks</title>
		<link>http://petermblair.com/2011/11/using-python-decorators-for-authentication-checks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-python-decorators-for-authentication-checks</link>
		<comments>http://petermblair.com/2011/11/using-python-decorators-for-authentication-checks/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 00:00:37 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[decorators]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1101</guid>
		<description><![CDATA[Consider the following example: A class decodes a JSON string and inspects it for certain authentication tokens. These token can be anything representing an authenticated session, I&#8217;m using the simple boolean check for my example. By using a decorator like the following: You can use the decorator above any method that handles JSON requests for [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following example: A class decodes a JSON string and inspects it for certain authentication tokens.  These token can be anything representing an authenticated session, I&#8217;m using the simple boolean check for my example.</p>
<p>By using a decorator like the following:</p>
<script src="http://gist.github.com/1332318.js"></script>
<p>You can use the decorator above any method that handles JSON requests for authentication.</p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/11/using-python-decorators-for-authentication-checks/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/11/using-python-decorators-for-authentication-checks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emailing updates to git users</title>
		<link>http://petermblair.com/2011/10/emailing-updates-to-git-users/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=emailing-updates-to-git-users</link>
		<comments>http://petermblair.com/2011/10/emailing-updates-to-git-users/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 19:57:09 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1099</guid>
		<description><![CDATA[Place this script in &#8220;.git/hooks/update&#8221; Ensure that you have this perl script installed to mail out the message]]></description>
			<content:encoded><![CDATA[<p>Place this script in &#8220;.git/hooks/update&#8221;</p>
<script src="http://gist.github.com/1323372.js"></script>
<p>Ensure that you have <a href="http://www.logix.cz/michal/devel/smtp-cli/">this perl script</a> installed to mail out the message</p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/emailing-updates-to-git-users/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/emailing-updates-to-git-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby and class methods</title>
		<link>http://petermblair.com/2011/10/ruby-and-class-methods/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-and-class-methods</link>
		<comments>http://petermblair.com/2011/10/ruby-and-class-methods/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 19:20:03 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1096</guid>
		<description><![CDATA[I&#8217;m just starting to learn to programme in Ruby, and wanted to play with some class methods to create a nice looking and expressive syntax. drink = Coffee.with :milk, :cream, :sugar When run: $ ./coffee.rb Creating coffee.. with Milk with Cream with Sugar Cost of coffee: 2.6]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just starting to learn to programme in Ruby, and wanted to play with some class methods to create a nice looking and expressive syntax.</p>
<p><code><br />
drink = Coffee.with :milk, :cream, :sugar<br />
</code></p>
<script src="http://gist.github.com/1323207.js"></script>
<p>When run:<br />
<code></p>
<p>$ ./coffee.rb<br />
Creating coffee..<br />
  with Milk<br />
  with Cream<br />
  with Sugar<br />
Cost of coffee: 2.6<br />
</code></p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/ruby-and-class-methods/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/ruby-and-class-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a team git repository</title>
		<link>http://petermblair.com/2011/10/creating-a-team-git-repository/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-a-team-git-repository</link>
		<comments>http://petermblair.com/2011/10/creating-a-team-git-repository/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 05:08:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1092</guid>
		<description><![CDATA[At work, we&#8217;re looking into using GIT to replace SVN for our team SCM.  I&#8217;m looking into &#8220;hosting&#8221; a repository on my workstation, and have outlined a few steps to make this as painless as possible. Step 1: Create a local user &#8220;git&#8221; This should be as easy as issuing &#8220;useradd git&#8221; as root, and [...]]]></description>
			<content:encoded><![CDATA[<p>At work, we&#8217;re looking into using GIT to replace SVN for our team SCM.  I&#8217;m looking into &#8220;hosting&#8221; a repository on my workstation, and have outlined a few steps to make this as painless as possible.</p>
<p><strong>Step 1: </strong><em>Create a local user &#8220;git&#8221;</em></p>
<p>This should be as easy as issuing &#8220;useradd git&#8221; as root, and setting all of the required permissions.  I&#8217;m going to assume that the home dir for git is &#8220;/home/git&#8221;, and all of my scripts will make the same assumption.</p>
<p><strong>Step 2:</strong><em> Create script to restrict SSH access to just git</em></p>
<p>We&#8217;re going to handle permissions by sharing SSH keys.  But, in order to stop users from just SSHing into the machine, and messing with things, we&#8217;ll use <a href="https://moocode.com/posts/6-code-your-own-multi-user-private-git-server-in-5-minutes">this wonderful tiny script<em></em><em></em></a> to handle this.  Install the script as described in the page, set the permissions, and we&#8217;re done.</p>
<p><strong>Step 3:</strong><em> Import a test SSH key</em></p>
<p>From another computer, generate a public SSH key, and paste the public key into git&#8217;s .ssh directory, within the file &#8220;authorized_keys&#8221;.  Take note that we&#8217;ll restrict certain SSH actions<em></em>:</p>
<p><code><br />
command="/usr/bin/gitserve git rw",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAA...<br />
</code></p>
<p><strong>Step 4:</strong><em> Create a utility script for creating new bare projects</em></p>
<p>We&#8217;re only concerned with handling new bare project at the moment, and not importing existing project.  So, we can use this little shell script to do the needful:</p>
<script src="http://gist.github.com/1321662.js"></script>
<p>Now, on the server, create a new project<em></em>:<br />
<code><br />
git@slowpoke:~$ bin/create_new_project.sh foo<br />
Initialized empty Git repository in /home/git/tmp/foo/.git/<br />
[master (root-commit) 988e2da] initial project<br />
0 files changed, 0 insertions(+), 0 deletions(-)<br />
create mode 100644 README<br />
Cloning into bare repository /home/git/foo.git...<br />
done.</code></p>
<p>And our project is now available for consumption.</p>
<p><strong>Step 5:</strong><em> Clone from remote</em></p>
<p>On a remote machine (my laptop in this case) I&#8217;ll clone the new git project.  Note, I&#8217;ve already had my public ssh key for my laptop installed under my workstation&#8217;s &#8220;git&#8221; user&#8217;s .ssh/authorized_keys file, so no extra authentication should be required.</p>
<p><code><br />
pblair@pblair-laptop:~$ rm -rf stuff/<br />
pblair@pblair-laptop:~$ mkdir stuff &amp;&amp; cd stuff<br />
pblair@pblair-laptop:~/stuff$ git clone git@slowpoke.internal.WORK.com:foo.git<br />
Initialized empty Git repository in /home/pblair/stuff/foo/.git/<br />
user git authorized<br />
remote: Counting objects: 3, done.<br />
remote: Total 3 (delta 0), reused 0 (delta 0)<br />
Receiving objects: 100% (3/3), done.</p>
<p>pblair@pblair-laptop:~/stuff$ ls -F<br />
foo/<br />
pblair@pblair-laptop:~/stuff$ cd foo/<br />
pblair@pblair-laptop:~/stuff/foo$ echo "indeed" &gt;&gt; README</p>
<p>pblair@pblair-laptop:~/stuff/foo$ git commit -m "indeed" -a<br />
[master 2c0ca9f] indeed<br />
1 files changed, 1 insertions(+), 0 deletions(-)<br />
pblair@pblair-laptop:~/stuff/foo$ git push<br />
user git authorized<br />
Counting objects: 5, done.<br />
Writing objects: 100% (3/3), 242 bytes, done.<br />
Total 3 (delta 0), reused 0 (delta 0)<br />
To git@slowpoke.internal.WORK.com:foo.git<br />
988e2da..2c0ca9f master -&gt; master<br />
</code></p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/creating-a-team-git-repository/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/creating-a-team-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration: Developer Commit and Staging Flow</title>
		<link>http://petermblair.com/2011/10/continuous-integration-developer-commit-and-staging-flow/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=continuous-integration-developer-commit-and-staging-flow</link>
		<comments>http://petermblair.com/2011/10/continuous-integration-developer-commit-and-staging-flow/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 19:49:02 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[devops]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1084</guid>
		<description><![CDATA[The Flowchart outlines a simple path in which a developer committing to branch breaks the regressions tests, triggering the CI server to lock the repository from subsequent commits. The expectation is that the developer will be notified via build report that the branch is effectively broken, and they must ensure that their subsequent commit will [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://petermblair.com/wordpress/wp-content/uploads/2011/10/flow.png"><img class="aligncenter size-full wp-image-1085" title="Continuous Deployment" src="http://petermblair.com/wordpress/wp-content/uploads/2011/10/flow.png" alt="" width="694" height="892" /></a><br />
The Flowchart outlines a simple path in which a developer committing to branch breaks the regressions tests, triggering the CI server to lock the repository from subsequent commits. The expectation is that the developer will be notified via build report that the branch is effectively broken, and they must ensure that their subsequent commit will pass all regression tests (note, the developer should be running regression tests against their branch before merging into the master, but not everyone will remember this). The SCM will be unlocked by some mechanism, be it a particular message indicating that the subsequent commit will fix it, re-opening the SCM to commits.</p>
<p>A successful regression test will trigger the <a href="http://rand9.com/blog/git-pre-receive-hook-for-rejecting-a-bad-gemfile/">SCM to be locked</a> until the current build it successfully deployed. The staging server will create a new chroot image based on a meta file containing all software packages, creating said software packages from the most recent commit to the SCM.</p>
<p>Upon successful stage, the CI server will request from the Deployment server that this new chroot environment be deployed to whatever environment (QA, Testing, Production, etc) for any subsequent User Acceptance testing, or for the truly brave, live production.</p>
<p>Once deployed, the CI server will unlock the SCM, allowing developers to commit more merges into the master branch, thus triggering this process over again.</p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/continuous-integration-developer-commit-and-staging-flow/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/continuous-integration-developer-commit-and-staging-flow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>devops: continuous deployment infrastructure</title>
		<link>http://petermblair.com/2011/10/devops-continuous-deployment-infrastructure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=devops-continuous-deployment-infrastructure</link>
		<comments>http://petermblair.com/2011/10/devops-continuous-deployment-infrastructure/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 05:51:46 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[continuous deployment]]></category>
		<category><![CDATA[continuous integration]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1076</guid>
		<description><![CDATA[Looking at how to handle a continuous deployment system in conjuncture with a continuous integration system. My thoughts are to use a CI system like Jenkins to automate the testing of all recently committed git repositories, and to kick off a check list of dependencies. The general idea would be: 1. Developer commits to git/master [...]]]></description>
			<content:encoded><![CDATA[<p>Looking at how to handle a continuous deployment system in conjuncture with a continuous integration system.  My thoughts are to use a CI system like <a href="http://jenkins-ci.org/">Jenkins</a> to automate the testing of all recently committed git repositories, and to kick off a check list of dependencies.</p>
<p>The general idea would be:</p>
<pre>
1. Developer commits to git/master
2. CI pulls from git/master
2.1 CI runs all regression tests against git/master
2.1.1 CI returns report to developer and halts if any fail
2.2 CI Looks up the package manifest of a given project, and pushes project to staging server
3. Staging server determines which OS project belongs under (Debian, etc) and generates debootstrap image if none exist
3.1 Staging server creates clone of debootstrap image, and apply all .deb packages from manifest to image
3.2 Staging server stores image to shared file space
4. CI calls deployment server to deploy the image to a given environment
5. Deployment server checks manifest, and determines which class of server image is to be deployed, and attempts to deploy the image to appropriate Dom0 for the given environment, as the appropriate DomU
</pre>
<p><a href="http://petermblair.com/wordpress/wp-content/uploads/2011/10/cd-diagram1.png"><img src="http://petermblair.com/wordpress/wp-content/uploads/2011/10/cd-diagram1.png" alt="" title="Continuous Deployment" width="323" height="382" class="aligncenter size-full wp-image-1079" /></a></p>
<p>Additional <a href="http://nedbatchelder.com/code/coverage/">coverage testing</a> would be included in the regression testing, and the first deployment would be to an <a href="http://en.wikipedia.org/wiki/Acceptance_testing">acceptance testing</a> environment. This setup is similar to <a href="http://morethanseven.net/2011/03/20/A-continuous-deployment-example-setup.html">http://morethanseven.net/2011/03/20/A-continuous-deployment-example-setup.html</a> and other ideas by <a href="http://www.kitchensoap.com/">kitchensoap.com</a>.</p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/devops-continuous-deployment-infrastructure/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/devops-continuous-deployment-infrastructure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>libemail: floating in space</title>
		<link>http://petermblair.com/2011/10/libemail-floating-in-space/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=libemail-floating-in-space</link>
		<comments>http://petermblair.com/2011/10/libemail-floating-in-space/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 06:46:48 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1073</guid>
		<description><![CDATA[Created with http://code.google.com/p/gource/]]></description>
			<content:encoded><![CDATA[<p>Created with <a href="http://code.google.com/p/gource/">http://code.google.com/p/gource/</a></p>
<p><div id="player2">
	<a href="http://www.macromedia.com/go/getflashplayer">
		<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
	</a>
</div>
<script type="text/javascript">
swfobject.embedSWF(
	'http://petermblair.com/wordpress/wp-content/plugins/flvplayer.swf',
	'player2',
	640,
	480,
	'9.0.0',
	false, 
	{file: "http://petermblair.com/videos/libemail.flv"},
	{allowfullscreen: true},
	{});
</script></p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/10/libemail-floating-in-space/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/10/libemail-floating-in-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://petermblair.com/videos/libemail.flv" length="6537216" type="video/x-flv" />
		</item>
		<item>
		<title>mutt: Mark all unread messages as read</title>
		<link>http://petermblair.com/2011/09/mutt-mark-all-unread-messages-as-read/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mutt-mark-all-unread-messages-as-read</link>
		<comments>http://petermblair.com/2011/09/mutt-mark-all-unread-messages-as-read/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 13:17:38 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://petermblair.com/?p=1029</guid>
		<description><![CDATA[I love this little mutt macro. Once I&#8217;ve cleared all of my mail that I&#8217;m interested in reading, I use this little macro to mark the rest as read: # Mark new messages as read macro index \Cr "~N\nN" "Mark all new messages as read"]]></description>
			<content:encoded><![CDATA[<p>I love this little mutt macro.  Once I&#8217;ve cleared all of my mail that I&#8217;m interested in reading, I use this little macro to mark the rest as read:</p>
<p><code><br />
# Mark new messages as read<br />
macro index \Cr "<tag-pattern>~N\n<tag-prefix><clear-flag>N" "Mark all new messages as read"<br />
</code></p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/09/mutt-mark-all-unread-messages-as-read/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/09/mutt-mark-all-unread-messages-as-read/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bikes on Wheels: Commercial</title>
		<link>http://petermblair.com/2011/09/bikes-on-wheels-commercial/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bikes-on-wheels-commercial</link>
		<comments>http://petermblair.com/2011/09/bikes-on-wheels-commercial/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 20:35:50 +0000</pubDate>
		<dc:creator>Peter Blair</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://petermblair.com/2011/09/bikes-on-wheels-commercial/</guid>
		<description><![CDATA[Local bike shop has a nice youtube commercial]]></description>
			<content:encoded><![CDATA[<p>Local bike shop has a nice youtube commercial </p>
<p><object width="550" height="309"><param name="movie" value="http://www.youtube.com/v/UJQQ879x4mA?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/UJQQ879x4mA?version=3" type="application/x-shockwave-flash" width="550" height="309" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div class="plus-one-wrap"><g:plusone href="http://petermblair.com/2011/09/bikes-on-wheels-commercial/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://petermblair.com/2011/09/bikes-on-wheels-commercial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

