<?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>damontimm.com &#187; macports</title>
	<atom:link href="http://blog.damontimm.com/tag/macports/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.damontimm.com</link>
	<description>Where I go to remember what I did</description>
	<lastBuildDate>Fri, 16 Jul 2010 18:51:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How To: Automated Encrypted Incremental Backups on Amazon S3 with Duplicity (OS X or Ubuntu)</title>
		<link>http://blog.damontimm.com/how-to-automated-secure-encrypted-incremental-backups-amazon-s3-duplicity-os-x-or-ubuntu/</link>
		<comments>http://blog.damontimm.com/how-to-automated-secure-encrypted-incremental-backups-amazon-s3-duplicity-os-x-or-ubuntu/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 22:26:46 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[amazon s3]]></category>
		<category><![CDATA[duplicity]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=107</guid>
		<description><![CDATA[Purpose: setup an automatic encrypted off-site backup system that utilizes Amazon S3 with incremental backups by duplicity on the Mac (Leopard) or Ubuntu. Currently, I do have my own on-site backup system in place (nightly backups via rsync to external hard drive), but I am wary that some day my house may explode and I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> setup an automatic encrypted off-site backup system that utilizes Amazon S3 with incremental backups by <a href="http://duplicity.nongnu.org/">duplicity</a> on the Mac (Leopard) or Ubuntu. Currently, I do have my own on-site backup system in place (nightly backups via rsync to external hard drive), but I am wary that some day my house may explode and I&#8217;ll have nothing left. Enter my new friend: the encrypted off-site backup.</p>
<p><span id="more-107"></span></p>
<h2>before you begin</h2>
<p>Before you can start backing things up off-site in a secure fashion, you&#8217;ll need to get a few pieces of the puzzle in place. Namely, you&#8217;ll need software installed (duplicity), a GPG key (for encryption), and an <a href="http://aws.amazon.com/s3/">Amazon S3 </a>account setup (for storage), and then use <a href="http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/">a backup script</a> that can be run automatically (for laziness&#8217;s sake!).</p>
<p>Getting an Amazon S3 account is easy to do: head over to <a href="http://aws.amazon.com/s3/">http://aws.amazon.com/s3/</a> and sign up; grab your &#8220;Access Key ID&#8221; and &#8220;Secret Access Key&#8221; and you are ready to go. There is a lot you can do with S3 (and a lot of ways to access it), but for our purposes, this is pretty much all you need.</p>
<p>Lastly, I would recommend spending a little time reading about duplicity (<a href="http://duplicity.nongnu.org/duplicity.1.html">see the man page</a>) as well as GnuPG (<a href="http://gnupg.org/documentation/manuals/gnupg/">man page</a>). There is a lot to consider, and I just picked the options I thought would work best for me.</p>
<h2>Install the Software: Duplicity</h2>
<p>For this to work we need duplicity installed with all the correct dependencies. The easiest way to do this on your Mac is to simply use <a href="http://www.macports.org/">MacPorts</a>, which has an up-to-date version in the repositories (<em>see</em> <a href="http://http://blog.damontimm.com/how-to-install-macports-on-os-x-leopard-105/">Installing MacPorts</a> if you don&#8217;t have it installed already). If you already have MacPorts installed, all you should have to do is run the following from the Terminal:</p>
<ul class="terminal">
<li><code>$ sudo port install duplicity py25-socket-ssl py25-boto</code></li>
</ul>
<p>If you are using Ubuntu, you could simply run <code>sudo aptitude install duplicity</code> to install the program (it is in the repositories); however, if you want to make sure you are using the <a href="http://savannah.nongnu.org/download/duplicity/" target="_blank">latest version</a> (which may not be available there yet), you can try this:</p>
<ul class="terminal">
<li><code>$ sudo apt-get build-dep duplicity</code></li>
<li><code>$ sudo aptitude install python-boto ncftp </code></li>
<li><code>$ wget http://savannah.nongnu.org/download/duplicity/duplicity-0.5.07.tar.gz</code></li>
<li><code>$ tar xvzf duplicity-0.5.07.tar.gz</code></li>
<li><code>$ cd duplicity-0.5.07/</code></li>
<li><code>$ sudo python setup.py install</code></li>
</ul>
<p>If you ever want to upgrade again, just download and untar the latest version and run the last setup line again.  It will install the newest version for you.</p>
<p>If everything has installed correctly, you can do a test run pretty easily on your local machine by backing up a folder to another local folder (first command) and then restoring it to a different folder (second command). If you look inside this <code>/test/backup-location/</code> you&#8217;ll see what duplicity looks like:</p>
<ul class="terminal">
<li><code>$ duplicity --no-encryption /test/folder/ file:///test/backup-location/</code></li>
<li><code>$ duplicity --no-encryption file:///test/backup-location/ /test/restore-location/</code></li>
</ul>
<h2>Setting Up Encryption</h2>
<p>For duplicity to really shine, it needs to have a gpg key to encrypt your files. If you don&#8217;t already have one, you can create it by running the following (read the <a href="http://www.gnupg.org/gph/en/manual.html#AEN26">documentation</a> for more information):</p>
<ul class="terminal">
<li><code>$ gpg --gen-key</code></li>
</ul>
<p>I used all the defaults when setting up my key and chose my own passphrase. Unfortunately, in order to make this work without user input (as an automatic cron job), the passphrase is going to have to be stored somewhere on your computer locally, so, I wouldn&#8217;t use one of your usual passwords (something really long and unique would be better).  Also, if you <em>already</em> have a gpg key (or want to use one for other purposes), I would recommend making a <em>different</em> one for the Amazon S3 backups &#8212; because, in the end, your password has to be stored somewhere on your computer for it to work auto-<em>magically</em>.</p>
<p>Once you have your gpg key created you can check it out by running:</p>
<ul class="terminal">
<li><code>$ gpg --list-keys</code></li>
</ul>
<p>This shows your new key, which probably looks something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">pub   1024D/CA4ZA320 2008-11-15
uid                  Damon Timm (thornomad) email@example.com
sub   2048g/C1E64A4F 2008-11-15</pre></div></div>

<p>Note the public key identifier &#8220;CA4FA320&#8243; (yours will be different); we will need that to go in our script.</p>
<h2>final step: using a backup script</h2>
<p>So, everything is on your system and, hopefully, working.  Now, to run a backup takes a lot of typing (on the command line) and the easiest way to avoid this chore is to run a backup script.  A script can store your Amazon and GPG key information and make it so you don&#8217;t have to type anything ever again!</p>
<p>Backing things up is a very personal task, and everyone is going to want to do it a little differently.  I created <a href="http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/">my own backup script</a> which you are happy to check out &#8212; if you have any neat features you add to suggestions, I would love to hear them and incorporate them.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-automated-secure-encrypted-incremental-backups-amazon-s3-duplicity-os-x-or-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To: Install MacPorts on OS X Leopard (10.5)</title>
		<link>http://blog.damontimm.com/how-to-install-macports-on-os-x-leopard-105/</link>
		<comments>http://blog.damontimm.com/how-to-install-macports-on-os-x-leopard-105/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 12:58:56 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[port]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/?p=43</guid>
		<description><![CDATA[Purpose: install MacPorts on OS X Leopard (10.5) to gain access to a host of open source applications and tools that make working on the Mac as cool as can be. Using MacPorts makes it easy to install applications you would otherwise have to build from source &#8212; which can be difficult for folks like [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> install <a href="http://macports.org">MacPorts</a> on OS X Leopard (10.5) to gain access to a host of open source applications and tools that make working on the Mac as cool as can be.  Using MacPorts makes it easy to install applications you would otherwise have to build from source &#8212; which can be difficult for folks like me, who don&#8217;t understand what the hell they are doing in the first place.</p>
<p><span id="more-43"></span></p>
<h3>Install MacPorts</h3>
<p>First, we&#8217;ll need to make sure you have &#8220;XCode Tools&#8221; installed on your Mac &#8212; XCode Tools install all the programs needed to build applications from source.  It comes standard with all Macs, however, it isn&#8217;t installed by default, so you&#8217;ll need your installation DVD (or you can <a href="http://developer.apple.com/technology/xcode.html">download them</a>).  From the DVD, go to the &#8220;Optional Install&#8221; folder and then &#8220;XCode Tools&#8221; and run the installer package.</p>
<p>Second, we&#8217;ll have to download and install the MacPorts from: <a href="http://macports.org/install.php">http://macports.org/install.php</a>.  Choose a .dmg disk image for whichever version of OS X you are using. </p>
<p>Third, after MacPorts has been installed, we&#8217;ll need to update our <code>PATH</code> variable in the Terminal to be able to find the MacPorts program (which is called <code>port</code>).  If you have your own way of doing this, go for it &#8212; however, I created a <code>~/.bash_profile</code> file to accomplish this task.  If you don&#8217;t already have a profile file, you can do this by entering the following in the terminal (I also added two other common places programs get installed on the command line that save me trouble down the road):</p>
<ul class="terminal">
<li><code>$ echo "export PATH=/usr/local/bin/:/usr/local/sbin/:/opt/local/bin/:/opt/local/sbin/:$PATH" >> ~/.bash_profile</code></li>
</ul>
<p>Restart the Terminal program for these changes to take effect.  If this has been accomplished successfully, then you should be able to run (again in the Terminal) the following for a self-update and it should work:</p>
<ul class="terminal">
<li><code>$ sudo port -v selfupdate</code></li>
</ul>
<p>If nothing happens and, instead, you get an error that says: <code>-bash: port: command not found</code>, that means your <code>PATH</code> variable wasn&#8217;t set correctly.  If this is the first time you are running a command using <code>sudo</code> you&#8217;ll get a warning saying something to the effect of: if you don&#8217;t know what you are doing, turn back now.  Ignore this warning.</p>
<h3>What&#8217;s Next</h3>
<p>With MacPorts installed by itself, nothing much is going to change.  But you&#8217;ll be able to use it to install open source applications that are very exciting (like lame, flac, ffmpeg, gimp, etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-install-macports-on-os-x-leopard-105/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
