<?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>Web Development &#38; Stuff &#187; OSX</title>
	<atom:link href="http://web-development-blog.co.uk/tag/osx/feed/" rel="self" type="application/rss+xml" />
	<link>http://web-development-blog.co.uk</link>
	<description>Some interesting findings from web-dev land...</description>
	<lastBuildDate>Mon, 02 Apr 2012 15:10:20 +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>Return exit code of previous shell command</title>
		<link>http://web-development-blog.co.uk/2009/10/03/return-exit-code-of-previous-shell-command/</link>
		<comments>http://web-development-blog.co.uk/2009/10/03/return-exit-code-of-previous-shell-command/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 14:45:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell scripting]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=196</guid>
		<description><![CDATA[You can return the exit/return code of the command you just ran in OSX/Linux using this simple command:
1echo $?
This is handy when debugging scripts that rely on shell command return values.
]]></description>
			<content:encoded><![CDATA[<p>You can return the exit/return code of the command you just ran in OSX/Linux using this simple command:</p>
<div class="codecolorer-container mysql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="mysql codecolorer" style="font-family:Monaco,Lucida Console,monospace">echo $?</div></td></tr></tbody></table></div>
<p>This is handy when debugging scripts that rely on shell command return values.</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/10/03/return-exit-code-of-previous-shell-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash &#8211; Match exact string in directory listing</title>
		<link>http://web-development-blog.co.uk/2009/04/27/bash-match-exact-string-in-directory-listing/</link>
		<comments>http://web-development-blog.co.uk/2009/04/27/bash-match-exact-string-in-directory-listing/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 16:38:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bash scripting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Shell scripting]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=150</guid>
		<description><![CDATA[Been doing some bash scripting of late, been meaning to for ages. Really enjoying it too!
Anyway, today I needed to match an exact string in a directory listing (ls). To check if a volume on my Mac Book was mounted, so I could backup to it. Or any other drive for that matter. I ended [...]]]></description>
			<content:encoded><![CDATA[<p>Been doing some bash scripting of late, been meaning to for ages. Really enjoying it too!</p>
<p>Anyway, today I needed to match an exact string in a directory listing (ls). To check if a volume on my Mac Book was mounted, so I could backup to it. Or any other drive for that matter. I ended up using this code:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co0">#!/bin/bash</span><br />
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$1&quot;</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; <span class="co0"># Look for an exact match of the first passed argument in /Volumes. </span><br />
&nbsp; <span class="co0"># The -x switch matches the string ($1) exactly. The -c switch counts the outputted lines.</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> $<span class="br0">&#40;</span><span class="kw2">ls</span> <span class="sy0">/</span>Volumes<span class="sy0">/</span> <span class="sy0">|</span> <span class="kw2">grep</span> <span class="re5">-c</span> <span class="re5">-x</span> <span class="st0">&quot;$1&quot;</span><span class="br0">&#41;</span> == <span class="nu0">1</span> <span class="br0">&#93;</span>; <span class="kw1">then</span><br />
&nbsp; &nbsp; <span class="co0"># Do stuff...</span><br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st_h">'Sorry, but no volume with that name not found.'</span><br />
&nbsp; <span class="kw1">fi</span><br />
<span class="kw1">else</span><br />
&nbsp; <span class="kw3">echo</span> <span class="st_h">'Please pass a destination volume to this backup script as the first command line argument.'</span><br />
<span class="kw1">fi</span><br />
<br />
<span class="co0"># Usage</span><br />
<span class="kw2">bash</span>$ backup.sh <span class="st0">&quot;Volume name&quot;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/04/27/bash-match-exact-string-in-directory-listing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reload bash_profile / profile without starting a new shell session</title>
		<link>http://web-development-blog.co.uk/2009/03/04/reload-bash_profile-profile-without-starting-a-new-shell-session/</link>
		<comments>http://web-development-blog.co.uk/2009/03/04/reload-bash_profile-profile-without-starting-a-new-shell-session/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 14:47:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=89</guid>
		<description><![CDATA[I always used to log-out / log-back-in to shell, to allow changes in my .bash_profile to kick in. I&#8217;m guessing this would work in OSX with your .profile file too but I&#8217;ve not tested it. Anyways, I discovered you can reload the script on the fly using:
1source ~/.bash_profile
]]></description>
			<content:encoded><![CDATA[<p>I always used to log-out / log-back-in to shell, to allow changes in my .bash_profile to kick in. I&#8217;m guessing this would work in OSX with your .profile file too but I&#8217;ve not tested it. Anyways, I discovered you can reload the script on the fly using:</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace">source ~<span class="sy0">/.</span>bash_profile</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/03/04/reload-bash_profile-profile-without-starting-a-new-shell-session/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mount remote file system on your local file system over SSH &#8211; SSHFS</title>
		<link>http://web-development-blog.co.uk/2009/02/25/mount-remote-file-system-on-your-local-file-system-ssh-sshfs/</link>
		<comments>http://web-development-blog.co.uk/2009/02/25/mount-remote-file-system-on-your-local-file-system-ssh-sshfs/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 23:07:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=80</guid>
		<description><![CDATA[Lots of love going about today! This time, the recipient is SSHFS which allows you to mount a remote filing system onto your local tree over SSH. In a virtual hosting environment (/vhosts/ etc) it&#8217;s pure joy to work with.
You&#8217;ll need to install SSHFS on the client (the machine you want to mount the remote [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of love going about today! This time, the recipient is SSHFS which allows you to mount a remote filing system onto your local tree over SSH. In a virtual hosting environment (/vhosts/ etc) it&#8217;s pure joy to work with.</p>
<p>You&#8217;ll need to install SSHFS on the client (the machine you want to mount the remote system on). All you need on the remote system is SSH. This is already installed on most systems.</p>
<p>You can install SSHFS on OSX with Mac Ports:</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace">port install sshfs</div></td></tr></tbody></table></div>
<p>On the local client system add the user you&#8217;re going to connect with to the fuse group. That group was created when you installed SSHFS:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">gpasswd -a localuser fuse</div></td></tr></tbody></table></div>
<p>Create a directory on the local filing system to use as a mount point:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mkdir /vhosts_servername/</div></td></tr></tbody></table></div>
<p>Now connect to the remote system using a command line like this on the client:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">sshfs localuser@yourdomain.com:/remote_directory/ /vhosts_servername</div></td></tr></tbody></table></div>
<p>Nice ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/02/25/mount-remote-file-system-on-your-local-file-system-ssh-sshfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX zoom mode with trackpad / ctrl</title>
		<link>http://web-development-blog.co.uk/2009/02/07/osx-zoom-mode-with-trackpad-ctrl/</link>
		<comments>http://web-development-blog.co.uk/2009/02/07/osx-zoom-mode-with-trackpad-ctrl/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 10:30:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/2009/02/07/osx-zoom-mode-with-trackpad-ctrl/</guid>
		<description><![CDATA[Weird, I found the zoom mode on my MacBook &#8220;13 today! Hold down the control key (ctrl) and move 2 fingers up the track pad. It&#8217;ll zoom the display. Handy to inspect those small graphic issues!
]]></description>
			<content:encoded><![CDATA[<p>Weird, I found the zoom mode on my MacBook &#8220;13 today! Hold down the control key (ctrl) and move 2 fingers up the track pad. It&#8217;ll zoom the display. Handy to inspect those small graphic issues!</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/02/07/osx-zoom-mode-with-trackpad-ctrl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

