<?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>Rian&#039;s Really Good Technoblog!</title>
	<atom:link href="http://riansreallygoodtechnoblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://riansreallygoodtechnoblog.com</link>
	<description>Technology tidbits from adapters to z... z... uh... zip files!</description>
	<lastBuildDate>Tue, 19 Jan 2010 22:15:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Kohana and Spam Sandwich</title>
		<link>http://riansreallygoodtechnoblog.com/2010/01/19/kohana-and-spam-sandwich/</link>
		<comments>http://riansreallygoodtechnoblog.com/2010/01/19/kohana-and-spam-sandwich/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 21:31:04 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[web applications]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=49</guid>
		<description><![CDATA[Firstly, let me apologize to anyone who may have left a genuine comment on the site.  The level of spam that I get in comments&#8230; is stunning.  Hundreds and hundreds every day.  And those are the ones that the automated filter doesn&#8217;t pick up.  The latest thing is to post something innocuous that ALMOST relates [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly, let me apologize to anyone who may have left a genuine comment on the site.  The level of spam that I get in comments&#8230; is stunning.  Hundreds and hundreds every day.  And those are the ones that the automated filter doesn&#8217;t pick up.  The latest thing is to post something innocuous that ALMOST relates to the post&#8230; in the hope that I&#8217;ll just blindly approve it.</p>
<p>Spammers, call yourselves buzz marketers if you like, but there is a spot in hell with your name on it.</p>
<p>Anyway, I&#8217;m sure there were some genuine comments in there.  I just don&#8217;t have the time to trawl through them.  I&#8217;ll keep looking for a better way to manage that.  Comments are my favorite part of blogging.  This is like having a dinner party, and people keep showing up at the door dressed like the UPS man to say &#8216;Hi, your house very nice.  I appreciating it all time, dude. Buying V1aGr4 very cheap!!!&#8217;  Slam!</p>
<p><strong><span style="text-decoration: underline;">Now&#8230; on to technojunk!</span></strong></p>
<p>Due to unforeseen circumstances, I have been thrust back into the world of PHP for a current engagement.  Without going into the pros and cons of PHP (truly, it has both), let&#8217;s just say that I&#8217;ll be using it.  That being the case, I&#8217;ve had to rather quickly decide on a development framework for the app&#8230; and boy howdy, are there <a title="This is just a few..." href="http://www.phpframeworks.com/" target="_blank">a bunch of them</a> these days.<span id="more-49"></span></p>
<p>Favorite slogan:<br />
&#8220;The <a title="What?  No suck?!" href="http://zoopframework.com/" target="_blank">Zoop Framework</a>: PHP development without the suck.&#8221;  Nice.</p>
<p>I dove in looking at some of the application framework comparisons (like <a title="AAHHHHH!!! MAKE IT STOP!!!" href="http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#PHP" target="_blank">this one on  Wikipedia</a>) and came to the conclusion that a) there&#8217;s a LOT of them, and b) I was just going to have to pick one and get on with it.</p>
<p>So, I decided that I needed a few basic things to feel self-actualized:</p>
<ul>
<li>PHP5</li>
<li>MVC</li>
<li>Extensibility</li>
<li>Object Relational Mapping (ORM)</li>
</ul>
<p>This is old news, but PHP5 has a few notable advantages over PHP4 for my purposes:</p>
<ul>
<li>Faster.  Faster&#8217;s better.</li>
<li>Passing by reference (PHP4 passed by value.  In a nutshell, that meant passing copies of things around instead of &#8220;the thing itself&#8221;.  That can be very, very confusing.</li>
<li>Greatly improved Object Model:
<ul>
<li>Visibility (Public, Protected, Private access)</li>
<li>Class methods and properties (no instance needed to access these, nice for utilities, factories, whatnot)</li>
<li>Interfaces, Abstracts, Finals&#8230; Oh boy! (These are basic OOP constructs that PHP4 just lacked)</li>
</ul>
</li>
</ul>
<p>That implies to me that a framework that isn&#8217;t based on PHP5 doesn&#8217;t take advantage of those things, and therefore is made more for compatibility than performance and robustness.</p>
<p>Model-View-Controller (MVC) is the cool kids&#8217; way of structuring a web application so that there is separation in the code between those pieces that represent the &#8220;business model&#8221; of the thing (e.g., accounts, users, ratings, postings) from the presentation level (i.e., what you see what you use it).</p>
<p>Implementation-wise, the controller and view layer are separate, but in practice, they are pretty tightly coupled&#8211; you pretty much need to know in the controller what views you have and what they do exactly.  The really important separation is between that stuff and the model.  Your application design works so much better if you think of the underlying structure completely without regard for how you present it. Again, like PHP5, I don&#8217;t know anyone who doesn&#8217;t do this at this point.</p>
<p>On the other hand, there are more elaborate frameworks (e.g., Drupal) that are more like content management systems than web application frameworks purely.  I wasn&#8217;t interested in buying into the learning curve associated with such a system, and I also wanted a rather spare skeleton on which to build our system so that we understood how every piece worked and weren&#8217;t locked into another &#8220;product&#8217;s&#8221; development process.</p>
<p>Extensibility means that I want to be able to add modules to do various things without having to perform surgery on the framework itself.  For the most part, the basic frameworks allow this, but&#8230; never assume or you make an ASS out of U and ME.</p>
<p>Object relational mapping (ORM) is&#8230; well, it&#8217;s different things to different people, but&#8230; simply put, it provides a layer of abstraction between your objects and SQL so you don&#8217;t have to sprinkle nasty SQL snippets all over the place.  Also, the thing I was keen on was a way to describe relations (e.g., &#8220;belongs to&#8221;,&#8221;has many&#8221;) so (a oversimplified example) that I could just say:</p>
<p><code>thing1-&gt;thing2-&gt;name</code></p>
<p>instead of having to do something like</p>
<p><code>thing1-&gt;thing2_id<br />
Thing2(thing2_id)-&gt;name</code></p>
<p>in a case where Thing1s have a Thing2 owning them.</p>
<p>Finally, the client had lots of experience with <a href="http://codeigniter.com/" target="_blank">CodeIgniter</a>.  That led me in that direction, but it fell a little short in that it&#8217;s not PHP5-based and doesn&#8217;t come with ORM (though, you can add it).  Turns out that there&#8217;s a nifty offshoot of that project called <a href="http://www.kohanaphp.org/" target="_blank">Kohana</a> that does, indeed, meet all of my desired traits.</p>
<p>So, that&#8217;s what I&#8217;m doing.  Why Yii?  Why not PHP on Trax (get it?  Ruby on Rails in PHP?) I&#8217;ll tell you why.  I need to get some work done.  It seems to me that one could spend months evaluating the pros and cons of these things and get absolutely no work done.  My advice on most things: just pick one and go.  You can generally make any of them do anything you want to.  Once you&#8217;ve looked at the basics, you quickly digress into hair-splitting and procrastination, and I need NO help with that.</p>
<p>My experience so far?  I&#8217;m pretty happy with it.  It allows for nesting of templates so you can specify (ala Rails&#8217; yield) an application layout into which you can insert a section template in which you can insert a page template&#8230; etc.  Performance is good.  PHP rewards the user for tolerating a lack of structure with a lot of flexibility, so there&#8217;s much less time spent trying to figure out type mismatches or other obscure minutiae that Java tends towards.</p>
<p>If I had my druthers, I&#8217;d have gone <a href="http://www.grails.org/" target="_blank">Grails</a> for this project, but given the aforementioned constraints, that didn&#8217;t work out.  I think Kohana will provide a very nice alternative without requiring much from the system administrators, again unlike Java, which can creep dependencies into the server environment if you&#8217;re not careful.</p>
<p>I&#8217;ll report back as we progress on any interesting lessons that come up.  In the meantime, so far, so good.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2010/01/19/kohana-and-spam-sandwich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You&#8217;re Catholic?  Hah!  Fear and Loathing in Computer Operating Systems</title>
		<link>http://riansreallygoodtechnoblog.com/2010/01/11/youre-catholic-hah-fear-and-loathing-in-computer-operating-systems/</link>
		<comments>http://riansreallygoodtechnoblog.com/2010/01/11/youre-catholic-hah-fear-and-loathing-in-computer-operating-systems/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 22:39:34 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Useless Rant]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=45</guid>
		<description><![CDATA[Just a quick note to memorialize a recent client visit during which my use of a MacBook was mocked no less than half a dozen times.  The very few times that my regular use of Linux as a desktop operating system was mentioned, it was similarly ridiculed.
And then I was handed the corporate-issue Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to memorialize a recent client visit during which my use of a MacBook was mocked no less than half a dozen times.  The very few times that my regular use of Linux as a desktop operating system was mentioned, it was similarly ridiculed.</p>
<p>And then I was handed the corporate-issue Windows XP laptop.  Hm.<span id="more-45"></span></p>
<p>I mention this only because I know that, at some point, I had similarly strong opinions on the choices people make about their computing platform.  I may have even thrown out the off-handed jibe at others for those choices.  To them, I apologize.</p>
<p>I&#8217;ve made it no secret that I don&#8217;t care for Windows&#8211; at least up to, and including, Vista.  I&#8217;ve yet to indulge myself in Windows 7, which gets good reports, in general.  Having paid for and experienced a lot of suffering at the hands of such winners as Windows ME and Windows Vista, I think it&#8217;s fair to say that my opinion is hard won.</p>
<p>That said, Linux is so flexible and open as to barely operate at times.  I&#8217;ve documented some good times that I had when the decision was made by some member of the open-source anarchic syndicalist commune that two video cards of different manufacture shall not be supported&#8211; or my logs filled with indecipherable memory abstraction errors or multipath disk naming voodoo that defied translation.</p>
<p>Then there&#8217;s the Mac.  Remember all those colorful generation-one iMacs making little flower shapes on the commercials?  Let us summarize that experience with the phrase &#8220;frowny face monitor with Xs in its eyes.&#8221;</p>
<p>Right now, I run Linux on my desktop with Windows in VirtualBox, and I tote around a MacBook.  I am pretty happy.  They all do what I need in the appropriate context.</p>
<p>Is one better than the others?  I don&#8217;t know.  For what?  Linux video editing is a joke.  Mac&#8217;s open/closed schizophrenia and high cost are off-putting.  And I can&#8217;t tell if Windows, itself, is spyware or just all the stuff that mysteriously installs itself at every turn.</p>
<p>On the other hand, my Linux machine allows me very complete control of about any conceivable option and is customized to my liking as a DesktopServerHybrid just how I need it.  The MacBook has never crashed and is light, very well-built, and functional, particularly for multi-media applications.  Lastly, there&#8217;s very few, if any, applications that I can&#8217;t get to run on Windows if all else fails.</p>
<p>My point is this: you like your Windows?  Good for you.  You don&#8217;t like Linux?  Fair enough.  Macs are for emo blogging wannabes?  Maybe.  Does any of it make any difference whatsoever to anyone?  Not really.</p>
<p>Mocking another&#8217;s computer is as pathetic as mocking their sexual orientation or height.  The more sure you are that I&#8217;m wrong, the more you likely need to take a Stuart Smalley look in the mirror and let yourself know that it&#8217;s OK for us all to be different.  We&#8217;re good enough, we&#8217;re smart enough, and doggonit, people like us.  Yes, even people who use Macs.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2010/01/11/youre-catholic-hah-fear-and-loathing-in-computer-operating-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Brother MFC-8890DW</title>
		<link>http://riansreallygoodtechnoblog.com/2009/12/21/the-brother-mfc-8890dw/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/12/21/the-brother-mfc-8890dw/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 23:59:04 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Equipment]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=40</guid>
		<description><![CDATA[I&#8217;m on this organization kick lately.  Long story, but let us just say that I have recently been taking steps to address a bit of a Disorder due to a Deficit in Attention.
Anyway, one of the characteristics of this &#8220;disorder&#8221; is the inability to throw junk away.  Instead, I *used to* keep it.  It could [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on this organization kick lately.  Long story, but let us just say that I have recently been taking steps to address a bit of a Disorder due to a Deficit in Attention.</p>
<p>Anyway, one of the characteristics of this &#8220;disorder&#8221; is the inability to throw junk away.  Instead, I *used to* keep it.  It could be broken (as in &#8220;garbage&#8221;) or semi-functional (as in &#8220;garbage&#8221;).  Broken stuff would get put away for the day that I&#8217;d need the parts or fix it (as in &#8220;when hell freezes over&#8221;).  Semi-functional stuff would stay out to be used once, frustrate me, and then collect dust until the next time I consider throwing it out.  Use once, frustrate, collect dust.  And repeat.</p>
<p>A variation on this theme is stuff that is completely functional but doesn&#8217;t meet my needs or perform at the level I&#8217;d like.  I&#8217;d had just such a situation with my laser printer and fax machine/scanner.  While they worked OK, they were both starting to lose their quality mojo.  Also, they were separate components and required an additional box to enable them to be put on my wireless network.  The last little annoyance was that the printer did not do full-duplex.  Often, I&#8217;d print out long documents, and to save paper, I&#8217;d manually divide the job and flip the sheets over.  Eesh.<span id="more-40"></span></p>
<p>Well, it&#8217;s that time of year when I think &#8220;time to spend some capital!&#8221;  I looked around my office, and there they were&#8230; taking up all kinds of plugs and counter space.  The laser printer was producing gray, stripey documents and having a hard time feeding single sheets.  The faxes would only go through half the time, and scans were so slow as to be&#8230; well, I have things to do.</p>
<p>So, I ordered myself one of these: <a title="Brother's Site" href="http://www.brother-usa.com/mfc/modeldetail.aspx?PRODUCTID=MFC8890DW" target="_blank">The Brother MFC-8890DW</a></p>
<p>Now, I don&#8217;t print an awful lot nor scan that often.  Still, I only paid roughly $400 for this thing.  That&#8217;s about what I paid for my laser printer some years ago.  The short story is that, so far, I am greatly pleased.</p>
<p>The MFC-8890DW is a fairly large piece of kit (as my friend, Roy, likes to say now that he&#8217;s British), but it takes up less counter space than my old fax did.  Set up took just a few minutes, really, and the thing is on my wireless network (with WPA2 encryption).  It prints duplex (i.e., both sides), it prints fast (they claim 32 PPM), it scans up to 2400dpi, and scans to Samba shares, hosts, email, USB stick, and lord knows where else.</p>
<p>They seem to be getting better at balancing cheap, plastic construction with the impression of durability because it seems quite solid.</p>
<p>Adding this printer to my linux machines required&#8230; well, very little.  I said &#8220;new printer&#8221;, and Ubuntu found it and installed the drivers just like that.  Given the history of struggle between linux users and about any peripheral (without some geekfest driver compilation), that was a beautiful thing. PCs and Macs were equally easy.</p>
<p>So, there you go, an uncompensated recommendation of the MFC-8890DW.  While I&#8217;ve only had it for a short time (I&#8217;ll report back if something nasty happens), and I haven&#8217;t been able to configure some of the interesting fax to and from email features simply because of lack of time or need for them, I can say that this thing appears to be a good purchase.  It saves me time, space, and the frustration of having to wonder if my prints or faxes are going to happen any time soon or with the quality that I&#8217;d like.  I think that&#8217;s worth $400.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/12/21/the-brother-mfc-8890dw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey, Me!  Stop Procrastinating!  Fix Your Backups!</title>
		<link>http://riansreallygoodtechnoblog.com/2009/12/04/hey-me-stop-procrastinating-fix-your-backups/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/12/04/hey-me-stop-procrastinating-fix-your-backups/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:05:15 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Disaster Recovery]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[online storage]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=37</guid>
		<description><![CDATA[Not too long ago, I, Mr. Check-me-out-I&#8217;m-so-technical-and-cool, had a catastrophic data loss.  As implied by the use of the word &#8216;catastrophic&#8217;, I lost some stuff that&#8230; I did not want to lose.  At all. Lost, lost.  Too bad.  Sucks to be me.  How could this happen to a guy who does this for a living?  [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long ago, I, Mr. Check-me-out-I&#8217;m-so-technical-and-cool, had a catastrophic data loss.  As implied by the use of the word &#8216;catastrophic&#8217;, I lost some stuff that&#8230; I did not want to lose.  At all. Lost, lost.  Too bad.  Sucks to be me.  How could this happen to a guy who does this for a living?  I&#8217;ll tell you how: <strong>procrastination</strong>.</p>
<p>I knew that off-site storage was necessary.  I have space on remote servers in secure locations&#8230; one of these days, I&#8217;m going to figure out a good way to, uh&#8230; <em>hey, I gotta go pick up the pizza! </em></p>
<p>But, it&#8217;s worse than that.  I actually have a mirrored-disk, network-attached storage (NAS) box specifically for backups.  I have external drives specifically for making local backups, too.  So, short of my office burning down, I should be covered, no?  Uh&#8230; no.<span id="more-37"></span></p>
<p>Turns out that my backup software to the NAS box had been failing silently because of some change in the client configuration.  Moreover, I&#8217;d procrastinated on replacing the batteries on my UPSs&#8211; they&#8217;d been pulled out for that reason (see where this is going?  no surge protection?) Now, mix that with my preference to use &#8220;logical volumes&#8221; for my storage because of their flexibility in sizing and storage, and toss in a completely unusual (but nonetheless real) power surge/outage.</p>
<p>What you get is a garfed logical volume (i.e., the physical device with the filesystem information on it survived but was irretrievably scrambled&#8230;) and the local backup external disk gets completely fried at the same time.  No network backup.  No local backup.  And the data itself has vanished.  What did I lose?  Well, my company books and tax records, for one thing.  (The actual happy ending is that because of my paranoia level, I had actually imaged my drives not too long ago to yet ANOTHER drive that I kept unattached.  I was able to reconstruct most of my data, but it took hours of work and validation.  Who knows what miscellaneous data I&#8217;ll notice is missing at some point.)</p>
<p>As W. famously said, &#8220;There&#8217;s an old saying in Tennessee — I know it&#8217;s in Texas, probably in Tennessee&#8230; that says, fool me once, shame on&#8230; shame on you. Fool me&#8230; you can&#8217;t get fooled again.&#8221;</p>
<p>So true, Mr. President.  So true.</p>
<p>Well, I can&#8217;t get fooled again.  So, no more procrastinating.  First order of business was to order myself a shiny, new UPS.  I went with the <a title="No, I don't get any money from this." href="http://www.newegg.com/Product/Product.aspx?Item=N82E16842102048&amp;cm_re=cyberpower-_-42-102-048-_-Product" target="_blank">CyberPower 1500AVR</a>.  At less than $200, and with the juice to run my (excessive) pile of gear for at least a half hour, it&#8217;s easy and inexpensive insurance against some putz putting his backhoe into the power main.  Still, they&#8217;ll think of something that I haven&#8217;t.</p>
<p>So, it&#8217;s on to my data.  Firstly, I forced myself back into a rational storage model.  Being your typical ADHD type, I have a tendency to keep EVERYTHING and keep it wherever it happens to land.  Forever.  Don&#8217;t know what it is?  Better just leave it.  You never know.  Right?</p>
<p>No, no, no&#8230; that&#8217;s not OK.  What I need to do is to keep my documents in, say, a DOCUMENTS folder.  Branch out by use (not&#8230; say&#8230; document type or date).  OK, so, &#8216;business&#8217; and &#8216;personal&#8217;.  Business can have &#8216;clients&#8217; and &#8216;financial&#8217;&#8230; and so on.  Everything goes into one of those folders.  EVERYTHING.  Is is a photo?  OK, it goes into personal/photos.  Or a separate photos folder.  Not both.  That file that I can&#8217;t identify?  My system to create an &#8220;unidentified&#8221; folder with dated sub-folders.  Everything I find that I can&#8217;t identify goes in those.  If, after a month or two, I still don&#8217;t know what it is and haven&#8217;t needed it&#8230; it goes.</p>
<p>Great, so, now I&#8217;ve got all my data in one place on my system&#8230; that is&#8230; my desktop system&#8230; which&#8230; doesn&#8217;t include my virtual systems&#8230; or my MacBook&#8230; oh boy.</p>
<p>Enter on-line storage and synchronization.  After some checking around, I went with <a title="I don't get money from this, either." href="http://getdropbox.com/" target="_blank">Dropbox</a>.  Other good options include: <a title="Same.  No Money." href="http://www.mozy.com/" target="_blank">mozy</a>, <a title="Same.  No Money." href="http://ww.jungledisk.com/" target="_blank">Jungledisk</a>, Ubuntu One, Amazon S3, and many others.  Dropbox appealed to me because of the drop-dead ease of installation, the cross-platform clients, and what seems like a pretty reasonable price for all that (about $10/mo. for 50GB of storage as of this writing).</p>
<p>Basically, Dropbox puts, what looks like, another folder on your system.  In this case, though, if you drop a file in there, it&#8217;s copied up to their storage and synced to any systems that you also have connected to your account.  Drop your resume into that folder on your Linux box and edit it on your Mac, output the PSD to the Dropbox folder, and open it up on your&#8230; iPod Touch?  Virtual XP instance?  Anywhere you can get to a browser?</p>
<p>I&#8217;ve always had a tendency to roll my own solution for this kind of thing, but the technology has advanced to the point that there is no way that I can justify the kind of effort it would take to get something like that righter than they have for that kind of money.  $120/year?  That&#8217;s one internal hard drive.  Dropbox installed and was doing its thing in about 5 minutes&#8211; on three systems.</p>
<p>So, we&#8217;ve got reliable, filtered power and offsite storage of critical data.  The last thing I needed to address was local backups.  Given the inexpensive drives available these days, it only makes sense to me to keep very complete backups locally so that I can do a complete recovery if the problem is a fried disk.  So, I had that pretty well covered already with <a title="These guys don't even HAVE money." href="http://www.fsarchiver.org/Main_Page" target="_blank">FSArchiver</a> for complete images and Back In Time for scheduled backups to the NAS box (a <a title="DNS-323 at Newegg.  Again, no money for me." href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822155003&amp;Tpk=dns-323" target="_blank">D-Link DNS-323</a>).</p>
<p>Maybe next time some super-freaky, never-happen-in-a-million-years thing happens, I won&#8217;t have to spend the day engaged in self-loathing and fear.  I&#8217;ll just restore my stuff and keep on keepin&#8217; on.  In the meantime, my next project is to write a little script to make sure that my backups are actually taking place.  If they&#8217;re not, I need to make something to pester me about it.</p>
<p>I&#8217;ll probably do that tomorrow&#8230; d&#8217;oh!</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/12/04/hey-me-stop-procrastinating-fix-your-backups/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VirtualBox: Great Thing&#8230; or&#8230; nevermind&#8230;</title>
		<link>http://riansreallygoodtechnoblog.com/2009/11/17/virtualbox-great-thing-or-nevermind/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/11/17/virtualbox-great-thing-or-nevermind/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:02:49 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=33</guid>
		<description><![CDATA[Let me start by saying that I hate Windows.  The Microsoft product.  I don&#8217;t hate Microsoft.  I don&#8217;t hate Bill Gates, but  I hate, hate, hate Windows.  This is not a religious thing, either.  I have had that operating system break my spirit more times than I care to [...]]]></description>
			<content:encoded><![CDATA[<p>Let me start by saying that I hate Windows.  The Microsoft product.  I don&#8217;t hate Microsoft.  I don&#8217;t hate Bill Gates, but  I hate, hate, hate Windows.  This is not a religious thing, either.  I have had that operating system break my spirit more times than I care to think about (and I&#8217;ve been at it since&#8230; Windows 3.0?).  Between the blue screens of death, weird distrustful activation schemes, arbitrary proprietary methodologies, and horrible security record, I just can&#8217;t stand the operating system itself.  And I&#8217;m staring at two copies of Vista on my shelf that I can&#8217;t use because they suck.  That&#8217;s about $600 sitting there.  Sucking.</p>
<p>Having said that, I also know that I can&#8217;t run everything that I&#8217;d like to run in Linux.  And as much as I love my MacBook, I don&#8217;t think I care to buy all my software over again for the Mac, thank you very much.</p>
<p>No, for better or worse, I&#8217;m a Linux guy.  Note that I am NOT recommending that ANYONE in their right mind switch to Linux for their desktop.  I have a propeller on my beanie the size of a helicopter blade.  If you&#8217;re starting out and can afford it, go Mac.  If you can&#8217;t afford that, go Windows 7.  If you&#8217;re a total geek who sits in his (or her) underwear until three in the morning trying to get a cron job to be able to get a custom kernel to build so you can hook up your old radio-controlled light-switch-remote to your machine&#8230; Linux is for you.  Now, go take a shower and go to bed.<span id="more-33"></span></p>
<p>So, what&#8217;s a guy to do?  I have clients who run Fedora, and I run Ubuntu.  I have apps that *only* run on Windows, and the Linux &#8220;equivalent&#8221; is&#8230; let&#8217;s say, lacking. (I&#8217;m talking to you, GnuCash).</p>
<p>Welcome to virtualization.  With virtualization, you can run nearly any (I haven&#8217;t tried hacking OSX, though I hear it&#8217;s possible) OS on nearly any other OS.  It amounts to a PC within a PC.  You install the virtualization software (e.g., Sun&#8217;s VirtualBox, VMWare, xen, kvm), create a virtual disk, and boot this virtual machine into your installation media.  Just like that (in some cases) you&#8217;ve got a window with Windows on your desktop.  No dual-booting.  No second machine.  Sweet.</p>
<p>Well, kind of.  VMWare is probably the granddaddy of commercial virtualization solutions, and it can be pricey.  It&#8217;s also, apparently, not the best performer on the block.  The open source solutions, specifically kvm, are&#8230; well, again, if you&#8217;ve got a lot of crumbs in your beard and a Jolt-cola-gut, you might have the patience for all the obtuse, esoteric incantations needed to get the thing set up.  (I can just hear him saying &#8220;well, if you can&#8217;t handle the command line&#8230; and I do NOT have crumbs in my beard&#8230;&#8221;)</p>
<p>Anyway, enter <a href="http://www.virtualbox.org" target="_blank">VirtualBox</a>.  The VirtualBox project (now owned by Sun&#8230; or somethinged by Sun&#8230; who knows&#8230;) is a super-easy-to-install virtualization solution that will even work if your processor doesn&#8217;t have the <a title="In case you don't know what I'm talking about..." href="http://en.wikipedia.org/wiki/X86_virtualization#Hardware_support" target="_blank">virtualization extensions</a> (not well, but it&#8217;ll work).</p>
<p>I&#8217;ve installed VBox on Linux, Windows, and Mac, and it has worked great each time.  Performance is, I think, quite remarkable given the situation.  The interface, after installing the guest utilities that come on an ISO disk image, can be resized or run fullscreen, and except for a couple things I&#8217;ll get to, you nearly can&#8217;t tell it&#8217;s not running on the &#8220;bare metal&#8221;.</p>
<p>It&#8217;s not perfect, of course (but nothing is).  For one thing, the relationship between things like virtual processor allocation (you can assign as many as you have to the guest OS) and performance is unintuitive.  In my case, assigning two (after having run on one) caused a significant performance degradation in Windows.  There are issues with APIC extensions having the same problem.</p>
<p>Also, I see very strange performance problems with some applications wherein they bring the guest OS (and the host, if you&#8217;re not careful) to a standstill.  I can&#8217;t elaborate too much, because I haven&#8217;t seen much of a pattern, but for some reason, Dreamweaver, for instance, can barely operate if I view &#8220;Design/Code&#8221; mode, but &#8220;Design&#8221; by itself is fine, and &#8220;Code&#8221; by itself is fine.</p>
<p>Still, my instances of Fedora and BSDixes run great, and since the UI is much less of a concern, they can be run in console mode for the most part.</p>
<p>My latest experiment, having successfully converted my physical XP installation into a VirtualBox guest (called P2V, &#8220;physical to virtual&#8221; conversion) is to go the other way.  I&#8217;m going to configure a client&#8217;s mail server on a virtual instance and then burn that image to a hard drive to install into the currently active hardware.  If all goes well, we&#8217;ll skip all the iffy upgrades that we&#8217;d need to do otherwise, and only need to be down for the time required to burn the image and reboot.</p>
<p>So, if you&#8217;re a Windows person wanting to learn Linux, a Linux person needing to run Windows apps, or a Mac user wanting either&#8230; check out VirtualBox.  There&#8217;s an open source version (OSE) and a personal use and evaluation version (PUEL).  I recommend the PUEL version unless you have a good reason to go with the OSE.  There are a few things, such as USB support, that the PUEL provides that the OSE does not.  In either case, though, it&#8217;s easy enough that you needn&#8217;t be a total geek to get it running.  And just because I am one doesn&#8217;t mean I don&#8217;t appreciate that.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/11/17/virtualbox-great-thing-or-nevermind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Routing Over PPTP VPN</title>
		<link>http://riansreallygoodtechnoblog.com/2009/11/16/routing-over-pptp-vpn/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/11/16/routing-over-pptp-vpn/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 22:18:52 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Remote Access]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/2009/11/16/routing-over-pptp-vpn/</guid>
		<description><![CDATA[Granted, I tend to be a little&#8230; extreme&#8230; in the oddly setup network scenarios.  Still, there are times when I need to make my freaky little combination work with a client&#8217;s environment without reconfiguring their network to meet my own needs.
I have a client that has a PPTP-based VPN solution in place.  While [...]]]></description>
			<content:encoded><![CDATA[<p>Granted, I tend to be a little&#8230; extreme&#8230; in the oddly setup network scenarios.  Still, there are times when I need to make my freaky little combination work with a client&#8217;s environment without reconfiguring their network to meet my own needs.</p>
<p>I have a client that has a PPTP-based VPN solution in place.  While I prefer a more robust SSL or IPSec VPN&#8211; this isn&#8217;t about me.  That&#8217;s what they have, and it works for them.  I needed to make my tools work with that situation.</p>
<p>On my end, though, I run a Linux desktop with virtualized (ask me later) instances of client servers or development environments.  In this case, I had a Windows XP guest system running, but I needed to be able to access my Linux system as well on their network.  So, while Linux&#8217;s NetworkManager would happily make a connection to their relatively oldish VPN server device, I couldn&#8217;t make another from the XP client at the same time.</p>
<p>What&#8217;s more, their VPN server device was having no part of routing my network&#8217;s traffic.  (Note: I am not specifying the parts involved here because I don&#8217;t want to start a &#8216;you should have done THIS!&#8217; discussion.  I&#8217;m very much a &#8216;get it working and move on&#8217; person.)</p>
<p><span id="more-28"></span></p>
<p>OK, so, I had a couple of choices.  I could go into their network and see if I could reroute all the traffic that looked like it came from me back through the VPN (I actually tried that, and it didn&#8217;t work, but it was no good anyway since it was too invasive).  Worse, I could reconfigure their VPN device to route my traffic, but again, that&#8217;s their machine, and I wasn&#8217;t going to spend all day figuring out how to accomplish that&#8211; on a device that isn&#8217;t even made anymore.</p>
<p>That&#8217;s all a long build-up to what turned out to work, not require anything on their side, and take me all of about 5 minutes.  The answer was to NAT the traffic from my guest OS to the Linux box.  (NAT = network address translation.  That&#8217;s when you wrap all the traffic from your network in your exposed single address, so that routers treat it like it came from that machine.  That&#8217;s how you can have a bunch of computers in your house running on that one IP address that comes with your DSL.)</p>
<p>192.168.1.X = Linux box with actual VPN connection<br />
10.0.0.131 = The assigned VPN address for that machine on the client network<br />
192.168.1.Y = XP virtual instance<br />
10.0.0.0/24 = client network</p>
<p>Step 1) Route the traffic from the XP client.</p>
<pre>route add 10.0.0.0 mask 255.255.255.0 192.168.1.X</pre>
<p>Step 2) Make sure the Linux box is routing traffic.</p>
<pre>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre>
<p><em>(set it permanently in /etc/sysctl.conf as net.ipv4.conf.default.forwarding=1)</em></p>
<p>Step 3) Setup iptables to NAT the traffic.  (Connect to VPN first, of course.)</p>
<pre>iptables -t nat -A POSTROUTING -d 10.0.0.0/24 -o ppp0 -j SNAT --to 10.0.0.131</pre>
<p>What you see there is my adding a rule to iptables that tells it that the last thing to do with any packets going to my client&#8217;s network is to wrap them in the aforementioned outer envelope with a return address of the Linux box&#8217;s assigned IP address in the client&#8217;s network.</p>
<p>If all goes well, the receiving end recognizes that this is a NATed packet, unwraps it, does whatever with it, and responds to the source with another packet wrapped similarly in an envelope that delivers it to the Linux box, where it&#8217;s unwrapped and passed back to the originating XP machine.</p>
<p>And, for what it&#8217;s worth, it did go well.  I was able to route both machines&#8217; traffic over the same connection without having to noodle with the client&#8217;s internal routing at all.</p>
<p>&#8220;I love it when a plan comes together.&#8221;  &#8212; Hannibal Smith, The A-Team</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/11/16/routing-over-pptp-vpn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NX: Great Thing or The Greatest Thing</title>
		<link>http://riansreallygoodtechnoblog.com/2009/11/03/nx-great-thing-or-the-greatest-thing/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/11/03/nx-great-thing-or-the-greatest-thing/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:35:00 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Remote Access]]></category>
		<category><![CDATA[freenx]]></category>
		<category><![CDATA[nomachine]]></category>
		<category><![CDATA[nx]]></category>
		<category><![CDATA[remote desktop]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=18</guid>
		<description><![CDATA[If you&#8217;re like me and have more than one machine to worry about, you&#8217;ve no doubt tried to remotely access one from the other.  There are times when you just can keep getting up to go over to the other machine just to enter some command or see how something&#8217;s running.  Then there are times [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me and have more than one machine to worry about, you&#8217;ve no doubt tried to remotely access one from the other.  There are times when you just can keep getting up to go over to the other machine just to enter some command or see how something&#8217;s running.  Then there are times when one machine is in a colocation closet in San Francisco, and you&#8217;re living in, say, Japan, like I was.  Or maybe your mom can&#8217;t get the 12:00 to stop blinking on her VCR (and she still has a VCR), and now she&#8217;d like you to figure out why &#8220;the Internet is broken.&#8221;<span id="more-18"></span></p>
<p><strong>RDP, VNC, ABC&#8230;</strong></p>
<p>Well, if you&#8217;re lucky, you can use something like the Windows Remote Desktop (RDP), which, generally speaking, can give pretty good results if you&#8217;ve got a nice fast connection with very low latency.  You might also have access to something like PCAnywhere, GoToMyPC, or some other proprietary solution.  Likewise, they&#8217;re able to be optimized to get pretty reasonable results.</p>
<p>If you&#8217;re <em>unlucky</em>, you&#8217;re managing a Linux box, and the best that you could hope for was <a title="It's Wikipedia... so it's probably not true." href="http://en.wikipedia.org/wiki/Virtual_Network_Computing" target="_blank">VNC</a>.  I&#8217;m not sure what I&#8217;m missing about VNC, but it has generally sucked.  I mean, it&#8217;s great that it works at all, but I&#8217;ve tried <a href="http://www.tightvnc.com/" target="_blank">Tight</a>, <a href="http://www.uvnc.com/" target="_blank">Ultra</a>, Vine, etc., and they&#8217;re all laggy and clunky.  It&#8217;s one of those things where it&#8217;s just annoying enough that I throw up my hands and go all command line on their asses.</p>
<p>That&#8217;s fine too, but the truth is, my <a title="If you're clicking on this, you probably have it, too.  Pay attention." href="http://www.add.org/" target="_blank">ADD</a> likes to have twenty things going at once, and it&#8217;s just very nice to have a desktop that lets me run process, file, or resource monitors and terminals for one machine on one and all those things for another machine on a separate one.  VNC lets me do it, but the performance, particularly over a sub-optimal connection, is not spectacular&#8211; unusably so often.</p>
<p><strong>And The Angels Descended from Heaven&#8230;</strong></p>
<p>Some time ago, I read about NX.  This was one of those cases where I noticed the mention of something one day, and the next day it was <em>everywhere</em>.  I had no clue what it was, and, frankly, I was too set in my ways to check it out.  Finally, about a year or so ago, I decided to look into it.  It turned out that it was a remote access system that was something between VNC and remote X-Windows.  Finally, I pulled down <a title="NoMachine's Site" href="http://www.nomachine.com/" target="_blank">NoMachine</a>&#8217;s <a title="There's also one for Solaris" href="http://www.nomachine.com/select-package.php?os=linux&amp;id=1" target="_blank">&#8220;Free Forever&#8221; Linux edition</a> and installed it on my servers at the colo and the client on my Mac laptop.</p>
<p><em>Yoiks!</em> Before too long, I was running a desktop over a long-distance net connection (on top of a VPN, to boot), and it performed like I was sitting in front of it&#8211; with the obvious exception of any kind of large graphics or video, there&#8217;s only so much you can do to compress graphics.  But my monitors and terminals reacted to my input almost instantaneously.  This was a huge step forward for me and anyone involved in the remote administration of Linux boxen.</p>
<p>I haven&#8217;t even touched the NX network facilities that allow for nodes to be defined, to distribute applications between those nodes, and then to nest them together on the client, but I use it constantly in the most basic remote desktop configuration. I hope to delve into those additional features to configure myself some aggregated remote desktops for different networks (assuming I understand those features correctly).</p>
<p><strong>How It Works: Taking X Back to Its Roots</strong></p>
<p>NX works by re-discovering the original nature of X-Windows.  X was developed as a network-based protocol.  It&#8217;s far less integrally tied to the operating system than, say, Windows.  The operating system runs the apps and outputs to an &#8220;X server&#8221;, a separate application responsible for rendering that output.  Usually, that X server is running on the same machine, and it appears to simply be a desktop environment no different than a Mac or Windows.  But, by changing the display variable, X can output to any arbitrary X server, whether it&#8217;s local or across the world.  The X server does the heavy lifting of drawing the output to whatever machine it&#8217;s on.</p>
<p>The problem is that X doesn&#8217;t do a very good job dealing with the world as it is.  It doesn&#8217;t handle compression of the, sometimes fat, data stream.  It doesn&#8217;t adapt to different bandwidths.  It isn&#8217;t very smart about &#8220;differential&#8221; analysis of the action on screen (i.e., only include in the data stream that which has changed on the screen and leave the rest.)</p>
<p>NX does all that and does it amazingly well.  I have to color-code my desktops so that I can tell them apart on my Linux workstation&#8211; my daily use desktop.  I rarely have that problem with RDP or VNC.  It&#8217;s pretty obvious that that&#8217;s what you&#8217;re looking at in those cases since you usually have to cut display parameters so far back that the display looks like a bad 1990 animated GIF.  With NX, the display looks nearly identical to my local display.  All without much impact at all on my local resources.</p>
<p><strong>OK, Now I Start Whining</strong></p>
<p>Of course, NX isn&#8217;t perfect.  I had some trouble getting my headless servers setup to work with it without causing a mad avalanche of installation to get Gnome or KDE working, but <a title="Between Fluxbox and Gnome, there's..." href="http://www.xfce.org/" target="_blank">XFCE</a> was quick to install and works great.  Like most things <em>Whateverix</em>, there&#8217;s a fairly high noodle factor to get it optimally set up, but thus far, on Fedora, Ubuntu, and Debian distros, it&#8217;s worked nearly flawlessly.  And that includes clients for Windows and Mac.</p>
<p>There aren&#8217;t too many things you can say that about.  I&#8217;ve become quite accustomed to things just not working quite right&#8211; most anyone who had the misfortune to install Ubuntu&#8217;s Jaunty release with, let&#8217;s say, an ATI graphics card can likely attest to that.  Mine installed to a black screen, required the installation of pre-release drivers from an unsupported repository, filled my logs with propeller-headed nonsense about BARs and MMIOs, and just generally was a turd.  But that&#8217;s another story&#8230;</p>
<p>My point is that NX, for me at least, has been one of those almost entirely pleasant, worthwhile experiences that has definitely made my work easier and more pleasant.  Imagine that.</p>
<p><strong>Commercial Vs. Open Source</strong></p>
<p>Now, there&#8217;s NX and there&#8217;s NX&#8230; ever a fan of open source, I tried to install <a title="Godspeed, I hope you have better luck." href="http://freenx.berlios.de/" target="_blank">FreeNX</a> rather than the commercial version from NoMachine.  Sadly, it was immediately apparent that there&#8217;s some internal squabble about libraries (I&#8217;m running 64-bit Linux) or <em>Something-Else-I-Don&#8217;t-Care-About</em>, and it simply wouldn&#8217;t install correctly.</p>
<p>Faced with a perfectly functional (and free, as in beer) version from NoMachine, I wasn&#8217;t about to spend yet another day trying to decode the passive-aggressive oneupmanship that can be open source &#8220;support&#8221; (<em>&#8216;RTFM n00b!&#8217;</em>).  Now, I should say that I think open source is the cat&#8217;s pajamas.  I contribute money when I can&#8217;t contribute time, but there is a tendency in the community to think that most users or low-level kernel driver engineers.  I&#8217;m not.  I&#8217;m just a big doofus who likes the stuff.  Honestly, I&#8217;m pretty far down the geek path, but one can only dedicate so much time to getting their tools to work.  Ya know?</p>
<p><strong>Give It a Shot</strong></p>
<p>So, if you&#8217;re someone who wants to remotely access a Linux box, and you&#8217;ve been dissatisfied with your options so far, give NX a whirl.  You&#8217;ll need to download the Client, Node, and Server packages for the server.  The client requires only that package.  Install those guys and (at least in my case) little or no server-side configuration was needed.  It just worked &#8220;right out of the box&#8221;.  Poke around and check out the options. They also claim to support Citrix, RDP, and VNC, though, again, I haven&#8217;t had the inclination nor time to check those out yet.</p>
<p>It&#8217;s secure (runs over SSH), relatively easy to setup (at least by Linux standards), and free for Linux.  Do it.  You can thank me later.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/11/03/nx-great-thing-or-the-greatest-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Backing Up MySQL: Know Your Cat: Storage Engines</title>
		<link>http://riansreallygoodtechnoblog.com/2009/11/02/more-backing-up-mysql-know-your-cat-storage-engines/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/11/02/more-backing-up-mysql-know-your-cat-storage-engines/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 19:05:20 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Disaster Recovery]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[fulltext]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[storage engines]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=10</guid>
		<description><![CDATA[Last time, I wrote about options for backing up MySQL, but I talked about them as though there is one kind of database, the MySQL database.  However, that&#8217;s not at all true.  There are two main types of storage engine used in MySQL&#8211; MyISAM and InnoDB.  In fact, there are many more, but these are [...]]]></description>
			<content:encoded><![CDATA[<p><a title="In case you missed it..." href="http://riansreallygoodtechnoblog.com/2009/10/31/backing-up-mysql-more-than-one-way-to-skin-a-cat/" target="_blank">Last time</a>, I wrote about options for backing up MySQL, but I talked about them as though there is one kind of database, the MySQL database.  However, that&#8217;s not at all true.  There are two main types of storage engine used in MySQL&#8211; MyISAM and InnoDB.  In fact, there are many more, but these are the two most commonly used without special requirements.<em> This is about the point where those of you not interested in the more, well, &#8220;technical&#8221; aspects of databases might want to go outside for a walk. <span id="more-10"></span></em></p>
<p>In reality, you could use MySQL for years and really know little or nothing about these database engines.  I did.  After all, if you&#8217;re setting up a database to manage, say, your office equipment in a small business, you&#8217;ll maybe have a couple of hundred rows?  You may only access the database once a week.  Who cares what the engine is?  MySQL will default to MyISAM (usually), and that will work fine.  You&#8217;ll never notice, nor care.</p>
<p>However, when you begin to approach almost any kind of consistency, performance, or resource constraint, you&#8217;ll want to think about which engine you&#8217;re using.  This, in turn, will affect your backup process.</p>
<p><strong>The 10,000 foot comparison of MyISAM and InnoDB</strong></p>
<p>I always find that it&#8217;s nice to look at these things in a table:</p>
<table style="text-align: left; width: 100%;" border="1" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td style="vertical-align: top;"></td>
<td style="vertical-align: top;">MyISAM</td>
<td style="vertical-align: top;">InnoDB</td>
</tr>
<tr>
<td style="vertical-align: top;">ACID (i.e., transactional)</td>
<td style="vertical-align: top;">No</td>
<td style="vertical-align: top;">Yes</td>
</tr>
<tr>
<td style="vertical-align: top;">Foreign Keys</td>
<td style="vertical-align: top;">No</td>
<td style="vertical-align: top;">Yes</td>
</tr>
<tr>
<td style="vertical-align: top;">Full-text Searches</td>
<td style="vertical-align: top;">Yes</td>
<td style="vertical-align: top;">No</td>
</tr>
<tr>
<td style="vertical-align: top;">Locking</td>
<td style="vertical-align: top;">Table</td>
<td style="vertical-align: top;">Row</td>
</tr>
<tr>
<td style="vertical-align: top;">Memory Use</td>
<td style="vertical-align: top;">Less</td>
<td style="vertical-align: top;">More</td>
</tr>
<tr>
<td style="vertical-align: top;">Speed Winner</td>
<td style="vertical-align: top;">Possibly in light load</td>
<td style="vertical-align: top;">Usually</td>
</tr>
<tr>
<td style="vertical-align: top;">Backup</td>
<td style="vertical-align: top;">mysqldump, mysqlhotcopy, replication, files</td>
<td style="vertical-align: top;">mysqldump, replication, files*, ibbackup**</td>
</tr>
</tbody>
</table>
<p><em>* you technically <span style="text-decoration: underline;">can</span> do a files-based backup with InnoDB (in fact, I do), but it&#8217;s a bit more involved.  See below for a discussion.</em></p>
<p><em>** ibbackup is a commercial product sold by the developers of the innodb engine, now a subsidiary of, gulp, Oracle.  The price? According to their site: &#8220;&#8230;please contact innodb_sales_ww at oracle.com&#8230;&#8221; i.e., &#8220;how much ya got?&#8221;</em></p>
<p>Let&#8217;s hit these in order:</p>
<p><strong>ACID</strong>: atomicity, consistency, uh&#8230; isohedron, um&#8230; danger?  Whatever.  It&#8217;s an acronym that means that the engine has mechanisms in place to ensure that &#8220;transactions&#8221; are performed reliably.  The classic example is the bank transfer.  You need to know that if you take the money out of account A, it gets into account B.  If not, the whole thing is called off.  MyISAM does not implement these mechanisms.  InnoDB does.</p>
<p><strong>Foreign Keys (FK)</strong>: Similarly to ACID, FK assures that your data makes sense in relation to your model.  For example, if you&#8217;re looking at an 8-track tape collection (I&#8217;m super old), you can&#8217;t have a recording without the recording&#8217;s artist.  So, before the recording table gets &#8220;They Only Come Out at Night&#8221; inserted, the artist table must contain Edgar Winter.  If you delete Edgar from the artist table, you&#8217;d better be sure that &#8220;TOCOAN&#8221; is also out of the recording table.  So, unlike ACID, which enforces proper operation of the database, FK enforces proper/logical USE of the database.  MyISAM does not support FK.  InnoDB does.</p>
<p><strong>Full-text Searches</strong>: In short, if you have a large text-type field, MyISAM supports special functions to index that field so that it can be searched against keywords with natural language and keyword expansion extensions if desired.  InnoDB doesn&#8217;t.</p>
<p><strong>Locking</strong>: MyISAM does not support row-level locking.  That means that if you want to lock a field to prevent it from changing during an operation, you need to lock the entire table that it&#8217;s in.  That means all write operations stop until you&#8217;re done.  In a heavy load situation, that&#8217;s, as they say, &#8220;bad&#8221;.  This is one of the main reasons that InnoDB whoops MyISAM in its ability to support concurrent access, particularly at heavy loads.</p>
<p><strong>Memory</strong> Use: All those fancy features of InnoDB aren&#8217;t free.  One cost is additional memory use.  For instance, InnoDB maintains &#8220;clustered&#8221; indexes and includes the primary key in any secondary indexes.  This speeds data access and improves CPU and IO efficiency, but at a cost of storing all that information in memory.  MyISAM stores  data and indexes in separate files.  Less efficient, but easier on the RAM.</p>
<p><strong>Speed Winner</strong>: Oh boy, I hate to even get into this one, but most of the benchmarks I&#8217;ve seen show InnoDB to win speed contests in most cases.  This becomes particularly true at high load levels.  This makes a lot of sense if you consider the concurrency and efficiency characteristics.  Or, if you have some anecdotal evidence to the contrary, let&#8217;s just agree that you&#8217;re right, and I&#8217;m wrong.  (But I&#8217;m not.)</p>
<p><strong>BACKUP!</strong>: Finally.  OK, so the big difference is that it&#8217;s not quite as easy to just copy the InnoDB files and expect anything good to happen.  With MyISAM, you can.  This means, according to the MySQL peeps, that you also cannot use the mysqlhotcopy utility with InnoDB since it uses the file mechanism to make the backup. You can, however, use the mysqldump utility with either.  Both are easier to do with a logical volume snap or replicated slave server to shutdown during the backup.  I also included InnoBase&#8217;s ibbackup program in case you&#8217;ve got some money burning a hole in your pocket.  Given the available options, I&#8217;m not sure I see the point in such a thing, but if you need some of the features it provides and don&#8217;t want to roll your own, it might be worth looking into.</p>
<p>So, that brings us back to my solution.  Given that I personally prefer to default my storage to InnoDB unless there&#8217;s a reason not to, I went with the replication model&#8211; create a slave server and calmly shut that down, make the backup, and restart the slave.  The thing I like about this approach is that it requires a minimum of fuss, causes no downtime, provides a running backup server, and does nothing that precludes me from using whatever type of storage engine I choose or mixing them together.</p>
<p><strong>Two Pronged Approach to Backups:</strong></p>
<p>Firstly, I turn on binary logging on the slave.  Then, when I shut the database down, I copy the relevant files (ibdata, .ibd, ib_logfile, .frm, and the my.cnf) to the backup staging area.  After that I can start the database back up, and it&#8217;ll sync itself back to the master.  There&#8217;s definitely some exposure to Murphy&#8217;s Law in there (e.g., the master takes on more data while the slave is shut down and then crashes before it syncs) but the probability of that is pretty minuscule.</p>
<p>Then, on a less frequent basis, I take a mysqldump of the database.  It takes a lot longer, but it&#8217;s got the advantages of not being binary, so it&#8217;s readable and less likely to become completely corrupted.  It&#8217;s sort of a backup-backup in case I need to fall back from a corrupt binary backup.</p>
<p>OK, maybe that&#8217;s enough on that topic.  Can hardly wait to see what I write about next&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/11/02/more-backing-up-mysql-know-your-cat-storage-engines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up MySQL: More than one way to skin a cat.</title>
		<link>http://riansreallygoodtechnoblog.com/2009/10/31/backing-up-mysql-more-than-one-way-to-skin-a-cat/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/10/31/backing-up-mysql-more-than-one-way-to-skin-a-cat/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 03:46:41 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Disaster Recovery]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[logical volumes]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=8</guid>
		<description><![CDATA[Moving to MySQL
I&#8217;m currently involved in moving an application from SQL Server (2000) to MySQL.  The reasoning isn&#8217;t terribly relevant, but primarily it&#8217;s an open source v. closed source issue.  This (aging) J2EE app required a proprietary bridge between the application server (Java on Linux) and the database (SQL Server on Windows 2000 Server).  That [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Moving to MySQL</strong></p>
<p>I&#8217;m currently involved in moving an application from SQL Server (2000) to MySQL.  The reasoning isn&#8217;t terribly relevant, but primarily it&#8217;s an open source v. closed source issue.  This (aging) J2EE app required a proprietary bridge between the application server (Java on Linux) and the database (SQL Server on Windows 2000 Server).  That odd adapter has caused us all stress over the years.  Being proprietary, we didn&#8217;t know <em>exactly</em> how it worked nor whether it would be around tomorrow.<span id="more-8"></span></p>
<p>The cost was also a consideration.  Updating the server to the current version would likely cost us thousands of dollars just for the RDBMS itself.  We&#8217;d likely move to the latest OS and upgrade the hardware, too.  It got very pricey, very quickly.</p>
<p>We came to the conclusion that a better solution would be to migrate the whole mess over to MySQL on a Linux server.  I am intimately familiar with MySQL and knew that for very little dough we could provide a fast data store with replication for fail-over, and we&#8217;d eliminate that vaguely disconcerting feeling that relying on closed source proprietary software creates.</p>
<p><strong>A More DIY Model of Disaster Recovery</strong></p>
<p>However, one of the nice things that MSSQL does provide is a backup mechanism from within that database manager itself.  MySQL does not.  I needed to evaluate my options given the situation and choose the most reliable, simplest-to-implement backup solution that wouldn&#8217;t cost additional money nor require disruptive, time-consuming reconfiguration of existing systems.</p>
<p>It appears to me that there are three common methods for backing up a simple MySQL database:</p>
<ol>
<li>mysqldump<br />
Shut down the database, dump out a text file with all of the SQL statements required to recreate the database, and restart.  Then, back up the file like any other file.</li>
<li>LVM snapshots<br />
Lock the tables, create a logical volume snapshot of the data partition, and unlock the tables.  Then back up the snapshot and remove it when completed.</li>
<li>Replication<br />
Create a slave database server that replicates the target server, and simply stop the slave, back up the data, and restart the slave.</li>
</ol>
<p>Mysqldump has the advantage of being very simple to setup and script.  Also, the backup is a text file, and so a ding to the file isn&#8217;t likely to destroy it completely.  With a binary backup, a data ding could render the whole thing useless.  Still, it requires a fair amount downtime, which is bad, and the backup files can be very large, which just makes backups and restores take that much longer.</p>
<p>LVM snapshots sound great.  There&#8217;s very little downtime (just enough to create the snapshot), and the backup is the actual datafile.  It&#8217;s likely to be smaller and restore takes essentially no time since the data file can just be dropped back into a running server and used.  Still, snapshots only work when the filesystem is built on logical volumes (another good topic to discuss, I think).  We were looking at some older systems that used standard physical partitions, and I was not enthusiastic about shutting them down, backing everything up, and reinstalling on LVM just to accomplish this.</p>
<p>So, I settled on replication.  MySQL provides a very slick ability to create a master-slave replication arrangement wherein one server maintains an identical copy of the master database (god willing).  There&#8217;s just a bit of setup, but with this arrangement, there&#8217;s no downtime for the master, and the slave can be backed up in any convenient way without concern for the time involved.  Also, should something befall the master, it is quite likely that the application server can just be pointed to the slave and carry on as though nothing happened.</p>
<p>As it happened, we had a machine in our colocation cabinet just sucking power, doing nothing.  I set up a replication slave on it in just a few minutes.  Then, I wrote a quick script to shut it down, run the backup, and restart the slave.  I added that to the cron table, and we had our backups licked.</p>
<p>Now, obviously, I&#8217;m not talking about a very complex setup here.  This is an application that is critical to the business, but not what I consider heavily used.  Should it ever graduate to the level of something like a load-balanced cluster, I&#8217;ll have to revisit this topic.  In the meantime, we&#8217;re securely covered with a backup process that doesn&#8217;t require downtime and provides the side-benefit of a spinning fail-over server as an even faster disaster recovery path.</p>
<p><strong>A Condescending Lecture on Backups</strong></p>
<p>Backup, backup, backup&#8230; it&#8217;s so often overlooked until it&#8217;s too late.  Do yourself a favor, spend a little money and time and back up more than you think you need to.  When the Bad Thing happens, a good backup strategy can mean the difference between a routine mechanical replacement and restore (<em>everyone&#8217;s happy!</em>) and an uncertain scrounging of data or total loss (<em>ain&#8217;t nobody happy</em>).  Make it a priority.</p>
<p>And like most things, the best way to start is to just start.  Now.  Don&#8217;t worry if it&#8217;s not perfect.  Just take a disk image if that&#8217;s all you can do.  Then, consider what would happen if various nasty scenarios occurred.  Then think about how you might recover.  What if the machine&#8217;s stolen (it happens)?  What if the machine bursts into flames (that&#8217;s happened to me)?  What if an earthquake crushes the colo (<em>probably not, but what if</em>)?</p>
<p>Classify your data by criticality and back it up accordingly.  I recently nearly lost my company books when a power surge took out my active drive and the routine backup drive.  I was lazy and calculated the probability that both of those drives would fail at the same time and decided without really thinking about it that I&#8217;d get around to good backups&#8230; later&#8230; sometime&#8230; Luckily for me, I&#8217;d had at least the forethought to take an image of my drives and store them offline.  I&#8217;d forgotten that I&#8217;d done that and spent the better part of a day engaged in self-loathing.  Now, I regularly take some time to consider how I might improve my backups&#8211; net-based, portable disks swapped offsite, RAIDed online storage, or maybe all of the above.  It&#8217;s done wonders for my comfort factor to know that if my backups turn out to be insufficient, it&#8217;s likely that I&#8217;ll be more worried about the zombies than my business records.</p>
<p>Oh, happy Halloween.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/10/31/backing-up-mysql-more-than-one-way-to-skin-a-cat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting a Really Good Wordpress Technoblog</title>
		<link>http://riansreallygoodtechnoblog.com/2009/10/31/starting-a-really-good-wordpress-technoblog/</link>
		<comments>http://riansreallygoodtechnoblog.com/2009/10/31/starting-a-really-good-wordpress-technoblog/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 01:17:05 +0000</pubDate>
		<dc:creator>rian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://riansreallygoodtechnoblog.com/?p=3</guid>
		<description><![CDATA[Meet the new blog.  Same as the old blog.
Not really.
I find that I get a lot of use out of my own notes (kept in Zim!) and the blogs of other propeller-heads.  I&#8217;ve stopped writing in my other blog for the time being for reasons I won&#8217;t go into, but I feel the need to [...]]]></description>
			<content:encoded><![CDATA[<p>Meet the new blog.  Same as the old blog.</p>
<p>Not really.</p>
<p>I find that I get a lot of use out of my own notes (kept in Zim!) and the blogs of other propeller-heads.  I&#8217;ve stopped writing in my other blog for the time being for reasons I won&#8217;t go into, but I feel the need to write about&#8230; something.  There&#8217;s two things that I know much about: backyard farming and technology.  I&#8217;ve been a computer dork literally since programs were stored on rolls of paper, paper cards, and formatted graph paper looking stuff (RPG FTW!).<span id="more-3"></span></p>
<p>The other blog was about gardening.  This one&#8217;s about technojunk.</p>
<p>These days, I&#8217;m a consultant&#8211; typically engaged in some variation on the theme of technology and marketing.  Sometimes more technology.  Sometimes more marketing.  To be honest, I can be ambivalent about both.  The whole of idea of &#8220;progress&#8221; seems pretty ludicrous as we&#8217;re destroying the only planet we have and showing no signs of letting up, and it&#8217;s unusual, unfortunately, when marketing doesn&#8217;t mean selling people stuff they don&#8217;t need by stretching the truth to its legal limits.</p>
<p>But technology is in my blood, and I&#8217;ve resigned myself to that.  I been fiddling with computers in one form or another since I was about 13.  Maybe younger.  I&#8217;m 43 as I write this.  30 years.  Amazing.</p>
<p>As I mentioned, I get a lot of use out of the technical notes, reviews, howtos, and what-not of other netizens.  I figure it&#8217;s about time that I contribute something useful to that body of knowledge.  That&#8217;s what my really good new blog is about.</p>
<p>The principles are something like this:</p>
<ul>
<li>Nothing written here will be influenced by cash or prizes.  I&#8217;ll take cash and prizes, but it won&#8217;t influence what I say.  In fact, I&#8217;ll probably end up getting sued.  Ah well.</li>
<li>I&#8217;m writing for people like myself in that I still believe that human consideration and decency is worth something, even if the person being addressed has not R&#8217;d T FM. (Read the f*cking manual.)  In that spirit, I will mercilessly purge comments or users who act like incorrigible asses.  Oh, except me.  My blog.  I get to act however I want.</li>
<li>I hope also to write in a way that normal, non-complete-geeks might get something out of it.  Obviously, if the topic is logical volumes or stateful packet inspection, that&#8217;s kinda hard.  If it&#8217;s a new router, though, I should be able to tell a small business owner what I thought of it without trying to demonstrate my leet speek.</li>
<li>I will not dumb down.  See above.  I think there&#8217;s a happy medium.  That&#8217;s usually what I shoot for: technical accuracy and literary clarity.</li>
<li>I reserve the right to establish additional principles as history demonstrates their need.</li>
</ul>
<p>There ya go.  Welcome to Rian&#8217;s Really Good Technoblog.  I hope you get something useful out of it.  Me too.</p>
]]></content:encoded>
			<wfw:commentRss>http://riansreallygoodtechnoblog.com/2009/10/31/starting-a-really-good-wordpress-technoblog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
