<?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>Racker Hacker</title> <atom:link href="http://rackerhacker.com/feed/" rel="self" type="application/rss+xml" /><link>http://rackerhacker.com</link> <description>Words of wisdom from a server administrator</description> <lastBuildDate>Wed, 25 Aug 2010 13:03:52 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>A nerd&#039;s perspective on cloud hosting</title><link>http://rackerhacker.com/2010/08/25/a-nerds-perspective-on-cloud-hosting/</link> <comments>http://rackerhacker.com/2010/08/25/a-nerds-perspective-on-cloud-hosting/#comments</comments> <pubDate>Wed, 25 Aug 2010 13:03:52 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[advice]]></category> <category><![CDATA[cloud]]></category> <category><![CDATA[hosting]]></category> <category><![CDATA[opinion]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1778</guid> <description><![CDATA[Let's go ahead and get this out of the way: The following post contains only my personal opinions. These are not the opinions of my employer and should not be considered as such. The term "cloud hosting" has become more popular over the past few years and it seems like everyone is talking about it. [...]]]></description> <content:encoded><![CDATA[<p>Let's go ahead and get this out of the way: <b style="color: #D42020;">The following post contains only my personal opinions.  These are not the opinions of my employer and should not be considered as such.</b></p><hr /> The term "cloud hosting" has become more popular over the past few years and it seems like everyone is talking about it.  I'm often asked by customers and coworkers about what cloud hosting really is.  Where does traditional dedicated hosting end and cloud begin? Do they overlap? Who needs cloud and who doesn't?</p><p>You can't talk about cloud hosting without defining it first.  When I think of "cloud", these are the things that come to mind:</p><ul><li>quickly add/remove resources with little or no lead time</li><li>hosting platforms that allow for quick provisioning of highly available systems</li><li>self-service adjustment of tangible and intangible resources that normally require human intervention</li></ul><p>That list may seem a bit vague at first, but try to let it sink in just a bit.  Hosting applications in a "cloud" shouldn't mean that you must have a virtual instance running on Xen, KVM or VMWare, and it shouldn't mean that you must have an account with Rackspace Cloud, Amazon EC2, or Microsoft Azure.  It means that your hosting operations are highly automated and you can rapidly allocate and deallocate resources for the requirements of your current projects.</p><p>Consider this: a customer of a traditional dedicated hosting provider decides to take their applications and host them on one VPS at a leading commercial provider.  That provider allows the customer to spin up new VM's in a matter of minutes and re-image the VM's whenever they like.  Is that cloud hosting? <strong>I'd say yes -- even if it's one single virtual instance.</strong> That customer has moved from a hosting system with manual interventions and extended lead times to a system where they have instant control over their resources.</p><p>It's not possible to talk about what cloud is without talking about what it isn't.</p><ul><li> <b>Cloud is not infinitely scalable.</b> If any provider ever claims that their solution is "infinitely scalable", you should be skeptical.  Regardless of the provider, everyone eventually runs out of datacenter space, servers, network bandwidth, or power.  (If you know of a provider that is infinitely scalable, please let me know as I'd love to see their facilities and review their supply chain.)</li><li> <b>Cloud isn't right for everybody.</b> Some applications have demands that cloud hosting might not be able to meet (yet).  If an application depends on proprietary hardware that is difficult to virtualize or rapidly allocate, cloud hosting is probably not the answer for that particular application.</li><li> <b>Cloud doesn't mean VPS. VPS doesn't mean cloud.</b> As I said before, having a virtual private server environment is not a pre-requisite for cloud hosting.  Also, not all VPS solutions fit my definition of cloud as they don't allow for rapid deployments and resource adjustments.</li></ul><p>It's important to remember that cloud hosting is a marketing term.  As for the technology of cloud, it's what you make of it.  You should be looking to reduce costs, solidify availability and increase performance every day.  If the ideals of cloud hosting help you do that, it might be the right option for you.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/08/25/a-nerds-perspective-on-cloud-hosting/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>A simple guide to redundant cloud hosting</title><link>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/</link> <comments>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/#comments</comments> <pubDate>Wed, 18 Aug 2010 00:41:16 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[cloud servers]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[database]]></category> <category><![CDATA[development]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[filesystem]]></category> <category><![CDATA[high availability]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[load balancing]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[network]]></category> <category><![CDATA[networking]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[php]]></category> <category><![CDATA[rackspace]]></category> <category><![CDATA[security]]></category> <category><![CDATA[slicehost]]></category> <category><![CDATA[ssl]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[web]]></category> <category><![CDATA[yum]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1771</guid> <description><![CDATA[Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago. I've written a guide on how to host a web application redundantly in a cloud environment. While it's still a bit of a rough draft, it should be a good starting point for those [...]]]></description> <content:encoded><![CDATA[<p>Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago.  I've <a href="/redundant-cloud-hosting-configuration-guide/">written a guide</a> on how to host a web application redundantly in a cloud environment.  While it's still a bit of a rough draft, it should be a good starting point for those who haven't worked in virtualized environments before.  Also, it may show some of the more experienced systems administrators a new way to do things.</p><p>The guide: <a href="/redundant-cloud-hosting-configuration-guide/">Redundant Cloud Hosting Guide</a></p><p>As always, if you find anything in the guide that needs improvement, I'm all ears. <img src='http://cdn.rackerhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Very unscientific GlusterFS benchmarks</title><link>http://rackerhacker.com/2010/08/13/very-unscientific-glusterfs-benchmarks/</link> <comments>http://rackerhacker.com/2010/08/13/very-unscientific-glusterfs-benchmarks/#comments</comments> <pubDate>Fri, 13 Aug 2010 20:55:24 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[benchmarks]]></category> <category><![CDATA[glusterfs]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1694</guid> <description><![CDATA[I've been getting requests for GlusterFS benchmarks from every direction lately and I've been a bit slow on getting them done. You may suspect that you know the cause of the delays, and you're probably correct. Quite a few different sites argue that the default GlusterFS performance translator configuration from glusterfs-volgen doesn't allow for good [...]]]></description> <content:encoded><![CDATA[<p>I've been getting requests for GlusterFS benchmarks from every direction lately and I've been a bit slow on getting them done.  You may suspect that you know the <a href="/2010/07/14/version-2-0-has-arrived/">cause of the delays</a>, and you're probably correct. <img src='http://cdn.rackerhacker.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p><p>Quite a few different sites argue that the default GlusterFS performance translator configuration from glusterfs-volgen doesn't allow for good performance.  You can find other sites which say you should stick with the defaults that come from the script.  I decided to run some simple tests to see which was true in my environment.</p><p>Here's the testbed:</p><ul><li>GlusterFS 3.0.5 running on RHEL 5.4 Xen guests with ext3 filesystems</li><li>one GlusterFS client and two GlusterFS servers are running in separate Xen guests</li><li>cluster/replicate translator is being used to keep the servers in sync</li><li>the instances are served by a gigabit network</li></ul><p>It's about time for some pretty graphs, isn't it?</p><div style="text-align: center;"> <a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/08/iozone-rereader-glusterfs-default-translators.png"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/08/iozone-rereader-glusterfs-default-translators-255x300.png" alt="iozone re-reader benchmark results with default glusterfs translators from glusterfs-volgen" title="iozone re-reader benchmark results with default glusterfs translators from glusterfs-volgen" width="255" height="300" class="alignnone size-medium wp-image-1720" style="padding-right: 25px;"/></a><a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/08/iozone-rereader-glusterfs-without-translators.png"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/08/iozone-rereader-glusterfs-without-translators-254x300.png" alt="iozone re-reader benchmark results with no glusterfs translators" title="iozone re-reader benchmark results with no glusterfs translators" width="254" height="300" class="alignnone size-medium wp-image-1721" /></a></div><div style="clear:both;"></div><p>The test run on the left used default stock <a href="http://pastebin.com/MAX1kWDg">client</a> and <a href="http://pastebin.com/uyE6qkZ6">server</a> volume files as they come from glusterfs-volgen.  The test run on the right used a <a href="http://pastebin.com/gqMquRpB">client volume file with no performance translators</a> (the server volume file was untouched).  Between each test run, the GlusterFS mount was unmounted and remounted.  I repeated this process four times (for a total of five runs) and averaged the data.</p><p><em>You'll have to forgive the color mismatches and the lack of labeling on the legend (that's KB/sec transferred) as I'm far from an Excel expert.</em></p><p>The graphs show that running without any translators at all will drastically hinder read caching in GlusterFS -- exactly as I expected.  Without any translators, the performance is very even across the board.  Since my instances had 256MB of RAM each, their iocache translator was limited to about 51MB of cache.  That's reflected in the graph on the left -- look for the vertical red/blue divider between the 32MB and 64MB file sizes.  I'll be playing around with that value soon to see how it can improve performance for large and small files.</p><p>Keep in mind that this test was very unscientific and your results may vary depending on your configuration.  While I hope to have more detailed benchmarks soon, this should help some of the folks who have been asking for something basic and easy to understand.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/08/13/very-unscientific-glusterfs-benchmarks/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>One month with GlusterFS in production</title><link>http://rackerhacker.com/2010/08/11/one-month-with-glusterfs-in-production/</link> <comments>http://rackerhacker.com/2010/08/11/one-month-with-glusterfs-in-production/#comments</comments> <pubDate>Wed, 11 Aug 2010 13:29:02 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[glusterfs]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[network]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[web]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1680</guid> <description><![CDATA[As many of you might have noticed from my previous GlusterFS blog post and my various tweets, I've been working with GlusterFS in production for my personal hosting needs for just over a month. I've also been learning quite a bit from some of the folks in the #gluster channel on Freenode. On a few [...]]]></description> <content:encoded><![CDATA[<p>As many of you might have noticed from my <a href="/2010/05/27/glusterfs-on-the-cheap-with-rackspaces-cloud-servers-or-slicehost/">previous GlusterFS blog post</a> and my <a href="http://twitter.com/rackerhacker">various tweets</a>, I've been working with GlusterFS in production for my personal hosting needs for just over a month.  I've also been learning quite a bit from some of the folks in the <a href="http://java.freenode.net/index.php?channel=gluster">#gluster</a> channel on <a href="http://freenode.net/">Freenode</a>.  On a few occasions I've even been able to help out with some configuration problems from other users.</p><p>There has been quite a bit of interest in GlusterFS as of late and I've been inundated with questions from coworkers, other system administrators and developers.  Most folks want to know about its reliability and performance in demanding production environments.  I'll try to do my best to cover the big points in this post.</p><p><strong>First off, here's now I'm using it in production:</strong> I have two web nodes that keep content in sync for various web sites.  They each run a GlusterFS server instance and they also mount their GlusterFS share.  I'm using the <a href="http://www.gluster.com/community/documentation/index.php/Translators/cluster/replicate">replicate translator</a> to keep both web nodes in sync with client side replication.</p><p>Here are my impressions after a month:</p><p><b>I/O speed is often tied heavily to network throughput</b><br /> This one may seem obvious, but it's not always true in all environments.  If you deal with a lot of small files like I do, a 40mbit/sec link between the Xen guests is plenty.  Adding extra throughput didn't add any performance to my servers.  However, if you wrangle large files on your servers regularly, you may want to consider higher throughput links between your servers.  I was able to push just under 900mbit/sec by using dd to create a large file within a GlusterFS mount.</p><p><b>Network and I/O latency are big factors for small file performance</b><br /> If you have a busy network and the latency creeps up from time to time, you'll find that your small file performance will drop significantly (especially with the replicate translator).  Without getting too nerdy (you're welcome to read the <a href="http://ftp.zresearch.com/pub/gluster/glusterfs/doc/afr.pdf">technical document on replication</a>), replication is an intensive process.  When a file is accessed, the client goes around to each server node to ensure that it not only has a copy of the file being read, but that it has the <em>correct</em> copy.  If a server didn't save a copy of a file (due to disk failure or the server being offline when the file was written), it has to be synced across the network from one of the good nodes.</p><p>When you write files on replicated servers, the client has to roll through the same process first.  Once that's done, it has to lock the file, write to the change log, then do the write operation, drop the change log entries, and then unlock the file.  All of those operations must be done on <em>all of the servers</em>.  High latency networks will wreak havoc on this process and cause it to take longer than it should.</p><p>It's quite obvious that if you have a fast, low-latency network between your servers, slow disks can still be a problem.  If the client is waiting on the server nodes' disks to write data, the read and write performance will suffer.  I've tested this in environments with fast networks and very busy RAID arrays.  Even if the network was very underutilized, slow disks could cut performance drastically.</p><p><b>Monitoring GlusterFS isn't easy</b><br /> When the client has communication problems with the server nodes, some weird things can happen.  I've seen situations where the client loses connections to the servers (see the next section on reliability) and the client mount simply hangs.  In other situations, the client has been knocked offline entirely and the process is missing from the process tree by the time I logged in.  Your monitoring will need to ensure that the mount is active and is responding in a timely fashion.</p><p>There's a <a href="http://www.sirgroane.net/2010/04/monitoring-gluster-with-nagios/">handy script</a> which allows you to monitor GlusterFS mounts via nagios that Ian Rogers put together.  Also, you can get some historical data with <a href="http://github.com/acrollet/munin-glusterfs">acrollet's munin-glusterfs plugin</a>.</p><p><b>GlusterFS 3.x is pretty reliable</b><br /> When I first started working with GlusterFS, I was using a version from the 2.x tree.  The Fedora package maintainer hadn't updated the package in quite some time, but I figured it should work well enough for my needs.  I found that the small file performance was lacking and the nodes often had communication issues when many files were being accessed or written simultaneously.  This improved when I built my own RPMs of 3.0.4 (and later 3.0.5) and began using those instead.</p><p>I did some failure testing by hard cycling the server and client nodes and found some interesting results.  First off, abruptly pulling clients had no effects on the other clients or the server nodes.  The connection eventually timed out and the servers logged the timeout as expected.</p><p>Abruptly pulling servers led to some mixed results.  In the 2.x branch, I saw client hangs and timeouts when I abruptly removed a server.  This appears to be mostly corrected in the 3.x branch.  If you're using replicate, it's important to keep in mind that the first server volume listed in your client's volume file is the one that will be coordinating the file and directory locking.  Should that one fall offline quickly, you'll see a hiccup in performance for a brief moment and the next server will be used for coordinating the locking.  When your original server comes back up, the locking coordination will shift back.</p><p><b>Conclusion</b><br /> I'm really impressed with how much GlusterFS can do with the simplicity of how it operates.  Sure, you can get better performance and more features (sometimes) from something like Lustre or GFS2, but the amount of work required to stand up that kind of cluster isn't trivial.  GlusterFS really only requires that your kernel have FUSE support (it's been in mainline kernels since 2.6.14).</p><p>There are some things that GlusterFS really needs in order to succeed:</p><ul><li><b>Documentation</b> - The current documentation is often out of date and confusing.  I've even found instances where the documentation contradicts itself.  While there are some good technical documents about the design of some translators, they really ought to do some more work there.</li><li><b>Statistics gathering</b> - It's very difficult to find out what GlusterFS is doing and where it can be optimized.  Profiling your environment to find your bottlenecks is nearly impossible with the 2.x and 3.x branches.  It doesn't make it easier when some of the performance translators actually decrease performance.</li><li><b>Community involvement</b> - This ties back into the documentation part a little, but it would be nice to see more participation from Gluster employees on IRC and via the mailing lists.  They're a little better with mailing list responses than other companies I've seen, but there is still room for improvement.</li></ul><p>If you're considering GlusterFS for your servers but you still have more questions, feel free to leave a comment or find me on Freenode (I'm 'rackerhacker').</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/08/11/one-month-with-glusterfs-in-production/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Adding comments to iptables rules</title><link>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/</link> <comments>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/#comments</comments> <pubDate>Mon, 26 Jul 2010 15:00:52 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[network]]></category> <category><![CDATA[security]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1619</guid> <description><![CDATA[After I wrote a recent post on best practices for iptables, I noticed that I forgot to mention comments for iptables rules. They can be extremely handy if you have some obscure rules for odd situations. To make an iptables rule with a comment, simply add on the following arguments to the rule: -m comment [...]]]></description> <content:encoded><![CDATA[<p>After I wrote a recent post on <a href="http://rackerhacker.com/2010/04/12/best-practices-iptables/">best practices for iptables</a>, I noticed that I forgot to mention comments for iptables rules.  They can be extremely handy if you have some obscure rules for odd situations.</p><p>To make an iptables rule with a comment, simply add on the following arguments to the rule:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">-m comment --comment &quot;limit ssh access&quot;</pre></div></div><p>Depending on your distribution, you may need to load the <code>ipt_comment</code> or <code>xt_comment</code> modules into your running kernel first.</p><p>A full iptables rule to limit ssh access would look something like this:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -j DROP -p tcp --dport 22 -m comment --comment &quot;limit ssh access&quot;</pre></div></div><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/07/26/adding-comments-to-iptables-rules/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Version 2.0 has arrived</title><link>http://rackerhacker.com/2010/07/14/version-2-0-has-arrived/</link> <comments>http://rackerhacker.com/2010/07/14/version-2-0-has-arrived/#comments</comments> <pubDate>Wed, 14 Jul 2010 17:48:54 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1606</guid> <description><![CDATA[As some of you may have noticed, I haven't made as many posts lately as I normally would. It's probably due to this little guy you see on the right. Evan Michael was born earlier this month and although he's had a bit of a rough start, he's proving that he's a strong fellow. I'll [...]]]></description> <content:encoded><![CDATA[<p><a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/07/IMG_0860.jpg"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/07/IMG_0860-150x150.jpg" alt="Evan" title="Evan" width="150" height="150" class="alignright size-thumbnail wp-image-1608" /></a>As some of you may have noticed, I haven't made as many posts lately as I normally would.  It's probably due to this little guy you see on the right.</p><p>Evan Michael was born earlier this month and although he's had a bit of a rough start, he's proving that he's a strong fellow.  I'll try to pick up where I left off with my posts when we have him settled.</p><div style="clear:both;"></div><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/07/14/version-2-0-has-arrived/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>A modern implementation and explanation of Linux Virtual Server (LVS)</title><link>http://rackerhacker.com/2010/06/27/modern-implementation-and-explanation-of-linux-virtual-server-lvs/</link> <comments>http://rackerhacker.com/2010/06/27/modern-implementation-and-explanation-of-linux-virtual-server-lvs/#comments</comments> <pubDate>Sun, 27 Jun 2010 16:03:27 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[general advice]]></category> <category><![CDATA[high availability]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[networking]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[web]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1529</guid> <description><![CDATA[A typical load balancing configuration using hardware devices or software implementations will be organized such that they resemble the diagram at the right. I usually call this a proxy-type load balancing solution since the load balancer proxies your request to some other nodes. The standard order of operations looks like this: client makes a request [...]]]></description> <content:encoded><![CDATA[<p><div id="attachment_1533" class="wp-caption alignright" style="width: 207px"><a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/loadbalancer-viaproxy.png"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/loadbalancer-viaproxy.png" alt="Load balancing via proxy" title="Load balancing via proxy" width="197" height="206" class="size-full wp-image-1533" /></a><p class="wp-caption-text">Typical configuration for a <br />proxy-type load balancer</p></div>A typical load balancing configuration using hardware devices or software implementations will be organized such that they resemble the diagram at the right.  I usually call this a proxy-type load balancing solution since the load balancer proxies your request to some other nodes.  The standard order of operations looks like this:</p><ul><li>client makes a request</li><li>load balancer receives the request</li><li>load balancer sends request to a web node</li><li>the web server sends content back to the load balancer</li><li>the load balancer responds to the client</li></ul><p>If you're not familiar with load balancing, here's an analogy.  Consider a fast food restaurant.  When you walk up to the counter and place an order, you're asking the person at the counter (the load balancer) for a hamburger.  The person at the counter is going to submit your order, and then a group of people (web nodes) are going to work on it.  Once your hamburger (web request) is ready, your order will be given to the person at the counter and then back to you.</p><p>This style of organization can become a problem as your web nodes begin to scale.  It requires you to ensure that your load balancers can keep up with the requests and sustain higher transfer rates that come from having more web nodes serving a greater number of requests.  Imagine the fast food restaurant where you have one person taking the orders but you have 30 people working on the food.  The person at the counter may be able to take orders very quickly, but they may not be able to keep up with the orders coming out of the kitchen.</p><p><div id="attachment_1532" class="wp-caption alignright" style="width: 226px"><a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/loadbalancer-ipvs.png"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/loadbalancer-ipvs.png" alt="Load balancing via Linux Virtual Server" title="Load balancing via Linux Virtual Server" width="216" height="206" class="size-full wp-image-1532" /></a><p class="wp-caption-text">LVS allows for application servers<br /> to respond to clients directly</p></div><br /> This is where <a href="http://en.wikipedia.org/wiki/Linux_Virtual_Server">Linux Virtual Server (LVS)</a> really shines.  LVS operates a bit differently:</p><ul><li>client makes a request</li><li>load balancer receives the request</li><li>load balancer sends request to a web node</li><li>the web server sends the response <strong>directly to the client</strong></li></ul><p>The key difference is that the load balancer sends the unaltered request to the web server and the web server responds <em>directly to the client</em>.  Here's the fast food analogy again.  If you ask the person at the counter (the load balancer) for a hamburger, that person is going to take your order and give it to the kitchen staff (the web nodes) to work on it.  This time around, the person at the counter is going to advise the kitchen staff that the order needs to go directly to you once it's complete.  When your hamburger is ready, a member of the kitchen staff will walk to the counter and give it directly to you.</p><p>In the fast food analogy, what are the benefits?  As the number of orders and kitchen staff increases, the job of the person at the counter doesn't drastically increase in difficulty.  While that person will have to handle more orders and keep tabs on which of the kitchen staff is working on the least amount of orders, they don't have to worry about returning food to customers.  Also, the kitchen staff doesn't need to waste time handing orders to the person at the counter.  Instead, they can pass these orders directly to the customer that ordered them.</p><p>In the world of servers, this is a large benefit.  Since the web servers' responses no longer pass through the load balancer, they can spend more time on what they do best -- balancing traffic.  This allows for smaller, lower-powered load balancing servers from the beginning.  It also allows for increases in web nodes without big changes for the load balancers.</p><p>There are three main implementations of LVS to consider:</p><p><a href="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/Lvslogo.png"><img src="http://cdn.rackerhacker.com/wp-content/uploads/2010/06/Lvslogo.png" alt="Linux Virtual Server Logo" title="Linux Virtual Server Logo" width="206" height="206" class="alignright size-full wp-image-1559" /></a><strong>LVS-DR: Direct Routing</strong><br /> The load balancer receives the request and sends the packet directly to a waiting real server to process.  LVS-DR has the best performance, but all of your servers must be on the same network subnet and they have to be able to share the same router (with no other routing devices in between them).</p><p><strong>LVS-TUN: Tunneling</strong><br /> This is very similar to the direct routing approach, but the packets are <a href="http://en.wikipedia.org/wiki/IP_tunnel">encapsulated</a> and sent directly to the real servers once the load balancer receives them.  This removes the restriction that all of the devices must be on the same network.  Thanks to encapsulation, you can use this method to load balance between multiple datacenters.</p><p><strong>LVS-NAT: Network Address Translation</strong><br /> Using NAT for LVS yields the least performance and scaling of all of the implementation options.  In this configuration, the incoming requests are rewritten so that they will be transported correctly in a NAT environment.  This puts a bigger burden on the load balancer as it must rewrite the requests quickly while still keeping up with how much work is being done by each web server.</p><hr /> <strong>Looking for a Linux Virtual Server HOWTO?</strong> Stay tuned.  I'm preparing one for my next post.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/06/27/modern-implementation-and-explanation-of-linux-virtual-server-lvs/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Reincarnation of Twitter&#039;s realtime XMPP search term tracking with ruby</title><link>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/</link> <comments>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/#comments</comments> <pubDate>Thu, 17 Jun 2010 18:40:48 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[jabber]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[scripts]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[xmpp]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1517</guid> <description><![CDATA[When Twitter was still in its early stages, you could track certain search terms in near-realtime via Jabber. It was quite popular and its performance degraded over time as more users signed up and began posting updates. Eventually, Twitter killed the jabber bot altogether. Many users have asked when it will return. Well, it hasn't [...]]]></description> <content:encoded><![CDATA[<p>When Twitter was still in its early stages, you could track certain search terms in near-realtime <a href="http://blog.twitter.com/2006/10/use-twitter-by-instant-message.html">via Jabber</a>.  It was quite popular and its performance degraded over time as more users signed up and began posting updates.  Eventually, Twitter killed the jabber bot altogether. <a href="http://www.lagesse.org/twitter-and-track/">Many users have asked when it will return</a>.</p><p>Well, it hasn't returned, but you can build your own replacement with ruby, a jabber account, and a few gems.  While it won't do everything that the original jabber bot did, you can still track tweets mentioning certain terms very quickly.</p><p>Here's how to get started:</p><p>First, install the <em>tweetstream</em> and <em>xmpp4r-simple</em> gems:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">gem install tweetstream xmpp4r-simple</pre></div></div><p>Next, you'll need a jabber account.  You'll probably want to make one for the exclusive use of your jabber bot.  I chose to make up a quick account at <a href="http://www.chatmask.com/">ChatMask</a> for mine.</p><p>The last step is to drop a copy of this script on your server:</p><div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/client'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/hash'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/status'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/user'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'tweetstream/daemon'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'xmpp4r-simple'</span>
&nbsp;
jabber = <span style="color:#6666ff; font-weight:bold;">Jabber::Simple</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'jabberbot@yourjabberserver.com'</span>,<span style="color:#996600;">'jabberpassword'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
tweets = <span style="color:#6666ff; font-weight:bold;">TweetStream::Client</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>twitterusername,twitterpassword<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
tweets.<span style="color:#9900CC;">track</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'celtics'</span>,<span style="color:#996600;">'lakers'</span>,<span style="color:#996600;">'finals'</span>,<span style="color:#996600;">'nba'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>status, client<span style="color:#006600; font-weight:bold;">|</span>
  imtext = <span style="color:#996600;">&quot;#{status.user.screen_name}: #{status.text} <span style="color:#000099;">\r</span><span style="color:#000099;">\n</span>&quot;</span> 
  imtext <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#996600;">&quot;[http://twitter.com/#{status.user.screen_name}/status/#{status.id}]&quot;</span>
  jabber.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;yourjabberusername@yourjabberserver.com&quot;</span>,imtext<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
