<?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: site | Miek</title>
<atom:link href="http://www.miek.nl/blog/archives/site/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/02/12/ip6/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2011/02/12/ip6/index.html</guid>
<title>ip6</title>
<dc:date>2011-02-12T22:16:11+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>Finally have ip6 (albeit as a tunnel) up and running again, from
my home system:</p>

<pre><code>% ping6 open.nlnetlabs.nl 
PING open.nlnetlabs.nl(open.nlnetlabs.nl) 56 data bytes
64 bytes from open.nlnetlabs.nl: icmp_seq=1 ttl=61 time=7.32 ms
64 bytes from open.nlnetlabs.nl: icmp_seq=2 ttl=61 time=7.32 ms
64 bytes from open.nlnetlabs.nl: icmp_seq=3 ttl=61 time=7.36 ms
^C
</code></pre>

<blockquote>
  <p>Bloody shame I didn't do this sooner.</p>
</blockquote>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2010/02/28/upgrading_to_lucid/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2010/02/28/upgrading_to_lucid/index.html</guid>
<title>Upgrading to Lucid</title>
<dc:date>2010-02-28T14:47:24+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>I'm going to upgrade my server to the new Ubuntu and
make it 64 bit in the process. This means a complete
re-install. </p>

<p>This means I'm going to be offline for some time.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/06/27/upgrading_nanoblogger_on_ubuntu_jaunty/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/06/27/upgrading_nanoblogger_on_ubuntu_jaunty/index.html</guid>
<title>Upgrading nanoblogger on Ubuntu Jaunty</title>
<dc:date>2009-06-27T13:04:01+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<blockquote>
  <p>This is more an entry for future reference</p>
</blockquote>

<p>In Karmic the version of <code>nanoblogger</code> will be 3.4. So I figured, why wait? I
currently have some time, lets try to upgrade nanoblogger.</p>

<p>Also another nanoblogger <a href="http://www.xxzz.de">user</a> mailed me, saying 3.4 was
three times faster... but with <em>all</em> my custom tweaks for 3.3 I'm
hoping for the best.</p>

<p>With some packaging foo (had to install <code>quilt</code> and <code>debhelper</code> from
Karmic), I now have a <code>nanoblogger</code> package for Jaunty
(<code>dpkg-source</code>, <code>dpkg-buildpackage</code> and <code>dpkg</code> are your friends).</p>

<pre><code> sudo dpkg -i nanoblogger_3.4-1_all.deb
</code></pre>

<p>OKay, no errors, only one config question....</p>

<pre><code>nb -l
</code></pre>

<p>still works.</p>

<pre><code>nb -l cat
</code></pre>

<p>still works (looks to be sorted differently).</p>

<p>Just to be sure, lets make a small backup:</p>

<pre><code>cp -rap miek.nl /tmp/backup-miek-nl
</code></pre>

<p>And now</p>

<pre><code>nb -u
</code></pre>

<p>I'm seeing <code>sed: -e expression #1, char 207: unterminated s command</code>,
but I have no idea where to look to fix this. Also I'm not getting the
feeling that this is not so much faster than version 3.3:
My zsh tells me it took this long:</p>

<pre><code>313.27s user 517.06s system 687.68s elapsed 120%CPU (nb -u)
</code></pre>

<p>A quick reload on my homepage... it's looking good except the 'recent
articles' is kaput, some css issues.</p>

<p>Finally the complete upgrade</p>

<pre><code>nb -u all
</code></pre>

<p>also works.</p>

<h2>Bug fixing</h2>

<p>It looks like <code>$NB_ArticleLinks</code> is now done differently, so I need to
update the templates a bit. The <code>$NB_ArticleLinks</code> now needs to be
properly wrapped in a <code>sidetitle</code> <code>div</code>.</p>

<h2>Different stuff</h2>

<p>Adding a new entry now must be done as follows:</p>

<pre><code>nb -a entry -c 7
</code></pre>

