<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>The Party Line</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/" />
    <link rel="self" type="application/atom+xml" href="http://blog.tobez.org/atom.xml" />
    <id>tag:blog.tobez.org,2010-01-06://3</id>
    <updated>2010-01-07T15:29:23Z</updated>
    <subtitle>tobez&apos;s personal weblog</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.01</generator>

<entry>
    <title>Do not use synergy, use synergy+</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2010/01/do-not-use-synergy-use-synergy.html" />
    <id>tag:blog.tobez.org,2010://3.117</id>

    <published>2010-01-07T15:26:28Z</published>
    <updated>2010-01-07T15:29:23Z</updated>

    <summary>For months, I&#8217;ve been plagued by intermittent mouse freezes on one of my boxes. It started after a regular Xorg upgrade. According to various mailing lists, that particular upgrade caused similar problems to a lot of people, so I tried...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Rants" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="freebsd" label="freebsd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="freebsdports" label="freebsd ports" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rants" label="rants" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="synergy" label="synergy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xorg" label="xorg" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>For months, I&#8217;ve been plagued by intermittent
mouse freezes on one of my boxes.</p>

<p>It started after a regular
<a href="http://www.x.org/wiki/">Xorg</a>
upgrade.
According to various mailing lists,
that particular upgrade caused similar problems
to a lot of people, so I tried different suggested fixes.
No luck.</p>

<p>A bit later, Xorg on
<a href="http://www.freebsd.org/">FreeBSD</a>
was modified to fix the
reported problems.  But the upgrade did not fix
<em>my</em> problem.</p>

<p>Eventually I came to a realization that it is likely
that the problem is not with the mouse driver or with
any other part of Xorg.  Rather, it was a problem with
<a href="http://synergy2.sourceforge.net/">synergy</a>
client interaction with the new
<a href="http://xcb.freedesktop.org/">xcb</a>.
I even found
<a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=127791">a problem report</a>
with a supposed fix to the
problem.  By the time I&#8217;ve found it, the fix was committed
to the
<a href="http://www.freshports.org/sysutils/synergy/">synergy port</a>,
and was subsequently rolled back
because it lead to other problems.  I tried the patch in the
PR anyway.  Still did not help me.</p>

<p>Not wanting to spend too much time on this,
I was coping with the delays and only occasionally,
when annoyed more than usual,
was trying to find another fix.  Unsuccessfully, I must add,
until this morning, when I discovered
<a href="http://code.google.com/p/synergy-plus/">synergy+</a>,
a maintenance fork of the original synergy.
I was not aware that synergy+ is basically a drop-in replacement
to synergy, the binaries having the same names as in the original.
Better still, synergy+ client works just fine with the original
synergy server.
So I&#8217;ve decided to give it a shot, removed the synergy package,
and installed the synergy+ port.
Voila, the freezes are gone.  I am a happy camper now.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>New smartmontools and munin</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2010/01/new-smartmontools-and-munin.html" />
    <id>tag:blog.tobez.org,2010://3.116</id>

    <published>2010-01-05T13:00:26Z</published>
    <updated>2010-01-05T13:24:12Z</updated>

    <summary>With the recent (2009-12-23) update to FreeBSD&#8217;s sysutils/smartmontools port smartctl stopped working if run as non-root. I did not investigate whether it is because of the change in the way smartctl operates, or whether it just stopped to be setuid...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Hints" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="freebsd" label="freebsd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="freebsdports" label="freebsd ports" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="munin" label="munin" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>With the recent (2009-12-23) update to
<a href="http://www.freebsd.org/">FreeBSD</a>&#8217;s
<a href="http://www.freshports.org/sysutils/smartmontools/"><code>sysutils/smartmontools</code> port</a>
<code>smartctl</code>
stopped working if run as non-root.
I did not investigate whether it is because of the change
in the way <code>smartctl</code> operates,
or whether it just stopped to be setuid root.</p>

<p>Normally I don&#8217;t mind going root to run <code>smartctl</code> by hand,
but it presents a bit of a problem for the <code>hddtemp_smartctl</code>
<a href="http://www.linpro.no/projects/munin/">Munin</a>
plugin.</p>

<p>One possible solution is to add the <code>munin</code> user to the <code>operator</code> group,
add the following two lines to <code>/etc/devfs.conf</code>:</p>

<pre><code>perm ata 0660
perm xpt0 0660
</code></pre>

<p>And finally, run <code>sh /etc/rc.d/devfs restart</code>.</p>

