<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>ape babble</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/" />
    <link rel="self" type="application/atom+xml" href="http://mykestubbs.com/blog/atom.xml" />
    <id>tag:mykestubbs.com,2009-01-05:/blog//1</id>
    <updated>2010-04-17T03:01:24Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.23-en</generator>

<entry>
    <title>Chef Client Installation On CentOS 5.4</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2010/04/chef-client-installation-on-ce.html" />
    <id>tag:mykestubbs.com,2010:/blog//1.14</id>

    <published>2010-04-09T21:12:35Z</published>
    <updated>2010-04-17T03:01:24Z</updated>

    <summary>Set up some variables we&apos;ll use throughout the install BASEARCH=$(uname -i) We need a newer version of Ruby than provided by CentOS/RHEL. Add appropriate repositories and install the packages. rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$BASEARCH/epel-release-5-3.noarch.rpm rpm -Uvh http://download.elff.bravenet.com/5/$BASEARCH/elff-release-5-3.noarch.rpm yum install -y ruby ruby-shadow...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="centos" label="centos" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="chef" label="chef" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="systems" label="systems" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>Set up some variables we'll use throughout the install</p>

<pre><code>BASEARCH=$(uname -i)</code></pre>

<p>We need a newer version of Ruby than provided by CentOS/RHEL. Add appropriate repositories and install the packages.</p>

<pre><code>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$BASEARCH/epel-release-5-3.noarch.rpm
rpm -Uvh http://download.elff.bravenet.com/5/$BASEARCH/elff-release-5-3.noarch.rpm
yum install -y ruby ruby-shadow ruby-ri ruby-rdoc gcc gcc-c++ ruby-devel</code></pre>

<p>With that complete, we want to install RubyGems from source as it's cross-platform and we know what to expect.</p>

<pre><code>cd /tmp
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar zxf rubygems-1.3.6.tgz
cd rubygems-1.3.6
ruby setup.rb
ln -sfv /usr/bin/gem1.8 /usr/bin/gem  # We may need this symlink if /usr/bin/gem doesn't exist</code></pre>

<p>Make sure the rubygems <span class="caps">EXECUTABLE</span>_DIRECTORY is in our <span class="caps">PATH</span></p>

<pre><code># gem env &amp;&amp; echo -e &quot;\nPath: $PATH&quot;
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby18
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /home/ymek/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources =&gt; true
     - :verbose =&gt; true
     - :benchmark =&gt; false
     - :backtrace =&gt; false
     - :bulk_threshold =&gt; 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
Path: /usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.3.4:/usr/games/bin:/home/ymek/development/sdks/flex_3.2/bin</code></pre>

<p>Create some config files to get chef-solo up and running</p>

<pre><code># cat /root/solo.rb
file_cache_path &quot;/tmp/chef-solo&quot;
cookbook_path &quot;/tmp/chef-solo/cookbooks&quot;
recipe_url &quot;http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz&quot;</code></pre>

<pre><code># cat /root/chef.json
{
    &quot;bootstrap&quot;: {
        &quot;chef&quot;: {
            &quot;url_type&quot;: &quot;http&quot;,
	    &quot;init_style&quot;: &quot;init&quot;,
	    &quot;path&quot;: &quot;/opt/lib/chef&quot;,
	    &quot;serve_path&quot;: &quot;/opt/lib/chef&quot;,
            &quot;server_fqdn&quot;: &quot;chef.server.com&quot;  # need a fqdn
        }
    },
    &quot;run_list&quot;: [ &quot;recipe[bootstrap::client]&quot; ]
}</code></pre>

<p>Add the Opscode gem source</p>

<pre><code>gem sources -a http://gems.opscode.com</code></pre>

<p>Install the chef gem.  This will also pull in some dependencies.</p>

<pre><code>gem install chef</code></pre>

<p>Bootstrap the client using Opscode's recipe.</p>

<pre><code># /usr/bin/chef-solo -c /root/solo.rb -j /root/chef.json</code></pre>

<p>Copy your server's validation.pem to /etc/chef/ on the client.  It's located in /etc/chef/validation.pem by default.  We also need to copy the init scripts over.</p>

<pre><code>cp /usr/lib64/ruby/gems/1.8/gems/chef-0.8.10/distro/redhat/etc/init.d/chef-client /etc/init.d/</code></pre>

<p><span class="caps">EDIT</span>:  The 0.8.10 release has an incorrect path for the chef-client pid file.  Let's fix that.</p>