<p>Which is slightly different in 3.3</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/06/27/upgrading_nb_to_3_4/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/06/27/upgrading_nb_to_3_4/index.html</guid>
<title>Upgrading nb to 3.4</title>
<dc:date>2009-06-27T09:51:11+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>I'm going to upgrade my nanoblogger installation to version 3.4 after
this post. I'm expecting some breakage...</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/06/11/speedtest_meme/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/06/11/speedtest_meme/index.html</guid>
<title>Speedtest Meme</title>
<dc:date>2009-06-11T20:39:46+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p><img src="http://www.miek.nl/gfx/2009/speedtest.png" alt="SpeedTest Image" title="" /></p>

<p>Yes... I rule.</p>

<blockquote>
  <p>Still seems a bit low as I should have 100 Mb/s...</p>
</blockquote>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/04/28/rebuilding_the_raid1_array/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/04/28/rebuilding_the_raid1_array/index.html</guid>
<title>Rebuilding the RAID1 array</title>
<dc:date>2009-04-28T17:39:38+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> linux, site</dc:subject>
<description><![CDATA[<p>I'm rebuilding my RAID1 array, so everything is a bit slow at the
moment.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/04/27/massaging_visitors_for_nicer_html/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/04/27/massaging_visitors_for_nicer_html/index.html</guid>
<title>Massaging visitors for nice(r) html</title>
<dc:date>2009-04-27T10:11:55+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>For my web statistics I use <a href="http://www.hping.org/visitors/">visitors</a>, 
to generate static html. Now the default html of <code>visitors</code> is nice,
but I wanted to integrate it with my default website theme.
Unfortunately <code>visitors</code> does not have the option to generate bare
html. So Perl and shell to the rescue!</p>

<h1>Stripping the style sheet</h1>

<p>The html as generated by <code>visitors</code> include the following style
sheet:</p>

<pre><code>&lt;style&gt;
td {
    font-size: 10px;
    padding: 0;
}
.barfill {
    background-color: #96ef94;
    border-left: 1px;
    border-right: 1px;
... /* and more */
&lt;/style&gt;
</code></pre>

<p>No I wanted to strip this using Perl and its marvelous flipflop (<code>..</code>)
operator. </p>

<div class="nbcode">
<pre>
<span class="lnr">1 </span><span class="Type">int</span> main(<span class="Type">int</span> c) {
<span class="lnr">2 </span>    printf(<span class="Constant">&quot;This is nice&quot;</span>);
<span class="lnr">3 </span>    exit(<span class="Constant">1</span>);
<span class="lnr">4 </span>}
</pre>
</div>

<p>Line <code>5.</code> shows the flip-flop operator in action. The <code>..</code>-operator
becomes true when <code>&lt;style&gt;</code> is seen (and stays true!) and becomes false
when <code>&lt;/style&gt;</code> is seen. Sort of like a state machine in one line of
code. So if I find that I'm between the two <code>style</code>-tags in the file I
don't print anything except for the first time (line 6). Then I insert
my own modified style sheet.</p>

<h1>header and footer</h1>

<p>I also need to insert my own header and footer, this can be easily done
with some here documents in the shell. And some annoying tags need
to be stripped: <code>sed</code> to the rescue:</p>

<pre><code>visitors -T -A -P http://www.miek.nl \
/var/log/apache2/miek.nl-access.log | \
sed -e 's/^&lt;html&gt;//' -e 's/^&lt;hea d&gt;//' \
-e 's/^&lt;body&gt;//' -e 's|^&lt;/head&gt;||' \
-e 's|&lt;/body&gt;||' -e 's|&lt;/html&gt;||' -e 's/\[//'
</code></pre>

<p>Note that to keep everything consistent I use <code>m4</code> to generate
templates, these templates get converted to <code>html</code> and those
are then used by <code>nanoblogger</code>. </p>

<h1>Complete script</h1>

<p>So the complete script for use in <em>my</em> site becomes:</p>

<pre><code>#!/bin/zsh
# make a nice visitors page for use on miek.nl

( cat &lt;&lt;HEADER
...insert my header here...
HEADER

# create the content
visitors -T -A -P http://www.miek.nl \
/var/log/apache2/miek.nl-access.log | \
sed -e 's/^&lt;html&gt;//' -e 's/^&lt;hea d&gt;//' \
-e 's/^&lt;body&gt;//' -e 's|^&lt;/head&gt;||' \
-e 's|&lt;/body&gt;||' -e 's|&lt;/html&gt;||' -e 's/\[//'

cat &lt;&lt;FOOTER
...insert my footer here...
FOOTER
) | perl -we '
# now fix the css style in the m5 file
# remove it completely and replace it with my own
my $printed = 0;
while (&lt;&gt;) {
if (m|&lt;style&gt;| .. m|&lt;/style&gt;|) {
    system("cat /home/miekg/bin/visit.style") if !
    $printed;
    $printed = 1;
    } else {
    print
    }
}' &gt; /home/miekg/miek.nl/server/visit.m5
# build the html, finally!
( cd /home/miekg/miek.nl; make -f m5.Makefile server/visit.html )
</code></pre>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/04/21/greylisting/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/04/21/greylisting/index.html</guid>
<title>Greylisting</title>
<dc:date>2009-04-21T18:07:05+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>Well, I finally caved in and implemented greylisting for miek.nl.</p>

<p>I must say, it really helps (for now). I've also made the rdup mailing
list subscriber only, because I was fed up with deleting email from
the <code>mailman</code>'s non-subscriber queue. I.e. non-subscriber email is
now <strong>discarded</strong>.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/04/21/notify_of_new_comments/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/04/21/notify_of_new_comments/index.html</guid>
<title>notify of new comments</title>
<dc:date>2009-04-21T11:17:01+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>In my
<a href="http://www.miek.nl/blog/archives/2009/01/24/nb_comments/index.html">quest</a> 
<a href="http://www.miek.nl/blog/archives/2009/01/26/nanoblogger_comments_update/index.html">to</a> 
build a comment system for my
nanoblogger/shell/m4/php blogging setup I have now implemented
a comment notification system. When giving a comment you
can click 'Notify me of followup comments by email'. Each approved comment
will then be mailed to the email address given. This will of course only
happen until the commenting is closed on this entry.</p>

<p>Doing so will get you these kind of email messages:</p>

<pre><code>Subject: Comment notify miek.nl `Windows 7?'
To: miek@miek.nl
Date: Tue, 21 Apr 2009 11:05:27 +0200 (CEST)

Hello,

This is an email to inform you of a new comment
at http://miek.nl.
It is posted under the blog entry titled `Windows 7?'

&lt;a href="http://miek.nl"&gt;Miek Gieben&lt;/a&gt;
Hallo

--
Comment notify sent by http://miek.nl - Tue Apr 21 11:05:27 CEST 2009
Notifies will be sent until commenting is closed
</code></pre>

<p>The only thing <em>not</em> implemented is a direct link to the blog entry with
the new comment. It is doable to recreate the original URL, but for now
this is sufficient.</p>

<p>Stuff on the todo: check if the email address is valid (syntax wise) and
make it easy to remove someone from the notification list.</p>]]></description>

</item>
<item>
<link>http://www.miek.nl/blog/archives/2009/04/12/site_move/index.html</link>
<guid isPermaLink="true">http://www.miek.nl/blog/archives/2009/04/12/site_move/index.html</guid>
<title>Site move</title>
<dc:date>2009-04-12T09:39:45+01:00</dc:date>
<dc:creator>Miek Gieben</dc:creator>
<dc:subject> site</dc:subject>
<description><![CDATA[<p>If you can read this, it means the server move was successful. I'm
once again hosting everything from my basement. On a quad core Intel
machine running Ubuntu with a shiny new 2.6.29.1 kernel.</p>]]></description>

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

