<?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; how to</title>
	<atom:link href="http://blog.damontimm.com/category/how-to/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>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>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>
		<item>
		<title>How To: Network Trash on Ubuntu File Server (NAS) with SFTP (SSH + Fuse) and AFP (netatalk)</title>
		<link>http://blog.damontimm.com/network-trash-ubuntu-file-server-nas-sftp-ssh-fuse-afp-netatalk/</link>
		<comments>http://blog.damontimm.com/network-trash-ubuntu-file-server-nas-sftp-ssh-fuse-afp-netatalk/#comments</comments>
		<pubDate>Sun, 22 Apr 2007 13:13:50 +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[server]]></category>
		<category><![CDATA[trash]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/network-trash-ubuntu-file-server-nas-sftp-ssh-fuse-afp-netatalk/</guid>
		<description><![CDATA[Purpose: create a Network Trash functionality for a Ubuntu Linux file server (NAS). Reason being: by default, files deleted from the command line on file server go away permanently. If I am connected to my file server from my Mac via AFP (through netatalk) or SSH (SFTP through Fuse) and delete a file, that file [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> create a Network Trash functionality for a Ubuntu Linux file server (NAS).  Reason being: by default, files deleted from the command line on file server go away permanently.  If I am connected to my file server from my Mac via AFP (through <a href="http://www.damontimm.com/blog/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/">netatalk</a>) or SSH (SFTP through Fuse) and delete a file, that file is gone forever!  This is a problem, because often I find I want them back.  Enter: <a href="http://pages.stern.nyu.edu/~marriaga/software/libtrash/">libtrash</a>!</p>
<p><span id="more-37"></span></p>
<p>Tested on: Ubuntu 6.06.1, 6.10, 10.04.</p>
<h3>install libtrash and test it out</h3>
<p>The version of libtrash in the repository is not the latest &#8212; I prefer to grab it from source which, in this case, is very easy:</p>
<ul class="terminal">
<li><code>sudo aptitude install build-essential</code></li>
<li><code>wget http://pages.stern.nyu.edu/~marriaga/software/libtrash/libtrash-latest.tgz</code></li>
<li><code>tar xzf libtrash-latest.tgz</code></li>
<li><code>cd libtrash-3.2/</code></li>
<li><code>make</code></li>
<li><code>sudo make install</code></li>
</ul>
<p>Unlike a lot of software on linux, installing it isn&#8217;t quite enough to get it running.  I think this is because it is a lib package and not an actual program &#8212; it seems to be meant to be used by other programs in the background and not directly interact with the user (in the way that I want it to).</p>
<p>To test it out briefly, run the following to start the libtrash engine in your terminal prompt:</p>
<ul class="terminal">
<li><code>export LD_PRELOAD=/usr/local/lib/libtrash.so</code></li>
</ul>
<p>After the above command has run, you can do a little test by creating a file (the <code>touch</code> command doesn&#8217;t seem to work, so create a real file) and then delete it.  It should show up in your <code>~/Trash</code> folder.</p>
<p>If it isn&#8217;t working at this point, check out the documentation at: <code>/usr/share/doc/libtrash/</code></p>
<p>To make sure libtrash is running every time you login you need to add the <code>export</code> command to the top of <code>/etc/profile</etc>:</p>
<ul class="terminal">
<li><code>sudo nano /etc/profile</code></li>
</ul>
<pre class="brush: text"># /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

export LD_PRELOAD=/usr/local/lib/libtrash.so

[...]</pre>
<p>You should be all set in the terminal, at this point.</p>
<p>There are a few more steps that need to be taken in order to begin utilizing Trash folders for the users on your system.  For each method of connecting/utilizing the files on the server (through the command line, through <a href="#ssh">sshFS</a>, or <a href="#afp">AFP</a>), the LD_PRELOAD option needs to be called for libtrash.  Also, I recommend you use one of the Trash cleaning scripts (<a href="#cron">outlined below</a>).</p>
<h2 id="ssh">using libtrash with SFTP (sshFS)</h2>
<p>I like to mount my home server remotely using sshFS (which utilizes FUSE).  sshFS  can be used on the Mac through the MacFUSE project or on Ubuntu through Places/Go to Server Menu on 7.04).  To initialize libtrash, we need to create small script that loads the module just before the sftp-server is started and then tell openssh (in my case) to run that script (rather than starting the sftp-server directly).</p>
<p>I created by file at <code>/usr/local/lib/libtrash-sftp-server</code> and entered:</p>
<pre class="brush: bash;">#!/bin/bash
export LD_PRELOAD=/usr/local/lib/libtrash.so
/usr/lib/openssh/sftp-server</pre>
<p>Change permissions to make it executable:</p>
<ul class="terminal">
<li><code>sudo chmod +x /usr/local/lib/libtrash-sftp-server</code></li>
</ul>
<p>Then open the configuration file for ssh (<code>/etc/ssh/sshd_config</code>) and make the following change near the very end of the file (comment out the original and add your own):</p>
<pre class="brush: bash;">#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp /usr/local/lib/libtrash-sftp-server</pre>
<p>Restart your ssh server and then, when you connect via sshFS (in Ubuntu go to Places < Connect to Server and choose a SFTP (SSH) server; on the Mac, you will need MacFuse and SSHFS) you'll be using your ~/Trash folder.</p>
<ul class="terminal">
<li><code>$ sudo /etc/init.d/ssh restart</code></li>
</ul>
<h2 id="afp">using libtrash with AFP (netatalk)</h2>
<p>I was able to use libtrash with netatalk by inserting the following line in the <code>/etc/init.d/netatalk</code> file (10.04 version shown here):</p>
<pre class="brush: bash; gutter: true; first-line: 88; highlight: 3;">
case "$1" in
	start)
        export LD_PRELOAD=/usr/local/lib/libtrash.so
		if [ "x$ATALK_BGROUND" = "xyes" ]; then
			echo "Starting Netatalk services in the background."
			atalk_startup >/dev/null &#038;
		else
			echo -n "Starting Netatalk services (this will take a while): "
			atalk_startup
			echo "."
		fi
	;;
</pre>
<p>I added line 90.  After, simply restart netatalk.</p>
<ul class="terminal">
<li><code>sudo /etc/init.d/netatalk restart</code></li>
</ul>
<h3 id="cron">how to empty the trash automatically</h3>
<p>If you look in <code>~/src/libtrash-x.x/cleanTrash/</code> you will find a couple different cleaning scripts.  I like strash the best.  If you do this, you can extract the script, install it to a usable path, and setup the man file (so you can read about its cleverness).</p>
<ul class="terminal">
<li><code>cd ~/src/libtrash-3.2/cleanTrash/</code></li>
<li><code>tar xvf strash.tar.gz</code></li>
<li><code>sudo cp strash-0.9/strash /usr/local/sbin/strash</code></li>
<li><code>sudo mkdir -p /usr/local/share/man/man8</code></li>
<li><code>sudo cp strash-0.9/strash.8 /usr/share/man/man8/strash.8</code></li>
</ul>
<p>You can read the man page for strash now, which will show you all the nifty options.  I added a line to my root crontab (by running: <code>sudo crontab -e</code>) that deletes all files over one week old:</p>
<pre class="brush: bash; gutter: true;">
# m h  dom mon dow   command
30 01 * * * /usr/sbin/strash --age 7d
</pre>
<p>Seems to work well.  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/network-trash-ubuntu-file-server-nas-sftp-ssh-fuse-afp-netatalk/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to: Install Netatalk (AFP) on Ubuntu with Encrypted Authentication</title>
		<link>http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/</link>
		<comments>http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/#comments</comments>
		<pubDate>Sun, 08 Apr 2007 20:42:02 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[afp]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[netatalk]]></category>
		<category><![CDATA[tiger]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/</guid>
		<description><![CDATA[Purpose: Install Netatalk (AFP) on Ubuntu with encrypted authentication (using OpenSSL), which is not enabled by default with the Ubuntu netatalk package. By default, the package installed from the Ubuntu universal repositories will transmit your password via clear text (you&#8217;ll know this because Mac OS X Tiger will throw a warning and Leopard won&#8217;t do [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> Install <a href="http://netatalk.sourceforge.net">Netatalk</a> (AFP) on Ubuntu with encrypted authentication (using OpenSSL), which is not enabled by default with the Ubuntu netatalk package.  By default, the package installed from the Ubuntu universal repositories will transmit your password via clear text (you&#8217;ll know this because Mac OS X Tiger will throw a warning and Leopard won&#8217;t do anything useful at all).</p>
<p><span id="more-36"></span></p>
<p>This is because, apparently, <a href="http://it.slashdot.org/comments.pl?sid=180016&amp;cid=14905489">OpenSSL has a license that is incompatible with Debian&#8217;s GPL</a>.  Regardless: clear text is bad; encryption is good.  And since Ubuntu doesn&#8217;t package netatalk with the appropriate encryption support, one must do it oneself.</p>
<p><em>Updated 05.08.09: Just tested this with Jaunty (09.04) and the package in the repositories works with no extra steps.  If you are using an older version of Ubuntu, however, you will want to follow these instructions.  Tested with Intrepid Ibex (8.10) as well as: 6.06, 7.04, 7.10, and 8.06.</em></p>
<h2>about this guide</h2>
<p>When I first found that Ubuntu&#8217;s netatalk package didn&#8217;t support encrypted authentication, I tried to compile netatalk from the source.  I didn&#8217;t get very far.  Throwing up my hands in frustration, I spent some more time on google and <a href="http://ubuntuforums.org/showthread.php?t=101823&amp;page=2">found some ideas at the Ubuntu Forums</a>.  Pulling it all together, with ideas and fixes from comments (below), this is what I came up with (which I think is a lot easier than building from source).</p>
<h2>steps to follow</h2>
<p><em>NOTE:</em> If you have already installed netatalk you should remove it before proceeding with a <code>sudo aptitude purge netatalk</code> before you get going.</p>
<ul class="terminal">
<li><code>sudo aptitude update</code></li>
<li><code>mkdir -p ~/src/netatalk</code></li>
<li><code>cd ~/src/netatalk</code></li>
<li><code>sudo aptitude install cracklib2-dev libssl-dev</code></li>
<li><code>apt-get source netatalk</code></li>
<li><code>sudo apt-get build-dep netatalk</code></li>
<li><code>cd netatalk-2.0.3</code></li>
<li><code>sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -us -uc</code></li>
<li><code>sudo debi</code></li>
<li><code>echo "netatalk hold" | sudo dpkg --set-selections</code></li>
</ul>
<p>The basic trend of this set of operations is to: create a directory where all the messy files can be stored, download necessary packages, get the netatalk source, compile the source with the ssl option, install the package, then tell Ubuntu never to update the package (because if it did, it would break).</p>
<p>Settings for the netatalk service can be found on your Ubuntu machine at <code>/etc/netatalk/</code>.  There are a couple configuration files in there with instructions.  Good luck.</p>
<h2>configuration files</h2>
<p>One of the first changes I make after installing netatalk is to disable some of the services that I don&#8217;t need running (and start those that I do).  To do this, I edit: <code>/etc/default/netatalk</code>, changing  the daemons that run so that it ends up looking like this (which allows netatlk to restart a lot quicker without the atalkd daemon &#8212; which is a holdover from pre-OS X times):</p>
<pre class="brush: text;"># Set which daemons to run (papd is dependent upon atalkd):
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=no
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no</pre>
<p>These are the settings I am using since I only need the afp file server &#8212; one thing to note, however, is that if you want to use the <strong>dbd</strong> databashe scheme rather than <strong>cdb</strong>, you need to set <code>CNID_METAD_RUN</code> to <code>yes</code>.  <strong>cdb</strong> is supposed to be faster, while <strong>dbd</strong> is supposed to be &#8220;corruption-proof&#8221;.  You can <a href="http://netatalk.sourceforge.net/2.0/htmldocs/configuration.html#CNID-backends" target="_blank">read it about in the docs</a>.</p>
<p>After you&#8217;ve saved changes to this configuration file, run the following to restart netatalk:</p>
<ul class="terminal">
<li><code>sudo /etc/init.d/netatalk restart</code></li>
</ul>
<h2>other tips and tricks</h2>
<p>Here are a couple other thoughts and pointers that I&#8217;ve picked up over the years &#8230;</p>
<h3>multiple afp servers running on the same network</h3>
<p>I never thought much of it, but I did notice: if you have two different servers on your network running netatalk, you are unable to login to both of them at the same time.  <strong>JET</strong> <a href="http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/#comment-3718">posted a solution</a> to this and it works flawlessly.  It has changed my life.</p>
<h3>multiple network interfaces causing errors</h3>
<p><strong>Update (9/24/07 &amp; 10/22/07):</strong> I&#8217;ve noticed <a href="http://www.damontimm.com/blog/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/#comment-748">a few people mentioning </a>they get an error when compiling and/or starting netatalk (from <a href="http://ubuntuforums.org/showpost.php?p=1273565&amp;postcount=21">ubuntuforums.org</a> as well).  Folks with more than one available network adapter (like <code>eth1</code> and <code>eth2</code>, or virtual adapters created by vmware) seem to run an error when they compile and during runtime .  During compile time you might have have an error that ends in:</p>
<ul class="terminal">
<li><code>dpkg: error processing netatalk (--install):</code></li>
<li><code>subprocess post-installation script returned error exit status 1</code></li>
<li><code>Errors were encountered while processing:</code></li>
<li><code>netatalk</code></li>
<li><code>debi: debpkg -i failed</code></li>
</ul>
<p>After this, you would probably get an error at runtime that looked like:</p>
<ul class="terminal">
<li><code>Starting Netatalk services (this will take a while): nbp_rgstr: Connection timed out</code></li>
</ul>
<p><strong>Tim Pope</strong> wrote a <a href="http://www.damontimm.com/blog/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/#comment-911">suggested fix</a> in the comments below that should eliminate the conflict between the multiple adapters.  I only have one adapter myself (and don&#8217;t use vmware) so I haven&#8217;t had a chance to try it yet myself.  Let me know if this works for you as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-install-netatalk-afp-on-ubuntu-with-encrypted-authentication/feed/</wfw:commentRss>
		<slash:comments>150</slash:comments>
		</item>
		<item>
		<title>How to: Mount a SFTP Folder (SSH + FTP) on Ubuntu Linux using SSHFS &amp; Fuse</title>
		<link>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/</link>
		<comments>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 17:58:17 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/</guid>
		<description><![CDATA[Purpose: to mount a remote directory on my local Ubuntu Linux Desktop system using SFTP (which is SSH in an FTP-like fashion). The goal is to easily gain access to a remote system&#8217;s files through another folder on my desktop. Debina/Ubuntu allows you to easily mount SSH folders via the GUI, however, these mounts won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> to mount a remote directory on my local Ubuntu Linux Desktop system using SFTP (which is SSH in an FTP-like fashion).  The goal is to easily gain access to a remote system&#8217;s files through another folder on my desktop.  Debina/Ubuntu allows you to easily mount SSH folders via the GUI, however, these mounts won&#8217;t show up in the terminal (and in some programs).  I used <a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> to accomplish this.</p>
<p><span id="more-33"></span></p>
<p> <strong>Special Thanks</strong>: goes to user llamakc from ubuntuforums.org for helping me with this one night <a href="http://ubuntuforums.org/showthread.php?t=270806">in this thread</a>; also, can find <a href="https://help.ubuntu.com/community/SSHFS">Ubuntu&#8217;s SSHFS documentation here</a>.)</p>
<h3>install the sshfs software and mount</h3>
<p>After some trial and error on my part, I found that only a few simple steps are needed to get everything up and running:</p>
<p>First, get the <a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> software (which is based on <a href="http://fuse.sourceforge.net">FUSE</a>); if you have Ubuntu, this is easy because it is an included package available for easy install.  After the package is installed, you need to add your username to the <code>fuse</code> group.  On Ubuntu, you would open a terminal window and perform the following:</p>
<ul class="terminal">
<li><code>sudo aptitude update</code></li>
<li><code>sudo apititude install sshfs</code></li>
<li><code>sudo adduser <strong>yourusername</strong> fuse</code></li>
</ul>
<p>After, restart your machine.  (I have tried just logging in and logging out, but I kept getting permissions errors &#8212; all of which disappeared after a restart.)</p>
<p>The next step it so to create an empty directory that will serve as the &#8220;window&#8221; into the SFTP server.  I created a folder on my desktop called <code>sftp</code>.  Once the folder has been created, simply run <code>sshfs</code> using the appropriate login information (host username and IP), the host and local directories, and the SFTP connection is mounted on a folder on my desktop.</p>
<ul class="terminal">
<li><code>mkdir ~/Desktop/sftp</code></li>
<li><code>sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp</code></li>
</ul>
<p>This folder will work like any other folder on your system; when you restart your computer (or logout and log back in) you will have to go through the last step of the process again (calling the <code>sshfs</code> program) to enable the folder on your desktop (save time by <a href="#bash">creating a bash alias</a>).</p>
<h3>possible errors and workarounds</h3>
<p>When I restarted my system the first time (using Ubuntu 6.06), after having so cleverly got <code>sshfs</code> to work, and tried to run my <code>sshfs</code> command I got an error:</p>
<ul class="terminal">
<li><code>sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp</code><br />
	<code><strong>fusermount: failed to open /dev/fuse: No such file or directory</strong><br />
</code></li>
</ul>
<p>A quick search on google brought me to the <a href="http://fuse.sourceforge.net/wiki/index.php/SshfsFaq">sourceforge FAQ</a> for sshfs and there, lo and behold, the following was suggested to rectify the situation:</p>
<ul class="terminal">
<li><code>sudo mknod -m 666 /dev/fuse c 10 229<br />
</code></li>
</ul>
<p>After running this command, I was able to mount my SFTP directory.  I never received this error using Ubuntu 6.10.</p>
<p>If you get any permission denied warnings, be sure you have added your username to the <code>fuse</code> group and also restarted your system. </p>
<h3 id="bash">create a bash alias to save time and typing</h3>
<p>To save time, I created a bash alias that would remember all the details for me.  </p>
<p>First, make make sure my system reads from the <code>~/.bash_aliases</code> file (it may not be default).  Open <code>~/.bashrc</code> and ensure the following lines are uncommented:</p>
<ul class="code">
<li><code># Alias definitions.</code></li>
<li><code># You may want to put all your additions into a separate file like</code></li>
<li><code># ~/.bash_aliases, instead of adding them here directly.</code></li>
<li><code># See /usr/share/doc/bash-doc/examples in the bash-doc package.</code></li>
<li><code></code></li>
<li class="modified"><code>if [ -f ~/.bash_aliases ]; then</code></li>
<li class="modified"><code>    . ~/.bash_aliases</code></li>
<li class="modified"><code>fi</code></li>
</ul>
<p>Next, create (or modify if you already have one) your <code>~/.bash_aliases</code> file.  </p>
<ul class="terminal">
<li><code>nano ~/.bash_aliases</code></li>
</ul>
<p>I added the following single line of code to the document (first call the mknod, if you are getting the error, then the sshfs):</p>
<ul class="code">
<li><code>alias sftp='sudo mknod -m 666 /dev/fuse c 10 229; sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp'<br />
</code></li>
</ul>
<p>Now, when I open the terminal, I just type:</p>
<ul class="terminal">
<li><code>sftp</code></li>
</ul>
<p>And everything loads correctly.  Is very fast and very nice.  I like it.  </p>
<h3>finally:</h3>
<p>Changes to your <code>~/.bash_aliases</code> file will only take effect after you have reopened the terminal or called:</p>
<ul class="terminal">
<li><code>. ~/.bash_aliases</code></li>
</ul>
<p>If you ever want to unmount the directory without logging out or restarting, use the following:</p>
<ul class="terminal">
<li><code> fusermount -u ~/Desktop/sftp</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to: Redirect Apache&#8217;s Default www or public_html Folder to a Directory in Your Home Folder</title>
		<link>http://blog.damontimm.com/how-to-redirect-apaches-default-www-or-public_html-folder-to-a-directory-in-your-home-folder/</link>
		<comments>http://blog.damontimm.com/how-to-redirect-apaches-default-www-or-public_html-folder-to-a-directory-in-your-home-folder/#comments</comments>
		<pubDate>Fri, 13 Oct 2006 19:39:53 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/how-to-redirect-apaches-default-www-or-public_html-folder-to-a-directory-in-your-home-folder/</guid>
		<description><![CDATA[Purpose: The default installation of Apache (from a Ubuntu-Server installation) sets the base directory for the web documents as /var/www (on Ubuntu&#8217;s installation &#8212; this may be different if you are running Apache on another machine); this may not be where you want it, in the end, and certainly isn&#8217;t as easily accessible from a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> The default installation of Apache (from a <a href="http://www.damontimm.com/blog/how-to-install-a-lamp-server-linux-apache-mysql-php-on-older-laptop-with-ubuntu/">Ubuntu-Server installation</a>) sets the base directory for the web documents as <code>/var/www</code> (on Ubuntu&#8217;s installation &#8212; this may be different if you are running Apache on another machine); this may not be where you want it, in the end, and certainly isn&#8217;t as easily accessible from a remote machine.  One option is to change where it is Apache searches for its web documents folder in Apache&#8217;s configuration file; another way, which I chose, is to create a symbolic link in the default location&#8217;s place and have it point to a directory in my user&#8217;s home folder.</p>
<p><span id="more-29"></span></p>
<p><strong>Benefit:</strong> I can login remotely with my user name (<code>henry</code>) and have direct access to the web documents root folder.  This makes it easy to use FTP or SSH or AFP to move files around and I don&#8217;t have to fool with user groups or permissions.</p>
<p>If you want to do this, login as the user you want to host the web pages and run the following from the terminal:</p>
<ul class="terminal">
<li><code>$ mkdir ~/www</code></li>
<li><code>$ sudo mv /var/www /var/www-backup</code></li>
<li><code>$ sudo ln -s /home/henry/www /var/www</code></li>
</ul>
<p>This will create a <code>www</code> folder in your user&#8217;s home directory, change the name of Apache&#8217;s default <code>www</code> directory, and create a symbolic link in its place that points to the directory you recently created.</p>
<p>Drop a <code>index.html</code> file in your new <code>~/www</code> directory and you are good to go!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-redirect-apaches-default-www-or-public_html-folder-to-a-directory-in-your-home-folder/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