<pre><code>/bin/sed -i '/\/var\/run\/chef\/client\.pid/\/var\/run\/chef\/chef-client\.pid/' /etc/init.d/chef-client</code></pre>

<p>Make the script executable and add it to the runtime services.</p>

<pre><code>chmod +x /etc/init.d/chef-client
chkconfig -a chef-client
chkconfig chef-client on</code></pre>

<p>The client will request validation from the server upon first run.  This will generate a client-specific key and save it to /etc/chef/client.pem.  After this happens, delete /etc/chef/validation.pem from the client machine</p>]]>
        
    </content>
</entry>

<entry>
    <title>Chef Server Installation On CentOS 5.4</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2010/03/chef-installation-on-centos-54.html" />
    <id>tag:mykestubbs.com,2010:/blog//1.11</id>

    <published>2010-03-04T16:49:20Z</published>
    <updated>2010-04-09T21:32:19Z</updated>

    <summary>Here at Grooveshark, we need to manage various types of servers with a varying set of dependencies and installed software suites (apache, mysql, hadoop, sphinx, etc). Here&apos;s how we got Chef up and running. All of the commands below assume...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="centos" label="centos" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="chef" label="chef" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="systems" label="systems" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>Here at Grooveshark, we need to manage various types of servers with a varying set of dependencies and installed software suites (apache, mysql, hadoop, sphinx, etc).  Here's how we got Chef up and running.  All of the commands below assume root privileges.</p>

<p>We need a newer version of Ruby than provided by CentOS/RHEL.  Add appropriate repositories and install the packages.</p>

<pre><code>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm
yum install -y ruby ruby-shadow ruby-ri ruby-rdoc gcc gcc-c++ ruby-devel</code></pre>

<p> With that complete, we want to install RubyGems from source as it's cross-platform and we know what to expect.</p>

<pre><code>cd /tmp
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar zxf rubygems-1.3.6.tgz
cd rubygems-1.3.6
ruby setup.rb
ln -sfv /usr/bin/gem1.8 /usr/bin/gem  # We may need this symlink if /usr/bin/gem doesn't exist</code></pre>

<p>Make sure the rubygems <span class="caps">EXECUTABLE</span>_DIRECTORY is in our <span class="caps">PATH</span></p>

<pre><code># gem env &amp;&amp; echo -e &quot;\nPath: $PATH&quot;
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.6
  - RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i386-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources =&gt; true
     - :verbose =&gt; true
     - :benchmark =&gt; false
     - :backtrace =&gt; false
     - :bulk_threshold =&gt; 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Path: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin</code></pre>

<p>Add the Opscode gem source</p>

<pre><code>gem sources -a http://gems.opscode.com</code></pre>

<p>Now we can install the chef gem.  This pulls in all gem dependencies as well.</p>

<pre><code>gem install chef</code></pre>

<p>The current release of merb (1.1.0) doesn't play nice with Chef.  Downgrade to a version which does (1.0.15)</p>

<pre><code>gem install merb-core merb-assets merb-haml merb-helpers merb-param-protection merb-slices -v=1.0.15
gem uninstall -I merb-core merb-assets merb-haml merb-helpers merb-param-protection merb-slices -v=1.1.0
</code></pre>

<p>Now that we have the basic framework in place, we'll use the Opscode cookbooks to handle setting up the rest of the server configuration.  We need to populate two files to make this happen. Other attributes of interest can be found in the <a href="http://github.com/opscode/cookbooks/blob/master/bootstrap/README.rdoc">bootstrap <span class="caps">README</span></a></p>

<pre><code># cat /root/solo.rb
file_cache_path &quot;/tmp/chef-solo&quot;
cookbook_path &quot;/tmp/chef-solo/cookbooks&quot;
recipe_url &quot;http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz&quot;</code></pre>

<pre><code># cat /root/chef.json
{
  &quot;bootstrap&quot;: {
    &quot;chef&quot;: {
      &quot;url_type&quot;: &quot;http&quot;,
      &quot;init_style&quot;: &quot;init&quot;,
      &quot;path&quot;: &quot;/opt/lib/chef&quot;,
      &quot;serve_path&quot;: &quot;/opt/lib/chef&quot;,
      &quot;server_fqdn&quot;: &quot;spacewalk.in.escapemg.com&quot;,
      &quot;webui_enabled&quot;: true
    }
  },
  &quot;run_list&quot;: [ &quot;recipe[bootstrap::server]&quot; ]
}</code></pre>

