<?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</title>
	<atom:link href="http://blog.damontimm.com/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: Store iMovie &#8217;09 Events and Projects on a Network Volume (NAS)</title>
		<link>http://blog.damontimm.com/how-to-store-imovie-09-events-and-projects-on-a-network-volume-nas/</link>
		<comments>http://blog.damontimm.com/how-to-store-imovie-09-events-and-projects-on-a-network-volume-nas/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:33:32 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iMovie]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=248</guid>
		<description><![CDATA[Purpose: while iMovie &#8217;09 allows you to store your events and projects on physically attached hard drives (external or internal) it doesn&#8217;t offer an out-of-the-box way to store them on a network attached storage (NAS) device. I have a file serve and I want to use it. how to set it up The only way [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose</strong>: while iMovie &#8217;09 allows you to store your events and projects on physically attached hard drives (external or internal) it doesn&#8217;t offer an out-of-the-box way to store them on a network attached storage (NAS) device.  I have a file serve and I want to use it.</p>
<p><span id="more-248"></span></p>
<h2>how to set it up</h2>
<p>The only way I have found to circumvent this annoyance is to play a little trick on iMovie.  And that trick is to move the original <code>~/Movies</code> folder under a different name and put a symlink in its place (to the network folder of your choice).</p>
<p>Here are the steps I took from the Terminal to do this (you will need to have Administrator privileges and you will need to know where your network folder is attached):</p>
<ul class="terminal">
<li><code>sudo mv ~/Movies/ ~/Movies-original</code></li>
<li><code>ln -s /Volumes/my-network-volume/Movies/ ~/Movies</code></li>
</ul>
<p>Now, when I load up iMovie it will use the networked volume.  If you don&#8217;t like this, you can always move your <code>~/Movies-original</code> folder back where it was.</p>
<h2>remaining issues</h2>
<p>Unfortunately, this isn&#8217;t a perfect fix.  There are two caveats or issues I have found.  </p>
<p>One, is that now my hard drive (called Papa Bear) is listed twice in the <em>Project Library</em>:</p>
<p><img src="http://blog.damontimm.com/wp-content/uploads/2010/04/imovie-duplicate-project-libraries.png" alt="" title="imovie-duplicate-project-libraries" width="415" height="96" class="aligncenter size-full wp-image-249" /></p>
<p>And two, is that when you delete an event or project from within iMovie, it moves the project into a temporary folder rather than actually deleting it.  The next time you open iMovie, it will show up again.  I&#8217;m sure this is because it <em>thinks</em> it is working with a bona fide Trash system but its not (because it is network storage.  See this example:</p>
<p><img src="http://blog.damontimm.com/wp-content/uploads/2010/04/imovie-temporary-folders.png" alt="" title="imovie-temporary-folders" width="423" height="93" class="aligncenter size-full wp-image-250" /></p>
<p>In order to get around this annoyance, I created a Python script which removes the temporary files for me and created a cron job to run the script from time to time (cleaning up the mess iMovie leaves behind).</p>
<pre class="brush: python; gutter: true;">#!/usr/bin/env python
'''
Simple script to remove all directories that match the name:
    /iMovie Temporary Items */  [note the star!]

'''
import os
import fnmatch
import shutil

# tuple of directories to search through (you can add more than one)
DIRS = ('/Volumes/leaker-damon/tps/Videos/',)

for directory in DIRS:
    for root, dirnames, filenames in os.walk(directory):
        for directory in dirnames:
            if fnmatch.fnmatch(directory,'iMovie Temporary Items *'):
                shutil.rmtree(os.path.join(root,directory))</pre>
<h2>make this more better</h2>
<p>Am interested to hear how other people have been handling this &#8212; this approach certainly isn&#8217;t perfect, but it seems to work (for now).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-store-imovie-09-events-and-projects-on-a-network-volume-nas/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Script: clean_bzip &#8211; a command line program for clean directory compression</title>
		<link>http://blog.damontimm.com/python-script-clean-bzip/</link>
		<comments>http://blog.damontimm.com/python-script-clean-bzip/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 14:01:05 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[bzip2]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=237</guid>
		<description><![CDATA[A simple command-line python utility that compresses a directory (or directories) and excludes certain unwanted files. As a self-taught Python user I am still looking for insight on the most pythonic and programmatically-friendly way of accomplishing a given task. In this case, I have written a script that will perform a &#8220;clean bzip2&#8243; of a [...]]]></description>
			<content:encoded><![CDATA[<p>A simple command-line python utility that compresses a directory (or directories) and excludes certain unwanted files.</p>
<p><span id="more-237"></span></p>
<p>As a self-taught Python user I am still looking for insight on the most pythonic and programmatically-friendly way of accomplishing a given task.  In this case, I have written a script that will perform a &#8220;clean bzip2&#8243; of a directory (or directories).  Mac OS X (via AFP and netatalk, in my case) tends leaves a bunch of ugly files/directories hanging around and I would rather not include them in my compressed tar file.</p>
<p>In writing the script, though, I ran into some questions and I am not sure what the recommended approach would be. The script works, as it is, but I feel its a little hacked together and also a little limited in its application.   There is something to be said for programs that &#8220;just work&#8221; (this does) but I want to take it a little further as an educational endeavor and would like it to appear robust, future-thinking, and pythonic.</p>
<p>My initial questions are:</p>
<ol>
<li><del datetime="2010-04-02T10:58:26+00:00">Is there a better way to implement a <code>--quiet</code> flag?</del> [using <code>logging</code>]</li>
<li>I am not very clear on the use of Exceptions (or even if I am using it in a good way here) &#8212; is what I have done the right approach? </li>
<li>Finally, in general: any feedback on how to improve this?  (I am thinking, just now, that the script is only suitable for a command line usage, and couldn&#8217;t be imported by another script, for example.)</li>
</ol>
<p>Any feedback is greatly appreciated.  Writing a script like this is a good learning tool (for me, at least).</p>
<pre class="brush: python;">#! /usr/bin/env python

'''Script to perform a "clean" bzip2 on a directory (or directories).  Removes
extraneous files that are created by Apple/AFP/netatalk before compressing.
'''

import os
import tarfile
import logging
from optparse import OptionParser

# Default files and directories to exclude from the bzip tar
IGNORE_DIRS = ('.AppleDouble',)
IGNORE_FILES = ('.DS_Store',)

class DestinationTarFileExists(Exception):
    '''If the destination tar.bz2 file already exists.'''

def ignore_walk(directory, ignore_dirs=None, ignore_files=None):
    '''Ignore defined files and directories when doing the walk.'''

    # TODO: this does not currently take wild cards into account.  For example,
    # if you wanted to exclude *.pyc files ... should fix that.  Perhaps
    # consider moving this entirely into the below function (or making it more
    # reusable for other apps).
    for dirpath, dirnames, filenames in os.walk(directory):
        if ignore_dirs:
            dirnames[:] = [dn for dn in dirnames if dn not in ignore_dirs]
        if ignore_files:
            filenames[:] = [fn for fn in filenames if fn not in ignore_files]
        yield dirpath, dirnames, filenames

def tar_bzip2_directory(directory, ignore_dirs=IGNORE_DIRS,
                                   ignore_files=IGNORE_FILES ):
    '''Takes a directory and creates a tar.bz2 file (based on the directory
    name).  You can exclude files and sub-directories as desired.'''

    file_name = '-'.join(directory.split(' '))
    tar_name = file_name.replace('/','').lower() + ".tar.bz2"

    if os.path.exists(tar_name):
        msg = ("The file %s already exists. " +
                "Please move or rename it and try again.") % tar_name
        raise DestinationTarFileExists(msg)

    tar = tarfile.open(tar_name, 'w:bz2')

    for dirpath, dirnames, filenames in ignore_walk(directory, ignore_dirs,
            ignore_files):
        for file in filenames:
            logging.info(os.path.join(dirpath, file))
            tar.add(os.path.join(dirpath, file))

    tar.close()

def main(args=None, callback=None):
    directories = []

    for arg in args:
        if os.path.isdir(arg):
            directories.append(arg)
        else:
            logging.ERROR("Ingoring: %s (it's not a directory)." % arg)

    for dir in directories:
        try:
            tar_bzip2_directory(dir)
        except DestinationTarFileExists, e:
            print e

if __name__ == "__main__":

    parser = OptionParser(usage="%prog [options: -q ] [dir1] [...dir2]")
    parser.add_option("-q", "--quiet", action="store_true", dest="quiet")
    options, args = parser.parse_args()

    if options.quiet:
        logging.basicConfig(level=logging.ERROR, format='%(message)s')
    else:
        logging.basicConfig(level=logging.INFO, format='%(message)s')

    main(args)</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/python-script-clean-bzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django-hitcount: simple app to count hits/views for an object</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/</link>
		<comments>http://blog.damontimm.com/django-hitcount-app-count-hits-views/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 01:10:38 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=201</guid>
		<description><![CDATA[django-hitcount: a simply django application that allows you to count hits/views on a per object basis. This app came about as an answer to my own question at stackoverflow.com. Am hoping that others will find it useful. This isn&#8217;t meant to be a full-fledged tracking application (see django-tracking) or a real analytic tool (try Google [...]]]></description>
			<content:encoded><![CDATA[<p><strong>django-hitcount</strong>: a simply django application that allows you to count hits/views on a per object basis.  This app came about as an answer to <a href="http://stackoverflow.com/questions/1603340/track-the-number-of-page-views-or-hits-of-an-object">my own question</a> at stackoverflow.com.  Am hoping that others will find it useful.</p>
<p><span id="more-201"></span></p>
<p>This isn&#8217;t meant to be a full-fledged tracking application (see django-tracking) or a real analytic tool (try Google Analytics); rather, it&#8217;s meant to simply count the number of hits/view on an object-per-object basis.  </p>
<h2>How to install:</h2>
<p>I find that the easiest way to work with django apps is to symbolically link them to my <code>site-packages</code> directory.  It&#8217;s easier to update the apps with svn, git, or hg than it is to manually download the files and install by hand.</p>
<p>For me, this is what it looks like (you can cut and paste to make it easy):</p>
<ul class="terminal">
<li><code>cd ~/src</code></li>
<li><code>git clone git://github.com/thornomad/django-hitcount.git</code></li>
<li><code>sudo ln -s `pwd`/django-hitcount/hitcount `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/hitcount</code></li>
</ul>
<p>Test it works by loading python and checking the version (should not get an error):</p>
<pre class="brush: python;">
>>> import hitcount
>>> hitcount.__version__
'0.1 alpha'
>>></pre>
<h2>Adding to your django project:</h2>
<p>Add the <code>hitcount</code> app to your <code>INSTALLED_APPS</code> tuple and run <code>syncdb</code>.  </p>
<p>There are two additional settings you can add to your <code>settings.py</code> file:</p>
<pre class="brush: python;">HITCOUNT_KEEP_HIT_ACTIVE = { 'days': 7 }
HITCOUNT_HITS_PER_IP_LIMIT = 0
HITCOUNT_EXCLUDE_USER_GROUP = ( 'Editor', )</pre>
<p><code><strong>HITCOUNT_KEEP_HIT_ACTIVE</strong></code>: is the number of days, weeks, months, hours, etc (timedelta kwargs), that an Hit is kept &#8216;active&#8217;.  If a Hit is &#8216;active&#8217; a repeat viewing will not be counted.  After the active period ends, however, a new Hit will be recorded.  You can decide how long you want this period to last &#8230;</p>
<p><code><strong>HITCOUNT_HITS_PER_IP_LIMIT</strong></code>: limit the number of &#8216;active&#8217; hits from a single IP address.  <code>0</code> means that it is unlimited.  You may want to set this, or not.  </p>
<p><code><strong>HITCOUNT_EXCLUDE_USER_GROUP</strong></code>: don&#8217;t count any hits from certain logged in users.  In the example above, I don&#8217;t want any of my editors inflating the total Hit count.</p>
<h2>Adding to your <code>urls.py</code>:</h2>
<p>You need to add one line to your <code>urls.py</code> file.  </p>
<p>You can have this url, itself, point to anywhere you like, but you need to keep the <code>name='hitcount_update_ajax'</code> constant.  </p>
<pre class="brush: python; gutter: true;">from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail
from hitcount.views import update_hit_count_ajax

urlpatterns = patterns('',
    url(r'^ajax/hit/$', # you can change this url if you would like
        update_hit_count_ajax,
        name='hitcount_update_ajax'), # keep this name the same

    # other views, for example my object view is:

    url(r'^/video/(?P&lt;object_id>\d+)$', object_detail,
        {   'queryset': Video.objects.all(),
            'template_name': "video/view.html"},
            name='video_detail_view'),

)</pre>
<h2>Edit your templates</h2>
<p>Add the javascript to your <code>object_detail</code> templates (or any template that handles a single object) so that our hit counter is called after the document loads.  </p>
<p>Here is what my <code>head</code> includes:</p>
<pre class="brush: html;">{% load hitcount_tags %}
&lt;script src="/media/js/jquery-latest.js" type="text/javascript">&lt;/script>
&lt;script type="text/javascript">&lt;!--
    $(document).ready(function() {
        {% get_hit_count_javascript for object %}
    });
-->&lt;/script></pre>
<p>When the template is rendered, it should turn into something like this:</p>
<pre class="brush: js;">
$(document).ready(function() {

$.post( '/ajax/hit/',
	{ hitcount_pk : '3' },
	function(data, status) {
		if (data.status == 'error') {
			// do something for error?
		}
	},
	'json');

});</pre>
<h2>Display the hits!</h2>
<p>The most exciting part, is actually displaying your hits.  There are four different ways to do it:</p>
<pre class="brush: text;">    - Return total hits for an object:
      {% get_hit_count for [object] %}

    - Get total hits for an object as a specified variable:
      {% get_hit_count for [object] as [var] %}

    - Get total hits for an object over a certain time period:
      {% get_hit_count for [object] within ["days=1,minutes=30"] %}

    - Get total hits for an object over a certain time period as a variable:
      {% get_hit_count for [object] within ["days=1,minutes=30"] as [var] %}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/django-hitcount-app-count-hits-views/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Replacing the Capacitors on my Netgear GS108</title>
		<link>http://blog.damontimm.com/replacing-the-capacitors-on-my-netgear-gs108/</link>
		<comments>http://blog.damontimm.com/replacing-the-capacitors-on-my-netgear-gs108/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:06:54 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[gs108]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=193</guid>
		<description><![CDATA[I got back from vacation recently and found that my Netgear GS108 gigabit switch had died &#8212; or rather, it was flashing green lights at me left and right and &#8212; even worse &#8212; very inconsistenly, at that. Sometimes off, sometimes on &#8230; didn&#8217;t seem to matter what machines were plugged in. Of course, I [...]]]></description>
			<content:encoded><![CDATA[<p>I got back from vacation recently and found that my Netgear GS108 gigabit switch had died &#8212; or rather, it was flashing green lights at me left and right and &#8212; even worse &#8212; very inconsistenly, at that.  Sometimes off, sometimes on &#8230; didn&#8217;t seem to matter what machines were plugged in.</p>
<p><span id="more-193"></span></p>
<p>Of course, I googled it and found this <a href="http://qualapps.blogspot.com/2007/05/netgear-gs108-gige-switch-failure.html">post by Jim Beveridge</a> &#8212; inside the comments were a suggestion to replace the capacitors.  So, I set about doing it.  I needed to replace the green ones (see image) and got everything at RadioShack.  Cost less than $20 (and I had to buy a soldering iron).</p>
<p><img class="aligncenter size-full wp-image-195" title="gs108-before" src="http://blog.damontimm.com/wp-content/uploads/2009/03/gs108-before.png" alt="gs108-before" width="500" height="330" /></p>
<p>So, out went the green ones (which were bulging) and in went the jumbo-sized RadioShack ones (I would recommend buying them online so they actually fit, but hey: I take what I can get).</p>
<p><img class="aligncenter size-full wp-image-194" title="gs108-after" src="http://blog.damontimm.com/wp-content/uploads/2009/03/gs108-after.png" alt="gs108-after" width="500" height="335" /></p>
<p>Case top won&#8217;t fit but a little masking tape did the trick and back to the basement it went &#8212; working like a charm!  Would have cost less than $5 if I had my own soldering iron &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/replacing-the-capacitors-on-my-netgear-gs108/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Server: AMD 4850e with RAID 5</title>
		<link>http://blog.damontimm.com/new-server-amd-4850e-raid-5/</link>
		<comments>http://blog.damontimm.com/new-server-amd-4850e-raid-5/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 17:25:44 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[amd]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=174</guid>
		<description><![CDATA[Well: the time finally came for me to bite the bullet and buy a new home server. This new machine is replacing my circa 1999 Dell Pentium III 550mhz box that has been running, faithfully I might add, in my basement for the last couple of years as a NAS.  It will also replace the [...]]]></description>
			<content:encoded><![CDATA[<p>Well: the time finally came for me to bite the bullet and buy a new home server. This new machine is replacing my circa 1999 Dell Pentium III 550mhz box that has been running, faithfully I might add, in my basement for the last couple of years as a NAS.  It will also replace the laptop with the broken screen in the basement, which has been serving as my web server.  Since: my file transfer speeds were so appalling (~10MB/s), I am running out of hard drive space, <em>and</em> the box sounds like it is ready to take off at any moment (I don&#8217;t think there are any ball bearings left) I thought it prudent to bit the bullet and get a new server.</p>
<p><span id="more-174"></span></p>
<p>Since this will be used mainly to store my files and do web development, I went with something cheap and, as much as possible, power efficient.  Here&#8217;s what I ended up with:</p>
<ul>
<li>Processor: <a title="View at Amazon.com" href="http://www.amazon.com/exec/obidos/ASIN/B0017K9F44/blog.damontimm.com-20" target="_blank">AMD 4850e</a>  (2.5ghz Dual-Processor, 45Watt)</li>
<li>Motherboard: ECS A780GM-A AM2+ (780G)</li>
<li>Memory: 4gb DDR-800</li>
<li>Hard Drives: 3x Western Digital 1TB &#8220;Green Power&#8221; (<a title="View at Amazon.com" href="http://www.amazon.com/exec/obidos/ASIN/B001IEZX3G/blog.damontimm.com-20" target="_blank">WD10EADS</a>)</li>
<li>Power Supply: Antec 380 Watts Earth Power Supplies (<a title="View at Amazon.com" href="http://www.amazon.com/exec/obidos/ASIN/B000KQ3QQY/blog.damontimm.com-20" target="_blank">EA380</a>)</li>
</ul>
<p>I am still waiting for the new hard drives to arrive (should be here today) &#8212; but so far, so good!  Hope to benchmark some power consumption as well as hard drive performance when I have the chance.  And also, get a virtual machine up and running for the web server so I can get rid of the two computers in my basement and just run one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/new-server-amd-4850e-raid-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Test Connection Speed Between Two Machines</title>
		<link>http://blog.damontimm.com/how-to-test-connection-speed-between-two-machines/</link>
		<comments>http://blog.damontimm.com/how-to-test-connection-speed-between-two-machines/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 14:58:26 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[nc]]></category>
		<category><![CDATA[pv]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=166</guid>
		<description><![CDATA[Purpose: as a quick diagnostic tool, sometimes it&#8217;s nice to know exactly how fast two machines can (theoretically) be connected.  I was having some slow downs on my NAS and using these command line tools, was able to determine that it was my NIC (and not my hard drives) that was causing the slow down.  [...]]]></description>
			<content:encoded><![CDATA[<p>Purpose: as a quick diagnostic tool, sometimes it&#8217;s nice to know exactly how fast two machines can (theoretically) be connected.  I was having some slow downs on my NAS and using these command line tools, was able to determine that it was my NIC (and not my hard drives) that was causing the slow down.  I learned this from a <a href="http://tech.slashdot.org/comments.pl?sid=1064679&amp;cid=26139847" target="_blank">thread at slashdot</a>. </p>
<p><span id="more-166"></span></p>
<h3>install nc and pv</h3>
<p>If you are on a mac, you can use <a href="http://blog.damontimm.com/how-to-install-macports-on-os-x-leopard-105/">MacPorts</a> to install this easily enough:</p>
<ul class="terminal">
<li><code>$ sudo port install netcat pv</code></li>
</ul>
<p>If you are on Ubuntu, you just need to get <code>pv</code> installed (<code>nc</code> is already there):</p>
<ul class="terminal">
<li><code>$ sudo aptitude install pv</code></li>
</ul>
<p>Once you have <code>nc</code> and <code>pv</code> installed, it&#8217;s really simple.  On one machine, run the following command:</p>
<ul class="terminal">
<li><code>$ nc -ulp 5000 &gt; /dev/null</code></li>
</ul>
<p>On the second machine run the following command (you need the IP address of the first machine):</p>
<ul class="terminal">
<li><code>$ pv &lt; /dev/zero | nc -u ip.addy.of.other.machine 5000</code></li>
</ul>
<p>And you should get some output with a little &lt;=&gt; sign moving across the screen that resembles this (static):</p>
<pre class="brush: text;">1.15GB 0:00:19 [ 218MB/s] [             &lt;=&gt;                  ]</pre>
<p>This will show you the number of MB/s the connection is averaging; if you watch if for a bit, you can get an idea of where things stand.  Here are some of the results I got between my PowerMac, PowerBook, and EEE PC:</p>
<pre class="brush: text;">localhost:                      218MB/s
gigabit Ethernet:               143MB/s
100MB ethernet:                 11.5MB/s
wireless (poor connection):     141kB/s</pre>
<p>If you read the <a href="http://tech.slashdot.org/comments.pl?sid=1064679&amp;cid=26139847">original post on slashdot</a>, it seems you can us pv to measure a lot of other stuff as well &#8212; I haven&#8217;t played with it yet but should, one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-test-connection-speed-between-two-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Bash Script: Incremental Encrypted Backups with Duplicity (Amazon S3)</title>
		<link>http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/</link>
		<comments>http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:47:18 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[amazon s3]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[duplicity]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[s3cmd]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.damontimm.com/?p=131</guid>
		<description><![CDATA[This bash script was designed to automate and simplify the remote backup process of duplicity on Amazon S3. After your script is configured, you can easily backup, restore, verify and clean (either via cron or manually) your data without having to remember lots of different command options and passphrases. Most importantly, you can easily backup [...]]]></description>
			<content:encoded><![CDATA[<p>This bash script was designed to automate and simplify the remote backup process of duplicity on Amazon S3.  After your script is configured, you can easily backup, restore, verify and clean (either via cron or manually) your data without having to remember lots of different command options and passphrases.</p>
<p>Most importantly, you can easily backup the script and your gpg key in a convenient passphrase-encrypted file.  This comes in in handy if/when your machine ever does go belly up. </p>
<p><span id="more-131"></span></p>
<h2>how to use</h2>
<p>To get the latest latest code in the script you can <a href="http://github.com/thornomad/dt-s3-backup/zipball/master">download a zip copy of the source</a> or clone the git repository like so:</p>
<ul class="terminal">
<li><code>git clone git://github.com/thornomad/dt-s3-backup.git</code></li>
</ul>
<p>You&#8217;ll also need to have a number of things in place in order to utilize this script, specifically: <a href="http://www.gnupg.org/">gpg</a>, <a href="http://www.nongnu.org/duplicity/">duplicity</a>, an <a href="http://aws.amazon.com/s3/">Amazon S3 account</a>, and (optionally) <a href="http://s3tools.org/s3cmd">s3cmd</a>.  If you need help getting all these in order, I wrote <a title="Check it out" href="http://blog.damontimm.com/how-to-automated-secure-encrypted-incremental-backups-amazon-s3-duplicity-os-x-or-ubuntu/">another post</a> about putting it all together.  It&#8217;s not all that difficult, but does take a few pieces of the puzzle to be in order.</p>
<p>Once you have the script, you will need to fill out the <strong>foobar</strong> variables with your own specific information.  I suggest testing the script on a small directory of files and a local directory for your destination first to make sure it is working.</p>
<h2>Usage</h2>
<p>From the README file:</p>
<pre class="brush: text;">COMMON USAGE EXAMPLES
=====================

* View help:
    $ dt-s3-backup.sh

* Run an incremental backup:
	$ dt-s3-backup.sh --backup

* Force a one-off full backup:
    $ dt-s3-backup.sh --full

* Restore your entire backup:
	$ dt-s3-backup.sh --restore
    You will be prompted for a restore directory

	$ dt-s3-backup.sh --restore /home/user/restore-folder
    You can also provide a restore folder on the command line.

* Restore a specific file in the backup:
    $ dt-s3-backup.sh --restore-file
    You will be prompted for a file to restore to the current directory

    $ dt-s3-backup.sh --restore-file img/mom.jpg
    Restores the file img/mom.jpg to the current directory

    $ dt-s3-backup.sh --restore-file img/mom.jpg /home/user/i-love-mom.jpg
    Restores the file img/mom.jpg to /home/user/i-love-mom.jpg

* List files in the remote archive
	$ dt-s3-backup.sh --list-current-files

* Verify the backup
    $ dt-s3-backup.sh --verify

* Backup the script and gpg key (for safekeeping)
    $ dt-s3-backup.sh --backup-script</pre>
<h2>Changes</h2>
<p>You can view the changelog at github.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>91</slash:comments>
		</item>
		<item>
		<title>How to: Retreive Custom Field Data in a WordPress Post</title>
		<link>http://blog.damontimm.com/how-to-retreive-custom-field-data-in-a-wordpress-post/</link>
		<comments>http://blog.damontimm.com/how-to-retreive-custom-field-data-in-a-wordpress-post/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 22:00:39 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/?p=72</guid>
		<description><![CDATA[Purpose: use WordPress&#8217;s &#8220;Custom Field&#8221; key/data pairs to store and retrieve specific post information and display it in your own custom templates. how this works I like to store post information in the form of key/data pairs utilizing WordPress&#8217;s &#8220;Custom Fields&#8221; for posts. You can make up any particular key/data pair you desire &#8212; I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> use WordPress&#8217;s &#8220;Custom Field&#8221; key/data pairs to store and retrieve specific post information and display it in your own custom templates.</p>
<p><span id="more-72"></span></p>
<h3>how this works</h3>
<p>I like to store post information in the form of key/data pairs utilizing WordPress&#8217;s &#8220;Custom Fields&#8221; for posts.  You can make up any particular key/data pair you desire &#8212; I choose, in this instance, to use key/data pairs to supplement some event information in some of my posts.  You can see an example of this at <a href="http://www.rosaleeshow.com/2008/10/12/indianapolis-in-2/">rosaleeshow.com</a>.</p>
<p>(To implement this, you will need some familiarity with customizing a wordpress theme.)</p>
<p>First, I created a function that takes an array of keys as an argument; these are the key values the function will search for in the post meta data looking for custom field information.  If a matching key is found, it will display that value in a definition list.  </p>
<p>I used this function called <code>eventmetadl()</code>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">//first argument: current post; </span>
      <span style="color: #666666; font-style: italic;">//second argument, array of keys to search through</span>
<span style="color: #000000; font-weight: bold;">function</span> eventmetadl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$postID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$metaArray</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
&nbsp;
  <span style="color: #666666; font-style: italic;">//this array will hold the key/data if matches are found</span>
  <span style="color: #000088;">$metaList</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//search through each item passed to the function </span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$metaArray</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$meta</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//for each key, get the data</span>
    <span style="color: #000088;">$metadata</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$postID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$meta</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
    <span style="color: #666666; font-style: italic;">//if there is data then add that key/data to the list</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$metadata</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      <span style="color: #000088;">$metaList</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$meta</span>&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$metadata</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//if there is a list of meta data then:</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$metaList</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;dl&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//open the definition list, etc</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//go through each item and print title/defition</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$metaList</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$dt</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$dd</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;dt&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$dt</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;:&lt;/dt&gt;&lt;dd&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$dd</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/dd&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/dl&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// close the definition list</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Then, inside my <code>sidebar.php</code> file in my theme, I create an array of the keys I am looking for and call my function to create the definition list.  If no keys are found to match, no list is created.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">// in my sidebar.php file - could be in any template</span>
  <span style="color: #000088;">$metatags</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ticket Price&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Contact&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Website&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  eventmetadl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$metatags</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>I have used this technique with considerable success &#8212; however, I am sure I stole the idea from someone else.  Thanks to that person, wherever they may be.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-retreive-custom-field-data-in-a-wordpress-post/feed/</wfw:commentRss>
		<slash:comments>0</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>
