<?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>Turing tarpit &#187; Workflow</title>
	<atom:link href="http://www.turingtarpit.com/category/development/workflow/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.turingtarpit.com</link>
	<description>Where everything is possible but nothing of interest is easy –Alan Perlis</description>
	<lastBuildDate>Thu, 11 Mar 2010 02:01:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mounting remote filesystems on OSX Leopard using sshfs, MacFuse and Macfusion</title>
		<link>http://www.turingtarpit.com/2009/04/mounting-remote-filesystems-on-osx-leopard-using-sshfs-macfuse-and-macfusion/</link>
		<comments>http://www.turingtarpit.com/2009/04/mounting-remote-filesystems-on-osx-leopard-using-sshfs-macfuse-and-macfusion/#comments</comments>
		<pubDate>Fri, 01 May 2009 07:06:25 +0000</pubDate>
		<dc:creator>Chandima Cumaranatunge</dc:creator>
				<category><![CDATA[Workflow]]></category>
		<category><![CDATA[SSHFS FUSE filesystems]]></category>

		<guid isPermaLink="false">http://www.turingtarpit.com/?p=315</guid>
		<description><![CDATA[Have you ever wanted to edit the web pages that reside on your commercial web host like they were on your own desktop? Wouldn’t it be nice to mount your entire remote website host directory on the desktop with a nice disk icon? Now you can drag and drop files into it without leaving the Finder. You can also edit files remotely without downloading, editing and uploading. This can be a huge improvement in workflow, and you don’t have to keep track of local and remote versions of files and the inevitable versioning headaches. This post shows you how to combine three free tools to setup this workflow.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-342 post-thumb" title="macfuse_icon" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfuse_icon.jpg" alt="macfuse_icon" width="200" height="200" /><span class="post-tagline">Work on the web pages that reside on your commercial web host like they were on your own desktop.</span></p>
<p>If you have cursed out an FTP client ( under your breath of course ) at any point in a development cycle, welcome to the club. I develop on an OSX machine and I love Cyberduck &#8211; the popular FTP client for the Mac. But wouldn&#8217;t it be nice to mount your  entire remote website host directory on the desktop with a nice disk icon? Now you can drag and drop files into it without leaving the Finder. You can also edit files remotely without downloading, editing and uploading. This can be a huge improvement in workflow, and you don&#8217;t have to keep track of local and remote versions of files and the invariable versioning headaches.</p>
<a name="wptoc_0_0_0"></a><h3>Advantages</h3>
<ul>
<li><strong>Avoid UNIX:</strong> Most hosting plans run on some variant of UNIX/Linux. Stuff that you had to do on the server over SSH using the Terminal can now be done on the desktop. For example, WordPress plugins and themes can be downloaded, unzipped and moved to their proper locations, all from the desktop. You no longer have to execute cryptic commands from the UNIX command line.</li>
<li><strong>Develop on a thin client: </strong>You can develop on a lightweight Netbook with a super fast, but low-capacity solid-state (SSD) drive. You don&#8217;t have to worry about the limited disk space  because your workspace resides on the remote server.</li>
<li><strong>Don&#8217;t have to worry about backups:</strong> Most hosting plans have some sort of incremental backup on the server side. Your workspace will automatically get backed up on the server.</li>
</ul>
<p>First, a caution &#8211; I&#8217;m not advocating editing a live website. Although that is certainly possible, it is not recommended practice. However, there are a myriad of little things that can be done quite efficiently if the remote filesystem was mounted on the desktop. Moving, renaming and deleting files is super easy ( these actions can be a real pain to accomplish using an FTP client). For those perfectionists who incessantly tinker with image files, just open the file, make the change and save it. The huge advantage is the seamless access and the improvement in overall workflow.<span id="more-315"></span></p>
<a name="wptoc_0_0_1"></a><h3>Disadvantages</h3>
<ul>
<li><strong>Filesystem response dependent on network speed: </strong>This is the big caveat. This method is not suitable for editing 100MB Photoshop files. However, it can be very effective for editing web pages.</li>
</ul>
<a name="wptoc_0_0_2"></a><h3><strong>System requirements</strong></h3>
<ul>
<li>You need to have access to a remote server like a commercial web host ( e.g. Dreamhost, Media Temple ).</li>
<li><a href="http://en.wikipedia.org/wiki/Secure_Shell" target="_blank">SSH</a> ( <em>Secure SHell</em> ) remote login has to be available and setup on the server. You can turn on SSH access on most hosting plans through your web panel. Make sure that you test SSH access before proceeding.</li>
<li>The method described here works only on Mac OSX Leopard.</li>
</ul>
<a name="wptoc_0_0_3"></a><h3>Method</h3>
<p>You need to install three applications / frameworks:</p>
<ol>
<li><a href="http://code.google.com/p/macfuse/" target="_blank">MacFuse</a></li>
<li><a href="http://www.macfusionapp.org/support.html" target="_blank">Macfusion</a></li>
<li><a style="text-decoration: none;" href="http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS" target="_blank">sshfs</a> (to update the old version pre-installed with Macfusion)</li>
</ol>
<a name="wptoc_3_1_0"></a><h4>1. Install MacFuse</h4>
<p><img class="alignnone size-full wp-image-317" title="macfuse" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfuse.jpg" alt="macfuse" width="250" height="145" /></p>
<p><a href="http://code.google.com/p/macfuse/" target="_blank">MacFuse</a> is an OSX implementation of the <em>Filesystem in Userspace</em> (FUSE) framework. <em>Fuse</em> provides an API to write a <em>virtual file system</em>. Virtual in the sense that a developer can write a file-system like front-end to any structured information source.  Even though the information is accessed and manipulated as files, the actual data doesn&#8217;t need to be files on a disk. For example, there is the Picasa image file system (<em>PicasawebFS)</em>, a virtual filesystem that allows you to mount all your Picasa images like a disk on the desktop. Then theres is the RSS file system (<em>RSSFS)</em> that allows you to mount an RSS feed as a filesystem and access each entry as an individual file. <strong>We will use SSHFS, the </strong><em><strong>Secure SHell FileSystem</strong></em>, that allows you to mount a remote computer directory though a <em>secure shell (SSH) </em>login. If you want additional technical details, watch a <a href="http://video.google.com/videoplay?docid=3138515991250095768" target="_blank">screencast</a> by  Amit Sigh, the project owner of  MacFuse.</p>
<p><strong>Download and install MacFuse from google code:</strong></p>
<p><a href="http://code.google.com/p/macfuse/" target="_blank">http://code.google.com/p/macfuse/</a></p>
<p>MacFuse comes with a nice preference pane to check for updates. The version was 2.0.3 as of this writing.</p>
<a name="wptoc_3_1_1"></a><h4>2. Install Macfusion</h4>
<p><img class="alignnone size-full wp-image-318" title="macfusion-icon" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfusion-icon.png" alt="macfusion-icon" width="64" height="64" /></p>
<p>Macfusion is an open source SSHFS mounting application for OSX Leopard. There are a couple of apps out there that do this ( <a href="http://mac.softpedia.com/get/Network-Admin/sshfs.shtml" target="_blank">sshfs 1.0</a>, <a href="http://www.pqrs.org/tekezo/macosx/sshfs/" target="_blank">sshfs for Mac OS X</a> ), but Macfusion is by far the most mature.</p>
<p><strong>Download and install from:</strong></p>
<p><a href="http://www.macfusionapp.org" target="_blank">http://www.macfusionapp.org</a></p>
<a name="wptoc_1_2_0"></a><h5>Add an SSHFS file system</h5>
<p>To add an SSHFS file system click on the plus icon at the bottom of the main window and choose SSHFS.</p>
<div id="attachment_320" class="wp-caption alignnone" style="width: 412px"><img class="size-full wp-image-320" title="add_sshfs" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/add_sshfs.jpg" alt="add_sshfs" width="402" height="126" /><p class="wp-caption-text">Adding an SSHFS filesystem</p></div>
<a name="wptoc_1_2_1"></a><h5>Set SSHFS mount parameters</h5>
<p>Under the <strong>SSH</strong> tab:</p>
<ul>
<li><strong>Host:</strong> The <em>hostname</em> of the server that you SSH to. This is usually the domain name of you website ( e.g. &#8216;yourdomain.com&#8217; ).</li>
<li><strong>User Name: </strong>Your SSH username.</li>
<li><strong>Password: </strong>Your SSH password.</li>
<li><strong>Path: </strong>can be left blank.</li>
</ul>
<p>Under the <strong>SSH Advanced</strong> tab:</p>
<ul>
<li><strong>Port:</strong> The default SSH port is 22 unless your server uses a different one ( just try 22 ).</li>
<li><strong>Follow Symbolic Links: </strong>Leave this checked.</li>
</ul>
<p>Under the <strong>Macfusion</strong> tab:</p>
<ul>
<li><strong>Mount Point and Volume Name:</strong> Can be left blank.</li>
<li><strong>Ignore Apple Double Files: </strong>You must <em>uncheck</em> this if you plan to <em>open/edit/save</em> files on the mounted volume.  For example, if you want to edit an image file using Photoshop, this setting has to be <em>unchecked</em>. However, this powerful feature comes with a downside. Leaving this unchecked will  cause OSX to place .DS_Store and ._ * ( Appledouble ) files on the server.  OSX utilizes these hidden files for enhanced filesystem features and extended file attributes in non OSX native filesystems. For example, a Photoshop file can have icon, thumbnail, and version cue information saved in a separate Appledouble file. These files are invisible in OSX and other filesystems as they start with a dot. Leave this <em>checked</em> if you are just going to <em>copy/move/delete</em> files ( increases speed ). You can leave this checked if editing text files as most apps don&#8217;t save additional file attributes with text files. However, this depends on the application you use, so do some testing first.</li>
<li><strong>Enable Negative VNode Cache:</strong> This is an <a href="http://code.google.com/p/macfuse/wiki/OPTIONS" target="_blank">optimization</a> to increase speed and should generally be left <em>checked </em>unless files can appear on the mounted volume from the server side. For example, if multiple users are using your mounted disk space leave this <em>unchecked</em>.</li>
</ul>
<p><a title="SSH tab" rel="shadowbox[SSHFS settings]" href="http://www.turingtarpit.com/wp-content/uploads/2009/04/ssh.jpg"><img class="size-thumbnail wp-image-323 alignnone" title="ssh" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/ssh-150x150.jpg" alt="ssh" width="120" height="120" /></a> <a title="SSH Advanced tab" rel="shadowbox[SSHFS settings]" href="http://www.turingtarpit.com/wp-content/uploads/2009/04/ssh_advanced.jpg"><img class="size-thumbnail wp-image-324 alignnone" title="ssh_advanced" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/ssh_advanced-150x150.jpg" alt="ssh_advanced" width="120" height="120" /></a> <a title="Macfusion tab" rel="shadowbox[SSHFS settings]" href="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfusion.jpg"><img class="alignnone size-thumbnail wp-image-322" title="macfusion" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfusion-150x150.jpg" alt="macfusion" width="120" height="120" /></a></p>
<p>You will now have an SSHFS filesystem ready to mount on your desktop.</p>
<a name="wptoc_1_2_2"></a><h5>Mount the remote filesystem</h5>
<p>Click on the mount button and if the SSH settings are correct, you should have a green disk icon mounted on the desktop.</p>
<div id="attachment_330" class="wp-caption alignnone" style="width: 415px"><img class="size-full wp-image-330" title="mounted" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/mounted.jpg" alt="mounted" width="405" height="111" /><p class="wp-caption-text">Macfusion main window after mounting a remote filesystem</p></div>
<p>You can now access your remote files like they were on an external disk attached to your computer. You can copy, move, rename and delete files at ease. Remember that if you want to edit files on the remotely mounted disk, the <em>Ignore Apple Double Files</em> checkbox should be <em>unchecked</em>. You can easily edit the SSHFS mount settings by unmounting the disk and clicking on the Edit button.</p>
<p>You might have noticed that we completed only two of the three steps but you can already mount your remote filesystem. This is because Macfusion already has SSHFS pre-installed within its application package. However, I found  the mounted filesystem response to be a little sluggish and wondered if the version of SSHFS that came pre-installed with Macfusion was outdated.</p>
<a name="wptoc_3_1_2"></a><h4>3. Update SSHFS</h4>
<p>Let&#8217;s examine the pre-installed version of SSHFS that comes with Macfusion. RIGHT-CLICK ( or CONTROL-CLICK) on the Macfusion app in the Applications folder. You will be presented with a contextual menu. Choose the &#8220;Show Package Contents&#8221; menu option. You will then be presented with a folder containing the application folder hierarchy. Drill down until you see an application called sshfs-static.</p>
<div id="attachment_333" class="wp-caption alignnone" style="width: 268px"><a title="Macfusion application package hierarchy" rel="shadowbox" href="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfusion_folders.jpg"><img class="size-medium wp-image-333" title="macfusion_folders" src="http://www.turingtarpit.com/wp-content/uploads/2009/04/macfusion_folders-258x300.jpg" alt="macfusion_folders" width="258" height="300" /></a><p class="wp-caption-text">Macfusion application hierarchy showing the location of the pre-installed version of SSHFS</p></div>
<p>This is the copy of sshfs that Macfusion uses to do its magic. To check its version, I opened up the Terminal app, changed directory to the parent folder off sshfs-static and typed in ./sshfs-static -V . You don&#8217;t have to do this by-the-way, just skip to the <em>Download and Install SSHFS</em> section.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">% cd /Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/
% ls -la
total 5736
drwxr-xr-x  9 chandima  staff      306 Aug  4  2008 .
drwxr-xr-x  5 chandima  staff      170 Aug  4  2008 ..
-rwxr-xr-x  1 chandima  staff    46928 Aug  4  2008 new_sshfs_askpass
-rwxr-xr-x  1 chandima  staff  2756952 Aug  4  2008 sshfs-static
-rw-r--r--  1 chandima  staff    13259 Aug  4  2008 sshfs.png
-rw-r--r--  1 chandima  staff     6796 Aug  4  2008 sshfsAdvanced.nib
-rw-r--r--  1 chandima  staff     7609 Aug  4  2008 sshfsConfiguration.nib
-rw-r--r--  1 chandima  staff    61418 Aug  4  2008 sshfs_icon.icns
-rwxr-xr-x  1 chandima  staff    29280 Aug  4  2008 sshnodelay.so
% ./sshfs-static -V
SSHFS version 1.8 (MacFUSE SSHFS 1.3.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point</pre></div></div>

<p>The pre-installed version was 1.8. I wondered if I&#8217;d get a speed increase if SSHFS was updated to the latest version which was 2.2 (as of this writing).</p>
<p><strong>Download SSHFS from:</strong></p>
<p><a href="http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS" target="_blank">http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS</a> (make sure you download <strong>sshfs-static-leopard.gz</strong> ).</p>
<p>After you uncompress the gzip archive, you will end up with a folder called <em>sshfs-binaries</em>. In there, you will see an app called <em>sshfs-static-leopard</em>.</p>
<p><strong>Rename the sshfs executable:</strong></p>
<p>Rename <em>sshfs-static-leopard</em> app to <em>sshfs-static </em>to match the filename that Macfusion expects.</p>
<p><strong>Replace the old version of sshfs with the new version:</strong></p>
<p>Drag and drop the downloaded and renamed <em>sshfs-static</em> executable into the <em>Resources</em> folder to replace the older version within the Macfusion package hierarchy.</p>
<p>You can check the version again to make sure that the new version is recognized.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">% ./sshfs-static -V
SHFS version 2.2 (MacFUSE SSHFS 2.2.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point</pre></div></div>

<p>I unmounted and remounted the filesystem and the speed increase was quite significant. I highly recommend that you do this third step.</p>
<a name="wptoc_0_0_4"></a><h3>What to do about those pesky <code>.DS_Store</code> and Appledouble files?</h3>
<p>There is a solution to <a href="http://support.apple.com/kb/HT1629" target="_blank">prevent <code>.DS_Store</code> file creation over network connections</a>.</p>
<p>The real power of this workflow is being able to edit files remotely without first copying them to the local computer. The <em>Ignore Apple Double Files</em> checkbox has to be left <em>unchecked</em> in order to edit images using Photoshop etc. However, as mentioned previously, this will cause OSX to spew  ._ * files on the server. These files, although invisible on the filesystem UI are still accessible through the web. As far as I know, the Appledouble files don&#8217;t contain any sensitive information like passwords and such and can be regarded as relatively harmless ( let me know if this is an incorrect assumption ).</p>
<a name="wptoc_0_0_5"></a><h3>Next steps</h3>
<p>Try it out and post a comment with your thoughts. I am interested in seeing if it does improve the workflow for web developers. For those of you who use a versioning system like subversion, I&#8217;m interested in getting some feedback on how this can be integrated, or if it is overkill.</p>
<p>I&#8217;ve only tested this with my commercial host ( Dreamhost.com ) that runs Linux, although it should work with most hosts that run some variant of UNIX / Linux. There could be permission issues depending on whether the remote filesystem allows extended file attributes. I&#8217;ll try and help out if you do have problems.</p>
<p>If anyone knows of a tutorial / resources on mounting remote filesystems on Windows please post a comment and I&#8217;ll integrate it into the post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.turingtarpit.com/2009/04/mounting-remote-filesystems-on-osx-leopard-using-sshfs-macfuse-and-macfusion/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
