<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>tending the garden &#187; sysadmin</title>
	<atom:link href="http://www.chesnok.com/daily/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chesnok.com/daily</link>
	<description>Selena Deckelmann&#039;s blog about postgres, open source and the web.</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:19:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>selenamarie@gmail.com (tending the garden)</managingEditor>
	<webMaster>selenamarie@gmail.com (tending the garden)</webMaster>
	<image>
		<url>http://www.chesnok.com/daily/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>tending the garden</title>
		<link>http://www.chesnok.com/daily</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>a gathering place for all the stray thoughts</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>tending the garden</itunes:author>
	<itunes:owner>
		<itunes:name>tending the garden</itunes:name>
		<itunes:email>selenamarie@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.chesnok.com/daily/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Puppet Faces: defaults and &#8216;puppet node clean&#8217;</title>
		<link>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=puppet-faces-defaults-and-puppet-node-clean</link>
		<comments>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 01:55:41 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[puppet faces]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=3468</guid>
		<description><![CDATA[TweetPuppet Faces are an extendable API for tricking out your Puppet instances. (&#8220;Faces&#8221; is just short for &#8220;Interfaces&#8221;.) Just a couple days ago I wrote about my survey of puppet + ec2 provisioning tools. The problem I&#8217;m trying to solve, &#8230; <a href="http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton3468" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F11%2F02%2Fpuppet-faces-defaults-and-puppet-node-clean%2F&amp;text=Puppet%20Faces%3A%20defaults%20and%20%26%238216%3Bpuppet%20node%20clean%26%238217%3B&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F11%2F02%2Fpuppet-faces-defaults-and-puppet-node-clean%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Puppet Faces are an extendable API for tricking out your Puppet instances. (&#8220;Faces&#8221; is just short for &#8220;Interfaces&#8221;.) Just a couple days ago I wrote about <a href="http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/">my survey of puppet + ec2 provisioning tools</a>.</p>
<p>The problem I&#8217;m trying to solve, which I don&#8217;t feel like I&#8217;ve solved well, is how to give a type to a new system at bootstrap time, without using DNS. The type variable maps to a node manifest group, and determines the personality of a host &#8211; is it a database, webserver or development instance?</p>
<p>What I&#8217;d like to do is pass a type to puppet at install time and have the puppetmaster and the agent remember that mapping between host and type. </p>
<p>I did it with a really simple Facter plugin, install scripts named by type (passed in to <code>puppet node install</code>), and a file created by the install script in <code>/etc/puppet</code>.</p>
<p>Then, I wanted to be able to see which hosts were configured with which install type. Facter was aware of the type, so this seemed like it should be pretty easy&#8230;</p>
<p>I wrote a quick and dirty Face that pulls information out of <code>$varlib/nodes/*.yaml</code> on the puppet master. I imagine there are better ways to do this, but in the absence of documentation or someone to tell me not to do this, I forged ahead!</p>
<p>There were two things that I spent quite a bit of time chewing on before figuring it out: </p>
<ol>
<li>If you want to make an <code>:action</code> in your Face the default, you just add <code>default</code> in the body of your <code>:action</code> block. I had to dig through a few cloudpack files before I found it!</li>
<li>If you are creating and terminating hosts frequently, you may end up with a bunch of certs and other annoying metadata laying around. To clean it up, the Puppet Node Face has a command you can run:<br />
<code><br />
# puppet node clean [hostname]<br />
</code></p>
<p>You&#8217;ll probably need to be the user that&#8217;s running puppet for this to work &#8212; it affects things that the puppetmaster owns in <code>$varlib</code>. </p>
<p>If you&#8217;re doing this with code, it&#8217;s:<br />
<code><br />
Puppet::Face[:node, :current].clean('hostname')<br />
</code>
</li>
</ol>
<p>I put <a href="https://github.com/selenamarie/puppetlabs-cloud-provisioner/commit/44e7300e1097d8a9290f864154ad591689feadc7">a little patch</a> into a recent version of cloudprovisioner that invokes clean during a terminate. It&#8217;s quick and dirty, and only for AWS. </p>
<p>The resources I&#8217;ve found useful are: </p>
<ul>
<li><a href="http://www.youtube.com/watch?v=C9k9lF4cskg">Kelsey&#8217;s talk at PuppetConf about Faces</a></li>
<li><a href="https://github.com/khightower/puppet-dashboard-face/">Kelsey Hightower&#8217;s Git repo for Puppet Dashboard Face</a></li>
<li><a href="http://www.kartar.net/2011/05/puppet-github-face/">Kartar&#8217;s Github face</a></li>
</ul>
<p>And to a lesser extent, these blog posts were helpful for filling in a few gaps: </p>
<ul>
<li><a href="http://puppetlabs.com/blog/puppet-faces-what-the-heck-are-faces/">What the heck are Faces?</a>
<li><a href="http://puppetlabs.com/blog/about-faces-until-we-go-in-the-right-direction/">Creating a simple &#8220;backup&#8221; Face</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2011/11/02/puppet-faces-defaults-and-puppet-node-clean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going from Vagrant and Puppet into EC2: A short survey of 5 tools (and two I didn&#8217;t bother trying)</title>
		<link>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying</link>
		<comments>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 02:21:58 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[puppet]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[vagrant]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=3420</guid>
		<description><![CDATA[TweetI thought this would be easy. I started using Vagrant, and was productive with it in about a day. Really a couple hours. Most of my time was spent downloading the correct version of VirtualBox, looking for starter images and &#8230; <a href="http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton3420" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F10%2F28%2Fgoing-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying%2F&amp;text=Going%20from%20Vagrant%20and%20Puppet%20into%20EC2%3A%20A%20short%20survey%20of%205%20tools%20%28and%20two%20I%20didn%26%238217%3Bt%20bother%20trying%29&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F10%2F28%2Fgoing-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I thought this would be easy. </p>
<p>I started using <a href="http://vagrantup.com/docs/getting-started/index.html">Vagrant</a>, and was productive with it in about a day. Really a couple hours. Most of my time was spent downloading the correct version of VirtualBox, <a href="http://morethanseven.net/2011/05/08/Vagrant-plugin-for-interacting-with-vagrantboxes.html">looking for starter images</a> and then a small amount of time experimenting with the Vagrantfile scripting language (<a href="http://vagrantup.com/docs/multivm.html">for multiple VMs</a>).</p>
<p>And we made some Puppet configs.</p>
<p>Then I wanted to use those same Puppet configs with EC2.</p>
<p>So my ultimate goals were: </p>
<ol>
<li>Reuse my existing puppet configs as much as possible</li>
<li>Have a completely automated deploy of a server system (including checkouts of code from a private github repo)</li>
<li>Have a puppetmaster in EC2</li>
<li>Be able to provision systems from EC2 or my laptop</li>
<li>Make the whole process easy for my coworkers</li>
</ol>
<p>This is mostly a list of what I failed at using, and the thing I succeed with at the end.</p>
<p><em>Short aside:</em></p>
<p><b>Pro tip to people writing documentation</b>: Most tutorials and sites that make recommendations for tools leave out the part where you run into all kinds of insane problems. <b>Create a wiki page or a place where you collect the problems.</b> Please. </p>
<p>For example: My Cloud Formation to Ubuntu AMI deploy was failing with an error in cfn.rb that said: &#8220;Unexpected return.&#8221;  Um. Ok. *facepalm*</p>
<p>The problem was that a AWS-image specific JSON file wasn&#8217;t present (and couldn&#8217;t be created) on the target machine. So instead of noting (raise an exception, anyone?) that the file wasn&#8217;t present, the module just executed a bare <code>return</code>. </p>
<p>Because I don&#8217;t know much about Puppet internals, this was a very annoying problem to solve. (like, what gets installed in <code>/var/lib/puppet/lib</code> vs. in the <code>gem install</code> vs. the cloudpack library I was told to install in <code>/etc/puppet/modules</code>?)</p>
<p>Stepping back a bit &#8211; a useful note from the Cloud Formation folks would have been: &#8220;Hey &#8211; this probably won&#8217;t work if you try to deploy to non-Amazon Linux AMI distros of Linux.&#8221; It&#8217;s not obvious that&#8217;s the case! You&#8217;re supposed to be able to completely control the classes being installed on the target system, right? Bad assumption, apparently.</p>
<p><em>And we&#8217;re back!</em></p>
<p>Let me know in the comments if you&#8217;ve successfully navigated any of the tools I didn&#8217;t pick. Juju, in particular, I don&#8217;t think I gave a fair chance (since I didn&#8217;t try it at all). </p>
<p>Here&#8217;s my list: </p>
<ol>
<li><a href="http://www.slideshare.net/derleiermann/juju-puppetconf">Juju</a>
<p>I just wasn&#8217;t sure this was a reasonable thing to install/use. No one I knew had ever heard of it. Didn&#8217;t try it.
</li>
<li><a href="http://www.devco.net/archives/2010/07/14/bootstrapping_puppet_on_ec2_with_mcollective.php">Mcollective + tools ported to PHP</a>
<p>I&#8217;m interested in Mcollective, but the configs looked overly complex, and I didn&#8217;t have anyone close by that was actively using it. </p>
<p>The examples scared me away because of the PHP. I already had three languages at play in the deployment, and I didn&#8217;t need another language dependency. So, I didn&#8217;t bother trying it.
</li>
<li><a href="http://www.codelord.net/2010/12/19/using-puppet-to-automatically-configure-new-ec2-instances/">Custom scripts based on the ec2-tools packages</a>
<p>This approach works, but is fragile and a PITA to keep updated. I tried it as a &#8220;getting oriented&#8221; exercise, and abandoned it.
</li>
<li><a href="https://github.com/jedi4ever/mccloud">Mccloud</a>
<p>This looked awesome! I could reuse all my Vagrant configs and not really have to change anything&#8230; Except I had to maintain duplicate configs, just sub &#8216;Mccloud&#8217;. Eh. </p>
<p>I may revisit this tool in the future, but it seemed to require pretty much the same things as the tool I ultimately decided to use, and didn&#8217;t seem as flexible. I also had a weird restriction where it wouldn&#8217;t allow me to spin up the correct type of image (I wanted m1.small in my testing). Could have been PEBKAC &#8212; I didn&#8217;t take good enough notes to say for sure.
</li>
<li><a href="https://help.ubuntu.com/community/CloudInit">cloud-init</a>
<p>This looked very promising! We were already using Ubuntu so seemed like a good fit. </p>
<p>Pros: easy &#8211; pass in a shell script when starting an EC2 instance from the web. Cons: required yet-another-configuration style. But there were command-line tools and it was looking very promising.</p>
<p>In the end, using a supported package would have required me to be running a Linux desktop to start my puppetmaster. I didn&#8217;t search much harder than <code>brew install cloud-init</code> for a Mac-equivalent (that doesn&#8217;t exist). So, I moved on to the next thing.
</li>
<li><a href="http://aws.amazon.com/cloudformation/">AWS Cloud Formation</a>
<p>I launched a puppetmaster pre-configured instance! I sort of got puppetmaster running! Then I tried to deploy an Ubuntu AMI from it&#8230; This does not work. </p>
<p>So, I will save you a ton of time: <b>Avoid trying to mix the pre-specified Cloud Formation images with other systems.</b></p>
<p>Someone showed me the chunk of the config you can rip out and probably get it to work. I was frustrated at that point, and moved on. Too much tweaking was required, for what was uncertain gain at that point.
</li>
<li><a href="https://github.com/puppetlabs/puppetlabs-cloud-provisioner">PuppetLab&#8217;s Cloud Provisioner</a>
<p>This is what I am currently using! I&#8217;m running <code>HEAD</code> pulled directly from github.  Older versions are not recommended. (I tried three versions.)</p>
<p>The configuration is pretty straightforward and <a href="http://docs.puppetlabs.com/guides/cloud_pack_getting_started.html">documented</a>. The one thing (a very important thing) is that you have to amend your <code>$RUBYLIB</code> if you don&#8217;t install the code in your version of ruby&#8217;s default libdir. There&#8217;s no gem. <a href="http://projects.puppetlabs.com/issues/10379">Yet</a>. </p>
<p>I customized the deploy script to my liking &#8211; there is an unsupported option called <code>--install-script</code> you can pass in that will execute whatever <code>.erb</code> (a shell script!) you&#8217;d like if you put it in <code>~/.puppet/scripts</code>. You can also pass in your puppetmaster hostname with <code>--server</code>.</p>
<p>Totally sweet. </p>
<p>The command-line is ok, but there&#8217;s also a programmatic interface in Ruby. Dan Bode showed me a short code snippet that worked (hostnames &#038; keys sanitized): </p>
<p><code><br />
irb(main):012:0> require 'puppet'<br />
irb(main):013:0> require 'puppet/face'<br />
irb(main):014:0> Puppet::Face[:node, :current].install('myserver.compute-1.amazonaws.com', :keyfile => 'mykey.pem', :login => 'ubuntu', :install_script => 'custom-puppetmaster', :server=>'myserver.compute-1.amazonaws.com')<br />
</code></p>
<p>I so appreciate this! <a href="http://puppetlabs.com/faces/">Faces</a> is awesome. </p>
</li>
</ol>
<p>I&#8217;ve got some additional tweaking to do yet, but I&#8217;m planning to commit a few amendments to the provisioner scripts included by default and the README. And I filed a couple bugs. </p>
<p>Overall, I&#8217;d bet that <a href="https://github.com/puppetlabs/puppetlabs-cloud-provisioner">cloud-provisioner</a> (if you use the version currently on github) will work for most people. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2011/10/28/going-from-vagrant-and-puppet-into-ec2-a-short-survey-of-5-tools-and-two-i-didnt-bother-trying/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Broken windows, broken code, broken systems</title>
		<link>http://www.chesnok.com/daily/2011/03/02/broken-windows-broken-code-broken-systems/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=broken-windows-broken-code-broken-systems</link>
		<comments>http://www.chesnok.com/daily/2011/03/02/broken-windows-broken-code-broken-systems/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 16:49:09 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[broken windows]]></category>
		<category><![CDATA[devops]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=2601</guid>
		<description><![CDATA[TweetA few days ago, I asked: I spend a lot of time thinking about the little details in systems &#8211; like the number of ephemeral ports consumed, number of open file descriptors and per-process memory utilization over time. Small changes &#8230; <a href="http://www.chesnok.com/daily/2011/03/02/broken-windows-broken-code-broken-systems/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton2601" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F03%2F02%2Fbroken-windows-broken-code-broken-systems%2F&amp;text=Broken%20windows%2C%20broken%20code%2C%20broken%20systems&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2011%2F03%2F02%2Fbroken-windows-broken-code-broken-systems%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>A few days ago, I asked: </p>
<p><a href="http://www.chesnok.com/daily/wp-content/uploads/2011/03/Twitter-_-@Selena-Deckelmann_-Is-there-a-_broken-window_-....png"><img src="http://www.chesnok.com/daily/wp-content/uploads/2011/03/Twitter-_-@Selena-Deckelmann_-Is-there-a-_broken-window_-...-300x116.png" alt="" title="Twitter _ @Selena Deckelmann_ Is there a _broken window_ ..." width="300" height="116" class="aligncenter size-medium wp-image-2665" /></a></p>
<p>I spend a lot of time thinking about the little details in systems &#8211; like the number of ephemeral ports consumed, number of open file descriptors and per-process memory utilization over time. Small changes across 50 machines can add up to a large overall change in performance. </p>
<p>And then, today, I saw <a href="http://infoworld.com/print/152375">this article</a>: </p>
<blockquote><p>One of the more telling comments I received was the idea that since the advent of virtualization, there&#8217;s no point in trying to fix anything anymore. If a weird error pops up, just redeploy the original template and toss the old VM on the scrap heap. Similar ideas revolved around re-imaging laptops and desktops rather than fixing the problem. OK. Full stop. A laptop or desktop is most certainly not a server, and servers should not be treated that way. But even that&#8217;s not the full reality of the situation.</p>
<p>I&#8217;m starting to think that current server virtualization technologies are contributing to the decline of real server administration skills.</p></blockquote>
<p>There definitely has been a shift &#8211; &#8220;real server administration skills&#8221; are now more about packaging, software selection and managing dramatic shifts in utilization. It&#8217;s less important know to know exactly how to manage M4 with sendmail, and more important that you know you should probably use postfix instead. I don&#8217;t spend much time convincing clients that they need connection pooling; I debug the connection pooler that was chosen.</p>
<p>The available software for web development and operations is quite broad &#8211; the version of Linux you select, whether you are vendor supported or not, and the volume of open source tools to support applications. </p>
<p>Inevitably, the industry has shifted to configuration management, rather than configuration. And, honestly, the shift started about 15 years ago with <a href="http://cfengine.com/pages/history">cfengine</a>.</p>
<p>Now we call this <a href="http://www.kitchensoap.com/2009/12/12/devops-cooperation-doesnt-just-happen-with-deployment/">DevOps</a>, the idea that systems management should be programmable. Burgess called this &#8220;Computer Immunology&#8221;. DevOps is a much better marketing term, but I think the core ideas remain the same: Make programmatic interfaces to manage systems and automate.</p>
<p>But, back to the broken window thing! I did some searching for development and broken windows and found that in 2007, a developer <a href="http://www.simonfl.com/2007/11/broken-windows-theory-for-software.html">talked about Broken Window Theory</a>: </p>
<blockquote><p>People are reluctant to break something that works, but not so much when it doesn&#8217;t. If the build is already broken, then people won&#8217;t spend much time making sure their change doesn&#8217;t break it (well, break it further). But if the build is pristine green, then they will be very careful about it.</p></blockquote>
<p>In 2005, Jeff Atwood <a href="http://www.codinghorror.com/blog/2005/06/the-broken-window-theory.html">mentioned</a> the <a href="http://www.codinghorror.com/blog/files/Atlantic%20Monthly%20-%20Broken%20Windows.htm">original source</a>, and said &#8220;Maybe we should be sweating the small stuff.&#8221; </p>
<p>That stuck with me because I admit that I focus on the little details first. I try to fix and automate where I can, but for political or practical reasons, I often am unable to make the comprehensive system changes I&#8217;d like to see.</p>
<p>So, given that most of us live in the real world where some things are just left undone, where do we draw the line? What do we consider a bit of acceptable street litter, and what do we consider a broken window? When is it ok to just reboot the system, and when do you really need to figure out exactly what went wrong?</p>
<p>This decision making process is often the difference between a productive work day, and one filled with frustration.</p>
<p>The strategies that we use to make this choice are probably the most important aspects of system administration and devops today. There, of course, is never a single right answer for every business. But I&#8217;m sure there are some themes. </p>
<p>For example:</p>
<ul>
<li>My boss wrote about <a href="http://tech.myemma.com/python-pep8-git-hooks/">PEP8 and standards in formatting code</a>, and automating this with a githook.</li>
<li>PostgreSQL code <a href="http://git.postgresql.org/gitweb?p=postgresql.git&#038;a=search&#038;h=HEAD&#038;st=commit&#038;s=pgindent">goes through a reformatting pass</a> before we release.</li>
<li>Etsy <a href="http://codeascraft.etsy.com/2010/12/08/track-every-release/">tracks their PHP warnings</a> for every release</li>
</ul>
<p>James posted &#8220;<a href="http://www.kartar.net/2010/03/james-whites-rules-for-infrastructure/">Rules for Infrastructure</a>&#8221; just the other day, which is a repost of the <a href="https://gist.github.com/161265">original gist</a>. What I like about this is that they are phrased philosophically: here are the lines in the sand, and the definitions that we&#8217;re all going to agree to. </p>
<p>Where do you draw the line? And how do you communicate to your colleagues where the line is?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2011/03/02/broken-windows-broken-code-broken-systems/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Customizing the RPMs from pgrpms.org</title>
		<link>http://www.chesnok.com/daily/2010/08/03/customizing-the-rpms-from-pgrpms-org/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=customizing-the-rpms-from-pgrpms-org</link>
		<comments>http://www.chesnok.com/daily/2010/08/03/customizing-the-rpms-from-pgrpms-org/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 02:00:23 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[postgres]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[pgrpms]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/?p=1862</guid>
		<description><![CDATA[TweetTo pick up where Devrim left off in customizing RPMs, here are some more tips for getting your very own RPMs built: Create a VM with your favorite operating system (I&#8217;m using versions of CentOS). I need both 32-bit OS &#8230; <a href="http://www.chesnok.com/daily/2010/08/03/customizing-the-rpms-from-pgrpms-org/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton1862" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2010%2F08%2F03%2Fcustomizing-the-rpms-from-pgrpms-org%2F&amp;text=Customizing%20the%20RPMs%20from%20pgrpms.org&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2010%2F08%2F03%2Fcustomizing-the-rpms-from-pgrpms-org%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>To pick up <a href="http://people.planetpostgresql.org/devrim/index.php?/archives/44-How-To-Build-Your-Own-PostgreSQL-and-related-software-RPMs-on-CentOSRHELFedora.html">where Devrim left off</a> in customizing RPMs, here are some more tips for getting your very own RPMs built:</p>
<ul>
<li>Create a VM with your favorite operating system (I&#8217;m using versions of CentOS). I need both 32-bit OS and 64-bit OS. This is much easier to manage with separate, local VMs.
</li>
<li>Install spectool (<a href="http://packages.sw.be/spectool/">available here</a>), and SVN
</li>
<li>The other dependancies were: gcc glibc-devel bison flex python-devel tcl-devel readline-devel zlib-devel openssl-devel krb5-devel e2fsprocs-devel libxml2-devel libxslt-devel pam-devel
</li>
<li>Edit the postgresql-$VERSION.spec file to your liking: If you&#8217;re adding patches, you need to add them in TWO places &#8211; first in the Patch#: group, and then again below where the %patch# series starts. Finally, if you&#8217;re adding an entirely new package (say in 8.2, pg_standby in contrib), you&#8217;ll need to also add the binary (or library, or whatever) to the appropriate %files clause later in the spec file.  It&#8217;s also a good idea to modify &#8216;Release&#8217;. Here&#8217;s a sample diff of my spec file:
</li>
</ul>
<p><code><br />
--- postgresql-8.2.spec (revision 188)<br />
+++ postgresql-8.2.spec (working copy)<br />
@@ -74,7 +74,7 @@<br />
 Summary:       PostgreSQL client programs and libraries<br />
 Name:          postgresql<br />
 Version:       8.2.17<br />
-Release:       1PGDG%{?dist}<br />
+Release:       1test%{?dist}<br />
 License:       BSD<br />
 Group:         Applications/Databases<br />
 Url:           http://www.postgresql.org/<br />
@@ -95,7 +95,9 @@<br />
 Patch4:                postgresql-test.patch<br />
 Patch6:                postgresql-perl-rpath.patch<br />
 Patch8:                postgresql-prefer-ncurses.patch<br />
+Patch7:                postgresql-pgstat-dir.patch<br />
 Patch9:                postgresql-use-zoneinfo.patch<br />
+Patch10:               pg_standby.patch</p>
<p> Buildrequires: perl glibc-devel bison flex<br />
 Requires:      /sbin/ldconfig initscripts<br />
@@ -282,7 +284,9 @@<br />
 %patch4 -p1<br />
 %patch6 -p1<br />
 %patch8 -p1<br />
+%patch7 -p1<br />
 %patch9 -p1<br />
+%patch10 -p1</p>
<p> pushd doc<br />
 tar -zcf postgres.tar.gz *.html stylesheet.css<br />
@@ -604,6 +608,7 @@<br />
 %{_bindir}/pg_controldata<br />
 %{_bindir}/pg_ctl<br />
 %{_bindir}/pg_resetxlog<br />
+%{_bindir}/pg_standby<br />
 %{_bindir}/postgres<br />
 %{_bindir}/postmaster<br />
 %{_mandir}/man1/initdb.*<br />
</code></p>
<p>How have you customized RPMs using this repo? Share your .spec files!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2010/08/03/customizing-the-rpms-from-pgrpms-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ptop &#8211; meeting summary from last nights pdxpug</title>
		<link>http://www.chesnok.com/daily/2007/11/16/ptop-meeting-summary-from-last-nights-pdxpug/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ptop-meeting-summary-from-last-nights-pdxpug</link>
		<comments>http://www.chesnok.com/daily/2007/11/16/ptop-meeting-summary-from-last-nights-pdxpug/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 18:04:04 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[pdxpug]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[user groups]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/2007/11/16/ptop-meeting-summary-from-last-nights-pdxpug/</guid>
		<description><![CDATA[TweetLast night&#8217;s meeting was about ptop and Mark Wong&#8217;s efforts to make an interactive, command-line tool for monitoring the current status of a PostgreSQL database. For our meeting, Mark set up a test operating system on a USB drive, and &#8230; <a href="http://www.chesnok.com/daily/2007/11/16/ptop-meeting-summary-from-last-nights-pdxpug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton175" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F11%2F16%2Fptop-meeting-summary-from-last-nights-pdxpug%2F&amp;text=ptop%20%26%238211%3B%20meeting%20summary%20from%20last%20nights%20pdxpug&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F11%2F16%2Fptop-meeting-summary-from-last-nights-pdxpug%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Last night&#8217;s meeting was about <a href="http://pgfoundry.org/projects/ptop">ptop</a> and Mark Wong&#8217;s efforts to make an interactive, command-line tool for monitoring the current status of a PostgreSQL database.</p>
<p>For our meeting, Mark set up a test operating system on a USB drive, and bravely demo&#8217;d his new software.</p>
<p>Mark got the idea for ptop a few months ago, and went looking for the source code to top to get started. After a few days of hacking, he had a some useful features he wanted to share. So, he&#8217;s set up a project and started gathering developers:</p>
<p><a href="http://pgfoundry.org/projects/ptop">http://pgfoundry.org/projects/ptop</a></p>
<p>The features currently supported include displaying:</p>
<ul>
<li>Current queries</li>
<li>Query plans</li>
<li>Locks</li>
<li>User table statistics</li>
<li>User index statistics</li>
</ul>
<p><span id="more-175"></span></p>
<p>One feature I particularly liked was showing deltas of statistics over time. So you set your ptop sampling interval to some value (i.e. 5 seconds) and then you can see, for example, user table statics<br />
changing over time. This is something I wrote some perl scripts for, but would love to have as a standard utility.  Particularly if I could log/graph it.</p>
<p>Currently, ptop is only compiling on Linux. I really want it on Mac OS X.</p>
<p>We came up with a short list of desired features for the next revision of ptop:</p>
<ul>
<li>Change command line options to match psql (-U for user, -p for port, etc)</li>
<li>Add command to show table (basically \dt [tablename]) for non-query processes</li>
<li>Enable arrow keys to move around in the content to select, instead<br />
of cut/paste process ID</li>
<li>Log the stats deltas over time (i would be very interested in this)</li>
<li>Change lock query to use an OUTER JOIN to show &#8220;waiting&#8221; locks that<br />
aren&#8217;t granted
</li>
</ul>
<p>And just a general question that came up:</p>
<ul>
<li>Is it possible to peek at a currently executing SELECT statement&#8217;s plan?<br />
       &#8211; We all agreed that this would be awesome.</li>
</ul>
<p>Thanks for a great meeting.</p>
<hr />
<p>Thank you Mark &#038; Gabrielle for sending out meeting announcements this month.</p>
<p>NEXT MEETING: DIFFERENT DATE AND TIME!</p>
<p><a href="http://pdxgroups.pbwiki.org/2007%20December%20Coders%20Social">December Coders Bash</a><br />
Tuesday, December 11, 2007<br />
CubeSpace, 622 SE Grand Ave., Portland OR 97214</p>
<p>Sam from the PHP Users group started organizing a group event in<br />
December, inviting folks from all the different users groups to come<br />
and socialize.</p>
<p>ALSO a HACKATHON:<br />
Gabrielle, Mark and I thought it would be awesome to have a ptop HackAThon the weekend after Thanksgiving. Some possible features we&#8217;d work on are below. Anyone interested? Get in touch.  I was thinking the early afternoon on Saturday, or early evening on Sunday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2007/11/16/ptop-meeting-summary-from-last-nights-pdxpug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>psql and file, CSV exports</title>
		<link>http://www.chesnok.com/daily/2007/10/13/psql-and-file-csv-exports/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=psql-and-file-csv-exports</link>
		<comments>http://www.chesnok.com/daily/2007/10/13/psql-and-file-csv-exports/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 23:53:20 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[postgresql]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/2007/10/13/psql-and-file-csv-exports/</guid>
		<description><![CDATA[TweetGabrielle and I met to talk about some projects today. She brought up a couple questions that were raised about differences between MySQL and PostgreSQL syntax for data export. She showed me \pset fieldsep and \pset format for controlling interactive &#8230; <a href="http://www.chesnok.com/daily/2007/10/13/psql-and-file-csv-exports/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton159" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F10%2F13%2Fpsql-and-file-csv-exports%2F&amp;text=psql%20and%20file%2C%20CSV%20exports&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F10%2F13%2Fpsql-and-file-csv-exports%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Gabrielle and I met to talk about some projects today. She brought up a couple questions that were raised about differences between MySQL and PostgreSQL syntax for data export. </p>
<p>She showed me <code>\pset fieldsep</code> and <code>\pset format</code> for controlling interactive output from <code>SELECTS</code> (see <a href="http://www.postgresql.org/docs/current/static/app-psql.html">psql documentation</a>).  You might say: <code>\pset fieldsep ,</code> (although that wouldn&#8217;t be CSV.. but it&#8217;s quick and dirty). And <code>\pset format</code> offers <code>unaligned, aligned, html, latex, or troff-ms</code>. There are several shortcuts available &#8211; <code>\a</code> for aligned/unaligned. A combination of <code>\pset fieldsep</code> and <code>\a</code> gets you nearly to CSV.</p>
<p>Then we took a look at the <a href="http://www.postgresql.org/docs/8.2/static/sql-copy.html">COPY</a> command and our options there. That&#8217;s when we discovered this: </p>
<blockquote><p>
<code><br />
COPY { tablename [ ( column [, ...] ) ] | ( <font color="red">query</font> ) }<br />
    TO { 'filename' | STDOUT }<br />
</code>
</p></blockquote>
<p>See that <font color="red">query</font>?  Yeah, super sweet. This feature was new in version 8.2. (<a href="http://www.postgresql.org/developer/beta">8.3 beta</a> is out now!)<br />
 Now you can run a command like: </p>
<blockquote><p>
<code><br />
COPY (SELECT param1, param2, param3 from myview) TO STDOUT WITH CSV;<br />
</code>
</p></blockquote>
<p>Or you can replace STDOUT with a file path. <code>\copy</code> supports the same syntax. This is a reasonable alternative to MySQL&#8217;s <code>SELECT INTO OUTFILE</code>. And the feature has been there for at least a year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2007/10/13/psql-and-file-csv-exports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>non-profits and systems administration</title>
		<link>http://www.chesnok.com/daily/2007/08/11/non-profits-and-systems-administration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=non-profits-and-systems-administration</link>
		<comments>http://www.chesnok.com/daily/2007/08/11/non-profits-and-systems-administration/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 04:38:48 +0000</pubDate>
		<dc:creator>selena</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.chesnok.com/daily/2007/08/11/non-profits-and-systems-administration/</guid>
		<description><![CDATA[TweetWouldn&#8217;t it be great if the non-profit world could embrace free software? In my head, I&#8217;ve seen a giant Venn diagram labeled &#8220;VALUES&#8221; with Open Source/Free Software overlapping significantly with the of non-profits. Here&#8217;s a small one: I think that &#8230; <a href="http://www.chesnok.com/daily/2007/08/11/non-profits-and-systems-administration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton118" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F08%2F11%2Fnon-profits-and-systems-administration%2F&amp;text=non-profits%20and%20systems%20administration&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.chesnok.com%2Fdaily%2F2007%2F08%2F11%2Fnon-profits-and-systems-administration%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.chesnok.com/daily/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Wouldn&#8217;t it be great if the non-profit world could embrace free software? In my head, I&#8217;ve seen a giant Venn diagram labeled &#8220;VALUES&#8221; with Open Source/Free Software overlapping significantly with the  of non-profits. Here&#8217;s a small one:<br />
<center><img alt="nonprofit open source venn diagram" id="image119" src="http://www.chesnok.com/daily/wp-content/uploads/2007/08/picture-15.thumbnail.png" /></center>I think that non-profits are certainly not ignorant of open source. In Oregon, our legislators tried to pass a <a href="http://www.newsforge.com/article.pl?sid=03/03/06/018222&#038;mode=thread&#038;tid=4">bill</a> that required F/OSS alternatives to commercial software to be considered for every software purchase. Then, the story goes, the <a href="http://news.com.com/2100-1012-996210.html">guys from Redmond</a> came down and talked them out of it. <a href="http://www.nosi.net/">NOSI</a> has been around for a few years, and I come across forums or blogs like <a href="http://www.techsoup.org/">techsoup</a> daily.</p>
<p>The problem is implementation and systems support. Administration is where the car goes off the rails for non-profits. Qualified open source admins are not necessarily available to non-profits &#8211; I&#8217;m not sure exactly why, but I&#8217;d bet cost is a big reason.</p>
<p>Non-profits often receive equipment and software donations from the community, with little technical experience to maintain them. Most of the donations are commercial software with expensive licenses. There are a few tech support groups popping up that cater to non-profits (lower prices, focus on maintaining &#8211; not upgrading).</p>
<p>We have <a href="http://www.freegeek.org">FreeGeek</a> here in Portland. But there are still many non-profits who don&#8217;t or can&#8217;t use their services. I wish that there was a &#8220;server-in-a-box&#8221; setup that office managers would feel comfortable maintaining. Filesharing is so ubiquitous and necessary, it is unreasonable to expect that every office that needs filesharing will have a &#8220;qualified&#8221; systems administrator to maintain the server.</p>
<p>I guess my question is &#8211; is there a set of software apps that could be given to small- to mid- size non-profits as a replacement for commercial/non-free software?</p>
<p>Off the top of my head, I would want:</p>
<p>* Ubuntu Linux for client/server<br />
* Firefox for a web browser<br />
* Zimbra or Chandler/Cosmo for email and calendaring<br />
* WebDav and SMB filesharing<br />
* Subversion auto-versioning support on sharepoints<br />
* Something like once:radix for a Filemaker-like database interface<br />
* Accounting software?<br />
That would all be pretty tough for a non-profit to maintain. I wonder about packaging those things together. Would it be worth it?</p>
<p>And then, once it was put together, how do we create a system where non-profits either have access to qualified sysadmins or can administrate everything themselves?</p>
<p>I&#8217;ve done a little research into non-profit/tech forums and organizations, but not nearly enough to know everything about what&#8217;s already out there. I&#8217;m very interested in pursuing this idea, maybe just for the sake of the few non-profits I work with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chesnok.com/daily/2007/08/11/non-profits-and-systems-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

