<?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>Casey A. McLaughlin &#187; IT Management</title>
	<atom:link href="http://www.caseymclaughlin.com/tags/it-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.caseymclaughlin.com</link>
	<description>Online Portfolio</description>
	<lastBuildDate>Fri, 30 Sep 2011 13:10:26 +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>How To Use SSH Tunnels with HeidiSQL and Plink</title>
		<link>http://www.caseymclaughlin.com/2010/11/how-to-use-ssh-tunnels-with-heidisql-and-plink/</link>
		<comments>http://www.caseymclaughlin.com/2010/11/how-to-use-ssh-tunnels-with-heidisql-and-plink/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 18:27:13 +0000</pubDate>
		<dc:creator>McLaughlin Casey</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[heidisql]]></category>
		<category><![CDATA[IT Management]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[plink]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh tunnel]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.caseymclaughlin.com/?p=259</guid>
		<description><![CDATA[In this post, I was poetically about HeidiSQL for a few sentences, and then I explain how to use HeidiSQL and Plink to successfully connect to MySQL servers through SSH Tunneling.]]></description>
			<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=How To Use SSH Tunnels with HeidiSQL and Plink&amp;rft.source=Casey A. McLaughlin&amp;rft.date=2010-11-05&amp;rft.identifier=http://www.caseymclaughlin.com/2010/11/how-to-use-ssh-tunnels-with-heidisql-and-plink/&amp;rft.language=English&amp;rft.aulast=McLaughlin&amp;rft.aufirst=Casey&amp;rft.subject=Web Development"></span>
