<?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>Matt Thommes &#187; Technical</title>
	<atom:link href="http://matthom.com/archive/category/technical/feed" rel="self" type="application/rss+xml" />
	<link>http://matthom.com</link>
	<description>My technical meanderings and other nonsense. Published since 2002. No, really. I&#039;m *that* internet-old.</description>
	<lastBuildDate>Sun, 12 May 2013 19:55:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Node.js</title>
		<link>http://matthom.com/archive/2013/01/15/node-js</link>
		<comments>http://matthom.com/archive/2013/01/15/node-js#comments</comments>
		<pubDate>Tue, 15 Jan 2013 23:28:25 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://matthom.com/?p=6981</guid>
		<description><![CDATA[I received this Node.js book for Christmas, and with the extra time off (around the holidays) I started digging into it. I find the concept of Node.js interesting, in that it&#8217;s a web server stack (similar to LAMP) but without all of the typical components of a stack. In other words, it&#8217;s everything LAMP is [...]]]></description>
				<content:encoded><![CDATA[<p>I received <a href="http://www.sitepoint.com/books/nodejs1/">this Node.js book</a> for Christmas, and with the extra time off (around the holidays) I started digging into it.</p>
<p>I find the concept of Node.js interesting, in that it&#8217;s a web server stack (similar to LAMP) but without all of the typical components of a stack. In other words, it&#8217;s everything LAMP is but contained in a single installation (if you don&#8217;t count all of the modules you have to require).</p>
<p>Here&#8217;s the down-and-dirty truth: I am getting somewhat tired of creating web applications with LAMP (specifically the &#8220;AMP&#8221; part). Not that it doesn&#8217;t suit my needs, or that it is particularly laborious or troublesome, but that I know there must be something better out there. Something that I might already know a lot of (JavaScript). Something that reduces the exposure to (and the need to code around) the annoying database layer.</p>
<p>I particularly hate having to code three different server-side layers: PHP, MySQL, and Apache (if you count htaccess).</p>
<p>Node.js seems like it simplifies all of that into a single layer, and uses JavaScript for everything (and a heavy dose of JSON).</p>
<p>Here are some initial oddities I&#8217;ve noticed when using Node.js:</p>
<ul>
<li>Odd use case: <code>'use strict';</code></li>
<li>Functions within functions.</li>
<li>Exposing functions to other modules. Example:</li>
</ul>
<pre>function init(exchange, orderType) {
    ...
  } module.exports = {
</pre>
<p>Otherwise it&#8217;s all very familiar to me already (due to it being JavaScript) and I am picking it up fast. It&#8217;s just a matter of finding real-world projects that I can apply these new skills to (which will continue my involvement and learning process).</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2013/01/15/node-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting photos online quicker</title>
		<link>http://matthom.com/archive/2012/07/29/getting-photos-online-quicker</link>
		<comments>http://matthom.com/archive/2012/07/29/getting-photos-online-quicker#comments</comments>
		<pubDate>Sun, 29 Jul 2012 17:28:34 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Zapier]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/07/29/getting-photos-online-quicker</guid>
		<description><![CDATA[I appreciate dedicated devices (such as the Kindle, Flip Camcorder, etc) because sometimes I want to instantly do something, and not have to wade through different menus and screens just to get there. (Multi-purpose devices like any smartphone also have benefits but that&#8217;s not the focus of this post.) I want to go from camera [...]]]></description>
				<content:encoded><![CDATA[<p>I appreciate dedicated devices (such as the Kindle, Flip Camcorder, etc) because sometimes I want to <em>instantly</em> do something, and not have to wade through different menus and screens just to get there.</p>
<p>(Multi-purpose devices like any smartphone also have benefits but that&#8217;s not the focus of this post.)</p>
<p>I want to go from <strong>camera to web</strong> more quickly than I currently do. By &#8220;web&#8221; I mean a submission to a personal server/domain (where the image is saved and a public URL is provided), or any social sharing site or web service.</p>
<p>I want this for web-enabled camera devices, and non-web-enabled camera devices.</p>
<p>One option is Dropbox automatic uploads (once a camera is attached):</p>
<p><img src="http://media.matthom.com/images/98b418276d571e623651fc1d471c7811.png" alt="Dropbox automatic uploads" /></p>
<p>This seems to work very well, and there is also an equivalant on iOS (once you take a photo and open the Dropbox app, it automatically uploads it).</p>
<p>Next, I could use <a href="http://matthom.com/archive/2012/06/27/zapier-an-enterprise-data-mashup-service">Zapier</a> (or something similar) to process new uploads to Dropbox:</p>
<p><img src="http://media.matthom.com/images/0c43d4c590532984474f3652fb436196.png" alt="Zapier: Dropbox to WebHook" /></p>
<p><img src="http://media.matthom.com/images/ba1974a88e98d7904c73b33aa6f9c128.png" alt="Dropbox settings in Zapier" /></p>
<p><img src="http://media.matthom.com/images/e3068eae46efe5564f266c6113619b43.png" alt="WebHook settings in Zapier" /></p>
<p>This seems to work great &#8211; it&#8217;s a fully automated camera to web process that only requires taking a photo and connecting it to a computer (or loading the app on iOS).</p>
<p>The best part is I can do this with cameras that don&#8217;t have WiFi or any web features.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/07/29/getting-photos-online-quicker/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I still self-host and hand-code in the age of SAAS</title>
		<link>http://matthom.com/archive/2012/06/20/why-i-still-self-host-and-hand-code-in-the-age-of-saas</link>
		<comments>http://matthom.com/archive/2012/06/20/why-i-still-self-host-and-hand-code-in-the-age-of-saas#comments</comments>
		<pubDate>Wed, 20 Jun 2012 21:57:32 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/06/20/why-i-still-self-host-and-hand-code-in-the-age-of-saas</guid>
		<description><![CDATA[To follow up with my previous post about why I still blog in the age of social networks, this post is why I still self-host and hand-code (my blog) in the age of SAAS (fully hosted and managed software services). I&#8217;ve toyed with the idea of ditching my complicated server and software setup and moving [...]]]></description>
				<content:encoded><![CDATA[<p>To follow up with my previous post about <a href="http://matthom.com/archive/2012/06/19/why-i-still-blog-in-the-age-of-social-networks">why I still blog in the age of social networks</a>, this post is why I still self-host and hand-code (my blog) in the age of SAAS (fully hosted and managed software services).</p>
<p>I&#8217;ve toyed with the idea of ditching my complicated server and software setup and moving to a &#8220;jump right in and start blogging&#8221; service like Tumblr. In fact, the idea of switching is so compelling at times, I&#8217;ve created numerous accounts at times when I really feel the urge. Those accounts always end up sitting static as I either run out of time to play around with it, or find a valid reason to keep using the approach I am using.</p>
<p>If I were to ever switch, I would need ability to:</p>
<ol>
<li>Import all blog posts and feedback.</li>
<li>Have the same URL&#8217;s for blog posts and RSS feeds.</li>
</ol>
<p>(#1) would be especially tricky with feedback, as there would need to be some way to relate feedback posts to blog posts.</p>
<p>(#2) would require a CNAME (most services offer this) and a custom URI structure of my choosing (YYYY/MM/DD/post-slug). RSS feeds would be tricky too because I don&#8217;t want existing subscribers (all four of you) to have to subscribe to another URL.</p>
<p>I would need some control on a hosting level to handle htaccess stuff and truly configure the crap out of things (if I felt inclined).</p>
<p>I&#8217;m doubting any service could offer all this in an easy-to-setup fashion. Most blogging services treat potential customers as <em>new</em> bloggers, which I think is a mistake because a lot of older bloggers (like myself) may want to be relieved of hosting and coding to use a service that lets them easily migrate from that scenario, but still give them some power if they want it.</p>
<p>So this is where I stand: intrigued by SAAS, but not wanting to give up the control I have over every aspect of my site.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/06/20/why-i-still-self-host-and-hand-code-in-the-age-of-saas/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git tip: use symlink for multiple repository clones</title>
		<link>http://matthom.com/archive/2012/05/08/git-tip-use-symlink-for-multiple-repository-clones</link>
		<comments>http://matthom.com/archive/2012/05/08/git-tip-use-symlink-for-multiple-repository-clones#comments</comments>
		<pubDate>Tue, 08 May 2012 12:12:32 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/05/08/git-tip-use-symlink-for-multiple-repository-clones</guid>
		<description><![CDATA[Here is a simple tip to help consolidate some of your Git repository clones on your servers. Anytime you have to clone the same repository on the same server (for different apps/folders), it requires you to pull changes in each folder (every time a change is pushed). A better way is to create a single [...]]]></description>
				<content:encoded><![CDATA[<p>Here is a simple tip to help consolidate some of your Git repository clones on your servers.</p>
<p>Anytime you have to clone the same repository on the same server (for different apps/folders), it requires you to pull changes in each folder (every time a change is pushed).</p>
<p>A better way is to create a single folder on your server, and anywhere you need to access that cloned repository, just create a symlink (dynamic folder link) to the main folder. This way you only have to pull once, and every spot instantly gets the changes.</p>
<p>Creating a symlink is simple using the command line. Let&#8217;s say you name your cloned repository &#8220;cloned&#8221; and your app directory is called &#8220;global.&#8221; First navigate to the appropriate directory, then issue:</p>
<pre>
ln -s /path/to/cloned/directory global
</pre>
<p>A new folder called &#8220;global&#8221; will appear, but instead of holding files itself, it just links to the source directory. Your web application won&#8217;t know the difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/05/08/git-tip-use-symlink-for-multiple-repository-clones/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web host migration checklist</title>
		<link>http://matthom.com/archive/2012/04/21/web-host-migration-checklist</link>
		<comments>http://matthom.com/archive/2012/04/21/web-host-migration-checklist#comments</comments>
		<pubDate>Sat, 21 Apr 2012 19:20:32 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/04/21/web-host-migration-checklist</guid>
		<description><![CDATA[I recently migrated from one web host to another, and wanted to share some common things that I had to make sure were updated or configured properly. Consider this a half checklist; half brain-dump. Common server components Create domains under the new web host. Upload files to appropriate domain directory. Databases created and data imported. [...]]]></description>
				<content:encoded><![CDATA[<p>I recently migrated from one web host to another, and wanted to share some common things that I had to make sure were updated or configured properly. Consider this a half checklist; half brain-dump.</p>
<h2>Common server components</h2>
<ol>
<li>Create domains under the new web host.</li>
<li>Upload files to appropriate domain directory.</li>
<li>Databases created and data imported.</li>
<li>Email accounts created (specifically, any MX records pointing to other servers like Google Apps).</li>
<li>Cronjobs created.</li>
<li>Make sure PHP version is correct.</li>
<li>Other DNS settings (like domain CNAME&#8217;s).</li>
</ol>
<h2>Script updates</h2>
<ol>
<li>Database connections in case you could not name everything identically.</li>
<li>Directory path references if it differs from previous server.</li>
<li>Any configuration needed in <code>.htaccess</code> files (such as forcing a PHP version).</li>
<li>Any <code>php.ini</code> settings, such as <code>date.timezone</code>.</li>
</ol>
<p>Once all of this is complete, it is usually safe to update the name servers for your domains to point to the new web host. Often some things are not noticeable until you flip the switch, so sometimes you just have to flip it and try to fix things as quickly as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/04/21/web-host-migration-checklist/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Naming Git branches</title>
		<link>http://matthom.com/archive/2012/03/06/naming-git-branches</link>
		<comments>http://matthom.com/archive/2012/03/06/naming-git-branches#comments</comments>
		<pubDate>Tue, 06 Mar 2012 20:43:38 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/03/06/naming-git-branches</guid>
		<description><![CDATA[Using branches in Git is a very convenient way to isolate development projects away from the main software files so you are not interfering with live functionality. Any time I have a new feature to implement, or simply want to fix or improve something, I create a branch which lets me work unimpeded and without [...]]]></description>
				<content:encoded><![CDATA[<p>Using branches in Git is a very convenient way to isolate development projects away from the main software files so you are not interfering with live functionality. Any time I have a new feature to implement, or simply want to fix or improve something, I create a branch which lets me work unimpeded and without interrupting actual users or other developers.</p>
<p>One aspect of branches I have trouble with is their names. I never know what name to give new branches, as it never seems to fully encompass the following things, without becoming too long or wordy:</p>
<ol>
<li>Section or feature of the software I am working on.</li>
<li><em>When</em> I started development in the branch (useful for knowing what state the software was in at that point).</li>
<li>Reason for creating the branch.</li>
</ol>
<p>For one thing, a long branch name requires extra typing every time you want to interact with Git from the command line. Who wants to type &#8220;<code>git pull my_really_long_branch_name_from_20120229</code>&#8221; every time you need to do something?</p>
<p>Most importantly, branches often change scope or direction, making the branch name sound irrelevant after a while.</p>
<p><em>(Note: I have the same problem with CSS class names.)</em></p>
<p>So I&#8217;ve started naming branches more abstract, generic, and system-like. For example, I will often just use a simple numbering system, such as &#8220;1&#8243; or &#8220;2&#8243;. I will then keep track (using some other system) what each branch pertains to (description, when it was created, etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/03/06/naming-git-branches/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to multiple GitHub accounts on Windows</title>
		<link>http://matthom.com/archive/2012/01/04/connecting-to-multiple-github-accounts-on-windows</link>
		<comments>http://matthom.com/archive/2012/01/04/connecting-to-multiple-github-accounts-on-windows#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:34:07 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2012/01/04/connecting-to-multiple-github-accounts-on-windows</guid>
		<description><![CDATA[I recently mentioned how to use multiple SSH keys with GitHub, but that was for Linux servers only. I also use Git on Windows, and need to work with my repositories (from multiple GitHub accounts) there. After my initial trial-and-error, I have yet to find a seamless solution, but I&#8217;ll post what I&#8217;ve done so [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://matthom.com/archive/2011/12/30/connecting-to-multiple-github-accounts-from-the-same-server">I recently mentioned</a> how to use multiple SSH keys with GitHub, but that was for Linux servers only. I also use Git on Windows, and need to work with my repositories (from multiple GitHub accounts) there.</p>
<p>After my initial trial-and-error, I have yet to find a seamless solution, but I&#8217;ll post what I&#8217;ve done so far.</p>
<p>I currently use <a href="http://code.google.com/p/tortoisegit/downloads/list">TortoiseGit</a>, and Pageant to store my SSH keys. I chose &#8220;TortoisePLink&#8221; during the SSH setup when installing TortoiseGit.</p>
<p>Pageant seems pretty straight-forward. You add SSH keys to it, and somehow it communicates with TortoiseGit when accessing GitHub.com.</p>
<p>The problem is when you need to access multiple GitHub.com accounts. You can add multiple SSH keys to Pageant, but it only seems to use the first one listed (the one at the very top):</p>
<p><img src="http://matthom.com/images/m1/2538.jpg" width="530" height="379" alt="Screenshot of Pageant window" title="Pageant SSH keys" /></p>
<p>I can&#8217;t figure out a way to have it use a different key from Pageant depending on the TortoiseGit settings (for each local working directory).</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2012/01/04/connecting-to-multiple-github-accounts-on-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to multiple GitHub accounts from the same server</title>
		<link>http://matthom.com/archive/2011/12/30/connecting-to-multiple-github-accounts-from-the-same-server</link>
		<comments>http://matthom.com/archive/2011/12/30/connecting-to-multiple-github-accounts-from-the-same-server#comments</comments>
		<pubDate>Fri, 30 Dec 2011 14:49:25 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2011/12/30/connecting-to-multiple-github-accounts-from-the-same-server</guid>
		<description><![CDATA[Here&#8217;s my dilemma: I have two GitHub.com accounts &#8211; one for work projects, and another for personal projects. I use the same servers to develop/deploy these projects, albeit in separate directories. I need to be able to authorize myself (via SSH keys) to either GitHub.com account (and repositories within) on a per-directory basis, all on [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s my dilemma:</p>
<p>I have two GitHub.com accounts &#8211; one for work projects, and another for personal projects.</p>
<p>I use the same servers to develop/deploy these projects, albeit in separate directories.</p>
<p>I need to be able to authorize myself (via SSH keys) to either GitHub.com account (and repositories within) on a per-directory basis, all on the same server.</p>
<p>It seems that the local git client wants to use the same SSH key every time it authorizes access to GitHub.com, rather than alternating it depending on the directory I am working in.</p>
<p>For example, here is an illustration of the setup on my server:</p>
<pre>
root/
  work-project/
  personal-project/
</pre>
<p>I want <code>work-project</code> to authorize to GitHub.com account A. I want <code>personal-project</code> to authorize to GitHub.com account B.</p>
<h2>Multiple SSH keys</h2>
<p>I&#8217;ve already set up multiple SSH keys &#8211; one for each GitHub.com account. Example:</p>
<pre>
.ssh/
  work_rsa
  personal_rsa
</pre>
<p>Both keys have been added to their appropriate GitHub.com accounts.</p>
<p>I&#8217;ve also already created a <code>config</code> file inside the <code>.ssh/</code> directory with the following contents:</p>
<pre>
Host github.com
    Hostname github.com
    User git
    IdentityFile ~/.ssh/work_rsa
    
Host github-matthom
    Hostname github.com
    User git
    IdentityFile ~/.ssh/personal_rsa
</pre>
<p>I&#8217;ve also ran these commands:</p>
<pre>
ssh-add ~/.ssh/work_rsa
ssh-add ~/.ssh/personal_rsa
</pre>
<p>This should allow both SSH keys to be used, which it does, but only partially.</p>
<p>It seems like it only honors the most recent <code>ssh-add</code> command. In other words, as long as I run one of the above commands, I am then able to authorize to that GitHub.com account <em>from that point forward</em>. But as soon as I run the command again (for a different account), it then always uses that account to authorize. Therefore repo access attempts fail because it can&#8217;t authorize the other user.</p>
<p><img src="http://matthom.com/images/m1/2537.jpg" width="524" height="89" alt="Screenshot of command prompt" title="GitHub.com authorization fails" /></p>
<p>I can&#8217;t figure out how to have it automatically know which SSH key to use based on the directory I am working in (since each directory is associated with a different GitHub.com account/repository).</p>
<h2>UPDATE (12/31/2011)</h2>
<p>I seem to have figured it out, thanks to <a href="http://net.tutsplus.com/tutorials/tools-and-tips/how-to-work-with-github-and-multiple-accounts/">this site</a>.</p>
<p>I re-configured the names of my SSH <code>id_rsa</code> files:</p>
<pre>
.ssh/
  id_rsa_work
  id_rsa_personal
</pre>
<p>Next, I updated the <code>.ssh/config</code> file to reference the new file names:</p>
<pre>
Host github.com
    Hostname github.com
    User git
    IdentityFile ~/.ssh/id_rsa_work
    
Host github-personal
    Hostname github.com
    User git
    IdentityFile ~/.ssh/id_rsa_personal
</pre>
<p>Notice, in particular, the second <code>Host</code> listed:</p>
<p><code>Host github-personal</code></p>
<p>This matches the file name <code>id_rsa_personal</code>. This also matches the actual GitHub.com account name (Note: &#8220;personal&#8221; is just used as an example, and is not my actual GitHub.com account name). So you would include your alternate GitHub.com account name here, as such:</p>
<pre>
Host github-ACCOUNT
    Hostname github.com
    User git
    IdentityFile ~/.ssh/id_rsa_ACCOUNT
</pre>
<p>Next, make sure the directory you create on your server is pointing to the appropriate GitHub.com account:</p>
<p><code>git remote add origin git@github-ACCOUNT:ACCOUNT/test.git</code></p>
<p>Again, replace &#8220;ACCOUNT&#8221; above with your actual GitHub.com account name, which should match the same name you referenced in the <code>config</code> file.</p>
<p>Now you can <code>pull</code> or <code>push</code> to that GitHub.com repository, and it will always use the correct SSH key.</p>
<p>I don&#8217;t think you need to run <code>ssh-add ...</code> anymore, but it doesn&#8217;t hurt to do this as you can save time from having to re-enter your SSH key password repeatedly.</p>
<p>Let me know if anyone notices any errors in my explanation, or easier ways to handle all this.</p>
<h2>UPDATE (01/03/2012)</h2>
<p>I forgot to mention I also had to add a <code>.bash_profile</code> file at the root of my server, containing these contents:</p>
<pre>
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
    eval `$SSHAGENT $SSHAGENTARGS`
    trap "kill $SSH_AGENT_PID" 0
fi
</pre>
<p>Otherwise I could never run <code>ssh-add</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2011/12/30/connecting-to-multiple-github-accounts-from-the-same-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Amazon EC2 instances</title>
		<link>http://matthom.com/archive/2011/09/01/setting-up-amazon-ec2-instances</link>
		<comments>http://matthom.com/archive/2011/09/01/setting-up-amazon-ec2-instances#comments</comments>
		<pubDate>Thu, 01 Sep 2011 11:14:15 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2011/09/01/setting-up-amazon-ec2-instances</guid>
		<description><![CDATA[I use Amazon Web Services for file storage (S3) with access through my own domains (CloudFront). S3 is great for backing up files and data, and serving them with redundancy and scalability, but what if I could take it a step further and serve entire websites from it? This is not possible with S3, but [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://matthom.com/images/m1/2212.png" width="273" height="73" alt="Screenshot of SSH client" title="Amazon EC2 SSH connection" /></p>
<p>I use Amazon Web Services for file storage (S3) with access through my own domains (CloudFront). S3 is great for backing up files and data, and serving them with redundancy and scalability, but what if I could take it a step further and serve entire websites from it? This is not possible with S3, but it is with <a href="http://aws.amazon.com/ec2/">EC2</a>.</p>
<p>The main problem with S3 for serving websites is that it doesn&#8217;t have access to a PHP interpreter (for my situation), nor is it meant to be a full-fledged server environment.</p>
<p>The benefits of EC2 are that you&#8217;re literally given a machine instance to work with, just like the computer in front of you. You have full root access and can install whatever you want. You can also stop and start each instance as often as needed (thereby avoiding monthly or long-term costs). It&#8217;s literally a &#8220;pay for what you use,&#8221; on-demand service.</p>
<h2>My history with EC2</h2>
<p>I think EC2 has been around the longest (of all Amazon Web Services), but I never ventured into it because:</p>
<ol>
<li>I already pay third-party companies to host my websites, albeit in a more fixed manner.</li>
<li>I was confused by the large barrier of entry for EC2 &#8211; it seemed complicated to get set up.</li>
</ol>
<p>I&#8217;ve taken steps regarding #2 above, thanks to some helpful articles. I started <a href="http://www.nczonline.net/blog/2011/07/21/quick-and-dirty-spinning-up-a-new-ec2-web-server-in-five-minutes/">here</a>. <a href="http://www.2bit-coder.com/2010/9/wordpress-in-the-cloud-amazon-ec2">This post</a> was also very helpful.</p>
<h2>Creating my first EC2 instance</h2>
<p>Very quickly I was able to create a new EC2 instance and access the URL through a web browser:</p>
<p><img src="http://matthom.com/images/m1/2214.png" width="778" height="296" alt="Screenshot of EC2 default webpage" title="My EC2 instance page" /></p>
<p>Exciting! Now how do I upload and manage files on the server?</p>
<p>I could already connect via SSH to the server (mentioned in the article above), but I really needed to use a graphical interface like <a href="http://winscp.net/eng/index.php">WinSCP</a> because I use that every day to connect to other servers via SSH/SFTP. Plus I don&#8217;t know all of the SSH commands for editing files, and it just seems more time-consuming to do everything through the command line.</p>
<p><img src="http://matthom.com/images/m1/2215.png" width="602" height="244" alt="Screenshot of Putty SSH client" title="Connected to my EC2 server via SSH" /></p>
<p>WinSCP is a SSH, SFTP, FTP, SCP client, so it&#8217;s easy to connect to your EC2 instance just like you would through a strictly command-line program like <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>. So I could connect right away through WinSCP, but I couldn&#8217;t upload/edit files. I was getting &#8220;Permission denied&#8221; errors.</p>
<p><img src="http://matthom.com/images/m1/2216.png" width="489" height="210" alt="Screenshot of WinSCP client" title="Permission denied errors in WinSCP" /></p>
<h2>&#8220;Permission denied&#8221; errors</h2>
<p>After heavy searching, I discovered I had to authenticate as the &#8220;root&#8221; user after establishing an SSH connection to my EC2 server via WinSCP.</p>
<p>(I&#8217;m not a server administrator, so a lot of this is new to me.)</p>
<p>To authenticate as the &#8220;root&#8221; user, I just issued this command via Putty:</p>
<p><code>sudo su -</code></p>
<p>Now I was accessing the server as the root user via Putty. (To be clear, I had a connection open via Putty <strong>and</strong> WinSCP &#8211; Putty for pure SSH commands, and WinSCP for graphical access.)</p>
<p>I navigated to the public web directory using WinSCP (<code>/var/www/html</code>).</p>
<p>But I still couldn&#8217;t upload/edit files through WinSCP. This is because WinSCP was still treating my connection as the non-root user (in this case, the user was &#8220;ec2-user&#8221;).</p>
<p>To allow user &#8220;ec2-user&#8221; <strong>write access</strong> to the public web directory, I ran this command via Putty (as the root user):</p>
<p><code>chown -R ec2-user /var/www/html</code></p>
<p>I also made sure permissions on that entire folder were correct:</p>
<p><code>chmod -R 755 /var/www/html</code></p>
<p>Now I could upload/edit files to my EC2 instance using WinSCP!</p>
<h2>Uploading a PHP file</h2>
<p>The first thing I did was create an <code>index.php</code> file and put some basic PHP code in it:</p>
<p><code>echo "test";</code></p>
<p><img src="http://matthom.com/images/m1/2217.png" width="336" height="177" alt="Screenshot of WinSCP client" title="Uploaded index file in WinSCP" /></p>
<p>When loading my EC2 URL in a web browser, it output &#8220;test&#8221; as it should! So that means the PHP is being interpreted as expected.</p>
<p><img src="http://matthom.com/images/m1/2218.png" width="431" height="122" alt="Screenshot of browser loading my EC2 page" title="My EC2 URL in the browser" /></p>
<h2>Unique IP address</h2>
<p>The next thing I did was assign my EC2 instance a unique IP address. The default URL looks something like this:</p>
<p><code>http://ec2-101-30-8-29.compute-1.amazonaws.com/</code></p>
<p>This is somewhat long and ugly if I were to share the site with anyone. Instead I can associate an IP address to my EC2 instance:</p>
<p><img src="http://matthom.com/images/m1/2213.png" width="629" height="382" alt="Screenshot of AWS Management Console" title="Associate IP address to EC2 instance" /></p>
<p>Now I can access my EC2 webpage using the IP address alone.</p>
<h2>Where to go from here&#8230;</h2>
<p>As I continue to play with EC2, I imagine I&#8217;ll find a lot of useful things. I still haven&#8217;t set up a MySQL database, or installed other software on my EC2 server. This post was just to mention my initial experience with EC2.</p>
<p>Would I replace my existing third-party hosting with EC2? Probably not. For most of my personal sites, I don&#8217;t need such incredible redundancy and scalability, and having to manually configure everything can be a pain for a novice user like myself.</p>
<p>But for quickly getting a web server up-and-running (to test things or share information), and shut it down as soon as you&#8217;re done, it&#8217;s a very nice service to have.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2011/09/01/setting-up-amazon-ec2-instances/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Q&amp;A: What is OAuth?</title>
		<link>http://matthom.com/archive/2011/07/30/q-a-what-is-oauth</link>
		<comments>http://matthom.com/archive/2011/07/30/q-a-what-is-oauth#comments</comments>
		<pubDate>Sat, 30 Jul 2011 13:23:22 +0000</pubDate>
		<dc:creator>Matt Thommes</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://matthom.com/archive/2011/07/30/q-a-what-is-oauth</guid>
		<description><![CDATA[Question: What is OAuth, and how does it differ from connecting to a site with your username and password? Answer: OAuth allows you to authenticate at the source site, as opposed to the site or app that you are connecting with. This increases security, since you are not providing the third-party site with your username [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Question:</strong> What is OAuth, and how does it differ from connecting to a site with your username and password?</p>
<p><strong>Answer:</strong> OAuth allows you to authenticate at the <em>source site</em>, as opposed to the site or app that you are connecting with. This increases security, since you are not providing the third-party site with your username or password. The third-party site only receives a <strong>key</strong> that is used to perform updates or obtain data on your behalf.</p>
<p>As a developer, instead of storing usernames and passwords to connect to another site on behalf of the user, you store a key instead, which is typically a long string of text, about 30-50 characters.</p>
<p>From a development perspective, the OAuth process involves these three steps:</p>
<ol>
<li>Obtain request token.</li>
<li>Direct user to URL using token from step #1.</li>
<li>Obtain access token.</li>
</ol>
<p>Step #1 involves submitting a POST request that returns data (the request token) back to your application. Step #2 is just providing the user a link that includes the request token in the URL. Step #3 is when the user is directed back to your application, after authenticating on the external site.</p>
<p>Once step #3 completes, you will have a key that can be used to perform updates, or obtain data on behalf of the user.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthom.com/archive/2011/07/30/q-a-what-is-oauth/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