jabber.<span style="color:#9900CC;">disconnect</span></pre></div></div><p>You'll want to be sure to fill in the following:</p><ul><li>your jabber bot's username and password</li><li>the username and password for the twitter account that will monitor the stream</li><li>the search terms you want to track</li><li>the destination jabber account where the messages should be sent</li></ul><p>Ensure that your jabber account has authorized the jabber bot's account so that you'll actually receive the messages.  Also, Twitter is <a href="http://apiwiki.twitter.com/Streaming-API-Documentation#FilterLimiting">very strict with their streaming API tracking terms</a>.  It's a good idea to review their <a href="http://apiwiki.twitter.com/Streaming-API-Documentation">entire Streaming API documentation</a> to ensure that you're not going to end up having your account temporarily or permanently blacklisted.</p><p>Once everything is ready to go, you can just run the script within GNU screen or via nohup.  There's still a bit more error checking to do around jabber reconnections, but the script has run non-stop for well over two weeks at a time without a failure.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/06/17/reincarnation-of-twitters-realtime-xmpp-search-term-tracking-with-ruby/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Parsing mdadm output with paste</title><link>http://rackerhacker.com/2010/06/14/parsing-mdadm-output-with-paste/</link> <comments>http://rackerhacker.com/2010/06/14/parsing-mdadm-output-with-paste/#comments</comments> <pubDate>Mon, 14 Jun 2010 14:05:57 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[mdadm]]></category> <category><![CDATA[scripts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1506</guid> <description><![CDATA[My curiosity is always piqued when I find new ways to manipulate command line output in simple ways. While working on a solution to parse /proc/mdstat output, I stumbled upon the paste utility. The man page offers a very simple description of its features: Write lines consisting of the sequentially corresponding lines from each FILE, [...]]]></description> <content:encoded><![CDATA[<p>My curiosity is always piqued when I find new ways to manipulate command line output in simple ways.  While working on a solution to parse /proc/mdstat output, I stumbled upon the <a href="http://www.gnu.org/software/coreutils/manual/html_node/paste-invocation.html">paste</a> utility.</p><p>The <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?paste">man page</a> offers a very simple description of its features:</p><blockquote><p>Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output.</p></blockquote><p>Here's an example of how it works.  Let's say you want to parse some software raid output that looks like this:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mdadm --brief --verbose --detail /dev/md0
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=7bea4601:d5a02f5c:2da69848:3184a367
   devices=/dev/sda1,/dev/sdb1</pre></div></div><p>It would be handy if we had both on one line as that would make it easier to parse with a script.  Of course, you can do this with utilities like awk and tr, but paste makes it so much easier:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mdadm --brief --verbose --detail /dev/md0 | paste - -
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=7bea4601:d5a02f5c:2da69848:3184a367	   devices=/dev/sda1,/dev/sdb1</pre></div></div><p>By default, paste uses tabs to separate the lines, but you can use the <code>-d</code> argument to specify any delimiter you like:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># mdadm --brief --verbose --detail /dev/md0 | paste -d&quot;*&quot; - -
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=7bea4601:d5a02f5c:2da69848:3184a367*   devices=/dev/sda1,/dev/sdb1</pre></div></div><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/06/14/parsing-mdadm-output-with-paste/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>GlusterFS on the cheap with Rackspace&#039;s Cloud Servers or Slicehost</title><link>http://rackerhacker.com/2010/05/27/glusterfs-on-the-cheap-with-rackspaces-cloud-servers-or-slicehost/</link> <comments>http://rackerhacker.com/2010/05/27/glusterfs-on-the-cheap-with-rackspaces-cloud-servers-or-slicehost/#comments</comments> <pubDate>Fri, 28 May 2010 00:34:10 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[filesystem]]></category> <category><![CDATA[glusterfs]]></category> <category><![CDATA[high availability]]></category> <category><![CDATA[rackspace]]></category> <category><![CDATA[storage]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1464</guid> <description><![CDATA[High availability is certainly not a new concept, but if there's one thing that frustrates me with high availability VM setups, it's storage. If you don't mind going active-passive, you can set up DRBD, toss your favorite filesystem on it, and you're all set. If you want to go active-active, or if you want multiple [...]]]></description> <content:encoded><![CDATA[<p>High availability is certainly not a new concept, but if there's one thing that frustrates me with high availability VM setups, it's storage.  If you don't mind going active-passive, you can set up <a href="http://en.wikipedia.org/wiki/Drbd">DRBD</a>, toss your favorite filesystem on it, and you're all set.</p><p>If you want to go active-active, or if you want multiple nodes active at the same time, you need to use a clustered filesystem like <a href="http://en.wikipedia.org/wiki/Global_File_System">GFS2</a>, <a href="http://en.wikipedia.org/wiki/OCFS">OCFS2</a> or <a href="http://en.wikipedia.org/wiki/Lustre_(file_system)">Lustre</a>.  These are certainly good options to consider but they're not trivial to implement.  They usually rely on additional systems and scripts to provide reliable <a href="http://en.wikipedia.org/wiki/Fencing_(computing)">fencing</a> and <a href="http://en.wikipedia.org/wiki/STONITH">STONITH</a> capabilities.</p><p>What about the rest of us who want multiple active VM's with simple replicated storage that doesn't require any additional elaborate systems?  This is where <a href="http://en.wikipedia.org/wiki/GlusterFS">GlusterFS</a> really shines.  GlusterFS can ride on top of whichever filesystem you prefer, and that's a huge win for those who want a simple solution.  However, that means that it has to use <a href="http://en.wikipedia.org/wiki/Filesystem_in_Userspace">fuse</a>, and that will limit your performance.</p><p><strong>Let's get this thing started!</strong></p><p>Consider a situation where you want to run a WordPress blog on two VM's with load balancers out front.  You'll probably want to use GlusterFS's replicated volume mode (RAID 1-ish) so that the same files are on both nodes all of the time.  To get started, build two small Slicehost slices or Rackspace Cloud Servers.  I'll be using Fedora 13 in this example, but the instructions for other distributions should be very similar.</p><p>First things first -- be sure to set a new root password and update all of the packages on the system.  This should go without saying, but it's important to remember.  We can clear out the default iptables ruleset since we will make a customized set later:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># iptables -F
# /etc/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:        [  OK  ]</pre></div></div><p>GlusterFS communicates over the network, so we will want to ensure that traffic only moves over the private network between the instances.  We will need to add the private IP's and a special hostname for each instance to <code>/etc/hosts</code> on both instances.  I'll call mine <code>gluster1</code> and <code>gluster2</code>:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">10.xx.xx.xx gluster1
10.xx.xx.xx gluster2</pre></div></div><p>You're now ready to install the required packages on both instances:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum install glusterfs-client glusterfs-server glusterfs-common glusterfs-devel</pre></div></div><p>Make the directories for the GlusterFS volumes on each instance:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">mkdir -p /export/store1</pre></div></div><p>We're ready to make the configuration files for our storage volumes.  Since we want the same files on each instance, we will use the <code>--raid 1</code> option. <strong>This only needs to be run on the first node:</strong></p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># glusterfs-volgen --name store1 --raid 1 gluster1:/export/store1 gluster2:/export/store1
Generating server volfiles.. for server 'gluster2'
Generating server volfiles.. for server 'gluster1'
Generating client volfiles.. for transport 'tcp'</pre></div></div><p>Once that's done, you'll have four new files:</p><ul><li><code>booster.fstab</code> - you won't need this file</li><li><code>gluster1-store1-export.vol</code> - server-side configuration file for the first instance</li><li><code>gluster2-store1-export.vol</code> - server-side configuration file for the second instance</li><li><code>store1-tcp.vol</code> - client side configuration file for GlusterFS clients</li></ul><p>Copy the <code>gluster1-store1-export.vol</code> file to <code>/etc/glusterfs/glusterfsd.vol</code> on your first instance.  Then, copy <code>gluster2-store1-export.vol</code> to <code>/etc/glusterfs/glusterfsd.vol</code> on your second instance.  The <code>store1-tcp.vol</code> should be copied to <code>/etc/glusterfs/glusterfs.vol</code> on both instances.</p><p>At this point, you're ready to start the GlusterFS servers on each instance:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">/etc/init.d/glusterfsd start</pre></div></div><p>You can now mount the GlusterFS volume on both instances:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">mkdir -p /mnt/glusterfs
glusterfs /mnt/glusterfs/</pre></div></div><p>You should now be able to see the new GlusterFS volume in both instances:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># df -h /mnt/glusterfs
Filesystem            Size  Used Avail Use% Mounted on
/etc/glusterfs/glusterfs.vol
                      9.4G  831M  8.1G  10% /mnt/glusterfs</pre></div></div><p>As a test, you can create a file on your first instance and verify that your second instance can read the data:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@gluster1 ~]# echo &quot;We're testing GlusterFS&quot; &gt; /mnt/glusterfs/test.txt
