<?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"
	>

<channel>
	<title>Insufficiently Random</title>
	<atom:link href="http://www.spearce.org/feed" rel="self" type="application/rss+xml" />
	<link>http://www.spearce.org</link>
	<description>The lonely musings of a loosely connected software developer.</description>
	<pubDate>Fri, 18 Jul 2008 20:23:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Getting Giddy with Git</title>
		<link>http://www.spearce.org/2008/07/getting-giddy-with-git.html</link>
		<comments>http://www.spearce.org/2008/07/getting-giddy-with-git.html#comments</comments>
		<pubDate>Fri, 18 Jul 2008 20:23:45 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<guid isPermaLink="false">http://www.spearce.org/?p=80</guid>
		<description><![CDATA[Recently Johannes Schindelin and I participated in a podcast about Git&#8217;s involvement in Google Summer of Code.  You can listen to the podcast on the Google open source blog.
]]></description>
			<content:encoded><![CDATA[<p>Recently Johannes Schindelin and I participated in a podcast about Git&#8217;s involvement in <a href="http://code.google.com/soc/">Google Summer of Code</a>.  You can listen to the podcast on <a href="http://google-opensource.blogspot.com/2008/07/getting-giddy-with-git.html">the Google open source blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2008/07/getting-giddy-with-git.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using jgit To Publish on Amazon S3</title>
		<link>http://www.spearce.org/2008/07/using-jgit-to-publish-on-amazon-s3.html</link>
		<comments>http://www.spearce.org/2008/07/using-jgit-to-publish-on-amazon-s3.html#comments</comments>
		<pubDate>Wed, 09 Jul 2008 05:06:07 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[jgit]]></category>

		<guid isPermaLink="false">http://www.spearce.org/?p=79</guid>
		<description><![CDATA[Recent versions of jgit, the 100% pure Java implementation of the Git version control system, support fetch and push directly over Amazon S3 .
It behaves like http push does in C git in that it is transparent to the end-user.  Transparent client-side encryption can also be enabled, in case the repository data must be [...]]]></description>
			<content:encoded><![CDATA[<p>Recent versions of <a href="http://repo.or.cz/w/egit.git">jgit</a>, the 100% pure Java implementation of the <a href="http://git.or.cz/">Git version control system</a>, support fetch and push directly over <a href="http://aws.amazon.com/s3">Amazon S3</a> .</p>
<p>It behaves like http push does in C git in that it is transparent to the end-user.  Transparent client-side encryption can also be enabled, in case the repository data must be protected from the operators of S3.<br />
<span id="more-79"></span><br />
First you need to create a bucket using some sort of standard S3 tools.  I used <a href="http://jets3t.s3.amazonaws.com/index.html">jets3t&#8217;s cockpit</a> tool to create &#8220;gitney&#8221;.  A bucket may hold any number of repositories and acts as a root directory.  It may also be a domain name if you want to use <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/VirtualHosting.html">S3 based virtual hosting</a>.</p>
<p>Next you need to create a properties file containing your AWSAccessKeyId and AWSSecretAccessKey so that jgit can authenticate itself with the S3 service.  Since the AWSSecretAccessKey should be maintained privately its a good idea to store this in a protected file within your home directory.</p>
<pre>
  $ touch ~/.jgit_s3_public
  $ chmod 600 ~/.jgit_s3_public
  $ cat >>~/.jgit_s3_public
  accesskey: AWSAccessKeyId
  secretkey: AWSSecretAccessKey
  acl: public
  EOF
</pre>
<p>We also include <code>acl: public</code> so all objects (files) created by jgit through this configuration file are readable by anyone.  The default (if not specified) is <code>acl: private</code>, making the objects readable only by yourself, and those who manage the S3 service.</p>
<p>Next we configure the remote in Git and push to the S3 bucket:</p>
<pre>
  $ git remote add s3 amazon-s3://.jgit_s3_public@gitney/projects/egit.git/
  $ jgit push s3 refs/heads/master
  $ jgit push --tags s3
</pre>
<p>Future updates are just as easy:</p>
<pre>
  $ jgit push s3 refs/heads/master
</pre>
<p>(or)</p>
<pre>
  $ git config --add remote.s3.push refs/heads/master
  $ jgit push s3
</pre>
<p>Pushes are always incremental and consequently there is relatively little bandwidth usage during subsequent pushes.</p>
<p>Our repository is now cloneable directly over HTTP (assuming we used <code>acl: public</code>):</p>
<pre>
  $ git clone http://gitney.s3.amazonaws.com/projects/egit.git
</pre>
<p>A jgit amazon-s3 URL is organized as:</p>
<pre>
  amazon-s3://$config@$bucket/$prefix
  http://$bucket.s3.amazonaws.com/$prefix
</pre>
<p>where the three major components are:</p>
<ul>
<li><code>$config</code> is the name of the configuration properties file stored in <code>$GIT_DIR/$config</code> or <code>$HOME/$config</code> (searched for in that order).</li>
<li><code>$bucket</code> is the name of the Amazon S3 bucket holding the objects.</li>
<li><code>$prefix</code> is the prefix to apply to all objects (files) within this repository.  It implicitly ends in &#8220;/&#8221;.  You may omit this portion of the URI if you want the bucket to contain only one repository.</li>
</ul>
<p>This is something of an abuse of URI syntax as the traditional username field is holding the name of a file in either <code>$GIT_DIR</code> or <code>$HOME</code>, however it permits hiding the secret access key from prying eyes as well as supplies a way to carry more information (such as acl or encryption settings) than what can appear in a URI.</p>
<p>Transparent client-side encryption for a repository stored on S3 can be enabled by adding a <code>password</code> to the properties file:</p>
<pre>
  $ cp ~/.jgit_s3_public ~/.jgit_s3_private
  $ echo password: Sup3rS3cr3t >>~/.jgit_s3_private
</pre>
<p>and using <code>.jgit_s3_private</code> in the $config field of an amazon-s3:// URL.  The encryption algorithm can also be specified in property <code>crypto.algorithm</code>, which defaults to PBEWithMD5AndDES.</p>
<p>The encryption format currently used by jgit matches the format used by jets3t (specifically format version 2), making it possible to download and decrypt a repository through cockpit in the event that jgit is not readily available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2008/07/using-jgit-to-publish-on-amazon-s3.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Server, New Home</title>
		<link>http://www.spearce.org/2008/06/new-server-new-home.html</link>
		<comments>http://www.spearce.org/2008/06/new-server-new-home.html#comments</comments>
		<pubDate>Fri, 27 Jun 2008 04:59:58 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<guid isPermaLink="false">http://209.20.77.23/2008/06/new-server-new-home.html</guid>
		<description><![CDATA[In honor of us moving from New York to California I have also moved the server that hosts spearce.org.  If you are reading this blog post, welcome to my new home away from home on the web.
If you aren&#8217;t reading this blog post, you may need to reconsider how you reached this location, since you [...]]]></description>
			<content:encoded><![CDATA[<p>In honor of us moving from New York to California I have also moved the server that hosts spearce.org.  If you are reading this blog post, welcome to my new home away from home on the web.</p>
<p>If you aren&#8217;t reading this blog post, you may need to reconsider how you reached this location, since you can&#8217;t see it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2008/06/new-server-new-home.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Difficult gitk Graphs</title>
		<link>http://www.spearce.org/2007/07/difficult-gitk-graphs.html</link>
		<comments>http://www.spearce.org/2007/07/difficult-gitk-graphs.html#comments</comments>
		<pubDate>Fri, 27 Jul 2007 03:59:02 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[git-gui]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2007/07/difficult-gitk-graphs.html</guid>
		<description><![CDATA[On the Git mailing list I&#8217;ve talked about one of the repositories I develop on/maintain, as its graph in gitk is somewhat interesting.  Today I took a couple of redacted screenshots from two of the interesting parts of the history.
The first image is from a set of octopus merges that occurred in the history. [...]]]></description>
			<content:encoded><![CDATA[<p>On the Git mailing list I&#8217;ve talked about one of the repositories I develop on/maintain, as its graph in gitk is somewhat interesting.  Today I took a couple of redacted screenshots from two of the interesting parts of the history.</p>
<p>The first image is from a set of octopus merges that occurred in the history.  This probably would look better if we had just used <a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"><code>git-rebase</code></a> to transplant the commits instead of merging them, but at the time the user who created these was still quite new to Git&#8230;</p>
<p style="margin-left: 40px"><a href="/2007/07/wide-gitk.gif"><img alt="Many Branches and Octopus Merges" title="Many Branches and Octopus Merges" src="/2007/07/wide-gitk-thumb.gif" /></a><br />
<a href="/2007/07/wide-gitk.gif"><em><font size="-1">(larger version)</font></em></a></p>
<p><span id="more-77"></span></p>
<p>What&#8217;s even worse about that particular rendering is the branches on either side.  This was taken with the following gitk preferences set:</p>
<blockquote><p>Maximum graph width (lines): 80<br />
Maximum graph width (% width of pane): 90</p></blockquote>
<p>Even with those settings, gitk still does not have enough space to show all of the active branches passing through this particular point in time (see the lines cut off on the upper right corner).  In case you are wondering, yes, nearly all of those merged together later on.  A few haven&#8217;t yet.<br />
This second image was taken from a more recent point in the project&#8217;s timeline, during the same gitk session, and with the same preferences.  We&#8217;ve obviously reduced the number of active branches somewhat, and there is now space for the commit subject lines (which I had to redact) and tracking branch labels (also had to be redacted).</p>
<p style="margin-left: 40px"><a href="/2007/07/ugly-gitk.gif"><img alt="Chained Merges" title="Chained Merges" src="/2007/07/ugly-gitk-thumb.gif" /></a><br />
<a href="/2007/07/ugly-gitk.gif"><em><font size="-1">(larger version)</font></em></a></p>
<p>There is still an octopus here (&#8221;Cauterize prior batch m&#8221;), but this one was automatically generated by a script we developed and was not directly caused by a user.  The script takes a single commit and merges it to all branches that share a common prefix.  I don&#8217;t have the repository on hand right now, but I think this particular octopus was created while we were merging one commit to ~80 branches.  In this case 4 branches were already fully merged with a 5th, and we wanted to keep it that way after the new commit was merged to all 80 branches.   To do that the script remerged these 4 by way of an octopus.</p>
<p>Before you can ask, no, this is not an imported repository.  This was all created in git, using the core porcelain and <a href="http://repo.or.cz/w/git-gui.git/">git-gui</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2007/07/difficult-gitk-graphs.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>pg is for sale</title>
		<link>http://www.spearce.org/2007/04/pg-is-for-sale.html</link>
		<comments>http://www.spearce.org/2007/04/pg-is-for-sale.html#comments</comments>
		<pubDate>Sun, 29 Apr 2007 05:50:54 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[pg]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2007/04/pg-is-for-sale.html</guid>
		<description><![CDATA[I have decided to no longer support pg, as I haven&#8217;t used it myself in a very, very long time.  It was a useful tool and learning vehicle for myself and a few others, but it just isn&#8217;t nearly as good as core Git with topic branches.  Or git-gui.
]]></description>
			<content:encoded><![CDATA[<p>I have decided to no longer support pg, as I haven&#8217;t used it myself in a very, very long time.  It was a useful tool and learning vehicle for myself and a few others, but it just isn&#8217;t nearly as good as core Git with topic branches.  Or <a xhref="/category/projects/scm/git-gui/">git-gui</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2007/04/pg-is-for-sale.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Git and Linux Repository Growth</title>
		<link>http://www.spearce.org/2007/03/git-and-linux-repository-growth.html</link>
		<comments>http://www.spearce.org/2007/03/git-and-linux-repository-growth.html#comments</comments>
		<pubDate>Thu, 01 Mar 2007 07:24:20 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<category><![CDATA[SCM]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2007/03/git-and-linux-repository-growth.html</guid>
		<description><![CDATA[I got curious about the growth rate for the git.git and linux-2.6.git repositories, so I wrote git-statplot to dump out object counts and sizes by earliest date entered.  Plotting these with Gnuplot gave me some interesting results:



The git.git repository (red line) appears to have a very stable history, but sees a huge spike right [...]]]></description>
			<content:encoded><![CDATA[<p>I got curious about the growth rate for the git.git and linux-2.6.git repositories, so I wrote <a href="http://article.gmane.org/gmane.comp.version-control.git/41042"><code>git-statplot</code></a> to dump out object counts and sizes by earliest date entered.  Plotting these with Gnuplot gave me some interesting results:</p>
<p><a href="/2007/03/bytes.pdf"><img src="/2007/03/bytes.png" height="216" width="360" /></a><br />
<a href="/2007/03/commits.pdf"><img src="/2007/03/commits.png" height="216" width="360" /></a><br />
<span id="more-75"></span><br />
The git.git repository (red line) appears to have a very stable history, but sees a huge spike right around now.  This spike is an outlier caused by my development repository; I was very actively rebasing a branch on Feb 26th, resulting in hundreds of commits in my reflog.</p>
<p>The linux-2.6.git history seems to show a periodic cycle, with some days reaching up to 700 commits per day.  The obvious correlation between number of KiB of disk space used and the number of commits per day is also clearly visible.  As I am not a kernel developer the linux-2.6.git data came from a mirror of Linus&#8217; repository.  I ommitted the first day outlier to prevent the Y-axis scales from shooting through the roof.</p>
<p>I have linked the images to higher-resolution PDFs, clicking on them will give you the PDFs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2007/03/git-and-linux-repository-growth.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>git-gui Screenshots</title>
		<link>http://www.spearce.org/2007/01/git-gui-screenshots.html</link>
		<comments>http://www.spearce.org/2007/01/git-gui-screenshots.html#comments</comments>
		<pubDate>Mon, 22 Jan 2007 07:57:20 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[git-gui]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2007/01/git-gui-screenshots.html</guid>
		<description><![CDATA[niv on #git nudged me enough to create some screenshots of git-gui.

The main window:

Branch creation dialog:

Delete branch dialog:

You can currently get git-gui by cloning the repository from repo.or.cz:
git clone git://repo.or.cz/git-gui.git
 or track it&#8217;s progress through gitweb at git-gui @ repo.or.cz.
]]></description>
			<content:encoded><![CDATA[<p>niv on #git nudged me enough to create some screenshots of git-gui.<br />
<span id="more-74"></span></p>
<p>The main window:<br />
<image src="/2007/01/gitgui-Main.png" /></p>
<p>Branch creation dialog:<br />
<image src="/2007/01/gitgui-CreateBranch.png" /></p>
<p>Delete branch dialog:<br />
<image src="/2007/01/gitgui-DeleteBranch.png" /></p>
<p>You can currently get git-gui by cloning the repository from repo.or.cz:</p>
<pre>git clone git://repo.or.cz/git-gui.git</pre>
<p> or track it&#8217;s progress through gitweb at <a href="http://repo.or.cz/w/git-gui.git">git-gui @ repo.or.cz</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2007/01/git-gui-screenshots.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>MythTV&#8217;s Deletion Logic</title>
		<link>http://www.spearce.org/2006/09/mythtvs-deletion-logic.html</link>
		<comments>http://www.spearce.org/2006/09/mythtvs-deletion-logic.html#comments</comments>
		<pubDate>Sun, 24 Sep 2006 00:48:38 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2006/09/mythtvs-deletion-logic.html</guid>
		<description><![CDATA[There must be a bug somewhere in MythTV&#8217;s show deletion logic.
I hate to admit it but I find Stargate Atlantis to be entertaining, so I record the new episode every Friday night.  Because I may not be able to get around to watching the show rigtht away I asked MythTV retain two copies of [...]]]></description>
			<content:encoded><![CDATA[<p>There must be a bug somewhere in MythTV&#8217;s show deletion logic.</p>
<p>I hate to admit it but I find Stargate Atlantis to be entertaining, so I record the new episode every Friday night.  Because I may not be able to get around to watching the show rigtht away I asked MythTV retain two copies of the show, deleting the oldest.</p>
<p>So right now my MythTV box has the episodes from Aug 25, Sept 18, Sept 16.  But not last night&#8217;s episode, Sept 22.  First off, why do I have 3 episodes when I asked for 2?  And secondly, why do I have an old episode but not the most recent?!?</p>
<p>Looking at the oldrecorded table in MySQL it shows that the Sept 22nd episode was in fact recorded.  But it must have been deleted just a few minutes after it finished recording.  <img src='http://www.spearce.org/wordpress/wp-includes/images/smilies/icon_mad.gif' alt=':mad:' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2006/09/mythtvs-deletion-logic.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>On Sandwich Making</title>
		<link>http://www.spearce.org/2006/09/on-sandwich-making.html</link>
		<comments>http://www.spearce.org/2006/09/on-sandwich-making.html#comments</comments>
		<pubDate>Mon, 04 Sep 2006 08:05:30 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2006/09/on-sandwich-making.html</guid>
		<description><![CDATA[I have never seen a discussion on sandwich making which was as worth reading as this one.  Nicely done.
]]></description>
			<content:encoded><![CDATA[<p>I have never seen a discussion on <a href="http://xkcd.com/c149.html">sandwich making</a> which was as worth reading as this one.  Nicely done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2006/09/on-sandwich-making.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>MySQL Recovery Blows</title>
		<link>http://www.spearce.org/2006/08/mysql-recovery-blows.html</link>
		<comments>http://www.spearce.org/2006/08/mysql-recovery-blows.html#comments</comments>
		<pubDate>Mon, 21 Aug 2006 07:56:16 +0000</pubDate>
		<dc:creator>spearce</dc:creator>
		
		<category><![CDATA[Random Musings]]></category>

		<guid isPermaLink="false">http://www.spearce.org/2006/08/mysql-recovery-blows.html</guid>
		<description><![CDATA[I&#8217;m running MythTV at home.  Since May it has replaced our trustworthy ReplayTV in the living room as the primary TV viewing apparatus.
Thus far its worked rather well for us, despite some odd user interface quirks that probably have more to do with the way I designed my Pronto panels than with MythTV itself.
But [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running <a href="http://www.mythtv.org/">MythTV</a> at home.  Since May it has replaced our trustworthy ReplayTV in the living room as the primary TV viewing apparatus.</p>
<p>Thus far its worked rather well for us, despite some odd user interface quirks that probably have more to do with the way I designed my Pronto panels than with MythTV itself.</p>
<p>But its use of <a href="http://www.mysql.com/">MySQL</a> is another story&#8230;<br />
<span id="more-71"></span><br />
Tonight MySQL filled the volume I have the database stored on.  What was a 4 GB disk volume went down to 0% free at 9:21 pm on Sunday.  MySQL didn&#8217;t handle this very well and crashed.  <img src='http://www.spearce.org/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>But to make matters worse I have the default Gentoo+MythTV MySQL setup, which means all MyISAM tables and binary logging.  After the great crash I moved the database to a dedicated volume of larger size and mounted that volume at the old location (<code>/var/lib/mysql</code>).  However MySQL found a way to corrupt its log files during the crash and was unable to start.  It kept demanding a non-existant log file.</p>
<p>I wound up having to check every table by hand with <code>myisamchk</code>, wipe out the logs, move the database to a temporary location, create a new database, delete the new database, then move the real database back.  Why?  Because even though the tables were all recovered the server kept demanding a missing log file and there was no obvious way to create a new log file to fill in its place.  If the server really was logging it wouldn&#8217;t have found a way to lose its log file in the first place.</p>
<p>I should make it clear that the host, the disks, the filesystem were all online and available.  62 days of uptime.  This crash wasn&#8217;t due to a power failure or disk corruption.  Its purely a software bug in MySQL.</p>
<p>Recovery is one of those areas that you just want to always work.  Oracle has had it working for many years (though I still have seen Oracle databases not recover but its pretty rare).  <a href="http://www.postgresql.org/">PostgreSQL</a> has also had pretty good recovery for a long time.  These <a href="http://sql-info.de/mysql/gotchas.html">MySQL yahoos</a> are still in the stone ages when it comes to recovery.  Yet MythTV&#8217;s only available database backend is MySQL.  Arrgh!</p>
<p>I hate crappy database software.  I had to give up on my OpenLDAP installation as it kept eating its Berkley DB database.  I don&#8217;t have time or the energy to try and recover the thing every time I want to use it.  Now its looking like I might have to give up MythTV because of its equally bad database backend.  No wonder why I only use PostgreSQL for my projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spearce.org/2006/08/mysql-recovery-blows.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
