<?xml version="1.0" encoding="iso-8859-1"?>
        <?xml-stylesheet type="text/css" href="http://www.miek.nl/blog/"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>Filed under: stuff | Miek</title>
<atom:link href="http://www.miek.nl/blog/archives/stuff/index-rss.xml" rel="self" type="application/rss+xml" />
<link>http://www.miek.nl/blog</link>
<description>Thoughts on (technical) stuff</description>
<dc:language>en-us</dc:language>
<dc:creator>Miek Gieben</dc:creator>
<dc:date>2012-02-04T04:15:11+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://www.miek.nl/blog/archives/2011/12/16/tantalizing_glimpse_of_higgs_particle/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2011/12/16/tantalizing_glimpse_of_higgs_particle/index.html</guid>
<title>Tantalizing glimpse of Higgs particle</title>
<dc:date>2011-12-16T14:43:57+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> stuff</dc:subject>
<description><![CDATA[<p><img src="http://miek.nl/gfx/2011/H.jpg"/></p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2011/12/08/new_euro_symbol/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2011/12/08/new_euro_symbol/index.html</guid>
<title>New Euro symbol</title>
<dc:date>2011-12-08T17:41:53+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> stuff</dc:subject>
<description><![CDATA[<p><img src="http://miek.nl/gfx/2011/Euro_symbol.jpg"/></p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/06/11/hyves_friends/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/06/11/hyves_friends/index.html</guid>
<title>Hyves Friends</title>
<dc:date>2009-06-11T14:29:24+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> news, stuff</dc:subject>
<description><![CDATA[<p><a href="http://www.jacquesloonen.com/1/">Jacques</a> has made a nice
script which tries to discover <em>all</em> the people who have
an account with <a href="http://hyves.nl/">Hyves</a>. </p>

<p>Currently there are:</p>

<pre><code>$ bzcat miek.nl/downloads/2009/hyves.txt.bz2|wc -l
3169894
</code></pre>

<p>Already 3.1 million of them! Interested in 
<a href="http://miek.nl/downloads/2009/hyves.txt.bz2">the list</a>?
(17 MB download).</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2008/06/28/a_new_latex_style/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2008/06/28/a_new_latex_style/index.html</guid>
<title>a new LaTeX style</title>
<dc:date>2008-06-28T12:28:23+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> linux, stuff</dc:subject>
<description><![CDATA[<p>I've created a new latex style to mimic some old school UNIX manuals
I've been reading the past few months. It's a very plain style that
keeps out of your face. This in contrast with the 
<a href="http://www.miek.nl/blog/archives/2007/12/21/blockbook_cls_a_latex_class/index.html">blockbook style</a></p>

<p>This is how it looks:</p>

<p><img class="shift" width="100%" src="/gfx/2008/atroff.png" alt="screenshot from atroff rendered page"></p>

<p>You can read about it a <a href="http://www.miek.nl/downloads/atroff_howto.pdf">small howto
doc</a>. To use it, you will
also need <a href="http://www.miek.nl/downloads/atroff.cls">the class file</a>. </p>

<p><em>UPDATE</em>
I've updated the style file so that the <code>description</code> lists will be
indented with the same amount of space, no so more</p>

<pre><code>item1  explanation
longer item  explanation
</code></pre>

<p>but like this</p>

<pre><code>item1        explanation
longer item  explanation
even longer item
             explanation
</code></pre>

<p>This was done with the help of the <em>LaTeX Companion</em>. This is more in the
style of manpages (according to the <em>Companion</em>). See line 100 in
<code>atstyle.cls</code>.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2008/03/16/best_vim_tip_ever/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2008/03/16/best_vim_tip_ever/index.html</guid>
<title>Best VIM tip ever!</title>
<dc:date>2008-03-16T13:12:01+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> linux, stuff</dc:subject>
<description><![CDATA[<p>Vim tip 21 allows you to copy text between VIM session running in
different terminals! No more using your mouse to copy, just <code>yank</code> in 
one terminal and <code>paste</code> in another!</p>

<p>Put this in your <code>.vimrc</code>:</p>

<pre><code>set clipboard=unnamed
set go+=a
</code></pre>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2008/02/02/puppet_with_git/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2008/02/02/puppet_with_git/index.html</guid>
<title>puppet with git</title>
<dc:date>2008-02-02T14:40:36+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> linux, stuff</dc:subject>
<description><![CDATA[<p>I've worked with <em>cfengine</em> in the past and really like it. It really
cuts down on management for the systems that used it.
For my home network I thought I try something else, that something 
turned out to be <em>puppet</em>.</p>

<p>I must say that I already like it more than <em>cfengine</em> as you can write
much smaller <em>manifests</em>.</p>

<h2>goals</h2>

<p>I want to centralize the management of the files in /etc and I want to
keep track of changes of the file. For the management I'm going with
<em>puppet</em> and for the versioning I choose <em>git</em>. </p>

<p>My main puppet server is called <em>elektron.atoom.net</em>. The first client is also
<em>elektron.atoom.net</em> so this server is both server and client.</p>

<h3>initial setup</h3>

<p>First install puppet, I'm not going into much detail here. Next install
git. Then:</p>

<pre><code># cd /etc/puppet
# git-init-db
</code></pre>

<p>So you we have created a git-repository in /etc/puppet. The default puppet install
on Debian/Ubuntu places some of the following files in /etc/puppet:</p>

<pre><code>files/
fileserver.conf
manifests/
puppetd.conf
puppetmasterd.conf
</code></pre>

<p>In files/ you place whole files you want to manage with puppet - I will come to that later.
Important now are fileserver.conf, puppetd.conf  and puppetmasterd.conf.</p>

<h3>Setting up the master</h3>

<p>The master daemon is called <em>puppetmasterd</em> and is controlled with the following files:</p>

<p>fileserver.conf:</p>

<pre><code>[files]
  path /etc/puppet/files
      allow 192.168.1.2
      allow 127.0.0.1
</code></pre>

<p>The <em>path</em> statement tells puppetmasterd that it can find the files in the /etc/puppet/files directory.
I haven't touch the file <code>puppetmasterd.conf</code>, and gone with my distribution's default.</p>

<h3>The client</h3>

<p>The client is called puppetd and uses the <code>puppetd.conf</code> for its configuration. The only important
change I've made is that I've added <code>server=elektron.atoom.net</code> to it.</p>

<h2>Writing manifests</h2>

<p><code>puppet</code> works by reading <em>manifests</em> which then get 'executed' on the target system. I'm not
following the preferred set of directories as I consider those a bit overkill for my small setup.</p>

<p>In <code>/etc/puppet/manifests</code> I <em>do</em> have the following:</p>

<pre><code>etc.pp 
site.pp
</code></pre>

<p><code>site.pp</code> is the default file that gets read by <code>puppetmasterd</code>, in there you specify which hosts
(called <em>nodes</em> in puppet) get which configuration. As I only configure 1 machine at the moment
I only have:</p>

<pre><code>import "etc.pp"
node 'elektron.atoom.net' {
    include etc
}
</code></pre>

<p>The file <code>etc.pp</code> defines one class: <code>etc</code> which I include in the configuration for <em>elektron.atoom.net</em>.
For my other (soon to be added) machine called "foton" I will need another <code>node</code>-statement. I needed
to put the name <code>elektron.atoom.net</code> in single quotes to make this work, double quotes didn't cut it 
for me.</p>

<h3>etc.pp</h3>

<p>The file <code>etc.pp</code> looks like this: (I've added line numbers)</p>

<pre><code> 1  class etc {
 2      file { "/etc":
 3          source =&gt; "puppet://elektron.atoom.net/files/elektron/etc",
 4          recurse =&gt; true
 5      }
 6
 7      file { "/etc/inetd.conf": owner =&gt; root, group =&gt; root, mode  =&gt; 644,
7.5      source =&gt; "puppet://elektron.atoom.net/files/elektron/etc/inetd.conf"}
 8      file { "/etc/motd.tail": owner =&gt; root, group =&gt; root, mode  =&gt; 644,
8.5      source =&gt; "puppet://elektron.atoom.net/files/elektron/etc/inetd.conf"}
 9      
10      service { inetd:
11          ensure =&gt; true,
12          pattern =&gt; "/usr/sbin/inetd",
13          subscribe =&gt; FILE["/etc/inetd.conf"]
14      }
15
16      exec { "Create /etc/motd":
17          subscribe =&gt; FILE["/etc/motd.tail"],
18          logoutput =&gt; true,
19          refreshonly =&gt; true,
20          command =&gt; "/bin/uname -snrvm &gt; /var/run/motd; /bin/cat /etc/motd.tail &gt;&gt; /var/run/motd"
21      }
22  }
</code></pre>

<p>I will go by this line-by-line. </p>

<ul>
<li>1: define a new class called <code>etc</code>.</li>
<li>2: The concerns the file "/etc" - which ofcourse is a directory.</li>
<li>3: This defines what to put in this directory: namely files from <code>/etc/puppet/files/elektron/etc</code>. 
now all files in that directory will get copied to <code>/etc</code>. Note the source syntax uses <code>/etc/puppet</code>
as a basedir, alltough we've specified <code>/etc/puppet/files</code> in <code>fileserver.conf</code>.</li>
<li>4: <code>recurse</code> is used to say that all files in files/elektron/etc should be monited.</li>
<li>7: The files are named here so that they can be references by other puppet manifests.</li>
<li>7.5: Because I redefine the file <code>/etc/inetd.conf</code> I must tell puppet
where to find it.</li>
<li>8.5: And the same here for <code>/etc/motd.tail</code>.</li>
<li>10: I use this to tell <code>puppet</code> that if the file <code>/etc/inetd.conf</code> changes the service (daeamon) <code>inetd</code> 
should be restarted.</li>
<li>13: <code>subscribe</code>, watch the file <code>/etc/inetd.conf</code>. My personal preference is to write this with all 
capitals. For puppet only the first character needs to be uppercased.</li>
<li>16: Now I subscribe to <code>/etc/motd</code>.</li>
<li>20: when the file changes puppet needs to perform the following command.</li>
</ul>

<p>Now I only need to put my files in <code>/etc/puppet/files/elektron/etc</code> and
puppet will miror them in the real `/etc'. Note that ownership and permissions are also exactly copied.</p>

<h2>versioning</h2>

<p>As said I will be using <code>git</code> to version my files. This is relatively easy. First add the files
to your repository.</p>

<pre><code># cd /etc/puppet
# git-add files manifests
</code></pre>

<p>And then commit them:</p>

<pre><code># git-commit -a -m "committing my changes to /etc"
</code></pre>

<p>As <code>git</code> doesn't support the <code>$Id$</code> tags that you might know from CVS and subversion I just
change my files to include the text string <code>## configured with puppet ##</code>.</p>

<h1>Debugging and testing</h1>

<p>Just use:</p>

<pre><code># puppetmasterd -v
</code></pre>

<p>on the commandline and watch the output and correct any errors you might see.</p>

<p>The easiest way to debug and test <code>puppetd</code> was also on the commandline, with:</p>

<pre><code># puppetd -v -o
</code></pre>

<p>You will get a lot of output telling you what happens. You can also
debug a specific puppet manifest with:</p>

<pre><code># puppetd -v -o etc.pp
</code></pre>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2007/12/24/windows_c_fonts/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2007/12/24/windows_c_fonts/index.html</guid>
<title>Windows C fonts</title>
<dc:date>2007-12-24T00:45:03+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> stuff</dc:subject>
<description><![CDATA[<p>For the unix minded... I've bundled the C-fonts from windows Vista in
a nice package:</p>

<p><a href="/downloads/vista-c-fonts.tar.gz">windows C fonts</a></p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2007/12/22/non_blinking_cursor_in_vim/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2007/12/22/non_blinking_cursor_in_vim/index.html</guid>
<title>Non blinking cursor in VIM</title>
<dc:date>2007-12-22T19:33:50+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> stuff</dc:subject>
<description><![CDATA[<p>In the go'old days cursors didn't blink. I also don't like it. </p>

<p>I wanted to have a non-blinking, block cursor in (g)Vim, turns out the
following is needed:<br/>
<tt>set gcr=a:blinkwait0,a:block-cursor</tt></p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2007/12/22/a_dns_filesystem/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2007/12/22/a_dns_filesystem/index.html</guid>
<title>A DNS filesystem</title>
<dc:date>2007-12-22T19:32:22+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> stuff, dns(sec)</dc:subject>
<description><![CDATA[<p>This is (perl) FUSE program that creates a filesystem from the DNS, so
can walk in the <tt>nl/</tt> dir and just 'ls' the labels and 'cd'
to child zones. This is a <em>DNS Filesystem</em>.</p>

<p>It's pretty alpha, but it works. Comments are welcome:<br/>
<a href="/downloads/fusedns.pl">fusedns.pl</a>.</p>]]></description>

</item>
</channel>
</rss>