<p>Being the dummy that I am, I only thought about a simpler solution
when composing this post: just add <code>user root</code> into the <code>[hddtemp_smartctl]</code> section
of your <code>munin/plugin-conf.d/plugins.conf</code> file.
Besides being simpler, this method has an added advantage: an updated
version of the
<a href="http://www.freshports.org/sysutils/munin-node/"><code>sysutils/munin-node</code> port</a>
can easily incorporate this change.
<a href="http://www.des.no/">Dag-Erling</a>: hint, hint.  :-)</p>
]]>
        

    </content>
</entry>

<entry>
    <title>port-tags on github</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2009/03/port-tags-on-github.html" />
    <id>tag:blog.tobez.org,2009://3.82</id>

    <published>2009-03-15T19:26:49Z</published>
    <updated>2009-03-15T19:29:51Z</updated>

    <summary><![CDATA[Some years ago I&#8217;ve made a little web application which allowed one to browse FreeBSD ports collection by tags, &agrave; la delicious. The tags were not created by users but were instead generated from a couple of fields taken from...]]></summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="freebsd" label="freebsd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="freebsdports" label="freebsd ports" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="github" label="github" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="porttags" label="port-tags" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ports" label="ports" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="woblomo" label="woblomo" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>Some years ago I&#8217;ve made <a href="http://www.tobez.org/port-tags/">a little
web application</a> which <a href="http://www.tobez.org/about-port-tags.html">allowed one
to browse</a> <a href="http://www.freebsd.org/">FreeBSD</a>
<a href="http://www.freebsd.org/ports/">ports collection</a>
by tags, &agrave; la <a href="http://delicious.com/">delicious</a>.</p>

<p>The tags were not created by users but were
instead generated from a couple of fields
taken from every
port&#8217;s <code>Makefile</code>,
so it was not exactly a &#8220;social&#8221; software.</p>

<p>There was some <a href="http://www.freebsd.org/cgi/getmsg.cgi?fetch=487425+0+/usr/local/www/db/text/2005/freebsd-ports/20051113.freebsd-ports">limited</a> <a href="http://www.freebsd.org/cgi/getmsg.cgi?fetch=834919+0+/usr/local/www/db/text/2005/freebsd-ports/20051120.freebsd-ports">amount</a>
of discussion on FreeBSD mailing lists, and a publicly
accessible readonly SVN repository
was created by my friend <a href="http://blog.droso.org/">Erwin</a>,
but the overall interest was rather low.</p>

<p>Over time I moved on and basically stopped
working on the project,
but recently I had an idea - not exactly to
re-surrect it, but to make it more
easy for people who are interested to
contribute.</p>

<p>Enter <a href="http://github.com/tobez/port-tags/tree/master"><code>port-tags</code> at github</a>.
<a href="https://github.com/">Github</a> is a tool
to host <a href="http://git-scm.com/">git</a> repositories
of your open-source projects.
Anybody can easily clone your repository,
fork it completely, or submit their
changes back to you.
I only started using it today,
so I cannot say much about its features
and how convenient they are,
but from what I&#8217;ve heard,
it is very very nice.</p>

<p>So, if you are interested,
and have got <a href="http://en.wiktionary.org/wiki/round_tuit">round tuits</a> to spare,
please hack on <code>port-tags</code> - maybe
some good will eventually come out of it.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>recoverdisk(1) and the sad, sad story of a bad, bad disk block</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2008/05/recoverdisk1-and-the-sad-sad-story-of-a-bad-bad-disk-block.html" />
    <id>tag:blog.tobez.org,2008://3.67</id>

    <published>2008-05-22T13:46:48Z</published>
    <updated>2009-03-01T12:07:39Z</updated>

    <summary>Over the last couple of days I had a sad opportunity to use Poul-Henning Kamp&#8217;s recoverdisk(1) utility. Since it turned out to be a life- (well, disk-) saving device, and it is covered by the beer-ware license, I definitely owe...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>Over the last couple of days
I had a sad opportunity to use
<a href="http://phk.freebsd.dk/">Poul-Henning Kamp&#8217;s</a> <a href="http://www.freebsd.org/cgi/man.cgi?query=recoverdisk&amp;sektion=1&amp;format=html"><code>recoverdisk(1)</code></a> utility.</p>

<p>Since it turned out to be a life- (well, disk-) saving
device, and it is covered by <a href="http://en.wikipedia.org/wiki/Beerware">the beer-ware license</a>,
I definitely owe phk a beer.</p>

<p>Yesterday morning I discovered that my server is down.
After traveling to the server room (there is no remote console)
and pretending
that my index finger is square in its cross-section,
my investigation showed that there is something fishy
with the system disk (which is backed up but not mirrored).</p>

<p>Namely, there are bad blocks, and periodic scripts that run at night
touch some of them, which leads to <em>bad things</em>.</p>

<p>Now, the first thing I did was to order a replacement disk.
The problem was that it won&#8217;t arrive until the beginning of next
week and I want the box up and running <em>now</em>.  Even worse, during the
weekend I am going to be in Stockholm for the <a href="http://conferences.yapceurope.org/npw2008/">Nordic Perl Workshop</a>
(oh, and by the way I still have a presentation to prepare),
and thus won&#8217;t be able to fix things that require my presence on-site.</p>

<p>After asking around, I got pointed in the direction of <code>recoverdisk(1)</code>
by <a href="http://x0.dk/">Phil</a>.
Thankfully, <code>recoverdisk /dev/ad4</code> told me exactly how many
bad blocks there are (one) and what offsets they are at.</p>

<p>The next step was to make the on-disk controller to remap the
block to one of the good reserve sectors on the disk.  While
I am sure that there are programs that will do just that, I
am not aware of any that run on <a href="http://www.freebsd.org/">FreeBSD</a>.</p>

<p>Besides, having the offsets, it was a trivial task
to quickly create a simple one-shot program
that writes something to the bad block, so that the
disk will have an opportunity to remap the sector all by
itself.</p>

<p>The only problem I had with this was that I could not <code>open(2)</code>
the raw disk for writing while any partitions were mounted
on it.  I was ready to move the disk to another box to
run the program there,
but <a href="http://www.batmule.dk/">Flemming</a> has helpfully told me that doing
<code>sysctl kern.geom.debugflags=16</code> will do the trick.  And it did.
Thanks, Flemming!</p>

<p>After this there are four more steps - run <code>recoverdisk</code> again
to make sure everything&#8217;s fine, run <code>fsck</code> on all partitions,
put the box online, and move
the system to the new and shiny disk when it finally arrives.</p>

<p>While this last step will have to wait a bit more,
the fact that you are reading this shows that everything else
worked.</p>

<p>I do realize that the primary purpose of the <code>recoverdisk(1)</code>
is to salvage the data from media that has gone hopelessly bad.
Nevertheless, I think that my example shows that it is pretty darn
useful in other cases as well.</p>

<p>Several people helped me along the way.
I have not yet mentioned <a href="http://www.thegler.dk/">Lars</a>,
who did some heavy lifting, and <a href="http://www.kri.dk/">Kristoffer</a>
for doing the network magic with subnet routing
when the box was moved to another, closer location.</p>

<p>Lessons learned:</p>

<ul>
<li><p>remote console is useful;</p></li>
<li><p>mirroring the system disk is essential.</p></li>
</ul>

<p>Open question: what does phk do with all the beers he is getting
when I know for a fact that he does not drink much?</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Version-independent location of a CPAN distribution&apos;s Changes file</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2007/12/version-independent-location-of-a-cpan-distributions-changes-file.html" />
    <id>tag:blog.tobez.org,2007://3.65</id>

    <published>2007-12-20T11:43:39Z</published>
    <updated>2009-03-01T12:07:36Z</updated>

    <summary>Some time ago several people (most notably skv@) ranted about including a list of changes or a link to such list in the commit message for a port update. I thought it was a great idea and started including a...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Hints" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>Some time ago several people (most notably skv@) ranted about including a 
list of changes or a link to such list in the commit message for a port
update.</p>

<p>I thought it was a great idea and started including a link to a <a href="http://www.cpan.org/">CPAN</a>&#8217;s 
distribution Changes file in my commits some time ago.</p>

<p>What I did not like was that those links looked like this:</p>

<p><a href="http://search.cpan.org/src/JESSE/Template-Declare-0.27/Changes">http://search.cpan.org/src/JESSE/Template-Declare-0.27/Changes</a></p>

<p>FreeBSD&#8217;s commit messages are preserved in our repository and mail archives
forever, for a suitable definition of &#8220;forever&#8221;.  On the other hand, CPAN
authors are encouraged to clean up old and obsolete versions promptly.</p>

<p>Thus there is a discrepancy between expected time of life of the link in the
commit message and the link contents.</p>

<p>While older CPAN distributions can still be found on 
<a href="http://backpan.cpan.org/">BackPAN</a>,
it only provides links to tarballs and not
individual files like Changes.</p>

<p>Luckily, it turns out that version-less links like</p>

<p><a href="http://search.cpan.org/dist/Template-Declare/Changes">http://search.cpan.org/dist/Template-Declare/Changes</a></p>

<p>work just fine, redirecting to the most recent version of the file.  This is 
acceptable, since Changes is expected to be a prepend-only file, so the
information the commit message was trying to link to can (almost) always be
found there.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Backing up Google Reader subscriptions as OPML, periodically and automatically</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2007/10/backing-up-google-reader-subscriptions-as-opml-periodically-and-automatically.html" />
    <id>tag:blog.tobez.org,2007://3.64</id>

    <published>2007-10-31T21:07:42Z</published>
    <updated>2009-03-01T12:07:36Z</updated>

    <summary>A fellow former Bloglines user has asked me whether I found a way to backup Google Reader subscriptions into an OPML file from cron, as we used to do with our Bloglines accounts. A quick search turned up this, which,...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Hints" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>A fellow former <a href="http://www.bloglines.com/">Bloglines</a> user has asked me whether
I found a way to backup <a href="http://reader.google.com/">Google Reader</a> subscriptions
into an <a href="http://en.wikipedia.org/wiki/OPML">OPML</a> file from <a href="http://www.freebsd.org/cgi/man.cgi?query=cron&amp;apropos=0&amp;sektion=8&amp;format=html">cron</a>, as we used to
do with our Bloglines accounts.</p>

<p>A quick search turned up <a href="http://googlesystem.blogspot.com/2007/08/blogroll-powered-by-google-reader.html">this</a>,
which,
from the look of it,
in order for it to work
requires every feed to be
explicitly marked with a tag which
is set up as public.</p>

<p>This by itself is rather cumbersome,
and you have to remember to do that for every new
feed you subscribe to,
otherwise you&#8217;ll defeat the purpose of making
periodic backups in the first place.</p>

<p>Luckily, there is a better solution.
There is a nice little module on <a href="http://www.cpan.org/">CPAN</a>,
<a href="http://search.cpan.org/~gray/WebService-Google-Reader/">WebService::Google::Reader</a> by <a href="http://search.cpan.org/~gray/">gray</a>,
which uses an unofficial <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI">Google Reader API</a>
to do various nifty things with your Google Reader
subscription,
<em>including</em> OPML export.</p>

<p>This means that after installing the module
you can simply put the following command
into your crontab (only command itself is shown,
see <a href="http://www.freebsd.org/cgi/man.cgi?query=crontab&amp;apropos=0&amp;sektion=5&amp;format=html">crontab(5) manual page</a> to find
out what else you will want to put in there):</p>

<pre><code>env GOOGLE_USERNAME=your-username-typically@gmail.com \
  GOOGLE_PASSWORD=your-user-password \
  perl -MWebService::Google::Reader -e \
  'print WebService::Google::Reader-&gt;new(
     username =&gt; $ENV{GOOGLE_USERNAME},
     password =&gt; $ENV{GOOGLE_PASSWORD})-&gt;opml' \
  &gt; /where/to/put/greader.opml
</code></pre>

<p>You will have to make the above to be one long line to satisfy
crontab syntax, and of course remember to use a real username,
password, and the path to the resulting OPML file.</p>

<p>Unfortunately, the most recent version
of the module (which is 0.03 at the time of this writing)
has a minor bug which prevents
the <code>opml()</code> method from working correctly.
So you will need to do a little patching.</p>

<p>Before installing the module,
edit the source file <code>lib/WebService/Google/Reader/Constants.pm</code>,
look for a string <code>subscribtions</code>,
and fix the spelling
(finding correct spelling is left as an exercise for the reader).
Then proceed installing the module as usual.</p>

<p>Hopefully, this step won&#8217;t be necessary in a couple of days&#8217; time
when a new version of the module is released.</p>

<p>If you are a <a href="http://www.freebsd.org/">FreeBSD</a> user like myself,
you may choose instead to
<a href="http://www.tobez.org/download/p5-WebService-Google-Reader-0.03.tgz">fetch a skeleton of the port of the module</a>.
Unpack it in <code>/usr/ports/www/</code>
and install it as you would any other port.</p>

<p>I intend to add the port to the ports collection as soon
as our <a href="http://www.freebsd.org/cgi/mid.cgi?id=20071030120901.GM45185%40droso.net&amp;db=mid">current ports freeze</a> is over.</p>

<p>Enjoy!</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Stop bitching.</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2006/04/stop-bitching.html" />
    <id>tag:blog.tobez.org,2006://3.49</id>

    <published>2006-04-11T14:01:25Z</published>
    <updated>2009-03-01T12:07:13Z</updated>

    <summary> So linux-flashplugin has been removed. So what? Stop bitching already. cvs -d /home/ncvs co -D &quot;1 april 2006&quot; -d linux-flashplugin6 ports/www/linux-flashplugin6 Enough said....</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p><img src="http://www.tobez.org/images/blog/adobe-logo.gif" alt="" /></p>

<p>So linux-flashplugin has been <a href="http://www.freebsd.org/cgi/getmsg.cgi?fetch=1993285+0+/usr/local/www/db/text/2006/cvs-all/20060409.cvs-all">removed</a>.
So what? Stop bitching already.</p>

<pre><code>cvs -d /home/ncvs co -D "1 april 2006" -d linux-flashplugin6 ports/www/linux-flashplugin6
</code></pre>

<p>Enough said.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>port-idea script</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2005/10/port-idea-script.html" />
    <id>tag:blog.tobez.org,2005://3.44</id>

    <published>2005-10-13T19:28:03Z</published>
    <updated>2009-03-01T12:07:11Z</updated>

    <summary> If you are bored and think about making yet another CPAN module into a FreeBSD port, you might find this useful. Step 1 Get yourself a local CPAN mirror. Don&#8217;t worry, you won&#8217;t need the whole deal, the most...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p><img src="http://www.tobez.org/images/blog/cpan.jpg" alt="" title="" /></p>

<p>If you are bored and think about making yet another CPAN module into a FreeBSD port, you might find this useful.</p>

<h4>Step 1</h4>

<p>Get yourself a local <a href="http://www.cpan.org/">CPAN</a> mirror.  Don&#8217;t worry, you won&#8217;t need the whole deal, the most recent versions of every module will suffice.  This boils down to just under 700 MB.  It&#8217;ll take a while the first time around, but after that it&#8217;ll require less time than your regular <code>/home/ncvs</code> updates.</p>

<p>Install <code>devel/p5-CPAN-Mini</code> port, then run</p>

<pre><code>minicpan -l ~/share/CPAN/ \
    -r ftp://ftp.funet.fi/pub/languages/perl/CPAN/ -p
</code></pre>

<p>Here <code>~/share/CPAN</code> is a directory of your choosing.  Similarly, choose a CPAN mirror closest to you instead of <code>ftp.funet.fi</code>.</p>

<h4>Step 2</h4>

<p>Install <code>devel/p5-File-Random</code> port.  Then fetch <a href="http://www.tobez.org/download/port-tools/port-idea">this script</a>, and modify the hard-coded path to CPAN.</p>

<p>Each time you run it, it will present you with some recent CPAN module that does not yet exist in the ports collection.</p>

<p>Please don&#8217;t forget to submit a PR.  ;-)</p>

<h4>Step 3</h4>

<p>There is no step 3.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Testing Perl ports</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2005/05/testing-perl-ports.html" />
    <id>tag:blog.tobez.org,2005://3.38</id>

    <published>2005-05-25T20:58:46Z</published>
    <updated>2009-03-01T12:07:02Z</updated>

    <summary> Yesterday I finally found time to wade through some of my outdated p5 ports. It is obvious that the monkey poo job of testing them with all three perls can be automated, but I never got really fed up...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p><img src="http://www.tobez.org/images/beastie.gif" alt="FreeBSD" /></p>

<p>Yesterday I finally found time to wade through some of my <a href="http://people.freebsd.org/~mat/perl.html">outdated p5 ports</a>.  It is obvious that the monkey poo job of testing them with all three perls can be automated, but I never got really fed up with the procedure before. So I wrote yet another port-related automation script, which I&#8217;d like to describe here.</p>

<p>First, a little about my setup.</p>

<p>I use three jails for testing.  There is a <strong>port58</strong> jail which has <a href="http://www.freshports.org/lang/perl5.8/">lang/perl5.8</a> installed.  There is a <strong>ports56</strong> jail (with <a href="http://www.freshports.org/lang/perl5/">lang/perl5</a>).  And there is a <strong>j4</strong> jail, which is a bit of a strange beast, since it is a 4.11 i386 jail (with system perl 5.005_03), so it took some tinkering to make that work on my 5.4 amd64 host system.</p>

<p>All three jails sit on a private subnet, and I can <code>ssh -l root</code> to them using my ssh key.  They get populated with a freshly cvsupped ports collection via <a href="http://www.freshports.org/sysutils/cpdup/">cpdup</a>,  a nifty little tool by <a href="http://apollo.backplane.com/">Matt Dillon</a>.</p>

<p>So, the manual procedure is basically:</p>

<ul>
make whatever changes are needed to the port
</ul>

<ul>
repeat for every jail:
<ul>
ssh to jail, cd to port
</ul>

<ul>
make clean ; make
</ul>

<ul>
if everything&#8217;s fine,
cd work/portdir; make test
</ul>

<ul>
if everything&#8217;s still fine,
cd ../..; make install; make deinstall, check for leftover files
</ul>

<p></ul></p>

<ul>
rinse, clean, repeat until the port works
</ul>

<p>The script to automate this task is called <a href="http://www.tobez.org/download/port-tools/test-port"><code>test-port</code></a>.  It is somewhat hackish, being a quick and dirty job, but it is usable.
Test-port makes use of other scripts, which I wrote over time and was using extensively, namely</p>

<ul>
<a href="http://www.tobez.org/download/port-tools/build_mtree"><code>build_mtree</code></a> for creating an mtree of a jail.
</ul>

<ul>
<a href="http://www.tobez.org/download/port-tools/plist"><code>plist</code></a> for checking the current file structure against a tree created with <code>build_mtree</code> and generating a plist delta.
</ul>

<ul>
<a href="http://www.tobez.org/download/port-tools/cpdup-port"><code>cpdup-port</code></a> for copying a port or the whole port tree to the jails.
</ul>

<ul>
<a href="http://www.tobez.org/download/port-tools/cpport"><code>cpport</code></a> for listing recently modified files (useful when committing stuff).
</ul>

<p>If you think you can have a use for those scripts, be my guest.  If you make any improvements to them, I would like to hear about it &#8212; they do need improvements (in particular, they are not usable without modifications outside of my setup).</p>
]]>
        

    </content>