.....
[root@gluster2 ~]# cat /mnt/glusterfs/test.txt
We're testing GlusterFS</pre></div></div><p>If you remove that file on your second instance, it should disappear from your first instance as well.</p><p>Obviously, this is a very simple and basic implementation of GlusterFS.  You can increase performance by making dedicated VM's just for serving data and you can adjust the default performance options when you mount a GlusterFS volume.  Limiting access to the GlusterFS servers is also a good idea.</p><p>If you want to read more, I'd recommend reading the <a href="http://www.gluster.com/community/documentation/index.php/GlusterFS_Technical_FAQ">GlusterFS Technical FAQ</a> and the <a href="http://www.gluster.com/community/documentation/index.php/GlusterFS_User_Guide">GlusterFS User Guide</a>.</p><hr /> <strong>Thank you for your e-mails!</strong> I'll be expanding on this post later with some sample benchmarks and additional tips/tricks, so please stay tuned.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/05/27/glusterfs-on-the-cheap-with-rackspaces-cloud-servers-or-slicehost/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>How to sell: a guide for technical people</title><link>http://rackerhacker.com/2010/05/26/how-to-sell-a-guide-for-technical-people/</link> <comments>http://rackerhacker.com/2010/05/26/how-to-sell-a-guide-for-technical-people/#comments</comments> <pubDate>Thu, 27 May 2010 02:12:39 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[guidance]]></category> <category><![CDATA[rackspace]]></category> <category><![CDATA[sales]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1445</guid> <description><![CDATA[I'll admit it right now: I love engaging customers and learning more about how what we do at Rackspace can help their business or ideas take flight. Talking with customers can be a little nerve-wracking at first since you're not always sure what their experience level is and which products they really need. However, you [...]]]></description> <content:encoded><![CDATA[<p>I'll admit it right now: I love engaging customers and learning more about how what we do at Rackspace can help their business or ideas take flight.  Talking with customers can be a little nerve-wracking at first since you're not always sure what their experience level is and which products they really need.  However, you can get past that initial nervousness very quickly by getting an idea of what the customer needs and what they've tried already (that didn't work).</p><p>You may not have realized it, but I covered the most important part of selling a technical product in the first paragraph without even mentioning the word "sell". <strong>That was intentional.</strong> As a technical person, you have an innate ability to interact with customers without needing to actively <em>sell</em> them the product.</p><p>Whenever I meet a customer at a conference, trade show, or some other relatively informal event, I try to keep a few things in mind.  I'll share them with you:</p><p><strong>Learn why your customers are seeking out your product and what they really need</strong><br /> It's pretty obvious that this step requires more listening than talking.  While the customer is explaining what they need but haven't found, try to keep a running tally in your brain of what technologies are important to them so that you can rank your suggestions for them.  Don't think about which product will work best for them yet -- just keep keep their general requirements in mind.</p><p>This is also a good opportunity to relate to what they've told you.  If there's a certain solution that ended up working really well or one that failed miserably, and you're familiar with one of those solutions, tell them briefly about your experiences.  This will re-affirm how the customer feels about that solution and it also shows them that you've been in their shoes before.  They'll also appreciate that you've been listening to their concerns and looking for ways to relate to their unique situation.</p><p><strong>Make thoughtful production suggestions and discuss implementation</strong><br /> Some folks might say this is where the selling starts, but if you're doing it correctly, you've been selling your product and your company the whole time.  This is where things can get tricky.  Most technical people I've met will try to avoid being pushy when suggesting a product for a customer to use, and that's a good idea.</p><p>You need to do three things: pick the right product (or group of products), explain what needs it meets, and briefly cover some example implementations. <strong>As a technical person, this is where you really shine.</strong> Interpreting the customer's needs and turning it into a mini technical sales pitch is a piece of cake when you know the product well and you've implemented it before.</p><p>It's great to give a customer multiple options, but it's a bad idea to overwhelm them.  If you find that you're talking a bit too much, there's no harm in offering to talk about details later during a formal meeting.  You can say things like these:</p><ul><li>"this product will meet all your needs, but if you want to save a little money, you can use this other product like this."</li><li>"if you combine these two products, you can meet these needs and save some time, but you can just use one and set it up like this..."</li><li>"then later on, if you need to expand, you can start using this product by..."</li></ul><p><strong>Think about the customer's future growth</strong><br /> Even if you have products that meet your customer's needs, they're going to be concerned about what's going to happen down the road.  What happens when they scale to a level that they can't even comprehend right now?  I don't think any customer would expect you to cover all the bases, but try to think of some basic future-proofing for the customer.  Even if it might involve a product that your company doesn't sell, just mention it.</p><p>Of course, there are some things that you shouldn't do:</p><ul><li>Don't overpromise or push hard about a future product.</li><li>Don't feel obligated to know the answer to every question.</li><li>Don't use words like "infinite", "forever", or "perfect".</li><li>Don't talk about cost constantly.</li><li>Don't force a customer to choose a product, take product literature, or take your contact information.</li><li>Don't make assumptions about the customer's technical level, needs, or purchasing power.</li><li>Don't let it bother you if the customer isn't interested in your product -- it's not personal.</li></ul><p>And that's about it.  If you follow those three tips and avoid the things you shouldn't do, you'll get the confidence you need to engage the customer and create the beginnings of a relationship with them.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/05/26/how-to-sell-a-guide-for-technical-people/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Idiot&#039;s guide to OAuth logins for Twitter</title><link>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/</link> <comments>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/#comments</comments> <pubDate>Thu, 20 May 2010 01:26:07 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[oauth]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[script]]></category> <category><![CDATA[twitter]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1425</guid> <description><![CDATA[It certainly shouldn't be difficult, but I always have a tough time with OAuth. Twitter is dropping support for basic authentication on June 30th, 2010. I have some automated Twitter bots that need an upgrade, so I've been working on a quick solution to generate tokens for my scripts. I formulated a pretty simple script [...]]]></description> <content:encoded><![CDATA[<p>It certainly shouldn't be difficult, but I always have a tough time with <a href="http://en.wikipedia.org/wiki/OAuth">OAuth</a>.  Twitter is <a href="http://apiwiki.twitter.com/OAuth-FAQ#WhenareyougoingtoturnoffBasicAuth">dropping support for basic authentication</a> on <a href="http://countdowntooauth.com/">June 30th, 2010</a>.  I have some automated Twitter bots that need an upgrade, so I've been working on a quick solution to generate tokens for my scripts.</p><p>I formulated a pretty simple script using <a href="http://twitter.rubyforge.org/">John Nunemaker's twitter gem</a> that will get it done manually for any scripts you have that read from or update Twitter:</p><div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'twitter'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># These credentials are specific to your *application* and not your *user*</span>
<span style="color:#008000; font-style:italic;"># Get these credentials from Twitter directly: http://twitter.com/apps</span>
application_token = <span style="color:#996600;">'[this should be the shorter one]'</span>
application_secret = <span style="color:#996600;">'[this should be the longer one]'</span>
&nbsp;
oauth = <span style="color:#6666ff; font-weight:bold;">Twitter::OAuth</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>application_token,application_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
request_token = oauth.<span style="color:#9900CC;">request_token</span>.<span style="color:#9900CC;">token</span>
request_secret = oauth.<span style="color:#9900CC;">request_token</span>.<span style="color:#9900CC;">secret</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Request token =&gt; #{request_token}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Request secret =&gt; #{request_secret}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Authentication URL =&gt; #{oauth.request_token.authorize_url}&quot;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">&quot;Provide the PIN that Twitter gave you here: &quot;</span>
pin = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_request</span><span style="color:#006600; font-weight:bold;">&#40;</span>request_token,request_secret,pin<span style="color:#006600; font-weight:bold;">&#41;</span>
access_token = oauth.<span style="color:#9900CC;">access_token</span>.<span style="color:#9900CC;">token</span>
access_secret = oauth.<span style="color:#9900CC;">access_token</span>.<span style="color:#9900CC;">secret</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Access token =&gt; #{oauth.access_token.token}&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Access secret =&gt; #{oauth.access_token.secret}&quot;</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_access</span><span style="color:#006600; font-weight:bold;">&#40;</span>access_token, access_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
twitter = <span style="color:#6666ff; font-weight:bold;">Twitter::Base</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>oauth<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> twitter.<span style="color:#9900CC;">friends_timeline</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div><p>When you run the script, it will give you a request token, request secret and a URL to visit.  When you access the URL, you'll be given a PIN.  Type the PIN into the prompt and you'll get your access token and secret.  This is what you can use to continue authenticating with Twitter, so be sure to save the access token and secret.</p><p>From then on, you should be able to login with a script like this:</p><div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'twitter'</span>
&nbsp;
application_token = <span style="color:#996600;">'[this should be the shorter one]'</span>
application_secret = <span style="color:#996600;">'[this should be the longer one]'</span>
&nbsp;
oauth = <span style="color:#6666ff; font-weight:bold;">Twitter::OAuth</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>application_token,application_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
oauth.<span style="color:#9900CC;">authorize_from_access</span><span style="color:#006600; font-weight:bold;">&#40;</span>access_token, access_secret<span style="color:#006600; font-weight:bold;">&#41;</span>
twitter = <span style="color:#6666ff; font-weight:bold;">Twitter::Base</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>oauth<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> twitter.<span style="color:#9900CC;">friends_timeline</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:count</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div><p>I hope this helps!</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/05/19/idiots-guide-to-oauth-logins-for-twitter/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Legacy tty1 and block device support for Xen guests with pvops kernels</title><link>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/</link> <comments>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/#comments</comments> <pubDate>Fri, 14 May 2010 13:24:34 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[development]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[virtualization]]></category> <category><![CDATA[xen]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1408</guid> <description><![CDATA[The discussions about the paravirt_ops, or "pvops", support in upstream kernels at Xen Summit 2010 last month really piqued my interest. Quite a few distribution maintainers have gone to great lengths to keep Xen domU support in their kernels and it's been an uphill battle. Some kernels, such as Ubuntu's linux-ec2 kernels, have patches from [...]]]></description> <content:encoded><![CDATA[<p>The discussions about the <a href="http://wiki.xensource.com/xenwiki/XenParavirtOps">paravirt_ops</a>, or "pvops", support in upstream kernels at <a href="http://www.xen.org/xensummit/xensummit_spring_2010.html">Xen Summit 2010</a> last month really piqued my interest.</p><p>Quite a few distribution maintainers have gone to great lengths to keep Xen domU support in their kernels and it's been an uphill battle.  Some kernels, such as Ubuntu's <a href="http://packages.ubuntu.com/lucid/linux-ec2">linux-ec2</a> kernels, have patches from 2.6.18 dragged forward into 2.6.32 and even 2.6.33.  It certainly can't be enjoyable to keep dragging those patches forward into new kernel trees.</p><p>The paravirt_ops support for Xen guests was added in 2.6.23 and continues to be included and improved in the latest kernel trees.  However, there are two significant problems with these new kernels if you're trying to work with legacy environments:</p><ul><li>the console is on <code>hvc0</code>, not <code>tty1</code></li><li>block devices are now <code>/dev/xvdX</code> rather than <code>/dev/sdX</code></li></ul><p>If you only have a few guests, these changes are generally pretty easy.  Switching the console just requires some changes to your inittab or upstart configurations.  Changing the block device names requires changes to the guest's Xen configuration file and <code>/etc/fstab</code> within the guest itself.</p><p>Considering the <a href="http://www.rackspacecloud.com/cloud_hosting_products/servers">amount of environments</a> I work with daily at Rackspace, changing the guest configuration is definitely not an option.  I needed a way to keep the console and block devices unchanged so that our customers could have a consistent experience on our infrastructure.</p><p>Luckily, <a href="http://blog.warma.dk/">Soren Hansen</a> offered to pitch in and a solution became apparent.  Through some <a href="http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00712.html">relatively small patches</a>, the legacy console and block device support was available in the latest 2.6.32 version (2.6.32.12 as of this post's writing).</p><p>So far, I've tested x86_64 and i386 versions of 2.6.32.12 with the console and block device patches.  It's gone through its paces on Xen 3.0.3, 3.1.2, 3.3.0 and 3.4.2.  All revisions of Fedora, CentOS, Ubuntu, Debian, Gentoo and Arch made within the last two years are working well with the new kernels.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Taking a posting break</title><link>http://rackerhacker.com/2010/05/05/taking-a-posting-break/</link> <comments>http://rackerhacker.com/2010/05/05/taking-a-posting-break/#comments</comments> <pubDate>Wed, 05 May 2010 23:06:43 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1404</guid> <description><![CDATA[I'd planned to add a new post this week, but I was sidelined with recovery from a surgery. Once I'm back on my feet, I'll get to work on the blog again. Thanks for the e-mails and support! &#169;2010 Racker Hacker. All Rights Reserved..]]></description> <content:encoded><![CDATA[<p>I'd planned to add a new post this week, but I was sidelined with recovery from a surgery. Once I'm back on my feet, I'll get to work on the blog again.</p><p>Thanks for the e-mails and support!</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/05/05/taking-a-posting-break/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Xen Summit: Day One Highlights</title><link>http://rackerhacker.com/2010/04/29/xen-summit-day-one-highlights/</link> <comments>http://rackerhacker.com/2010/04/29/xen-summit-day-one-highlights/#comments</comments> <pubDate>Thu, 29 Apr 2010 15:52:41 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1394</guid> <description><![CDATA[I flew out to San Jose, California with two other Rackers for the Xen Summit at AMD's headquarters. The first day of the two-day conference was very informative. Lots of people asked for some highlights, so I'll provide those here. Ian Pratt and Keir Fraser started off the day with an overview of Xen's current [...]]]></description> <content:encoded><![CDATA[<p>I flew out to San Jose, California with two <a href="http://twitter.com/ajmesserli">other</a> <a href="http://twitter.com/h1nch">Rackers</a> for the Xen Summit at AMD's headquarters.  The first day of the two-day conference was very informative.  Lots of people asked for some highlights, so I'll provide those here.</p><p><a href="http://en.wikipedia.org/wiki/Ian_Pratt_(computer_scientist)">Ian Pratt</a> and <a href="http://www.xen.org/community/spotlight/keirfraser.html">Keir Fraser</a> started off the day with an overview of Xen's current roadmap.  They talked about their largest products and where they're going.</p><p>Open source Xen development is going strong with the recent release of Xen 4.0 and there are some great features in the works for Xen 4.1.  There should be a new credit scheduler called "<a href="http://wiki.xensource.com/xenwiki/Credit2_Scheduler_Development">credit2</a>" in that release.  Also, the <a href="http://www.xen.org/products/cloudxen.html">Xen Cloud Platform</a> project is improving and the feature set is growing.  The <a href="http://openvswitch.org/">Open vSwitch</a> was recently integrated with XCP.</p><p>The <a href="http://www.xen.org/products/xci.html">Xen Client Initiative</a> caught my attention quickly as it allows a user to run a very thin hypervisor on a client machine, such as a laptop or desktop computer, and then run multiple operating systems on top of that hypervisor.  This would reduce the need for products like VMWare Fusion, VirtualBox or Parallels Desktop.</p><p>Still not impressed?  Watch Ian Pratt do a quick demonstration of XCI:</p><p><span class="youtube"> <object width="600" height="360"><param name="movie" value="http://www.youtube.com/v/b2-K1dbzZPk&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" /><param name="allowFullScreen" value="true" /> <embed wmode="transparent" src="http://www.youtube.com/v/b2-K1dbzZPk&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" width="600" height="360"></embed><param name="wmode" value="transparent" /> </object> </span><p><a href="http://www.youtube.com/watch?v=b2-K1dbzZPk&fmt=18"><img src="http://img.youtube.com/vi/b2-K1dbzZPk/default.jpg" width="130" height="97" border=0></a></p><p><a href="http://www.youtube.com/watch?v=b2-K1dbzZPk&fmt=18">www.youtube.com/watch?v=b2-K1dbzZPk</a></p></p><p>Tom Woller from AMD talked about some of the new hardware enhancements that allow Xen to virtualize devices more efficiently.  While much of the low-level hardware discussion was a little over my head (I'm terrible with hardware), the improvements make sense and should improve the relationship with Xen.</p><p><a href="http://mesl.ucsd.edu/yuvraj/">Yuvraj Agarwal</a> from the University of California San Diego talked about SleepServers.  He's done some impressive work with Xen to reduce the energy usage of PC's left on when their users are no longer in the office.</p><p>Jonathan Ludlum covered the roadmap for Xen Cloud Platform in greater detail.  This is definitely going to be a product to watch as it has a tight integration between various products, including XAPI, Open vSwitch, and the Xen hypervisor itself.  It currently runs a CentOS-based userland and Jonathan said there are no plans to change it.</p><p>Later in the afternoon, <a href="http://www.linkedin.com/in/darnok">Konrad Wilk</a> from Oracle talked about the current status of the Xen kernels.  The PVOps kernels are used with Xen 4.0 for the dom0 (and soon for the 3.4.x branch as well).  The domU support has been present in PVOps code in the upstream kernels for some time.  Many distribution vendors are making one kernel for bare metal and virtualized instances by simply adding PVOps support when they build their kernels.  This eliminates the need for the traditional "kernel-xen" kernels that needed to be loaded for virtualized instances to work properly. <a href="http://www.goop.org/~jeremy/">Jeremy Fitzhardinge</a> helped Konrad answer some questions from the audience and their presentation was one of the most informative ones of the day.</p><p><a href="http://www.xen.org/community/spotlight/dunlap.html">George Dunlap</a> talked about the new credit2 scheduler that is due to be released with Xen 4.1 later this year.  He found that the current scheduler negatively affects VM's running applications that have low CPU requirements but are affected greatly by higher latency.  He tested this with a VM that was playing back an audio stream.  When the rest of the VM's on the server used a lot of CPU time, the audio skipped many times.  The credit2 scheduler allows for these low-CPU, latency-sensitive applications to keep running as expected without interruptions.  I'm looking forward to testing this out later this year.</p><p>The last presentation of the day was from <a href="http://uk.linkedin.com/in/stabellini">Stefano Stabellini</a>.  He covered the work being done to simplify how applications interact with Xen.  The new library, libxenlight, strives to be a common layer between client applications and the Xen hypervisor.</p><p>The day wrapped up with a great party at Dave and Buster's.  We had the opportunity to meet many people from Citrix as well as other people working in the virtualization space.  Overall, the first day was very informative and I'm eager to hear some of the presentations scheduled for the second day.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/04/29/xen-summit-day-one-highlights/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Best practices: iptables</title><link>http://rackerhacker.com/2010/04/12/best-practices-iptables/</link> <comments>http://rackerhacker.com/2010/04/12/best-practices-iptables/#comments</comments> <pubDate>Mon, 12 Apr 2010 13:35:31 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1377</guid> <description><![CDATA[Anyone who has used iptables before has locked themselves out of a remote server at least once. It's easily avoided, but often forgotten. Lots of people have asked me for a list of best practices for iptables firewalls and I certainly hope this post helps. Understand how iptables operates Before you can begin using iptables, [...]]]></description> <content:encoded><![CDATA[<p>Anyone who has used <a href="http://en.wikipedia.org/wiki/Iptables">iptables</a> before has locked themselves out of a remote server at least once.  It's easily avoided, but often forgotten.  Lots of people have asked me for a list of best practices for iptables firewalls and I certainly hope this post helps.</p><p><b>Understand how iptables operates</b><br /> Before you can begin using iptables, you need to fully understand how it matches packets with chains and rules.  There is a <a href="http://en.wikipedia.org/wiki/Iptables#Operational_summary">terrific diagram in Wikipedia</a> that will make it easier to understand.  It's imperative to remember that iptables rules are read top-down until a matching rule is found.  If no matching rule is found, the default policy of the chain will be applied (more on that in a moment).</p><p><b>Don't set the default policy to DROP</b><br /> All iptables chains have a default policy setting.  If a packet doesn't match any of the rules in a relevant chain, it will match the default policy and will be handled accordingly.  I've seen quite a few users set their default policy to DROP, and this can bring about some unintended consequences.</p><p>Consider a situation where your INPUT chain contains quite a few rules allowing traffic, and you've set the default policy to DROP.  Later on, another administrator logs into the server and flushes the rules (which isn't a good practice, either).  I've met quite a few good systems administrators who are unaware of the default policy for iptables chains.  Your server will be completely inaccessible immediately.  All of the packets will be dropped since they match the default policy in the chain.</p><p>Instead of using the default policy, I normally recommend making an explicit DROP/REJECT rule at the bottom of your chain that matches everything.  You can leave your default policy set to ACCEPT and this should reduce the chance of blocking all access to the server.</p><p><b>Don't blindly flush iptables rules</b><br /> Before running <code>iptables -F</code>, always check each chain's default policy.  If the INPUT chain is set to DROP, you'll need to set it to ACCEPT if you want to access the server after the rules are flushed.  Also, consider the security implications of your network when you clear the rules.  Your services will be completely exposed and any masquerading or NAT rules will be removed.</p><p><b>Remember localhost</b><br /> Lots of applications require access to the <code>lo</code> interface.  Ensure that you set up your rules carefully so that the <code>lo</code> interface is not disturbed.</p><p><b>Split complicated rule groups into separate chains</b><br /> Even if you're the only systems administrator for your particular network, it's important to keep your iptables rules manageable.  If you have a certain subset of rules that may be a little complicated, consider breaking them out into their own chain.  You can just add in a jump to that chain from your default set of chains.</p><p><b>Use REJECT until you know your rules are working properly</b><br /> When you're writing iptables rules, you'll probably be testing them pretty often.  One way to speed up that process is to use the REJECT target rather than DROP.  You'll get an immediate rejection of your traffic (a TCP reset) instead of wondering if your packet is being dropped or if it's making it to your server at all.  Once you're done with your testing, you can flip the rules from REJECT to DROP if you prefer.</p><p><em>For those folks working towards their RHCE, this is a huge help during the test.  When you're nervous and in a hurry, the immediate packet rejection is a welcomed sight.</em></p><p><b>Be stringent with your rules</b><br /> Try to make your rules as specific as possible for your needs.  For example, I like to allow ICMP pings on my servers so that I can run network tests against them.  I could easily toss a rule into my INPUT chain that looks like this:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -p icmp -m icmp -j ACCEPT</pre></div></div><p>However, I don't want to simply allow all ICMP traffic.  There have been some ICMP flaws from time to time and I'd rather keep as low of a profile as possible.  There are <a href="http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#List_of_permitted_control_messages_.28incomplete_list.29">many types of ICMP control messages</a>, but I only want to allow echo requests:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT</pre></div></div><p>This will allow echo requests (standard ICMP pings), but it won't explicitly allow any other ICMP traffic to pass through the firewall.</p><p><b>Use comments for obscure rules</b><br /> If you have rules to cover edge cases that other administrators might not understand, consider using iptables comments by adding the following arguments to your rules:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">-m comment --comment &quot;limit ssh access&quot;</pre></div></div><p>The comments will appear in the iptables output if you list the current rules.  They will also appear in your saved iptables rules.</p><p><b>Always save your rules</b><br /> Most distributions offer some way to save your iptables rules so that they persist through reboots.  Red Hat-based distributions offer <code>/etc/init.d/iptables save</code>, but Debian and Ubuntu require some <a href="http://rackerhacker.com/2009/11/16/automatically-loading-iptables-on-debianubuntu/">manual labor</a>. An errant reboot would easily take out your unsaved rules, so save them often.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/04/12/best-practices-iptables/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Adjusting tty&#039;s in Fedora 13 with upstart</title><link>http://rackerhacker.com/2010/03/26/adjusting-ttys-in-fedora-13-with-upstart/</link> <comments>http://rackerhacker.com/2010/03/26/adjusting-ttys-in-fedora-13-with-upstart/#comments</comments> <pubDate>Fri, 26 Mar 2010 14:09:13 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[tty]]></category> <category><![CDATA[upstart]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1354</guid> <description><![CDATA[Fedora 13 has quite a few changes related to upstart, and one of the biggest ones is how terminals are configured.  Most distributions tuck the tty configuration away in /etc/inittab, /etc/event.d/ or /etc/init/.  If you want to adjust the number of tty's in Fedora 13, you'll need to look in /etc/sysconfig/init: # color =&#62; new [...]]]></description> <content:encoded><![CDATA[<p>Fedora 13 has quite a few changes related to <a href="http://en.wikipedia.org/wiki/Upstart">upstart</a>, and one of the biggest ones is how terminals are configured.  Most distributions tuck the tty configuration away in <code>/etc/inittab</code>, <code>/etc/event.d/</code> or <code>/etc/init/</code>.  If you want to adjust the number of tty's in Fedora 13, you'll need to look in <code>/etc/sysconfig/init</code>:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># color =&gt; new RH6.0 bootup</span>
<span style="color: #666666; font-style: italic;"># verbose =&gt; old-style bootup</span>
<span style="color: #666666; font-style: italic;"># anything else =&gt; new style bootup without ANSI colors or positioning</span>
<span style="color: #007800;">BOOTUP</span>=color
<span style="color: #666666; font-style: italic;"># column to start &quot;[  OK  ]&quot; label in </span>
<span style="color: #007800;">RES_COL</span>=<span style="color: #000000;">60</span>
<span style="color: #666666; font-style: italic;"># terminal sequence to move to that column. You could change this</span>
<span style="color: #666666; font-style: italic;"># to something like &quot;tput hpa ${RES_COL}&quot; if your terminal supports it</span>
<span style="color: #007800;">MOVE_TO_COL</span>=<span style="color: #ff0000;">&quot;echo -en \\033[<span style="color: #007800;">${RES_COL}</span>G&quot;</span>
<span style="color: #666666; font-style: italic;"># terminal sequence to set color to a 'success' color (currently: green)</span>
<span style="color: #007800;">SETCOLOR_SUCCESS</span>=<span style="color: #ff0000;">&quot;echo -en \\033[0;32m&quot;</span>
<span style="color: #666666; font-style: italic;"># terminal sequence to set color to a 'failure' color (currently: red)</span>
<span style="color: #007800;">SETCOLOR_FAILURE</span>=<span style="color: #ff0000;">&quot;echo -en \\033[0;31m&quot;</span>
<span style="color: #666666; font-style: italic;"># terminal sequence to set color to a 'warning' color (currently: yellow)</span>
<span style="color: #007800;">SETCOLOR_WARNING</span>=<span style="color: #ff0000;">&quot;echo -en \\033[0;33m&quot;</span>
<span style="color: #666666; font-style: italic;"># terminal sequence to reset to the default color.</span>
<span style="color: #007800;">SETCOLOR_NORMAL</span>=<span style="color: #ff0000;">&quot;echo -en \\033[0;39m&quot;</span>
<span style="color: #666666; font-style: italic;"># default kernel loglevel on boot (syslog will reset this)</span>
<span style="color: #007800;">LOGLEVEL</span>=<span style="color: #000000;">3</span>
<span style="color: #666666; font-style: italic;"># Set to anything other than 'no' to allow hotkey interactive startup...</span>
<span style="color: #007800;">PROMPT</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #666666; font-style: italic;"># Set to 'yes' to allow probing for devices with swap signatures</span>
<span style="color: #007800;">AUTOSWAP</span>=no
<span style="color: #666666; font-style: italic;"># What ttys should gettys be started on?</span>
<span style="color: #007800;">ACTIVE_CONSOLES</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span>-<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div><p>The very last line controls the number of tty's that are kept alive on your system.  If you need more tty's, simply increase the 6 to a higher number.  If you only want one terminal (which is usually what I want in Xen), just make this adjustment:</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># What ttys should gettys be started on?</span>
<span style="color: #007800;">ACTIVE_CONSOLES</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tty1</pre></div></div><p>A normal <code>telinit q</code> doesn't seem to adjust the terminals on the fly as it did before upstart was involved.  I'm not sure if this is a bug or an intended feature.  Either way, a reboot solves the problem and you should see the changes afterwards.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/26/adjusting-ttys-in-fedora-13-with-upstart/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Why I&#039;m a Racker</title><link>http://rackerhacker.com/2010/03/26/why-im-a-racker/</link> <comments>http://rackerhacker.com/2010/03/26/why-im-a-racker/#comments</comments> <pubDate>Fri, 26 Mar 2010 13:38:07 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[rackspace]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1342</guid> <description><![CDATA[I normally try to keep my work-related items separate from this blog, but I felt that I needed to break tradition for a moment.  The new Rackspace Talent site was released a few weeks ago and Michael Long asked me to write a blog post about what it means to be a Racker (that's the [...]]]></description> <content:encoded><![CDATA[<p><a href="http://rackblogs.com/talent/rackers/why-im-a-racker/"><img class="alignright size-medium wp-image-1346" title="Why I'm A Racker - Rackspace Talent blog" src="http://cdn.rackerhacker.com/wp-content/uploads/2010/03/whyimaracker-rackspacetalent-300x213.jpg" alt="Why I'm A Racker - Rackspace Talent blog" width="300" height="213" /></a>I normally try to keep my work-related items separate from this blog, but I felt that I needed to break tradition for a moment.  The new <a title="Rackspace Talent site" href="http://www.rackertalent.com/">Rackspace Talent</a> site was released a few weeks ago and <a title="Twitter: theredrecruiter" href="http://twitter.com/theredrecruiter">Michael Long</a> asked me to write a blog post about what it means to be a Racker (that's the term we use for employees of Rackspace).</p><p>After the post went up, I received as much feedback from people outside of Rackspace as I received from Rackers.  The negative feedback I received was centered around the assertion that the post's content was "fluffed" to make the Rackspace experience seem better than it actually is.  That couldn't be further from the truth.</p><p>If you want to make comments on the post, or if you want to know more about working at Rackspace, let me know.  Although I'm not in sales and I'm not in recruiting, I always enjoy talking to people about using Rackspace's services or working for Rackspace.</p><p>Here's a link to the post: <a title="Why I'm A Racker - Major Hayden" href="http://www.rackertalent.com/rackers/why-im-a-racker/">Rackspace Talent - Why I'm a Racker</a></p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/26/why-im-a-racker/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Testing network throughput with iperf</title><link>http://rackerhacker.com/2010/03/20/testing-network-throughput-with-iperf/</link> <comments>http://rackerhacker.com/2010/03/20/testing-network-throughput-with-iperf/#comments</comments> <pubDate>Sat, 20 Mar 2010 21:38:07 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[network]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1324</guid> <description><![CDATA[When you need to measure network throughput and capacity, I haven't found a simpler solution than iperf. There isn't much to say about the operation of iperf -- it's a very simple application. In short, iperf can be installed on two machines within your network. You'll run one as a server, and one as a [...]]]></description> <content:encoded><![CDATA[<p>When you need to measure network throughput and capacity, I haven't found a simpler solution than <a href="http://sourceforge.net/projects/iperf/">iperf</a>.  There isn't <a href="http://en.wikipedia.org/wiki/Iperf">much to say</a> about the operation of iperf -- it's a very simple application.</p><p>In short, iperf can be installed on two machines within your network.  You'll run one as a server, and one as a client.  On the server side, simply run:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iperf -s</pre></div></div><p>On the client side, run:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">iperf -c [server_ip]</pre></div></div><p>The client side will try to shove TCP packets through the network interface as quickly as possible for a period of 10 seconds by default.  Once that's complete, you'll see a report on the server and client that will look like this:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">$ iperf -c 192.168.10.10
------------------------------------------------------------
Client connecting to 192.168.10.10, TCP port 5001
TCP window size: 65.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.10.30 port 53345 connected with 192.168.10.10 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  37.9 MBytes  31.8 Mbits/sec</pre></div></div><p>The previous test was run over an 802.11n network between a wired and wireless device.  The <a href="http://en.wikipedia.org/wiki/Comparison_of_wireless_data_standards#Throughput">typical downlink</a> for an 802.11n network is about 40Mbit/s, so it's obvious that my home network could use an adjustment.</p><p>You can also run bidirectional tests from the client either at the same time (<code>-d</code> flag) or one after the other (<code>-r</code> flag).  The server side will keep running until you stop it, so you can leave it running and run tests from multiple locations over time.  You can daemonize the server end if that makes things easier.</p><p>For the full list of options, refer to <a href="http://staff.science.uva.nl/~jblom/gigaport/tools/man/iperf.html">iperf's man page</a>.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/20/testing-network-throughput-with-iperf/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>SIGTERM vs. SIGKILL</title><link>http://rackerhacker.com/2010/03/18/sigterm-vs-sigkill/</link> <comments>http://rackerhacker.com/2010/03/18/sigterm-vs-sigkill/#comments</comments> <pubDate>Thu, 18 Mar 2010 13:25:59 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1313</guid> <description><![CDATA[Sending signals to processes using kill on a Unix system is not a new topic for most systems administrators, but I've been asked many times about the difference between kill and kill -9. Anytime you use kill on a process, you're actually sending the process a signal (in almost all situations - I'll get into [...]]]></description> <content:encoded><![CDATA[<p>Sending signals to processes using <code><a href="http://en.wikipedia.org/wiki/Kill_(command)">kill</a></code> on a Unix system is not a new topic for most systems administrators, but I've been asked many times about the difference between <code>kill</code> and <code>kill -9</code>.</p><p>Anytime you use <code>kill</code> on a process, you're actually sending the process a signal (in almost all situations - I'll get into that soon).  Standard C applications have a <a href="http://en.wikipedia.org/wiki/Signal.h">header file</a> that contains the steps that the process should follow if it receives a particular signal.  You can get an entire list of the available signals on your system by checking the man page for <code>kill</code>.</p><p>Consider a command like this:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kill 2563</pre></div></div><p>This would send a signal called <a href="http://en.wikipedia.org/wiki/SIGTERM">SIGTERM</a> to the process.  Once the process receives the notice, a few different things can happen:</p><ul><li>the process may stop immediately</li><li>the process may stop after a short delay after cleaning up resources</li><li>the process may keep running indefinitely</li></ul><p>The application can determine what it wants to do once a SIGTERM is received.  While most applications will clean up their resources and stop, some may not.  An application may be configured to do something completely different when a SIGTERM is received.  Also, if the application is in a bad state, such as waiting for disk I/O, it may not be able to act on the signal that was sent.</p><p>Most system administrators will usually resort to the more abrupt signal when an application doesn't respond to a SIGTERM:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kill -9 2563</pre></div></div><p>The <code>-9</code> tells the <code>kill</code> command that you want to send signal #9, which is called <a href="http://en.wikipedia.org/wiki/SIGKILL">SIGKILL</a>.  With a name like that, it's obvious that this signal carries a little more weight.</p><p>Although SIGKILL is defined in the same signal header file as SIGTERM, it cannot be ignored by the process.  In fact, the process isn't even made aware of the SIGKILL signal since the signal goes straight to <del datetime="2010-03-18T18:02:01+00:00">the kernel</del> init.  At that point, init will stop the process.  The process never gets the opportunity to catch the signal and act on it.</p><p>However, the kernel may not be able to successfully kill the process in some situations.  If the process is waiting for network or disk I/O, the kernel won't be able to stop it. <a href="http://en.wikipedia.org/wiki/Zombie_process">Zombie processes</a> and processes caught in an <a href="http://en.wikipedia.org/wiki/Uninterruptible_sleep">uninterruptible sleep</a> cannot be stopped by the kernel, either.  A reboot is required to clear those processes from the system.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/18/sigterm-vs-sigkill/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Rackspace Cloud Tech Podcast Episode 2</title><link>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/</link> <comments>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/#comments</comments> <pubDate>Tue, 09 Mar 2010 01:51:39 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[cloud]]></category> <category><![CDATA[security]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1295</guid> <description><![CDATA[www.youtube.com/watch?v=QC4KxSbWKEQ I participated in a podcast for the Rackspace Cloud with Robert Collazo last week. We covered some important topics including network security and convenient deployment tools. &#169;2010 Racker Hacker. All Rights Reserved..]]></description> <content:encoded><![CDATA[<p><span class="youtube"> <object width="600" height="360"><param name="movie" value="http://www.youtube.com/v/QC4KxSbWKEQ&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" /><param name="allowFullScreen" value="true" /> <embed wmode="transparent" src="http://www.youtube.com/v/QC4KxSbWKEQ&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" width="600" height="360"></embed><param name="wmode" value="transparent" /> </object> </span><p><a href="http://www.youtube.com/watch?v=QC4KxSbWKEQ&fmt=18"><img src="http://img.youtube.com/vi/QC4KxSbWKEQ/default.jpg" width="130" height="97" border=0></a></p><p><a href="http://www.youtube.com/watch?v=QC4KxSbWKEQ&fmt=18">www.youtube.com/watch?v=QC4KxSbWKEQ</a></p></p><p>I participated in a <a href="http://www.rackspacecloud.com/blog/2010/03/05/tech-cloud-cast-episode-2/">podcast</a> for the <a href="http://rackspacecloud.com/">Rackspace Cloud</a> with <a href="http://twitter.com/rcollazo">Robert Collazo</a> last week.  We covered some important topics including network security and convenient deployment tools.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/08/rackspace-cloud-tech-podcast-episode-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Sticky shift key with synergy in Fedora 12</title><link>http://rackerhacker.com/2010/03/03/sticky-shift-key-with-synergy-in-fedora-12/</link> <comments>http://rackerhacker.com/2010/03/03/sticky-shift-key-with-synergy-in-fedora-12/#comments</comments> <pubDate>Thu, 04 Mar 2010 02:44:12 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[gdm]]></category> <category><![CDATA[keyboard]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[synergy]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1274</guid> <description><![CDATA[My synergy setup at work is relatively simple. I have a MacBook Pro running Snow Leopard that acts as a synergy server and a desktop running Fedora 12 as a synergy client. On the Mac, I use SynergyKM to manage the synergy server. The Fedora box uses my gdm strategy for starting synergy at the [...]]]></description> <content:encoded><![CDATA[<p>My synergy setup at work is relatively simple.  I have a MacBook Pro running Snow Leopard that acts as a synergy server and a desktop running Fedora 12 as a synergy client.  On the Mac, I use SynergyKM to manage the synergy server.  The Fedora box uses <a href="http://rackerhacker.com/2008/07/30/automatically-starting-synergy-in-gdm-in-ubuntufedora/">my gdm strategy</a> for starting synergy at the login screen and in GNOME.</p><p>I kept having an issue where the shift key would become stuck regardless of the settings I set for the client or server.  The <code> halfDuplexCapsLock</code> <a href="http://synergy2.sourceforge.net/configuration.html">configuration option</a> had no effect.  After installing <code>xkeycaps</code>, I found that both shift keys were getting stuck if I brought the mouse back and forth between Mac and Fedora twice.</p><p>I decided to run a test.  I started the client with the debug argument and moved the mouse to my Fedora box.  At that point, I pressed the letter 'a' and saw:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">DEBUG1: CXWindowsKeyState.cpp,195:   032 (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   03e (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   032 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   03e (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up</pre></div></div><p>I brought the mouse back to the Mac and then back to Fedora.  I pressed 'a' again and saw:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) down
DEBUG1: CXWindowsKeyState.cpp,195:   026 (00000000) up</pre></div></div><p>After dumping the keyboard layout with <code>xmodmap</code> I found the keys that corresponded with the key numbers:</p><ul><li>032 - Left shift</li><li>03e - Right shift</li><li>026 - a</li></ul><p>If I tapped the left shift, I could clear the key press, but I couldn't clear the right shift key (it was stuck down according to Fedora's X server).  When I hooked up a physical keyboard and mouse, I was able to use them normally without any keybinding problems.</p><p><span style="font-weight: bold; color: #008000;">The root cause:</span> When synergy started in <code>/etc/gdm/PreSession/Default</code> after the gdm login, the keyboard layout wasn't set up properly.  The X server was setting up the keyboard layout later in the startup process and this confusion caused the shift keys to get stuck.  Fedora 12 uses evdev to probe for keyboards during X's startup and eventually settles on a default layout if none are explicitly defined.</p><p><span style="font-weight: bold; color: #008000;">The fix:</span> I added the synergy startup to the GNOME startup items and it works flawlessly.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/03/sticky-shift-key-with-synergy-in-fedora-12/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Private network interfaces: the forgotten security hole</title><link>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/</link> <comments>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/#comments</comments> <pubDate>Tue, 02 Mar 2010 00:55:07 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[cloud]]></category> <category><![CDATA[command line]]></category> <category><![CDATA[encryption]]></category> <category><![CDATA[iptables]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[network]]></category> <category><![CDATA[security]]></category> <category><![CDATA[ssl]]></category> <category><![CDATA[sysadmin]]></category> <category><![CDATA[tcpwrappers]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1263</guid> <description><![CDATA[Regardless of the type of hosting you're using - dedicated or cloud - it's important to take network interface security seriously. Most often, threats from the internet are the only ones mentioned. However, if you share a private network with other customers, you have just as much risk on that interface. Many cloud providers allow [...]]]></description> <content:encoded><![CDATA[<p>Regardless of the type of hosting you're using - dedicated or cloud - it's important to take network interface security seriously.  Most often, threats from the internet are the only ones mentioned.  However, if you share a private network with other customers, you have just as much risk on that interface.</p><p>Many cloud providers allow you access to a private network environment where you can exchange data with other instances or other services offered by the provider.  The convenience of this access comes with a price: other instances can access your instance on the private network just as easily as they could on the public interface.</p><p>Here are some security tips for your private interfaces:</p><p><strong>Disable the private interface</strong><br /> This one is pretty simple.  If you have only one instance or server, and you don't need to communicate privately with any other instances, just disable the interface.  Remember to configure your networking scripts to leave the interface disabled after reboots.</p><p><strong>Use packet filtering</strong><br /> The actual mechanism will vary based on your operating system, but filtering packets is the one of the simplest ways to secure your private interface.  You can take some different approaches with them, but I find the easiest method is to allow access from your other instances and reject all other traffic.</p><p>For additional security, you can limit access based on ports as well as source IP addresses.  This could prevent an attacker from having easy access to your other instances if they're able to break into one of them.</p><p><strong>Configure your daemons to listen on the appropriate interfaces</strong><br /> If there are services that don't need to be listening on the private network, don't allow them to listen on your private interface.  For example, MySQL might need to listen on the private interface so the web server can talk to it, but apache won't need to listen on the private interface.  This reduces the profile of your instance on the private network and makes it a less likely target for attack.</p><p><strong>Use hosts.allow and hosts.deny</strong><br /> Many new systems administrators forget about how handy tcpwrappers can be for limiting access.  If your firewall is down in error, host.allow and hosts.deny could be an extra layer of protection.  It's important to ensure that the daemons you are attempting to control are build with tcpwrappers support.  Daemons like sshd support it, but apache and MySQL do not.</p><p><strong>Encrypt all traffic on the private network</strong><br /> Just because it's called a "private" network doesn't mean that your traffic can traverse the network privately.  You should always err on the side of caution and encrypt all traffic traversing the private network.  You can use ssh tunnels, stunnel, or the built-in SSL features found in most daemons.</p><p>This also brings up an important point: <strong>you should know how your provider's private network works</strong>.  Are there safeguards to prevent sniffing?  Could someone else possibly ARP spoof your instance's private IP addresses?  Is your private network's subnet shared among many customers?</p><p>With all of that said, it's also very important to have proper change control policies so that administrators working after you are fully aware of the security measures in place and why they are important.  This will ensure that all of the administrators on your instances will understand the security of the system and they should be able to make sensible adjustments later for future functionality.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/03/01/private-network-interfaces-the-forgotten-security-hole/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>System Administration Inspiration: If it&#039;s broken, break it a little more</title><link>http://rackerhacker.com/2010/02/28/system-administration-inspiration-if-its-broken-break-it-a-little-more/</link> <comments>http://rackerhacker.com/2010/02/28/system-administration-inspiration-if-its-broken-break-it-a-little-more/#comments</comments> <pubDate>Sun, 28 Feb 2010 16:47:16 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[general advice]]></category> <category><![CDATA[sysadmin]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1121</guid> <description><![CDATA[Earlier this year, I started a series of posts to encourage systems administrators to refine their troubleshooting abilities. This is the second post in that series. Almost every system administrator has found themselves in a situation where they're confronted with a server which has a problem. However, if you're not the primary administrator for the [...]]]></description> <content:encoded><![CDATA[<p>Earlier this year, <a href="http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/">I started a series of posts</a> to encourage systems administrators to refine their troubleshooting abilities.  This is the second post in that series.</p><p>Almost every system administrator has found themselves in a situation where they're confronted with a server which has a problem.  However, if you're not the primary administrator for the server, you may not always know what has changed recently or you may not be aware of changes in the server's environment.  In these situations, if the fix isn't obvious, try going through these steps:</p><p><strong>Localize the problem to a specific daemon or service</strong><br /> In the case of a problem where a website isn't loading properly, is it a problem with the web server itself?  Could something other than the actual web server daemon be having an issue?</p><p>As an example, consider a ruby on rails application which runs through apache's mod_proxy_balancer and queries data from MySQL.  If any of those individual puzzle pieces were not functioning correctly, you'd get a different result.  A downed MySQL instance could make the application throw errors or appear to be unresponsive.  If the mongrel cluster had failed, apache might be returning internal server errors.  Your browser might return a connection refused if apache was down.  These are all relatively easy to determine.</p><p>What if you are unable to determine which daemon is causing the problem?</p><p><strong>If it's broken, break it a little more</strong><br /> Let's say that you've reviewed the process list and all of the appropriate daemons appear to be running.  However, the website is still not loading properly.  What do you do?  Bring down a service and try again.  Did something change? Did a new error appear? If not, bring that daemon back up and try taking down one of the other ones.</p><p>I've also had some good results by making small adjustments in the web server's configuration file.  If you have a virtual host that isn't returning the correct data, try commenting it out temporarily.  For rewrite rules, try removing them temporarily or strip them down to a more basic form.  Test again, and then begin adding lines back incrementally.  As much as a single period or quotation mark can derail a perfectly good set of rewrite rules.</p><p>In short - try to think outside the box when you're troubleshooting a difficult issue on an unfamiliar system.  Always remember to back up your configurations before making changes and ensure your daemons will start properly if you bring them down.</p><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/02/28/system-administration-inspiration-if-its-broken-break-it-a-little-more/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>MySQL: The total number of locks exceeds the lock table size</title><link>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/</link> <comments>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/#comments</comments> <pubDate>Tue, 16 Feb 2010 18:00:29 +0000</pubDate> <dc:creator>Major Hayden</dc:creator> <category><![CDATA[Posts]]></category> <category><![CDATA[configuration]]></category> <category><![CDATA[database]]></category> <category><![CDATA[innodb]]></category> <category><![CDATA[memory]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[optimization]]></category><guid isPermaLink="false">http://rackerhacker.com/?p=1173</guid> <description><![CDATA[If you're running an operation on a large number of rows within a table that uses the InnoDB storage engine, you might see this error: ERROR 1206 (HY000): The total number of locks exceeds the lock table size MySQL is trying to tell you that it doesn't have enough room to store all of the [...]]]></description> <content:encoded><![CDATA[<p>If you're running an operation on a large number of rows within a table that uses the InnoDB storage engine, you might see this error:</p><p><code>ERROR 1206 (HY000): The total number of locks exceeds the lock table size</code></p><p>MySQL is trying to tell you that it doesn't have enough room to store all of the row locks that it would need to execute your query.  The only way to fix it for sure is to adjust <code>innodb_buffer_pool_size</code> and restart MySQL.  By default, this is set to only 8MB, which is too small for anyone who is using InnoDB to do anything.</p><p><strong>If you need a temporary workaround,</strong> reduce the amount of rows you're manipulating in one query.  For example, if you need to delete a million rows from a table, try to delete the records in chunks of 50,000 or 100,000 rows.  If you're inserting many rows, try to insert portions of the data at a single time.</p><p>Further reading:</p><ul><li><a href="http://bugs.mysql.com/bug.php?id=15667">MySQL Bug #15667 - The total number of locks exceeds the lock table size</a></li><li><a href="http://mrothouse.wordpress.com/2006/10/20/mysql-error-1206/">MySQL Error 1206 &raquo; Mike R's Blog</a></li></ul><p>&copy;2010 <a href="http://rackerhacker.com">Racker Hacker</a>. All Rights Reserved.</p>.]]></content:encoded> <wfw:commentRss>http://rackerhacker.com/2010/02/16/mysql-the-total-number-of-locks-exceeds-the-lock-table-size-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached (user agent is rejected)
Database Caching 12/108 queries in 0.071 seconds using memcached
Object Caching 1791/1987 objects using memcached
Content Delivery Network via cdn.rackerhacker.com

Served from: rackerhacker.com @ 2010-09-02 19:05:47 -->