<p><a href="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/ImageWorks.jpg"><img class="alignright size-thumbnail wp-image-262" title="Tunnel!" src="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/ImageWorks-150x150.jpg" alt="It's a magic SSH tunnel!" width="150" height="150" /></a>Do you love <a title="HeidiSQL" href="http://www.heidisql.com">HeidiSQL</a> as much as I do?  It&#8217;s really the best MySQL front-end I&#8217;ve found so far for Windows.  Sure, <a title="MySQL Workbench" href="http://wb.mysql.com/">MySQL Workbench</a> has all kinds of super-fancy features and GUI tools and what-not.  But, in Workbench, I find that it takes sixteen mouse clicks to perform the same task that you can do in five with HeidiSQL.</p>
<p>I use HeidiSQL for nearly everything, and only have had one major beef with it.  I could never get SSH Tunnels to work with it until today <em>I figured it out!</em> I&#8217;m super-stoked.  If you&#8217;re having problems with Heidi and SSH too, I&#8217;ll provide a step-by-step below (keep reading).</p>
<p>If you want to skip the background junk, and go right to the procedure, <a title="Go on down to the content yer lookin fer." href="http://www.caseymclaughlin.com/2010/11/how-to-use-ssh-tunnels-with-heidisql-and-plink#Setting+it+Up">be my guest</a>!</p>
<a name="First%3A+Why+SSH+Tunnels%3F"></a><h3><span id="more-259"></span>First: Why SSH Tunnels?</h3>
<p>Okay, if you&#8217;re reading this article, I assume you are at-least familiar with MySQL and HeidiSQL.  Chances are, you connect to your database server via the default port 3306.  You open up HeidiSQL, enter your DB Username, password, and host, and away you go.</p>
<p>The problem with this approach is that the MySQL protocol that you are using to transfer your data around is inherently insecure.  Folks sniffing network traffic can intercept your data as it travels over the network.  So, if you care about your data or your database not being hacked, it&#8217;s a good idea to encrypt the traffic between your client (HeidiSQL) and your server (MySQL Server).</p>
<div id="attachment_260" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/insecure_mysql.png"><img class="size-medium wp-image-260" title="Insecure MysQL" src="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/insecure_mysql-300x95.png" alt="Not a Good Way To Do Things" width="300" height="95" /></a><p class="wp-caption-text">Insecure MySQL Traffic Flows Across the &#39;Net as Plaintext</p></div>
<p>SSH, on the other hand, is a secure protocol.  All traffic between the client and the server is encrypted so that nefarious network sniffer folks can&#8217;t decrypt the traffic (easily).</p>
<p>What you want to do is to convert the insecure MySQL traffic to secure SSH traffic on your computer before it hits the Internet.  On the server-side, you want to decode the SSH traffic and pass it along the MySQL server.   Something like this:</p>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/secure_ssh_traffic.png"><img class="size-medium wp-image-261" title="Secure SSH Tunnel" src="http://www.caseymclaughlin.com/wp-content/uploads/2010/11/secure_ssh_traffic-300x176.png" alt="This is much better" width="300" height="176" /></a><p class="wp-caption-text">SSH Tunnel.  All data travels across the &#39;net as SSH</p></div>
<a name="Setting+it+Up"></a><h3>Setting it Up</h3>
<p>First, make sure you know what your SSH username and password are on the server where your MySQL database lives.  Then, follow along:</p>
<ol>
<li><a title="Make sure you choose &quot;Plink&quot;" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Download Plink.exe</a>.  Plink is a nifty little SSH tool for Windows that allows you easily setup a SSH tunnel.</li>
<li>Place the downloaded file anywhere on your hard-drive you wish.  It&#8217;s probably a good idea to put it somewhere inside your home directory.</li>
<li>Now (this is the step that kept tripping  me up), before HeidiSQL can use Plink to connect to your server, you must download the server&#8217;s public key to your computer.</li>
<li>So, fire up your command-line, and browse to wherever you put the <em>plink.exe</em> file.</li>
<li>Type: <strong>plink.exe -L 3307:localhost:3306 [USERNAME]@[YOURSERVER.COM]</strong></li>
<li>If it worked, you&#8217;ll get a big long message that ends with <em>&#8220;Store key in Cache? (y/n)&#8221;</em></li>
<li>Say &#8220;yes&#8221;, of course.  Where does it put this key?  That was a mystery to me too!  It turns out, when you say yes, Plink will put the key into your Windows Registry (at HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys).</li>
<li>Type your password, and then type &#8220;exit&#8221; to finish up this step.</li>
<li>Okay, now that you&#8217;ve downloaded the key, you&#8217;re ready to use SSH Tunneling in HeidiSQL!</li>
<li>Fire up HeidiSQL</li>
<li>Create a new connection, and choose &#8220;SSH Tunnel&#8221; from the &#8220;Network Type&#8221; dropdown.</li>
<li>Inside the &#8220;Settings&#8221; tab, use &#8220;127.0.0.1&#8243; for the hostname.  Then, enter your normal database username and password.  Yep, 127.0.0.1 is correct.  You enter the address as if you were logged-in to the server via SSH.</li>
<li>Next, flip to the &#8220;SSH Tunnel&#8221; tab.  Tell HeidiSQL where the <em>plink.exe </em>file is on your hard-drive, then put the <strong>actual </strong>IP address or DNS name for your database server.  Use 22 (SSH) for the port.</li>
<li>Enter your SSH username and password, and then choose &#8220;3307&#8243; (or some other unused port) on your computer for the &#8220;Local Port&#8221;.</li>
<li>Let &#8216;er rip!</li>
</ol>
<p>If all is well, and the powers-that-be are smiling down on you, you&#8217;ll be able to login to click &#8220;Open&#8221; and everything will work.  Congrats!  Now all your database traffic is travelling through the tubes securely.</p>
<p>If it doesn&#8217;t work, it&#8217;s time to check your steps or go bother somebody in the <a title="Be Nice.  They build this stuff for free!" href="http://www.heidisql.com/forum.php">HeidiSQL forums</a>.</p>
<p>Happy Friday!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caseymclaughlin.com/2010/11/how-to-use-ssh-tunnels-with-heidisql-and-plink/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Backups and Disaster Recovery Kit</title>
		<link>http://www.caseymclaughlin.com/2010/01/backups-and-disaster-recovery-kit/</link>
		<comments>http://www.caseymclaughlin.com/2010/01/backups-and-disaster-recovery-kit/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:21:00 +0000</pubDate>
		<dc:creator>McLaughlin Casey</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[basics]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.caseymclaughlin.com/?p=186</guid>
		<description><![CDATA[In this post, I chastise you, the reader, for presumably not backing up your department's data, and share how to create a portable DR kit.]]></description>
			<content:encoded><![CDATA[<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.type=&amp;rft.format=text&amp;rft.title=Backups and Disaster Recovery Kit&amp;rft.source=Casey A. McLaughlin&amp;rft.date=2010-01-15&amp;rft.identifier=http://www.caseymclaughlin.com/2010/01/backups-and-disaster-recovery-kit/&amp;rft.language=English&amp;rft.aulast=McLaughlin&amp;rft.aufirst=Casey&amp;rft.subject=IT Management"></span>
<p><a href="../wp-content/uploads/2010/01/bear-survival-kit.jpg"><img class="alignright" title="bear-survival-kit" src="../wp-content/uploads/2010/01/bear-survival-kit-150x150.jpg" alt="Be Prepared!" width="150" height="150" /></a>It&#8217;s the perfect time to think about it.  With <a title="..and the subsequent media frenzy" href="http://en.wikipedia.org/wiki/2010_Haiti_earthquake">disaster</a> on everybody&#8217;s mind, and this being the season of resolutions, it&#8217;s time to think about your disaster recovery strategy.</p>
<p>Recently, a major department right here at FSU <a title="News article about the loss" href="http://cci.fsu.edu/news/?p=6580">suffered catastrophic loss</a> to their servers, with scant means of quick recovery.  Their site was down literally for weeks as staff from all over the University scrambled to assist them in recreating the critical pieces.  They lost of <em>a lot</em> of time and money.</p>
<p>I&#8217;m absolutely sure they&#8217;ll be super-prepared next time, but <span style="text-decoration: underline;"><em>you</em></span> don&#8217;t have to wait until something tragic happens to be prepared!</p>
<a name="Disaster+Recovery+Enterprise+Planning+%3D+Big+Words+%28Scary%21%29"></a><h3><span id="more-186"></span>Disaster Recovery Enterprise Planning = Big Words (Scary!)</h3>
<p>When I was an IT Manager n00b, I thought that planning for disasters was intimidating and complicated.  I thought it took a team of folks working around the clock, military-style, to prepare for incidents.  I was encouraged to believe this by colleagues constantly talking in <a title="Yeah... stuff like this" href="http://spedr.com/5rduk">business-speak</a>, conference sessions talking about <a title="Just like this." href="http://spedr.com/2v7ul">things like &#8220;DR evaluation metrics&#8221;</a>, and by <a title="Big Ugly Book" href="http://spedr.com/1frzy">big</a> <a title="What's the picture on the front of the book supposed to indicate?" href="http://spedr.com/3y867">ugly</a> <a title="More books" href="http://spedr.com/3wig0">books</a> that take days to even read through.</p>
<p>In the meantime, while I was being intimidated by all this &#8220;enterprise&#8221; stuff, we went without reliable backups.  We would have been <em>Scre-ewed</em> if something happened.</p>
<a name="1.+Embracing+Common+Sense"></a><h3>1. Embracing Common Sense</h3>
<p>Okay, just ignore all that business-speak.  Let&#8217;s start with the basics:  If you&#8217;re not backing up your data, put down the <a title="Big Ugly Book" href="http://spedr.com/1frzy">big</a> <a title="What's the picture on the front of the book supposed to indicate?" href="http://spedr.com/3y867">ugly</a> <a title="More books" href="http://spedr.com/3wig0">DR books</a> <em>right now</em> and go setup a backup.</p>
<p>No, seriously, do it <span style="text-decoration: underline;">right now</span>.</p>
<p>This does not have to be complicated.  Go find an external hard drive, then find out where your data is on your computers or servers.  Plug the hard-drive into the back of the computers and copy the folders with your data.  Do this every day, and you have a basic disaster recovery strategy!</p>
<blockquote><p><em>Pro Tip: </em>If you&#8217;re using Windows, I&#8217;m a big fan of using <a title="Seriously awesome freeware." href="http://www.codesector.com/teracopy.php">Teracopy</a> when I have to copy lots of data at a time.</p></blockquote>
<p>You get bonus if you copy the data to two hard-drives and take one off-site every day.  Now your data is in two geographic locations on three devices.</p>
<p>See? Easy.  Now that you&#8217;re off and running, you can make your life even easier by automating your backups.  If you&#8217;re not excited about doing a bunch of geeky tech stuff to get your automated backups working, go convince your boss to spend a few bucks a month on <a title="Mozy Pro Goodness" href="http://mozy.com/pro">cheap</a>, <a title="I Drive is good, too" href="http://www.idrive.com/">easy-to-setup</a> <a title="SOS Backup Services" href="http://www.sosonlinebackup.com/">online backup services</a>.  If he doesn&#8217;t want to spend the money, you can scare him with <a title="Coding Horror: Backup Awareness Day" href="http://spedr.com/5nizg">many</a> <a title="Company Fail" href="http://spedr.com/4jg32">horrifying</a> <a title="Marketing site, but still true" href="http://spedr.com/4niov">stories</a> of data loss on the Internet.</p>
<a name="2.+Being+Prepared"></a><h3>2. Being Prepared</h3>
<p>Next Step: Just sit down in a quiet place for a few minutes and think about the things that could go wrong:</p>
<ul>
<li>&#8220;My server could suffer a catastrophic hardware failure&#8221;</li>
<li>&#8220;My backup data could be corrupt&#8221;</li>
<li>&#8220;The building could burn down&#8221;</li>
<li>&#8220;We could get robbed&#8221;</li>
<li>&#8220;An employee could go apeshit and format the C: drive of the server&#8221;</li>
<li><em>etc..</em></li>
</ul>
<p>Now consider which three or four of those scenarios are most likely to happen in your department. You&#8217;ve just considered your risks.  Now, for each one of those scenarios, think about (a) what you can easily do to guard against them and (b) what you would have to do to recover from them:</p>
<ul>
<li>Buy a second, backup server (or set an old computer aside to act as server temporarily in case of disaster).</li>
<li>Keep two backup copies instead of one and periodically test opening files on the backup.</li>
<li>Take backups offsite so that the data doesn&#8217;t burn down with the rest of the building.</li>
<li>Lock the servers in a room without windows.</li>
<li>Keep backups (already done), and make sure employees don&#8217;t have too much access to the server.</li>
<li><em>etc..</em></li>
</ul>
<p>If you write all of this stuff down somewhere and tell your boss about it, you have a basic DR plan!  Go have a beer.</p>
<a name="3.+Building+Your+Kit"></a><h3>3. Building Your Kit</h3>
<p>Now that you are creating backups and thinking about our risks/responses, it&#8217;s time to build your <strong>Disaster Recovery Kit!</strong> Put this kit somewhere out of harm&#8217;s way, and have it handy in case you need it.  Here&#8217;s mine:</p>
<ol>
<li><strong>A camcorder bag</strong> &#8212; I like this, because it&#8217;s easy to carry and has a lot of compartments for all the stuff below:</li>
<li><strong>Operating System Boot discs </strong>&#8211; In my case, Ubuntu Server 8.04</li>
<li><strong>GParted Boot disc</strong> &#8212; For formatting and partitioning systems on-the-fly.</li>
<li><strong>Cables </strong>&#8211; Standard power cable and USB cable.</li>
<li><strong>Backup hard drives</strong> &#8212; Two.  They are my offsite copies of all our data.  I rotate them and keep them encrypted.</li>
<li><strong>Flash light </strong>&#8211; Small and compact, for poking around inside computers or navigating server rooms in the dark</li>
<li><strong>Thumb drive</strong> &#8212; Includes a backup of my server setup procedures/changelogs, systems passwords (in KeePass), and a bunch of portable apps.  Updated weekly.</li>
<li><strong>Printed copy of contact information for key stakeholders</strong> &#8212; My IT colleagues, clients, and my boss, so I can keep them updated.</li>
<li> <strong>Geek tool kit</strong> &#8211;  <a title="Belkin Basic Toolkit" href="http://spedr.com/3mv8z">Something like this</a>.  Includes screwdrivers, etc.</li>
<li><strong>External SATA Hard Disk Reader </strong>&#8211; Something<a title="StarTech USB SATA adapter" href="http://spedr.com/46suc"> small and compact</a>.  In case I need to rip a hard drive from a computer and get the data off quickly.</li>
<li><strong>A big sheet of paper that says <span style="color: #800000;">&#8220;<em>Don&#8217;t Panic</em>&#8220;</span></strong></li>
<li><strong>Music CD</strong> with high-energy power music on it.</li>
<li><strong>Energy supplement</strong> &#8212; Or a flask of whiskey, depending on how you roll.</li>
<li><strong>&#8220;Getting started&#8221; guide </strong>&#8211; A piece of paper, right on top, that explains briefly how to use the kit.</li>
<li><strong>Checklist</strong> &#8212; With all of these items on it, and with weekly DR Kit maintenance procedures.</li>
</ol>
<p>There, now I can sleep at night much better.  What&#8217;s in your DR Toolkit?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caseymclaughlin.com/2010/01/backups-and-disaster-recovery-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