</entry>

<entry>
    <title>Patchnames bikeshed</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2005/04/patchnames-bikeshed.html" />
    <id>tag:blog.tobez.org,2005://3.37</id>

    <published>2005-04-08T11:58:32Z</published>
    <updated>2009-03-01T12:07:01Z</updated>

    <summary> 54 messages and counting, 4 commits (including one backout), and all I wanted was to rename patchfiles with the percent sign in them to something more sensible! A hint to the next would-be bikeshed initiator: misc/kde3-i18n-sr@Latn port. Link...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p><img src="http://www.tobez.org/images/FreeBSD-no-bikeshed.jpg" alt="no bikeshed" />
54 messages and counting, 4 commits (including one backout), and all I wanted was to rename patchfiles with the percent sign in them to something more sensible!</p>

<p>A hint to the next would-be bikeshed initiator: <code>misc/kde3-i18n-sr@Latn</code> port.</p>

<p><a href="http://cvsweb.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml.diff?r1=1.549&amp;r2=1.550">Link</a></p>
]]>
        

    </content>
</entry>

<entry>
    <title>krion&apos;s FreeBSD Blog</title>
    <link rel="alternate" type="text/html" href="http://blog.tobez.org/2005/03/krions-freebsd-blog.html" />
    <id>tag:blog.tobez.org,2005://3.35</id>

    <published>2005-03-29T19:47:53Z</published>
    <updated>2009-03-01T12:07:00Z</updated>

    <summary>I finally hunted krion&#8217;s blog down. First he was using some concoction written in bash as his blog engine, then he switched to some blogging service, and now he is back to the nanoblogger again. Link...</summary>
    <author>
        <name>tobez</name>
        
    </author>
    
        <category term="FreeBSD" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://blog.tobez.org/">
        <![CDATA[<p>I finally hunted krion&#8217;s blog down.  First he was using <a href="http://nanoblogger.sourceforge.net/">some concoction written in bash</a> as his blog engine, then he switched to some blogging service, and now he is back to the nanoblogger again.</p>

<p><a href="http://voodoo.oberon.net/~krion/weblog/">Link</a></p>
]]>
        

    </content>
</entry>

</feed>
