<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title></title>
  <link href="http://extraordinaire.me/atom.xml" rel="self"/>
  <link href="http://extraordinaire.me/"/>
  <updated>2011-12-14T21:01:42+00:00</updated>
  <id>http://extraordinaire.me/</id>
  <author>
    <name>Andrei Serdeliuc</name>
    
  </author>

  
  <entry>
    <title>Puppet: Load Dependent Resource in a Custom Provider</title>
    <link href="http://extraordinaire.me/blog/2011/12/14/puppet-load-dependent-resource-in-a-custom-provider/"/>
    <updated>2011-12-14T19:35:00+00:00</updated>
    <id>http://extraordinaire.me/blog/2011/12/14/puppet-load-dependent-resource-in-a-custom-provider</id>
    <content type="html">&lt;p&gt;Not sure if this is nuts, bad practice or just insane, but today I found myself in need to load the provider for a resource I was dependent on, in a custom provider.&lt;/p&gt;

&lt;p&gt;Take the following example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;provision {'worker':
  provider  =&amp;gt; 'puppet',
  provision =&amp;gt; 'worker.pp'
  require   =&amp;gt; Chroot['worker'],
  chroot    =&amp;gt; Chroot['worker']
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Let me give you some context: Puppet is running puppet inside a debootstrap lvm-snapshot schroot. I know, mental.&lt;/p&gt;

&lt;p&gt;I needed the instance of the chroot provider (in this case, the schroot provider), inside my &quot;provision&quot; provider so I can run the &lt;code&gt;puppet apply&lt;/code&gt; in the right schroot source.&lt;/p&gt;

&lt;p&gt;Anyway, here's how I've done it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def provision
  resource.catalog.resource('chroot', resource[:chroot].title).provider.source_exec(puppet_apply_cmd)
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is there a nicer way of doing this?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Puppet Error: No Ability to Determine if Debootstrap Exists</title>
    <link href="http://extraordinaire.me/blog/2011/12/13/puppet-error-no-ability-to-determine-if-debootstrap-exists/"/>
    <updated>2011-12-13T01:55:00+00:00</updated>
    <id>http://extraordinaire.me/blog/2011/12/13/puppet-error-no-ability-to-determine-if-debootstrap-exists</id>
    <content type="html">&lt;p&gt;I've just spend a fair bit of time trying to figure out what this error means while developing a new puppet type for Debootstrap.&lt;/p&gt;

&lt;p&gt;Turns out the error is actually very very obvious. It does mean that Puppet doesn't know how to check if my resource exists, simply implementing a &quot;exists?&quot; method on the new type solved the error.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Vagrant Error in API Call to Get_state</title>
    <link href="http://extraordinaire.me/blog/2011/08/27/vagrant-error-in-api-call-to-get_state/"/>
    <updated>2011-08-27T06:40:00+01:00</updated>
    <id>http://extraordinaire.me/blog/2011/08/27/vagrant-error-in-api-call-to-get_state</id>
    <content type="html">&lt;p&gt;I just updated Vagrant / VirtualBox and started getting weird errors whenever I tried to interact with the Vagrant environment. All the errors seemed to be API errors similar to &quot;Error in API call to get_state&quot;.&lt;/p&gt;

&lt;p&gt;This seems to be due to VirtualBox not being able to access some of it's machines. The fix is to open the GUI and remove the ones that are marked as &quot;Inaccessible&quot;.&lt;/p&gt;

&lt;p&gt;The issue wasn't caused by the upgrade, it was purely because I removed some of the boxes directly from the disk instead of doing it through VirtualBox.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>Google Search Appliance Not Saving Network Configuration</title>
    <link href="http://extraordinaire.me/blog/2011/08/18/google-search-appliance-not-saving-network-configuration/"/>
    <updated>2011-08-18T14:26:00+01:00</updated>
    <id>http://extraordinaire.me/blog/2011/08/18/google-search-appliance-not-saving-network-configuration</id>
    <content type="html">&lt;p&gt;We got our replacement GSA today. While trying to set it up, one of the first steps is to configure its IP address and gateway. If you ever have to do this and after you hit continue you just get a dead screen and when you refresh you're back to step one, use Firefox!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <title>SQL ORDER By</title>
    <link href="http://extraordinaire.me/blog/2011/08/17/sql-order-by/"/>
    <updated>2011-08-17T11:04:00+01:00</updated>
    <id>http://extraordinaire.me/blog/2011/08/17/sql-order-by</id>
    <content type="html">&lt;p&gt;&lt;em&gt;Have you ever had the need to shoot yourself in the foot?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here's a neat way of doing just that, with SQL. If you ever need to manually specify the order in an ORDER BY statement, you can do it like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SELECT * FROM `table_name`
ORDER BY ( CASE
    WHEN order_column = 2 THEN 0
    WHEN order_column = 1 THEN 1
    WHEN order_column = 3 THEN 2
END )
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  
  <entry>
    <title>Octopress - Blogging Like a Hacker</title>
    <link href="http://extraordinaire.me/blog/2011/08/01/octopress---blogging-like-a-hacker/"/>
    <updated>2011-08-01T15:06:00+01:00</updated>
    <id>http://extraordinaire.me/blog/2011/08/01/octopress---blogging-like-a-hacker</id>
    <content type="html">&lt;p&gt;Well, been offline for a while now, got a bit bored of the whole blogging thing, I didn't think I had that much time to write a fully-fledged article every time I had an idea. Wordpress and other &quot;blogging&quot; platforms tend to give me that feeling, that I have to write 3000 words for each idea I have.&lt;/p&gt;

&lt;p&gt;I hope that will be solved by Octopress and it's use of Markdown. I've been meaning to setup Jekyll and Github pages for a while now (a couple of months), but never got around to it. Thankfully, the cool guys at the Changelog gave Octopress a shout, and 20 minutes later I was up and running.&lt;/p&gt;

&lt;p&gt;If you're like me, and want something simple that does the job beautifully, you should really give it a try.&lt;/p&gt;
</content>
  </entry>
  
</feed>

