<?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>Tea-Driven Development &#187; Linux / OS X Newbie Tips</title>
	<atom:link href="http://blog.mattwynne.net/category/linux-os-x-newbie-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mattwynne.net</link>
	<description>Matt Wynne taking it one tea at a time</description>
	<lastBuildDate>Tue, 10 Jan 2012 20:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pain-free and fun password-less SSH with ssh-forever</title>
		<link>http://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/</link>
		<comments>http://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 00:51:20 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/</guid>
		<description><![CDATA[A while ago I wrote a tip that showed you how to copy your public SSH key to a remote server to allow you to login without entering a password every time. I&#8217;ve since put this into a script that I use, and today I got sick enough of copying that script onto yet another [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I <a href="http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/">wrote a tip</a> that showed you how to copy your public SSH key to a remote server to allow you to login without entering a password every time. I&#8217;ve since put this into a script that I use, and today I got sick enough of copying that script onto yet another machine that I packaged it up as a gem, so now we can all use it.</p>

<p>It works just like the plain old &#8216;ssh&#8217; command, but this time you&#8217;ll never have to enter your password again:</p>

<p><div>
<pre class="txt" style="font-family:monospace;">ssh-forever username@yourserver.com</pre>
</div></p>

<p>Your key will be generated (if necessary), copied to your server, and you&#8217;ll be logged in as normal.</p>

<h2>Installation</h2>

<p><div>
<pre class="txt" style="font-family:monospace;">gem sources --add http://gemcutter.org
gem install ssh-forever</pre>
</div></p>

<h2>Example:</h2>

<p><div>
<pre class="txt" style="font-family:monospace;">[matt@bowie ssh-forever (master)]$ ssh-forever mattwynne@mattwynne.net
You do not appear to have a public key. I expected to find one at /Users/matt/.ssh/id_rsa.pub
Would you like me to generate one? [Y/n]y
Copying your public key to the remote server. Prepare to enter your password for the last time.
mattwynne@mattwynne.net's password:
Success. From now on you can just use plain old 'ssh'. Logging you in...
Linux broncos 2.6.29-xeon-aufs2.29-ipv6-qos-grsec #1 SMP Thu Jul 9 16:42:58 PDT 2009 x86_64
  _
 | |__ _ _ ___ _ _  __ ___ ___
 | '_ \ '_/ _ \ ' \/ _/ _ (_-&lt;
 |_.__/_| \___/_||_\__\___/__/
&nbsp;
 Welcome to broncos.dreamhost.com
&nbsp;
Any malicious and/or unauthorized activity is strictly forbidden.
All activity may be logged by DreamHost Web Hosting.
&nbsp;
Last login: Sat Aug 15 17:24:17 2009
[broncos]$</pre>
</div></p>

<h2>Why?</h2>

<p>Because I can never remember how to do it by hand. Now I don&#8217;t have to, and nor do you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2009/08/16/pain-free-and-fun-password-less-ssh-with-ssh-forever/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Quick and Easy Password-less SSH Login on Remote Servers</title>
		<link>http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/</link>
		<comments>http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 17:34:27 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[passwords]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/</guid>
		<description><![CDATA[Like so many posts in this category, this is surely child&#8217;s play to you linux aficionados. For those of us mere morals though, this is a very useful little trick, and it shows how you can easily move data from your local workstation to a remote server using SSH. If you don&#8217;t already have a [...]]]></description>
			<content:encoded><![CDATA[<p>Like so many posts in this category, this is surely child&#8217;s play to you linux aficionados. For those of us mere morals though, this is a very useful little trick, and it shows how you can easily move data from your local workstation to a remote server using SSH.</p>

<p>If you don&#8217;t already have a public / private key pair on your local workstation do this:</p>

<p>ssh-keygen -t rsa</p>

<p>If you have no idea what I&#8217;m talking about, try looking for this:</p>

<p>ls ~/.ssh</p>

<p>Did you see anything? You&#8217;re looking for a file called id_rsa.pub, I would guess.</p>

<p>Now that you have generated your key, to copy the public key part up to the remote server, do this:</p>

<p>ssh remote-user@remote-server.com &#8220;echo &#8216;<code>cat ~/.ssh/id_rsa.pub</code>&#8216; &gt;&gt; ~/.ssh/authorized_keys&#8221;</p>

<p>You should now be able to dance around the inner bits of the internet to your heart&#8217;s content.</p>

<p>Thanks to <a href="http://www.daniellucraft.com/blog/">Dan Lucraft</a> for the technology behind this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2009/01/13/quick-and-easy-password-less-ssh-login-on-remote-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu Eee &#8211; The OS Your EEE Should Have Been Born With</title>
		<link>http://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/</link>
		<comments>http://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 00:18:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[EEE PC]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/</guid>
		<description><![CDATA[On finishing a long contract and project at the BBC a few months ago, I was incredibly touched to be given a brand new Asus EEE PC as a leaving gift by my colleagues. Although I loved the tiny form factor and take it with me practically everywhere, I was never quite satisfied with the [...]]]></description>
			<content:encoded><![CDATA[<p>On finishing a long contract and project at the BBC a few months ago, I was incredibly touched to be given a brand new Asus EEE PC as a leaving gift by my colleagues.</p>

<p>Although I loved the tiny form factor and take it with me practically everywhere, I was never quite satisfied with the default Xandros Linux and have fidgeted around ever since trying out different options, spending way too much time on the on the excellent <a href="http://www.eeeuser.com/">eeeuser.com</a> community site, zapping the flash drive with different distros.</p>

<p>Finally this evening I think I found the answer: <a href="http://www.ubuntu-eee.com/">http://www.ubuntu-eee.com/</a></p>

<p>Slick, easy to install, great looking, and of course a proper operating system under the hood. Props to the team who put this together, it&#8217;s terrific. If you have one of these little beauties yourself, I highly recommend checking it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Danger: MacPorts Breaks Your Rails/Ruby Relationship</title>
		<link>http://blog.mattwynne.net/2008/07/31/danger-macports-breaks-your-railsruby-relationship/</link>
		<comments>http://blog.mattwynne.net/2008/07/31/danger-macports-breaks-your-railsruby-relationship/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 14:06:48 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/07/31/danger-macports-breaks-your-railsruby-relationship/</guid>
		<description><![CDATA[So I just spent a fun morning trying to work out why so many of our unit tests were breaking on my machine with the message: undefined method `[]' for #&#60;Enumerable: I turns out that Ruby 1.8.7 doesn&#8217;t run Rails very well, and if you take the time to read the small print it&#8217;s clear [...]]]></description>
			<content:encoded><![CDATA[<p>So I just spent a fun morning trying to work out why so many of our unit tests were breaking on my machine with the message:</p>

<p><div>
<pre class="txt" style="font-family:monospace;">undefined method `[]' for #&lt;Enumerable:</pre>
</div></p>

<p><span id="more-67"></span></p>

<p>I turns out that Ruby 1.8.7 doesn&#8217;t run Rails very well, and if you take the time to read <a href="http://www.rubyonrails.org/down">the small print</a> it&#8217;s clear you really need to just run 1.8.6.</p>

<p>Trouble is, the wonderful <a href="http://www.macports.org/">MacPorts</a> is now installing 1.8.7.</p>

<p>I have been fumbling around for the past few days installing/building various versions of things like <a href="http://www.danga.com/memcached/">memcached</a> to get our app to work on my OSX 10.4. It&#8217;s been a lonely furrow to plough &#8211; all the other devs in the office are hard-core emacs / ubuntu heads, and it seems like most Mac people have moved on to Leopard these days&#8230;</p>

<p>At some point I must have made the mistake of running</p>

<p><div>
<pre class="txt" style="font-family:monospace;"># DO NOT RUN THIS!
sudo port upgrade ruby</pre>
</div></p>

<p>So be warned, people.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/07/31/danger-macports-breaks-your-railsruby-relationship/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fetch and Parse HTML Web Page Content From Bash. Wow.</title>
		<link>http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/</link>
		<comments>http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 22:47:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/</guid>
		<description><![CDATA[Okay, this is another one of those linux newbie posts where I tried to figure out how to do something that&#8217;s probably really obvious to all you seasoned hackers out there. Anyway here I go clogging up the internet with a post that somebody, somewhere will hopefully find useful. Are you that person? Well&#8230; have [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, this is another one of those linux newbie posts where I tried to figure out how to do something that&#8217;s probably really obvious to all you seasoned hackers out there.</p>

<p>Anyway here I go clogging up the internet with a post that somebody, somewhere will hopefully find useful.</p>

<p>Are you that person? Well&#8230; have you ever used the shell command <a href="http://curl.haxx.se/">curl</a> to fetch a web page? It&#8217;s cool, isn&#8217;t it, but you do end up with a splurge of ugly HTML tags in your terminal shell:</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2008/04/picture-6.png" style="max-width: 800px" /></p>

<p>Eugh!</p>

<p>So&#8230; how about we parse that HTML into something human-readable?</p>

<p><span id="more-56"></span>
Enter my new friend, <a href="http://w3m.sourceforge.net/">w3m</a>, the command-shell web browser!</p>

<p>If you&#8217;re using OS X, you can install w3m using <a href="http://darwinports.com/">darwinports</a> thusly:
<pre>sudo port install w3m</pre>
Linux hackers, I&#8217;m going to assume you can figure this out for yourselves.
So, with a brand-new blade in our swiss-army knife, let&#8217;s pipe the curl command into the standard input for w3m and see what happens:</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2008/04/picture-7.png" style="max-width: 800px" /></p>

<p>Hmm&#8230; two problems here: because I&#8217;ve grabbed its output and piped it off to w3m, curl has started blethering on about how long it took. I can fix that with swift but ruthless the flick of a -s switch to silence it. How about all that raw HTML though &#8211; I thought this w3m thing was supposed to parse my html, not just regurgitate it?</p>

<p>It turns out that w3m assumes its input is of MIME-type text/plain, unless told otherwise. Let&#8217;s set the record straight:</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2008/04/picture-8.png" style="max-width: 800px" /></p>

<p>Aw yeah. Now we&#8217;re talking. Old-skool green-screen meets nu-school interweb. It&#8217;s like being back on the <a href="http://en.wikipedia.org/wiki/Bulletin_board_system">BBS</a> network of yore.</p>

<p>What&#8217;s the point of all this? Well, that&#8217;s up to you. I have a couple of ideas, but you&#8217;re going to have to start coming up with your own you know. Why are you reading this anyway? Haven&#8217;t you got anything better to do?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Saving Your WordPress Blog to CD</title>
		<link>http://blog.mattwynne.net/2008/04/11/saving-your-wordpress-blog-to-cd/</link>
		<comments>http://blog.mattwynne.net/2008/04/11/saving-your-wordpress-blog-to-cd/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 10:42:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[burning]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mirror]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/04/11/saving-your-wordpress-blog-to-cd/</guid>
		<description><![CDATA[So the wife has been writing her mandatory university course diary as a wordpress blog, but now she needs to hand it in. &#62; Can you put it on a CD for me? She asks. Unix to the rescue! Following this excellent article I had the site saved down to disk in a jiffy, with [...]]]></description>
			<content:encoded><![CDATA[<p>So the wife has been writing her mandatory university course diary as a wordpress blog, but now she needs to hand it in.</p>

<p>&gt; Can you put it on a CD for me?
She asks.</p>

<p>Unix to the rescue!</p>

<p><span id="more-47"></span></p>

<p>Following <a href="http://www.jim.roberts.net/articles/wget.html">this excellent article</a> I had the site saved down to disk in a jiffy, with all links modified to work offline, all images and CSS files copied down.</p>

<p>For your reference, here&#8217;s the command I used.
<pre>    wget --mirror -w 2 -p --html-extension --convert-links -P -H -Dwordpress.com ~/path/to/save/locally http://yourblog.wordpress.com</pre>
Quoting Jim&#8217;s article for the meaning of the command line options:
&gt; &#8211;mirror: specifies to mirror the site. Wget will recursively follow all links on the site and download all necessary files. It will also only get files that have changed since the last mirror, which is handy in that it saves download time.
&gt;
&gt; -w: tells wget to “wait” or pause between requests, in this case for 2 seconds. This is not necessary, but is the considerate thing to do. It reduces the frequency of requests to the server, thus keeping the load down. If you are in a hurry to get the mirror done, you may eliminate this option.
&gt;
&gt; -p: causes wget to get all required elements for the page to load correctly. Apparently, the mirror option does not always guarantee that all images and peripheral files will be downloaded, so I add this for good measure.
&gt;
&gt; &#8211;html-extension: All files with a non-html extension will be converted to have an html extension. This will convert any cgi or asp generated files to html extensions for consistency.
&gt;
&gt; &#8211;convert-links: all links are converted so they will work when you browse locally. Otherwise, relative (or absolute) links would not necessarily load the right pages, and style sheets could break as well.
&gt;
&gt; -P (prefix folder): the resulting tree will be placed in this folder. This is handy for keeping different copies of the same site, or keeping a “browsable” copy separate from a mirrored copy.</p>

<p>I&#8217;ve also added my own at the end of Jim&#8217;s version:
<pre>-H -Dwordpress.com</pre>
These options tell wget to recursively fetch any file within the .wordpress.com domain &#8211; otherwise the stylesheets and images for the blog, which are stored in different subdomains of wordpress.com, will not be downloaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/04/11/saving-your-wordpress-blog-to-cd/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Use Rsync to Copy Your ASP.NET Website</title>
		<link>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/</link>
		<comments>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 01:34:29 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux / OS X Newbie Tips]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/</guid>
		<description><![CDATA[If you&#8217;ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you&#8217;re using TFS and Resharper, you&#8217;ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you&#8217;re using TFS and Resharper, you&#8217;ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders.</p>

<p>If you have a unix/linux/apple machine handy, or have at least had the sense to instal <a href="http://www.cygwin.com/">cygwin</a> or <a href="http://colinux.wikia.com/">coLinux</a> on your quaint old PC, then give this a rumble.</p>

<p><span id="more-44"></span></p>

<p>Prepare a file with the inclusion / exclusion rules for the files / folders you want to copy. For my solution, it looks like this:</p>

<ul>
<li>*.cs</li>
<li>**/lib/<em>.</em></li>
<li>*.csproj</li>
<li>*.sln</li>
<li>*.resx</li>
<li>*.jgp</li>
<li>*.gif</li>
<li>*.gif</li>
<li>*.aspx</li>
<li>*.ashx</li>
<li>*.js</li>
<li>*.ascx</li>
<li>*.config</li>
<li>*.xml</li>
<li>*.txt</li>
<li>*.html</li>
<li>*.htm</li>
<li>*.dbp</li>
<li>*.sql</li>
<li>*/</li>
<li>*</li>
</ul>

<p>There are a few fascinating points to note about this file:</p>

<ul>
<li>The lines that begin with a &#8216;+&#8217; character are include rules.</li>
<li>The second line copies anything in a /lib folder, which is where we keep dependencies in my world</li>
<li>The second-to-last line tells rsync to copy every folder. Without this, the last line would exclude all the folders (rsync works its way through the folder tree recursively) and you&#8217;d never get to the files you&#8217;d mentioned above. Read that bit again, it&#8217;s hard to understand at first, but important.</li>
<li>The last line excludes everything else.</li>
</ul>

<p>Now fire up your terminal, and invoke the magic of rsync:</p>

<p>rsync -av &#8211;exclude-from=files.txt source/Projects/Widgets/ target/Projects/Widgets/</p>

<p>Which means</p>

<ul>
<li>copy <em>a</em>ll files (recursively)</li>
<li>write <em>v</em>erbose output</li>
</ul>

<p>And there you have it. Yet more unix joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