<p>The server should now know how to behave in a limited capacity.  We want to bring in the external recipe tarball.  This will bring up the Chef Server environment.</p>

<pre><code>chef-solo -c ~/solo.rb -j ~/chef.json </code></pre>

<p>We want to make sure we're using the proper validator before firing everything up.  edit /etc/chef/server.rb and make sure "validate_client_name" is  set to "chef-validator"</p>

<p>Now, copy some default configurations over, register services that go with them, and start everything up. </p>

<pre><code>useradd chef
chown chef:chef -R /srv/chef
chown -Rv chef:chef /etc/chef/
chown -Rv chef:chef /var/chef/ca/
cp /usr/lib/ruby/gems/1.8/gems/chef-0.8.0/distro/redhat/etc/sysconfig/* /etc/sysconfig
cp /usr/lib/ruby/gems/1.8/gems/chef-0.8.0/distro/redhat/etc/init.d/* /etc/init.d
chmod +x /etc/init.d/chef-*

for svc in solr solr-indexer server server-webui
do
  chmod +x /etc/init.d/chef-${svc}
  chkconfig --add chef-${svc}
  chkconfig chef-${svc} on
  service chef-${svc} start
done</code></pre>]]>
        
    </content>
</entry>

<entry>
    <title>Autoloading Facebook&apos;s PHP Classes</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2009/12/autoloading-facebooks-php-clas.html" />
    <id>tag:mykestubbs.com,2009:/blog//1.10</id>

    <published>2009-12-04T13:59:06Z</published>
    <updated>2009-12-04T14:22:49Z</updated>

    <summary>Being the lead developer of ShareSong has given me a chance to become fairly familiar with Facebook&apos;s PHP client library. From the moment I began using the library I had one major complaint: cludgy integration. We use an autoloader within...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="facebookdevelopmentphpautoload" label="facebook development php autoload" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>Being the lead developer of <a href="http://facebook.com/ShareSong">ShareSong</a> has given me a chance to become fairly familiar with Facebook's <span class="caps">PHP </span>client library.  From the moment I began using the library I had one major complaint:  cludgy integration.</p>

<p>We use an autoloader within our <span class="caps">PHP </span>frameworks to instantiate objects without manually requiring every class file.  As such, I can include my conf.php and create a <code>new Facebook(FB_APIKEY, FB_SECRET);</code> and php can magically figure out that class is within a file called Facebook.php within a specified lib directory.  Well, the Facebook platform's client library bundles several (albeit-related) classes into one file, they do not follow our mechanism of ProudCamels for classes, and otherwise make things messy.</p>

<p>Well, being me I decided to "fix" it.  So, here it is.  Extract it, pop it into your app's library directory and viola!  A library client that autoloads and is, beyond some case changes to class-names and restructuring, a completely Facebook-authored <span class="caps">PHP </span>client!<br />
<span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://mykestubbs.com/blog/2009/12/04/Facebook-Platform.tar.gz">Facebook-Platform.tar.gz</a></span></p>]]>
        
    </content>
</entry>

<entry>
    <title>Grooveshark 2.0</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2009/08/grooveshark-20.html" />
    <id>tag:mykestubbs.com,2009:/blog//1.9</id>

    <published>2009-08-21T23:16:28Z</published>
    <updated>2009-08-21T23:19:47Z</updated>

    <summary>Grooveshark 2.0 is coming. Here&apos;s a taste. =)...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>Grooveshark 2.0 is coming.  Here's a taste.  =)<br />
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://mykestubbs.com/blog/assets_c/2009/08/gs_screen01-3.html" onclick="window.open('http://mykestubbs.com/blog/assets_c/2009/08/gs_screen01-3.html','popup','width=1366,height=768,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://mykestubbs.com/blog/assets_c/2009/08/gs_screen01-thumb-600x337-3.png" width="600" height="337" alt="gs_screen01.png" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span></p>]]>
        
    </content>
</entry>

<entry>
    <title>Grooveshark Dev</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2009/01/grooveshark-dev.html" />
    <id>tag:mykestubbs.com,2009:/blog//1.7</id>

    <published>2009-01-05T14:10:03Z</published>
    <updated>2009-01-05T14:13:04Z</updated>

    <summary>For the last few months, I have been working with Escpae Media Group; a young company whose flagship product is Grooveshark. It&apos;s very exciting to be a part of such a wonderful and youthful team. We&apos;re going places, and you...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="grooveshark" label="grooveshark" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="music" label="music" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>For the last few months, I have been working with Escpae Media Group;  a young company whose flagship product is <a href="http://grooveshark.com">Grooveshark</a>.  It's very exciting to be a part of such a wonderful and youthful team.  We're going places, and you should all come with us.</p>]]>
        
    </content>
</entry>

<entry>
    <title>How the mighty have fallen</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2008/07/how-the-mighty-have-fallen.html" />
    <id>tag:mykestubbs.com,2008:/blog//1.6</id>

    <published>2008-07-19T06:08:09Z</published>
    <updated>2008-07-19T06:12:46Z</updated>

    <summary>Not only have we polluted this planet, we&apos;ve cluttered the atmosphere surrounding it. Call me a hippie, but wtf?...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="china" label="china" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pollution" label="pollution" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="space" label="space" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>Not only have we polluted this planet, <a href="http://blogs.discovery.com/news_space/2008/07/earths-ringed-w.html">we've cluttered the atmosphere surrounding it</a>.  Call me a hippie, but wtf?</p>]]>
        
    </content>
</entry>

<entry>
    <title>Parallel?</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2008/04/parallel.html" />
    <id>tag:mykestubbs.com,2008:/blog//1.5</id>

    <published>2008-04-02T04:01:48Z</published>
    <updated>2008-04-02T04:09:03Z</updated>

    <summary>I wonder what Hillary was thinking when she decided to liken herself to Rocky in Philadelphia. In this BBC News article Senator Clinton is quoted: &quot;When it comes to finishing a fight, Rocky and I have a lot in common....</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
    <category term="hillaryclinton" label="hillary clinton" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="politics" label="politics" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>I wonder what Hillary was thinking when she decided to liken herself to Rocky in Philadelphia.  In <a href="http://news.bbc.co.uk/2/hi/americas/7325342.stm">this <span class="caps">BBC</span> News article</a> Senator Clinton is quoted: "When it comes to finishing a fight, Rocky and I have a lot in common. I never quit."  The determination is admirable.  Let us not forget:  Rocky lost.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Sound Blaster Audigy LS and Linux</title>
    <link rel="alternate" type="text/html" href="http://mykestubbs.com/blog/2007/08/sound-blaster-audigy-ls-and-li.html" />
    <id>tag:mykestubbs.com,2007:/blog//1.2</id>

    <published>2007-08-06T02:29:13Z</published>
    <updated>2007-08-07T00:26:49Z</updated>

    <summary>I am a Gentoo user and, as such, have had some troubles in the past getting my sound cards to work with 5.1 sound. However those days have come to a close! Configure/make/install a kernel and configure alsa in accordance...</summary>
    <author>
        <name>Myke</name>
        
    </author>
    
        <category term="linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="audigy" label="audigy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ca0106" label="ca0106" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="soundblaster" label="sound blaster" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="surroundsound" label="surround sound" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://mykestubbs.com/blog/">
        <![CDATA[<p>I am a Gentoo user and, as such, have had some troubles in the past getting my sound cards to work with 5.1 sound. However those days have come to a close!</p>
<p>Configure/make/install a kernel and configure alsa in accordance with the <a href="http://www.gentoo.org/doc/en/alsa-guide.xml" title="Gentoo Linux ALSA Guide">Gentoo Linux <span class="caps">ALSA</span> Guide</a>. Configuration is fairly simple and mostly follows standard kernel build procedures;  don't forget to update your modules.  Reboot into this new kernel.  At this point, Audacious was throwing an error upon startup.  After multiple, unsuccessful attempts at fixing this problem, I gave up; sound was working and software volume is what I desired anyway.  A few days later, I revisited the issue and tried to load the sound driver for the Audigy LS (ca0106 chipset)</p><p><code>modprobe snd-ca0106</code></p><p>With all mixer devices properly configured, I moved on to 5.1 sound.  This has been excruciatingly painful in the past.  However, Gentoo proves worthwhile again (at least in documentation ;) with their <a href="http://gentoo-wiki.com/HOWTO_Surround_Sound" title="Surround Sound Howto">Linux Surround Sound Howto</a>.  I also found the information in <a href="http://www.halfgaar.net/surround-sound-in-linux" title="Surround Sound In Linux">this surround sound reference</a> valuable.  Adding the proper bits of code listed in the Gentoo howto to my .asoundrc, I now have 5.1 sound in Linux.  woot!</p>]]>
        
    </content>
</entry>

</feed>
