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

  <title><![CDATA[dewey.ws]]></title>
  <link href="http://dewey.ws/atom.xml" rel="self"/>
  <link href="http://dewey.ws/"/>
  <updated>2011-11-27T22:14:17-08:00</updated>
  <id>http://dewey.ws/</id>
  <author>
    <name><![CDATA[retr0h]]></name>
    <email><![CDATA[blog@dewey.ws]]></email>
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Public IP Address Discovery With Chef and Ohai]]></title>
    <link href="http://dewey.ws/blog/2011/10/27/public-ip-address-discovery-with-chef-and-ohai/"/>
    <updated>2011-10-27T22:01:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/10/27/public-ip-address-discovery-with-chef-and-ohai</id>
    <content type="html"><![CDATA[<p>I am currently automating the deployment and configuration of a moderately complex service architecture.  <a href="https://github.com/opscode/ohai">Ohai</a>, currently has no way to discover a systems public (floating) ip address in an <a href="http://www.openstack.org/">OpenStack</a> environment.  The ability to discover this information helps with additional automation (eg. Provisioning dns in <a href="http://dyn.com/">DynECT</a>).</p>

<p>This <a href="https://github.com/retr0h/ohai/blob/master/floating_plugin.rb">Ohai plugin</a> is a semi-poor attempt at discovering a guest&#8217;s public ipaddress.</p>

<p><strong>Update: Fri Nov 11 2011</strong></p>

<p>Looks like Ohai already attempts to capture this information from the meta-data server.  However, this fails due to MAC address not matching.  Updated the previously discussed plugin to capture the floating IP from the meta-data server.  Also, have it following the same API as the eucalyptus plugin.</p>

<pre><code>https://github.com/opscode/ohai/blob/master/lib/ohai/plugins/eucalyptus.rb
</code></pre>

<p>Usage is as follows:</p>

<div><script src='https://gist.github.com/1399227.js?file='></script>
<noscript><pre><code>$ knife search node 'name:i-0000010f' -a eucalyptus.public_ipv4
1 items found

eucalyptus.public_ipv4:  XX.55.66.48
id:                      i-0000010f</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Zkpython and Homebrew]]></title>
    <link href="http://dewey.ws/blog/2011/08/29/zkpython-and-homebrew/"/>
    <updated>2011-08-29T22:54:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/08/29/zkpython-and-homebrew</id>
    <content type="html"><![CDATA[<p>Ran into the following error on OSX, when trying to pip install a <a href="https://github.com/mxcl/homebrew">Homebrew</a> installed version of <a href="http://zookeeper.apache.org/">ZooKeeper</a>&#8217;s zkpython.</p>

<pre><code>zookeeper.c:20:23: error: zookeeper.h: No such file or directory
</code></pre>

<p>Was able to install by providing the &#8216;C_INCLUDE_PATH&#8217; to pip.</p>

<div><script src='https://gist.github.com/1117566.js?file='></script>
<noscript><pre><code>BREW_HOME=$HOME/.homebrew

    $ brew install zookeeper
    $ C_INCLUDE_PATH=${BREW_HOME}/Cellar/zookeeper/3.3.3/include/c-client-src/ pip install zkpython</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Using Netcat to Open Ports]]></title>
    <link href="http://dewey.ws/blog/2011/08/14/using-netcat-to-open-ports/"/>
    <updated>2011-08-14T20:58:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/08/14/using-netcat-to-open-ports</id>
    <content type="html"><![CDATA[<p>I find it useful to easily open a port, to test access controls.  Configuring a webserver or iptables to redirect to a known running port is cumbersome.  The following has proved useful many times.</p>

<pre><code>$ echo "open port" |nc -l 8080
</code></pre>

<p>Verification can be done with telnet or netcat.</p>

<pre><code>$ telnet example.com 8080
Trying example.com...
Connected to example.com.
Escape character is '^]'.
open port
Connection closed by foreign host.

$ nc example.com 8080
open port
</code></pre>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nokogiri RVM Homebrew]]></title>
    <link href="http://dewey.ws/blog/2011/08/13/nokogiri-rvm-homebrew/"/>
    <updated>2011-08-13T14:45:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/08/13/nokogiri-rvm-homebrew</id>
    <content type="html"><![CDATA[<p>Having problems getting <a href="http://nokogiri.org/">Nokogiri</a> to compile on OSX with <a href="https://github.com/mxcl/homebrew">Homebrew</a>?</p>

<div><script src='https://gist.github.com/1001477.js?file='></script>
<noscript><pre><code>BREW_HOME=$HOME/.homebrew

$ brew install libxml2
$ brew link libxml2
$ brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rb
$ brew link libxslt
$ brew install libiconv
$ brew link libiconv
$ gem install nokogiri -- --with-xml2-dir=$BREW_HOME/Cellar/libxml2/2.7.8 --with-xslt-dir=$BREW_HOME/Cellar/libxslt/1.1.26 --with-iconv-dir=$BREW_HOME/Cellar/libiconv/1.13.1/</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Openstack Image Uploader]]></title>
    <link href="http://dewey.ws/blog/2011/08/13/openstack-image-uploader/"/>
    <updated>2011-08-13T14:03:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/08/13/openstack-image-uploader</id>
    <content type="html"><![CDATA[<p>My co-worker and best pal <a href="https://twitter.com/kevinbringard">Kevin</a> wrote a <a href="https://github.com/kevinbringard/OpenStack-tools/blob/master/glance-uploader.bash">script</a> to upload images into <a href="http://www.openstack.org/">OpenStack&#8217;s </a> <a href="https://launchpad.net/glance">Glance</a>.  He recently released the script as the <a href="https://github.com/kevinbringard/ogler">ogler</a> rubygem.  It is a straight forward script, built on the <a href="https://github.com/kevinbringard/ogle">ogle</a> library.  Our friends at <a href="http://www.opscode.com/">Opscode</a> contacted Kevin, and are planning to distribute it in some fashion.</p>

<p>Uploading directly into Glance allows the setting of <a href="http://glance.openstack.org/glanceapi.html">metadata</a>, it also avoids the unnecessary steps behind &#8216;euca-bundle-image&#8217; (<a href="https://launchpad.net/swift">object store</a> upload -> unbundle -> Glance upload).</p>

<h2>Usage</h2>

<p>Install the rubygem:</p>

<pre><code>$ gem install ogler
</code></pre>

<p>To upload a x86_64 Ubuntu 11.04 ami and 2.6.35 aki:</p>

<pre><code>$ ogler -i &lt;ami&gt; -k &lt;aki&gt; -a x86_64 -e 2.6.35 -d ubuntu -v 11.04 -h &lt;Glance endpoint&gt;
</code></pre>

<p>Attaching additional metadata is as simple as appending key/value pairs:</p>

<pre><code>-c foo=bar,baz=qux
</code></pre>

<p>Glance uses decimal ids.  <a href="https://launchpad.net/nova">Nova</a> converts them to standard ami ids you&#8217;re used to, when queried through the EC2 API.  To view the metadata we query Glance for the image id:</p>

<pre><code>$ curl -i -X HEAD localhost:9292/v1.0/images/4
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Image-Meta-Property-Distro: Ubuntu
X-Image-Meta-Id: 4
X-Image-Meta-Property-Arch: amd64
X-Image-Meta-Deleted: False
X-Image-Meta-Container_format: ami
X-Image-Meta-Property-Uploader: root@enc1b11
X-Image-Meta-Location: file:///var/lib/glance/images/4
X-Image-Meta-Deleted_at: 
X-Image-Meta-Created_at: 2011-05-11T15:48:02
X-Image-Meta-Size: 1476395008
X-Image-Meta-Status: active
X-Image-Meta-Property-Type: machine
X-Image-Meta-Property-Kernel_name: natty-server-uec-amd64-vmlinuz-virtual
X-Image-Meta-Is_public: True
X-Image-Meta-Property-Kernel_id: 3
X-Image-Meta-Updated_at: 2011-05-11T15:48:08
X-Image-Meta-Checksum: b6149317c554d2c335365e7bd43e9bf0
X-Image-Meta-Property-Version: 11.04
X-Image-Meta-Disk_format: ami
X-Image-Meta-Name: ubuntu_11.04-amd64
Location: http://localhost:9292/v1/images/4
Etag: b6149317c554d2c335365e7bd43e9bf0
Date: Sun, 14 Aug 2011 17:57:48 GMT
</code></pre>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Giving Octopress a Try]]></title>
    <link href="http://dewey.ws/blog/2011/08/13/giving-octopress-a-try/"/>
    <updated>2011-08-13T12:45:00-07:00</updated>
    <id>http://dewey.ws/blog/2011/08/13/giving-octopress-a-try</id>
    <content type="html"><![CDATA[<p><a href="http://octopress.org/">Octopress</a> is quite impressive.</p>
]]></content>
  </entry>
  
</feed>

