<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
     xmlns:georss="http://www.georss.org/georss"
     xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
     xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>mpolden&#39;s blog</title>
    <atom:link
      href="https://mpolden.no/blog/feed.xml"
      rel="self" type="application/rss+xml" />
    <link>https://mpolden.no/blog/</link>
    <description><![CDATA[]]></description>
    <language>en</language>
    <pubDate>Fri, 11 Oct 2024 14:52:00 +0200</pubDate>
    <lastBuildDate>Mon, 15 Sep 2025 21:26:42 +0200</lastBuildDate>
    <generator>weblorg 0.1.0 (https://emacs.love/weblorg)</generator>
    <webMaster>Martin Polden</webMaster>
    <image>
      <url>https://orgmode.org/img/org-mode-unicorn-logo.png</url>
      <title>mpolden&#39;s blog</title>
      <link>https://mpolden.no/blog/</link>
    </image>
    
    <item>
      <title>OpenBSD, dhcp6leased and Altibox</title>
      <link>https://mpolden.no/blog/posts/2024-10-11-openbsd-dhcp6leased-and-altibox.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2024-10-11-openbsd-dhcp6leased-and-altibox.html</guid>
      
        <pubDate>Fri, 11 Oct 2024 14:52:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2024-10-11">Oct 11, 2024</time></p>

<p>
OpenBSD 7.6 was <a href="https://www.openbsd.org/76.html">released this week</a> and now includes support for DHCPv6-PD as
part of the base installation, provided by a new program called <a href="https://man.openbsd.org/dhcp6leased">dhcp6leased</a>.
</p>

<p>
I use OpenBSD on my router, for a symmetric fiber connection provided by
<a href="https://www.altibox.no/">Altibox</a>. They provide a single IPv4 address assigned through DHCP, as well as
IPv6 prefixes assigned through DHCPv6-PD. Until now, I've had to use <a href="https://roy.marples.name/projects/dhcpcd">dhcpcd</a> for
the DHCPv6-part, but this is no longer necessary now that <code>dhcp6leased</code> is
available!
</p>

<p>
So how do you configure OpenBSD to work with an Altibox link then?
</p>
<div id="outline-container-vlan-and-ipv4" class="outline-2">
<h2 id="vlan-and-ipv4">VLAN and IPv4</h2>
<div class="outline-text-2">
<p>
<i>Note that this assumes that you terminate the connection directly in your
OpenBSD router, either through a NIC with a SFP module, or via a media
converter.</i>
</p>

<p>
Altibox expects packets for their Internet service to be tagged with VLAN
ID 102. Assuming <code>ix0</code> is the network interface connected to the ISP uplink,
this can be configured like this:
</p>

<pre class="example" id="vlan102">
$ ifconfig ix0 up
$ ifconfig vlan102 create
$ ifconfig vlan102 parent ix0
$ ifconfig vlan102 vnetid 102
</pre>

<p>
To request an IPv4 address via DHCP we tell the interface to use <code>autoconf</code>:
</p>

<pre class="example" id="vlan102-autoconf">
$ ifconfig vlan102 inet autoconf
</pre>

<p>
At this point an IPv4 address should already be assigned. Verify this with:
</p>

<pre class="example" id="dhcpleasectl">
$ dhcpleasectl -l vlan102
</pre>

<p>
Finally, we can make this configuration persistent across reboots by creating
the following files:
</p>

<pre class="example" id="ix0-vlan102-persistent">
# /etc/hostname.ix0
up

# /etc/hostname.vlan102
parent ix0
vnetid 102
inet autoconf
</pre>
</div>
</div>
<div id="outline-container-dhcpv6-pd" class="outline-2">
<h2 id="dhcpv6-pd">DHCPv6-PD</h2>
<div class="outline-text-2">
<p>
For a home network, we typically want a single IPv6 address for the router
itself as well as a <code>/64</code> prefix that can be used by machines on our local
network.
</p>
</div>
<div id="outline-container-dhcpcd" class="outline-3">
<h3 id="dhcpcd">dhcpcd</h3>
<div class="outline-text-3">
<p>
Before 7.6 was released I already had a working setup running using <code>dhcpcd</code>,
with the following configuration that requests a <code>/128</code> non-temporary address
(<code>ia_na</code>) for <code>vlan102</code> , and a <code>/64</code> prefix delegation (<code>ia_pd</code>) for <code>vlan1</code>:
</p>

<pre class="example" id="dhcpcd.conf">
# configure only ipv6 addresses
ipv6only

# disable router solicitation
noipv6rs

# wait for ipv6 address
waitip 6

# allow configuration of these interfaces
allowinterfaces vlan102 vlan1

# request ip address for the external if and a prefix delegation for the internal if
interface vlan102
  ipv6rs
  ia_na 1
  ia_pd 2 vlan1/0
</pre>

<p>
However, I was not able to replicate this configuration exactly in
<code>dhcp6leased</code>, since it only supports requesting prefix delegations.
</p>
</div>
</div>
<div id="outline-container-dhcp6leased" class="outline-3">
<h3 id="dhcp6leased">dhcp6leased</h3>
<div class="outline-text-3">
<p>
So how can we replace <code>dhcpcd</code> with <code>dhcp6leased</code> then? Luckily, <code>dhcp6leased</code>
makes it very easy to request arbitrary prefixes, without doing boring prefix
math.
</p>

<p>
First we need to enable IPv6 router solicitation so that our machine can
discover router advertisement messages. This had me stumped for a while because
I forgot that this is what the <code>ipv6rs</code> line in <code>dhcpcd.conf</code> does.
</p>

<pre class="example" id="vlan102-autoconf6">
$ ifconfig vlan102 inet6 autoconf
</pre>

<p>
Make this change persist across reboots by updating <code>/etc/hostname.vlan102</code> as follows:
</p>

<pre class="example" id="vlan102-persistent-ipv6">
# /etc/hostname.vlan102
parent ix0
vnetid 102
inet autoconf
inet6 autoconf
</pre>

<p>
We then configure <code>dhcp6leased</code> as follows:
</p>

<pre class="example" id="dhcp6leased.conf">
# /etc/dhcp6leased.conf
request rapid commit

request prefix delegation on vlan102 for {
    vlan102/128
    vlan1/64
}
</pre>

<p>
And enable and start the daemon:
</p>

<pre class="example" id="dhcp6leased-start">
$ rcctl enable dhcp6leased
$ rcctl start dhcp6leased
</pre>

<p>
After a few seconds you should have a <code>/63</code> prefix delegation available. Verify
this with
</p>

<pre class="example" id="dhcp6leasectl">
$ dhcp6leasectl -l vlan102
</pre>

<p>
Note: If no prefix delegation becomes available and you have PF enabled, you may
need to allow DHCPv6 packets on the <code>vlan102</code> interface. This can be done with
the following rule:
</p>

<pre class="example" id="dhcp6-pf-rule">
# /etc/pf.conf
pass in on vlan102 inet6 proto udp from fe80::/10 to port dhcpv6-client
</pre>
</div>
</div>
<div id="outline-container-rad" class="outline-3">
<h3 id="rad">rad</h3>
<div class="outline-text-3">
<p>
Finally, we want to provide IPv6 addresses to our local network. This is done
with the <code>rad</code> daemon. Assuming <code>vlan1</code> is our LAN interface, create the
following configuration file:
</p>

<pre class="example" id="rad.conf">
# /etc/rad.conf
interface vlan1
</pre>

<p>
And enable and start the daemon:
</p>

<pre class="example" id="rad-start">
$ rcctl enable rad
$ rcctl start rad
</pre>

<p>
And we're done! Machines on the local network should now receive IPv6 addresses
through <a href="https://en.wikipedia.org/wiki/IPv6_address#Stateless_address_autoconfiguration_(SLAAC)">SLAAC</a>.
</p>
</div>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Shocktober is finally here</title>
      <link>https://mpolden.no/blog/posts/2024-10-05-shocktober-is-here.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2024-10-05-shocktober-is-here.html</guid>
      
        <pubDate>Sat, 05 Oct 2024 12:08:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2024-10-05">Oct 05, 2024</time></p>

<p>
🎃 Horror movie season is upon us! 👻
</p>

<p>
I don't really celebrate Halloween, but every year I line up a bunch of horror
movies to watch throughout October, and this year is no exception. While the
excessively wet and drab fall in Trondheim makes for terrible MTB trail
conditions, it provides a great atmosphere for watching spooky movies.
</p>

<p>
I try to mix up the selection with some new movies I haven't seen yet, coupled
with a few classics/rewatchables. There's no attempt at grouping movies by
sub-genre, or trying to find a good double feature, but there might be some
happy accidents. Overall, I prefer psychological and tense horror over gory
non-sense, although the latter can occasionally be very fun (but rarely scary).
</p>
<div id="outline-container-the-list" class="outline-2">
<h2 id="the-list">The list</h2>
<div class="outline-text-2">
<p>
Top three picks:
</p>
<ol class="org-ol">
<li><a href="https://www.imdb.com/title/tt17526714/">The Substance (2024)</a></li>
<li><a href="https://www.imdb.com/title/tt22375054/">Strange Darlings (2023)</a></li>
<li><a href="https://www.imdb.com/title/tt15474916/">Smile (2022)</a></li>
</ol>

<p>
<del>This is what I have come up with so far, but it's still early so the final list
might change.</del>
</p>

<p>
Complete list:
</p>

<ul class="org-ul">
<li>Week 40
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0087800/">A Nightmare on Elm Street (1984)</a></li>
<li><a href="https://www.imdb.com/title/tt26470109/">Oddity (2023)</a></li>
<li><a href="https://www.imdb.com/title/tt22375054/">Strange Darlings (2023)</a></li>
</ul></li>
<li>Week 41
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt4160708/">Don't Breathe (2016)</a></li>
<li><a href="https://www.imdb.com/title/tt14577874/">It's What's Inside (2024)</a></li>
</ul></li>
<li>Week 42:
<ul class="org-ul">
<li>A new Diablo IV expansion was released so this week was just a blur of
demons and loot.</li>
</ul></li>
<li>Week 43:
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0103873/">Braindead (1992)</a></li>
<li><a href="https://www.imdb.com/title/tt15474916/">Smile (2022)</a></li>
<li><a href="https://www.imdb.com/title/tt14509110/">No One Will Save You (2023)</a></li>
</ul></li>
<li>Week 44:
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0080057/">Zombi 2 (1979)</a> - Watched this on a old and grainy 35mm print, which
definitely improved the experience!</li>
<li><a href="https://www.imdb.com/title/tt0099700/">Gremlins 2: The New Batch (1990)</a></li>
<li><a href="https://www.imdb.com/title/tt17526714/">The Substance (2024)</a></li>
</ul></li>
</ul>

<p>
<i>Last updated: 2024-11-01</i>
</p>
</div>
</div>
<div id="outline-container-2023s-list" class="outline-2">
<h2 id="2023s-list">2023s list</h2>
<div class="outline-text-2">
<p>
While I didn't write about it at the time, here is my week-to-week lists from
last year.
</p>

<ul class="org-ul">
<li>Week 40
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0085333/">Christine (1986)</a></li>
<li><a href="https://www.imdb.com/title/tt0094761/">The Blob (1988)</a></li>
<li><a href="https://www.imdb.com/title/tt1181791/">Black Death (2010)</a></li>
<li><a href="https://www.imdb.com/title/tt5774450/">Summer of '84 (2018)</a></li>
<li><a href="https://www.imdb.com/title/tt9100018/">Cobweb (2023)</a></li>
</ul></li>
<li>Week 41
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0072271/">The Texas Chain Saw Massacre (1974)</a></li>
<li><a href="https://www.imdb.com/title/tt0089885/">Re-Animator (1985)</a></li>
<li><a href="https://www.imdb.com/title/tt0089175/">Fright Night (1985)</a></li>
</ul></li>
<li>Week 42
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0075005/">The Omen (1976)</a></li>
</ul></li>
<li>Week 43
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt0113409/">In the Mouth of Madness (1994)</a></li>
</ul></li>
</ul>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>This should not happen</title>
      <link>https://mpolden.no/blog/posts/2024-08-20-this-should-not-happen.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2024-08-20-this-should-not-happen.html</guid>
      
        <pubDate>Tue, 20 Aug 2024 18:02:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2024-08-20">Aug 20, 2024</time></p>

<p>
One of my favorite things to read in exception messages or logs is this sentence:
</p>

<p>
"This should not happen!"
</p>

<p>
Why, you say? Because it's enduring proof that programmers overestimate their
ability to understand valid program states.
</p>

<p>
But we programmers seem unable to stop falling for this trap. I'm guilty of
doing this myself, on many occasions, and I always have the same thought: This
state is not possible, and the message should say so, because if this happens
some other part of the program (possibly not written by me) is breaking an
invariant.
</p>

<p>
My most recent observation of this is a <a href="https://github.com/torvalds/linux/commit/4461438a8405e800f90e0e40409e5f3d07eed381">recently added message in the Linux kernel</a>:
</p>

<pre class="example" id="log-msg">
[ti. aug. 20 17:47:55 2024] Unpatched return thunk in use. This should not happen!
[ti. aug. 20 17:47:55 2024] WARNING: CPU: 1 PID: 983 at arch/x86/kernel/cpu/bugs.c:3023 __warn_thunk+0x2a/0x40
</pre>

<p>
But it still did! It always does. <a href="https://en.wikipedia.org/wiki/Murphy's_law">And it's been known for a long time</a>.
</p>
]]></description>
    </item>
    
    <item>
      <title>Building a home server (2024 edition)</title>
      <link>https://mpolden.no/blog/posts/2024-04-05-building-a-home-server-2024-edition.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2024-04-05-building-a-home-server-2024-edition.html</guid>
      
        <pubDate>Fri, 05 Apr 2024 19:00:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2024-04-05">Apr 05, 2024</time></p>

<p>
For the past decade I've had a <a href="https://www.storagereview.com/review/hp-proliant-microserver-gen8-review">HP MicroServer Gen8</a> as a home server. This tiny
box has been very performant and reliable and is among my favorite computers
that I've ever owned. However, its hardware is getting a bit long in the tooth.
It's equipped with a low-power Xeon E3-1220L V2 and the memory is maxed at 16GB.
While it stills performs decently, it was overdue for an upgrade.
</p>

<p>
The MicroServer case is very compact and it uses mostly custom HP components
such as the motherboard, so simply upgrading its components is not feasible. I
therefore settled for building a new one. I didn't really have any concrete
specifications in mind, but I knew I wanted some sort of out-of-band management
as I've gotten used to this on the MicroServer (iLO) and ECC memory.
</p>

<p>
It's been a long time since I last built a machine from scratch, but luckily
most of the process has remained the same. I started out with choosing a case. I
like the cube factor of the MicroServer, but I wanted something with room for
more 3.5" drives and generally big enough so that the initial build, and later
upgrades, doesn't become annoying due to space constraints.
</p>

<p>
I settled on a <a href="https://www.fractal-design.com/products/cases/node/node-804/black/">Fractal Design Node 804</a> which is a micro-ATX chassis with room
for up to 10 disks. It has an elegant cube-shaped look, and has neat solutions
for cable management. Now for the hard part of any build: Which motherboard, CPU
and memory combination can I buy which isn't prohibitively expensive?
Historically ECC memory has been artificially limited to enterprise-grade CPUs
and motherboards, such as the Intel Xeon CPUs and associated chipsets. In
comparison, AMD has supported ECC memory on their CPUs for many years now.
</p>
<div id="outline-container-amd-based-build" class="outline-2">
<h2 id="amd-based-build">AMD-based build</h2>
<div class="outline-text-2">
<p>
I initially came up with the following components:
</p>

<ul class="org-ul">
<li>Case: Fractal Design Node 804</li>
<li>Motherboard: ASRock B650D4U</li>
<li>CPU: AMD Ryzen 7 7700</li>
<li>Memory: 2 x Kingston DDR5 32GB ECC (KSM48E40BD8KM-32HM)</li>
<li>OS disk: WD Black SN850X 1TB</li>
<li>PSU: Seasonic Focus GX 550W</li>
</ul>

<p>
The hardest part was finding a motherboard that supported both ECC memory and
out-of-band management. When I finally found one, I just went with memory and OS
disk from the motherboard QVL list to keep things simple. However, the board
wasn't in stock anywhere and Norwegian sellers were charging exorbitant prices
for it. This is presumably because this is card is classified as "professional"
or "enterprise" product and is thus priced differently from consumer boards.
</p>
</div>
</div>
<div id="outline-container-intel-based-build-final-choice" class="outline-2">
<h2 id="intel-based-build-final-choice">Intel-based build (final choice)</h2>
<div class="outline-text-2">
<p>
During my research found out that Intel had (quietly?) started <a href="https://www.anandtech.com/show/17308/the-intel-w680-chipset-overview-ecc-for-alder-lake-workstations">supporting ECC on
their consumer processors</a>. The only catch being that you need a motherboard
with the W680 chipset. This meant that Intel was back in the running, so I
started considering an equivalent Intel-based build.
</p>

<p>
After reading some benchmarks I ended up with the following components:
</p>

<ul class="org-ul">
<li>Case: Fractal Design Node 804</li>
<li>Motherboard: Asus PRO WS W680M-ACE</li>
<li>CPU: Intel Core i5-13500</li>
<li>Memory: 2 x Kingston DDR5 32GB ECC (KSM48E40BD8KM-32HM)</li>
<li>OS disk: WD Black SN850X 1TB</li>
<li>PSU: Seasonic Focus GX 550W</li>
</ul>

<p>
I had to buy the motherboard from Amazon US as it was half the price Norwegian
sellers were charging (and none had it in stock, a recurring theme). Yet another
case of being charged a tax for "professional" components.
</p>
</div>
</div>
<div id="outline-container-conclusion" class="outline-2">
<h2 id="conclusion">Conclusion</h2>
<div class="outline-text-2">
<p>
Components with ECC memory support are becoming more readily available, but
finding compatible motherboards and memory modules is a bit of a chore. Getting
what you want requires fine-reading motherboard QVL lists and CPU data sheets.
However, it's great that this feature is no longer being restricted to
server-grade components.
</p>

<p>
Assembling the components into the Node 804 case was a breeze. The case has lots
of room and is easy to work with. Stability of the build has also been excellent
over the past couple months. I did however have to coerce Debian into supporting
the new hardware properly. See <a href="#appendix-linux-woes">appendix</a> for more details.
</p>

<p>
My new server (left) now sits neatly next to the MicroServer, which has since
become a router. Hopefully it will last a decade, like its predecessor!
</p>

<img class="media" alt="Home server" src="/blog/img/2024-04-05-building-a-home-server-2024-edition.png"/>
</div>
</div>
<div id="outline-container-appendix-linux-woes" class="outline-2">
<h2 id="appendix-linux-woes">Appendix: Linux woes</h2>
<div class="outline-text-2" id="text-appendix-linux-woes">
</div>
<div id="outline-container-igpu" class="outline-3">
<h3 id="igpu">iGPU</h3>
<div class="outline-text-3">
<p>
The Asus PRO WS W680M-ACE motherboard has an integrated VGA controller. This is
exposed through A) a physical VGA connector and B) a virtual VGA console,
accessible via the BMC. It also has DisplayPort and HDMI connectors, these are
connected to the iGPU on supported CPUs.
</p>

<p>
I wanted to use the iGPU for transcoding video, but I wanted the console to be
available via the VGA controller. This turned out to be difficult because
connecting anything to the VGA connector would disable the iGPU completely, and
vice-versa.
</p>

<p>
The solution to this problem is as follows:
</p>
<ul class="org-ul">
<li>Update the kernel to atleast 6.5. On Debian Bookworm, it's sufficient to
install the latest kernel from backports</li>
<li>In the BIOS, set <code>Primary display: Auto</code> and <code>iGPU Multi-Monitor: Enabled</code></li>
<li>Boot the kernel with <code>nomodeset i915.modeset=1</code>. This forces the console to
use a good old framebuffer, but explicitly enables video mode setting in the
<code>i915</code> driver (used by the iGPU)</li>
</ul>
</div>
</div>
<div id="outline-container-raid-controller" class="outline-3">
<h3 id="raid-controller">RAID controller</h3>
<div class="outline-text-3">
<p>
Another issue was related to PCI-e power saving. I have a RAID controller
connected to a PCI-e port, and occasionally the kernel would print a bunch of
errors from the <code>3w-9xxx</code> driver. For example:
</p>

<pre class="example" id="3w-log-msg">
3w-9xxx: scsi0: ERROR: (0x03:0x0100): SGL entry contains zero data:address=0x0, length=0x0, cmd=X
</pre>

<p>
This turned out to be caused by something called Active State Power Management,
which tries to power down the PCI Express serial link in order to save power.
This is obviously not a good idea for a RAID controller. To solve this issue I
added <code>pcie_aspm=off</code> to the kernel boot parameters.
</p>
</div>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Revisiting Linux on the desktop</title>
      <link>https://mpolden.no/blog/posts/2023-03-07-revisting-linux-on-the-desktop.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2023-03-07-revisting-linux-on-the-desktop.html</guid>
      
        <pubDate>Tue, 07 Mar 2023 18:43:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2023-03-07">Mar 07, 2023</time></p>

<p>
It's been over a decade since I last used Linux on the desktop! Time really
flies when it's not spent on tweaking your desktop environment and cursing
Nvidia's shoddy drivers. However, I figured I was long overdue for trying Linux
on the desktop again. Especially seeing as I'm a long-time Linux user on other
fronts, such as my personal servers, and it being a significant part of my
<code>$DAYJOB</code>.
</p>

<p>
Why now though? I have an old gaming machine that I wanted to breathe some life
into. The machine used to run Windows 10 and was booted at most a few times a
year. With Microsoft seeming hell-bent on deprecating perfectly fine hardware by
requiring TPM 2.0 in Windows 11, I figured I might as well switch to Linux.
</p>

<p>
To top it off I was greeted by a dialog instructing me "you must sign into your
Microsoft account again" when I booted Windows one last time, although I had
never signed into anything. It was an obvious sign to purge this abomination of
an OS once and for all!
</p>
<div id="outline-container-choosing-a-distribution" class="outline-2">
<h2 id="choosing-a-distribution">Choosing a distribution</h2>
<div class="outline-text-2">
<p>
So how does this go again? It's been so long. Which distribution do I choose?
Which desktop environment?
</p>

<p>
On my trusty personal server I've been running Debian since 2015. Debian would
probably work perfectly fine for my desktop too, but it's a boring choice.
</p>

<p>
The last desktop distribution I remember using was Xubuntu with the XFCE
environment, circa 2013. My impression is that Ubuntu and its derivatives seem
to have lost their way long ago, with numerous privacy concerns and lack of
innovation. Besides, if I wanted Debian unstable I would simply run that.
</p>

<p>
I did have a few requirements in mind though:
</p>
<ul class="org-ul">
<li>I wanted an immutable OS with low maintenance and safe upgrades</li>
<li>I wanted to try KDE again. Not having used it since the 3.x days</li>
</ul>
</div>
</div>
<div id="outline-container-fedora-kinoite" class="outline-2">
<h2 id="fedora-kinoite">Fedora Kinoite</h2>
<div class="outline-text-2">
<p>
Eventually I landed on <a href="https://kinoite.fedoraproject.org/">Fedora Kinoite</a> which comes with the KDE desktop
environment (there's also <a href="https://silverblue.fedoraproject.org/">Fedora Silverblue</a>, which comes with GNOME). Kinoite is
an immutable OS with reliable upgrades, with most applications being isolated in
containers or Flatpaks.
</p>

<p>
The last time I ran Fedora it was called <a href="https://en.wikipedia.org/wiki/Fedora_Linux_release_history#Fedora_Core_2">Core 2</a>, so it's definitely been a
while.
</p>

<p>
The OS itself is immutable and upgrades are managed through <a href="https://coreos.github.io/rpm-ostree/">rpm-ostree</a> - a
hybrid image/package system. In simplified terms <code>rpm-ostree</code> maintains two
snapshots of the root filesystem. Whenever a upgrade is performed, <code>rpm-ostree</code>
creates a new snapshot which you can then boot into. If anything breaks you can
simply roll back to the previous snapshot. Since everything is immutable, there
is no room for package conflicts or other broken states.
</p>

<p>
However, it's still possible to install additional packages by layering them on
top of the immutable snapshot. This new snapshot will still be immutable though.
Layering additional packages is often required in practice, e.g. to install
non-free drivers. In my case I ended up layering the following set of packages:
</p>

<pre class="example" id="packages">
$ rpm-ostree status -b
State: idle
BootedDeployment:
● fedora:fedora/37/x86_64/kinoite
                  Version: 37.20230302.0 (2023-03-02T02:27:19Z)f
               BaseCommit: f14852827a340d0b159239b6455606cd308f7e5e133ef78a75335fbe0e07dc7b
             GPGSignature: Valid signature by ACB5EE4E831C74BB7C168D27F55AD3FB5323552A
          LayeredPackages: akmod-nvidia akmod-wl cronie emacs fzf htop mosh mozilla-openh264 restic ripgrep stow syncthing trash-cli
                           xorg-x11-drv-nvidia zsh zsh-syntax-highlighting
            LocalPackages: rpmfusion-free-release-37-1.noarch rpmfusion-nonfree-release-37-1.noarch
</pre>

<p>
This adds the non-free drivers required by my hardware, H264 video support in
Firefox, a decent shell and the one true editor.
</p>
</div>
</div>
<div id="outline-container-hardware-support" class="outline-2">
<h2 id="hardware-support">Hardware support</h2>
<div class="outline-text-2">
<p>
Most of my hardware worked out of the box, with the exception of my Wi-Fi
adapter which required a non-free driver (provided by the <code>akmod-wl</code> package).
</p>

<p>
The free <code>nouveau</code> driver was too unstable for me, causing the desktop to freeze
at random, so I went with the non-free driver (provided by the <code>akmod-nvidia</code>
package).
</p>

<p>
Bluetooth audio just worked out of the box. Color me impressed!
</p>
</div>
</div>
<div id="outline-container-applications" class="outline-2">
<h2 id="applications">Applications</h2>
<div class="outline-text-2">
<p>
But if everything is immutable, how do I install applications?
</p>

<p>
Desktop applications are available through Discover - KDE's software center.
These applications are installed as <a href="https://www.flatpak.org/">Flatpaks</a>, thus isolating them from the base
system. I recommend enabling the FlatHub repository, which provides a larger
library of software, including non-free software such as Spotify and Steam.
</p>

<p>
For development tools, Fedora Kinoite comes with <a href="https://github.com/containers/toolbox">Toolbox</a> which is a simplified
front-end for interacting with containers. As with Flatpak, putting tools inside
a Toolbox keep them isolated from the base system.
</p>
</div>
<div id="outline-container-hidpi-and-fractional-scaling" class="outline-3">
<h3 id="hidpi-and-fractional-scaling">HiDPI and fractional scaling</h3>
<div class="outline-text-3">
<p>
I use a 27" 4K monitor, and I prefer scaling the desktop to 1.5. This is called
fractional scaling and its implementation in KDE/Wayland is far from perfect.
</p>

<p>
In most cases it works well for applications that installed natively. However,
it does not always work well for applications installed through Flatpak. There's
probably several reasons for this, such as the high variation in UI frameworks.
</p>

<p>
I had to apply some tweaks to the following applications for them to scale properly:
</p>
</div>
<div id="outline-container-spotify" class="outline-4">
<h4 id="spotify">Spotify</h4>
<div class="outline-text-4">
<p>
Copy <code>/var/lib/flatpak/exports/share/applications/com.spotify.Client.desktop</code> to
<code>~/.local/share/applications</code>. Then edit the file and add
<code>--force-device-scale-factor=1.5</code> to the <code>ExecStart</code> section.
</p>
</div>
</div>
<div id="outline-container-vlc" class="outline-4">
<h4 id="vlc">VLC</h4>
<div class="outline-text-4">
<p>
VLC must be told the scale factor as well for some reason. Maybe it will be
fixed in the next major version? If it's ever released.
</p>

<p>
Scale factor can be set with: <code>sudo flatpak override
--env=QT_SCREEN_SCALE_FACTORS=1.5 org.videolan.VLC</code>
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-conclusion" class="outline-2">
<h2 id="conclusion">Conclusion</h2>
<div class="outline-text-2">
<p>
I've been running Fedora Kinote for a month now, and I'm really enjoying my
resurrected desktop. The only major issue I've had is getting all applications
to do fractional scaling properly.
</p>

<p>
The fact that most Steam games work fine in Linux now was a nice surprise.
</p>

<p>
Upgrades have been a breeze! It seems obvious to me that this way of managing OS
packages is the future for Fedora and eventually Red Hat. It's infinitely better
than DNF directly mutating a rickety RPM database.
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Pragmatic self-hosting</title>
      <link>https://mpolden.no/blog/posts/2022-08-17-pragmatic-self-hosting.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2022-08-17-pragmatic-self-hosting.html</guid>
      
        <pubDate>Wed, 17 Aug 2022 00:00:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2022-08-17">Aug 17, 2022</time></p>

<p>
There are many benefits to self-hosting software services, such as learning
about networking, software infrastructure, security as well as increased privacy
and cost saving. However, it's not an all-or-nothing proposal. There are degrees
of difficulty that depend on the exact service you're trying to host. The best
approach is usually a middle-ground where you self-host low-to-medium effort
services and use third-party solutions for the rest.
</p>

<p>
As a long-time computer hobbyist, I've been self-hosting various services since
my high school days. This continued when I started at the university, because
our student union was granted a small server room (or rather, a closet, with
questionable cooling solutions) with enough spare rack space to cover personal
servers.
</p>

<p>
A key to self-hosting is choosing low-maintenance solutions. In recent years,
the popularization of Linux containers have made self-hosting most software even
less complicated.
</p>

<p>
Below is a table of some services you can self-host, the approximate effort
required and some software recommendations:
</p>

<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


<colgroup>
<col  class="org-left" />

<col  class="org-left" />

<col  class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Service</th>
<th scope="col" class="org-left">Effort required</th>
<th scope="col" class="org-left">Software</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Backup</td>
<td class="org-left">Low</td>
<td class="org-left"><a href="https://restic.net/">restic</a></td>
</tr>

<tr>
<td class="org-left">Email</td>
<td class="org-left">High</td>
<td class="org-left">you're probably better off not doing it</td>
</tr>

<tr>
<td class="org-left">File server</td>
<td class="org-left">Low</td>
<td class="org-left">SFTP served by <a href="https://www.openssh.com">OpenSSH</a> or good old <a href="https://www.samba.org">Samba</a></td>
</tr>

<tr>
<td class="org-left">File synchronization</td>
<td class="org-left">Low</td>
<td class="org-left"><a href="https://syncthing.net/">Syncthing</a></td>
</tr>

<tr>
<td class="org-left">Git forge</td>
<td class="org-left">Medium</td>
<td class="org-left"><a href="https://git.zx2c4.com/cgit/about/">cgit</a>, <a href="https://gitea.io/">Gitea</a></td>
</tr>

<tr>
<td class="org-left">Advanced home router</td>
<td class="org-left">Medium-high</td>
<td class="org-left"><a href="https://mikrotik.com/software">Mikrotik router with RouterOS</a>, <a href="https://www.openbsd.org/">OpenBSD</a></td>
</tr>

<tr>
<td class="org-left">Media server</td>
<td class="org-left">Low</td>
<td class="org-left"><a href="https://www.plex.tv/">Plex</a></td>
</tr>

<tr>
<td class="org-left">Metrics monitoring</td>
<td class="org-left">Medium</td>
<td class="org-left"><a href="https://grafana.com/">Grafana</a> and <a href="https://prometheus.io">Prometheus</a></td>
</tr>

<tr>
<td class="org-left">Password manager</td>
<td class="org-left">Medium</td>
<td class="org-left"><a href="https://github.com/dani-garcia/vaultwarden">Vaultwarden</a></td>
</tr>

<tr>
<td class="org-left">VPN gateway</td>
<td class="org-left">Medium</td>
<td class="org-left"><a href="https://www.wireguard.com">WireGuard</a></td>
</tr>

<tr>
<td class="org-left">Webserver with HTTPS</td>
<td class="org-left">Low</td>
<td class="org-left"><a href="https://nginx.org">Nginx</a> and <a href="https://letsencrypt.org">Lets Encrypt</a></td>
</tr>

<tr>
<td class="org-left">Ad-filtering DNS server</td>
<td class="org-left">Medium</td>
<td class="org-left"><a href="https://nlnetlabs.nl/projects/unbound/about/">Unbound</a> with <a href="https://github.com/StevenBlack/hosts">custom filters</a>, <a href="https://pi-hole.net/">Pi-hole</a></td>
</tr>
</tbody>
</table>
]]></description>
    </item>
    
    <item>
      <title>Top TV shows of 2022 so far</title>
      <link>https://mpolden.no/blog/posts/2022-07-08-top-tv-shows-mid-year.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2022-07-08-top-tv-shows-mid-year.html</guid>
      
        <pubDate>Fri, 08 Jul 2022 20:05:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2022-07-08">Jul 08, 2022</time></p>

<p>
2022 is shaping up to be another year filled with an abundance of quality TV.
Due to the sheer amount of new shows or seasons I decided to do a mid-year list.
</p>

<p>
These are the ones I've enjoyed the most, so far:
</p>

<ol class="org-ol">
<li><a href="https://www.imdb.com/title/tt3032476/">Better Call Saul S06</a> (Netflix<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>)</li>
<li><a href="https://www.imdb.com/title/tt4574334/">Stranger Things S04</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt1998372/">Under the Banner of Heaven</a> (Hulu/FX<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>)</li>
<li><a href="https://www.imdb.com/title/tt14192504/">We Own This City</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt8888462/">Pachinko</a> (Apple TV+)</li>
<li><a href="https://www.imdb.com/title/tt5348176/">Barry S03</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt9288030/">Reacher</a> (Amazon Prime)</li>
<li><a href="https://www.imdb.com/title/tt8634332/">The Righteous Gemstones S03</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt14452776/">The Bear</a> (Hulu/FX<sup><a id="fnr.2.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>)</li>
<li><a href="https://www.imdb.com/title/tt11280740/">Severance</a> (Apple TV+)</li>
</ol>

<p>
Honorable mentions, in no particular order:
</p>
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt13365348/">Archive 81</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt7772588/">For All Mankind S03</a> (Apple TV+)</li>
<li><a href="https://www.imdb.com/title/tt11815682/">Hacks S02</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt5875444/">Slow Horses</a> (Apple TV+)</li>
<li><a href="https://www.imdb.com/title/tt1190634/">The Boys S03</a> (Amazon Prime)</li>
<li><a href="https://www.imdb.com/title/tt10166622/">The Dropout</a> (Disney+)</li>
<li><a href="https://www.imdb.com/title/tt13833978/">The Lincoln Lawyer</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt5645432/">The Old Man</a> (Hulu/FX<sup><a id="fnr.2.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup>)</li>
<li><a href="https://www.imdb.com/title/tt2887954/">Tokyo Vice</a> (HBO Max)</li>
</ul>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">

<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Technically not finished yet, but first half was excellent!
</p></div></div>

<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
This will likely be available on Disney+ internationally, later this year.
</p></div></div>


</div>
</div>]]></description>
    </item>
    
    <item>
      <title>Raspberry Pi and no video signal</title>
      <link>https://mpolden.no/blog/posts/2022-02-06-rpi-no-video.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2022-02-06-rpi-no-video.html</guid>
      
        <pubDate>Sun, 06 Feb 2022 09:40:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2022-02-06">Feb 06, 2022</time></p>

<p>
Over the past week I've been setting up a second home office. This required
another monitor, so I decided to re-use the one I had been using for my home
dashboard. However, as I have grown very used to the information displayed by
<a href="https://github.com/mpolden/jarvis2">jarvis</a>, I had to find another monitor for that purpose.
</p>

<p>
Like most geeks I have piles of unused computer parts and accessories (my SO
never misses a chance to make fun of my ever-growing pile of cables), and among
it I found a 20" monitor - an ancient Dell 2007WFP.
</p>

<p>
My dashboard runs on a Raspberry Pi 3B. I've used this monitor for the same
purpose in the past, but this time I encountered a strange display issue. I
connected the monitor using a HDMI-DVI cable and then booted the Raspberry Pi.
The monitor turned on and the kernel boot log was printed, as expected.
</p>

<p>
However, immediately after booting completed, the monitor went to sleep. After
fiddling with a couple of <code>xset</code> commands to disable blanking, I still couldn't
make the monitor turn on after the X server was started.
</p>
<div id="outline-container-initial-debugging" class="outline-2">
<h2 id="initial-debugging">Initial debugging</h2>
<div class="outline-text-2" id="text-initial-debugging">
<p>
Searching the web for "raspberry pi no hdmi signal" yielded many similar
problems, but most of them revolved around having no video signal at all. In my
case I had a video signal until the kernel completed its boot process. The
Raspberry Pi has <a href="https://www.raspberrypi.com/documentation/computers/config_txt.html">countless options</a> for configuring video output, so I tried a
bunch of those, including <code>hdmi_force_hotplug=1</code>, <code>hdmi_safe=1</code> and
<code>config_hdmi_boost=6</code>, but none of them helped.
</p>

<p>
Then I discovered that Raspbian now has two different video drivers,
<code>vc4-fkms-v3d</code> - a legacy driver, and its replacement: <code>vc4-kms-v3d</code>. I'm
running <a href="https://wiki.debian.org/RaspberryPiImages">standard Debian</a> on my Raspberry Pi, but I still have to use the same
non-free firmware as the <a href="https://www.raspberrypi.com/software/">Raspberry Pi OS</a>. I couldn't find too much details on the
difference between these two drivers, but <code>fkms</code> stands for "fake <a href="https://wiki.archlinux.org/title/Kernel_mode_setting">KMS</a>".
Basically <code>vc4-fkms-v3d</code> manages more of the video output pipeline internally,
while the new <code>vc4-kms-v3d</code> driver delegates this work to the kernel.
</p>

<p>
From what I could gather, <code>vc4-kms-v3d</code> is the default since Bullseye, so I
tried reverting to the legacy driver by setting <code>dtoverlay=vc4-fkms-v3d</code> in
<code>/boot/firmware/config.txt</code> (this is the path on standard Debian, on Raspberry
Pi OS it's located in <code>/boot</code>). However, changing the driver had no effect. The
monitor still went to sleep immediately after booting.
</p>
</div>
</div>
<div id="outline-container-solution" class="outline-2">
<h2 id="solution">Solution</h2>
<div class="outline-text-2" id="text-solution">
<p>
While searching for more solutions, I found a suggestion to boot with
<code>drm.debug=0x14</code>, by adding it to <code>/boot/firmware/cmdline.txt</code>. This causes the
kernel to print debug information related to <a href="https://en.wikipedia.org/wiki/Direct_Rendering_Manager">drm</a> - the subsystem responsible for
interfacing with the GPU.
</p>

<p>
Once I did that, I found the following message in the boot log:
</p>

<pre class="example" id="example1">
$ dmesg -T | grep drm | grep disconnected
[Sat Feb  5 19:13:35 2022] [drm:drm_helper_probe_single_connector_modes [drm_kms_helper]] [CONNECTOR:32:HDMI-A-1] status updated from unknown to disconnected
</pre>

<p>
So the kernel believes that the monitor is disconnected? Let's double-check.
</p>

<pre class="example" id="example2">
$ cat /sys/class/drm/card0-HDMI-A-1/status
disconnected
</pre>

<p>
Yes, it was indeed showing up as disconnected. But isn't <code>hdmi_force_hotplug=1</code>
supposed work around exactly this problem? From the <a href="https://www.raspberrypi.com/documentation/computers/config_txt.html#hdmi_force_hotplug">config.txt documentation</a>:
</p>

<blockquote id="quote1">
<p>
Setting <code>hdmi_force_hotplug</code> to 1 pretends that the HDMI hotplug signal is
asserted, so it appears that a HDMI display is attached. In other words, HDMI
output mode will be used, even if no HDMI monitor is detected.
</p>
</blockquote>

<p>
This option changed nothing when using either <code>vc4-fkms-v3d</code> or the
<code>vc4-kms-v3d</code> driver. However, if the new driver delegates more of its
responsibility to the kernel, the kernel itself must surely have a way of
forcing video output?
</p>

<p>
Some further analysis led me to the excellent <a href="https://wiki.archlinux.org/title/Kernel_mode_setting#Forcing_modes">Arch wiki</a>:
</p>

<pre class="example" id="example3">
video=&lt;conn&gt;:&lt;xres&gt;x&lt;yres&gt;[M][R][-&lt;bpp&gt;][@&lt;refresh&gt;][i][m][eDd]
...
D: digital output forced to on (e.g. DVI-I connector)
</pre>

<p>
Adding <code>video=HDMI-A-1:D</code> to <code>/boot/firmware/cmdline.txt</code> and rebooting did the
trick! No more loss of video signal.
</p>

<p>
<i>Update 2022-06-07: <code>video=HDMI-A-1:D</code> should be added to
<code>/etc/default/raspi-extra-cmdline</code> instead so that the configuration is</i>
<i>preserved when <code>update-initramfs</code> runs, e.g. when the kernel is upgraded.</i>
</p>

<p>
I have no idea why this workaround is needed though, I suppose it could be a bug
in EDID information sent by the monitor, a bug in the kernel or some
incompatibility due to using a HDMI-to-DVI adapter.
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Top TV shows of 2021</title>
      <link>https://mpolden.no/blog/posts/2021-12-27-top-tv-shows.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-12-27-top-tv-shows.html</guid>
      
        <pubDate>Mon, 27 Dec 2021 13:36:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-12-27">Dec 27, 2021</time></p>

<p>
2021 was a great year for TV! It seems the release schedule is mostly back on
track and the number of quality shows released easily rivals pre-pandemic times.
</p>

<p>
These are my top picks:
</p>

<ol class="org-ol">
<li><a href="https://www.imdb.com/title/tt10155688/">Mare of Easttown</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt7660850/">Succession S03</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt9174558/">Dopesick</a> (Disney+)</li>
<li><a href="https://www.imdb.com/title/tt11337908/">Maid</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt10574558/">Midnight Mass</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt7660970/">The North Water</a> (Amazon Prime, "Iskaldt Hav" on NRK)</li>
<li><a href="https://www.imdb.com/title/tt11041332/">Yellowjackets</a> (Paramount+)</li>
<li><a href="https://www.imdb.com/title/tt10574236/">Station Eleven</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt11815682/">Hacks</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt7472896/">Mr. Inbetween S03</a> (HBO Max)</li>
</ol>

<p>
Honorable mentions, in no particular order:
</p>
<ul class="org-ul">
<li><a href="https://www.imdb.com/title/tt11471892/">Landscapers</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt5180504/">The Witcher S02</a> (Netflix)</li>
<li><a href="https://www.imdb.com/title/tt13406094/">The White Lotus</a> (HBO Max)</li>
<li><a href="https://www.imdb.com/title/tt7908628/">What We Do in the Shadows S03</a> (HBO Max)</li>
</ul>
]]></description>
    </item>
    
    <item>
      <title>My approach to backups</title>
      <link>https://mpolden.no/blog/posts/2021-12-18-my-approach-to-backups.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-12-18-my-approach-to-backups.html</guid>
      
        <pubDate>Sat, 18 Dec 2021 10:07:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-12-18">Dec 18, 2021</time></p>

<p>
In this post I describe my approach to backing up personal data. My backup
process is something I've refined over many years, striving to keep it simple
while ensuring my backups are complete and redundant.
</p>
<div id="outline-container-the-3-2-1-backup-strategy" class="outline-2">
<h2 id="the-3-2-1-backup-strategy">The 3-2-1 backup strategy</h2>
<div class="outline-text-2" id="text-the-3-2-1-backup-strategy">
<p>
I try to follow the 3-2-1 backup strategy for all my backups. The 3-2-1 strategy
states that you should:
</p>

<ul class="org-ul">
<li>Keep <b>3</b> copies of your data</li>
<li>on <b>2</b> different media</li>
<li>with at least <b>1</b> copy being kept off-site</li>
</ul>

<p>
This strategy covers most of the likely restore scenarios you'll run into, and
some less likely ones. The obvious one is simply restoring your working copy
from backup. By keeping at least two additional copies it ensures that you can
still restore if your main backup media has become corrupt.
</p>

<p>
Keeping one of the copies off-site ensures that you can still restore your data
in the event of a full disaster - such as a lightning strike frying all your
electronics or a fire breaking out in your home.
</p>

<p>
When implementing my backup strategy I have a few additional considerations to
the above strategy:
</p>
<ul class="org-ul">
<li>All backup operations must happen automatically, i.e. I shouldn't spend any
time on the backup process unless something breaks</li>
<li>Two out of three backup copies should be kept on media under my control, not
in the cloud. However, the cloud is a good choice for the off-site backup</li>
<li>Backups must be encrypted</li>
<li>Backups must be tested and verified periodically</li>
<li>Backups must be pruned periodically</li>
<li>Backups must be stored in an open and documented format</li>
<li>I must be notified of any backup errors</li>
</ul>

<p>
In the 3-2-1 strategy I count the working copy of my data as one of those three
copies.
</p>
</div>
</div>
<div id="outline-container-data-overview" class="outline-2">
<h2 id="data-overview">Data overview</h2>
<div class="outline-text-2" id="text-data-overview">
<p>
Before implementing a backup strategy, it's good to have an idea about what data
you need to back up and where that data lives.
</p>

<p>
For example, I have three devices holding data I care about:
</p>
<ul class="org-ul">
<li>Laptop</li>
<li>File server</li>
<li>iPhone</li>
</ul>

<p>
My laptop holds the working copy of all my important data. This includes:
</p>
<ul class="org-ul">
<li>Code and configuration (in Git repositories)</li>
<li>Documents</li>
<li>Email, contacts and calendar</li>
<li>Photos</li>
<li>Data from cloud services I use</li>
</ul>

<p>
Since my laptop runs macOS, all my data is stored in a single location: <code>$HOME</code>.
This makes it easy to backup everything, but I still add some exclude rules for
cache directories and other cruft.
</p>

<p>
My file server holds both a working copy of some less important data and my
primary backups. My phone holds a subset of the data on my laptop, such as
documents, email and photos.
</p>
</div>
</div>
<div id="outline-container-implementation" class="outline-2">
<h2 id="implementation">Implementation</h2>
<div class="outline-text-2" id="text-implementation">
<p>
To implement my backup strategy I rely primarily on these programs:
</p>
<ul class="org-ul">
<li><a href="https://restic.net/">restic</a></li>
<li><a href="https://rclone.org/">rclone</a></li>
<li><a href="https://en.wikipedia.org/wiki/Cron">cron</a></li>
</ul>

<p>
I use <code>restic</code> to create backup snapshots periodically on my laptop and my file
server. Both of these devices run <code>restic backup</code> of my home directory once a
day, and store their data in a shared <a href="https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html">restic repository</a>.
</p>

<p>
In the past I've used <a href="https://www.duply.net">duply</a> (a frontend for <a href="https://duplicity.gitlab.io/duplicity-web/">duplicity</a>) to backup my file server,
and <a href="https://www.arqbackup.com/">Arq</a> to backup my laptop. However, when redoing my setup I wanted to use a
single program across all my devices.
</p>

<p>
My laptop backs up to the restic repository through SFTP, while my file server
accesses the repository locally as the repository resides on its redundant ZFS
filesystem. This results in having two copies of my data. One working copy and
one backup copy in the restic repository. To ensure I also have a third copy,
located off-site, my file server uses <code>rclone sync</code> to mirror the restic
repository to <a href="https://www.jottacloud.com/">Jottacloud</a> nightly.
</p>

<p>
Because the home directory on both my laptop and file server is always backed
up, any other data I need to backup up can simply be downloaded to my home
directory. I do this periodically for data which is stored on remote services,
such as my email.
</p>

<p>
All backup operations are automated with cron, which is installed by default on
most UNIX-like systems. If an operation fails, cron sends me an email.
</p>

<p>
Backup overview:
</p>
<pre class="example" id="example1">
laptop, server (working copy)
    |
    V
restic repository on server (local copy)
    |
    V
jottacloud (off-site copy)
</pre>
</div>
<div id="outline-container-maintenance" class="outline-3">
<h3 id="maintenance">Maintenance</h3>
<div class="outline-text-3" id="text-maintenance">
<p>
Creating daily backups of two machines quickly adds up, so to prune backups I
have wopr run <code>restic forget --prune</code> periodically. I tell restic to keep the
past 30 daily and 24 weekly (6 months) snapshots. Since restic de-duplicates
data that doesn't change between snapshots, this is relatively cheap in terms of
space.
</p>

<p>
As both my laptop and file server share the same restic repository, the laptop
doesn't need to run the pruning process itself, which can be expensive and thus
not ideal to run on a laptop.
</p>

<p>
All data contained in the restic repository is verified by my file server once a
month. This process is made easy by using <code>restic check --read-data</code> which
verifies that the data contained in all backup snapshots can be restored and
that its matches the stored checksums.
</p>
</div>
</div>
<div id="outline-container-data-stored-in-cloud-services" class="outline-3">
<h3 id="data-stored-in-cloud-services">Data stored in cloud services</h3>
<div class="outline-text-3" id="text-data-stored-in-cloud-services">
<p>
Some of my data is integrated into their respective service, such as my Spotify
listening history or check-ins on Untappd. Luckily, since the introduction of
<a href="https://en.wikipedia.org/wiki/General_Data_Protection_Regulation">GDPR</a>, most services now support exporting data to an open format.
</p>

<p>
For most services I've written scripts to export the data, but where this isn't
possible (e.g. Spotify or Netflix) I do a manual export once per quarter.
</p>
</div>
</div>
<div id="outline-container-running-restic-robustly-on-macos" class="outline-3">
<h3 id="running-restic-robustly-on-macos">Running restic robustly on macOS</h3>
<div class="outline-text-3" id="text-running-restic-robustly-on-macos">
<p>
My laptop runs macOS, which includes cron. Adding entries to crontab works fine
for the most part, but when the laptop is asleep it naturally won't execute
anything. It will also not execute any crontab entries that was missed after it
wakes up again.
</p>

<p>
This is problematic when using cron to run backups. After briefly looking into
the mess that is <a href="https://en.wikipedia.org/wiki/Launchd">Launchd</a>, I ended up writing <a href="#appendix--once-sh">once.sh</a> - a shell script that will
run a given command at most once per a given time unit, e.g. once per day.
</p>

<p>
By running <code>restic</code> through <code>once</code> frequently enough, I can be sure that a
backup is created if my laptop is awake for at least 15 minutes. The following
crontab entry runs <code>restic backup</code> once every day, checking every 15 minutes in
the hours 15-23:
</p>

<pre class="example" id="example2">
*/15 15-23 * * * once d restic --quiet backup $HOME
</pre>
</div>
</div>
<div id="outline-container-icloud-and-sharing-files-between-devices" class="outline-3">
<h3 id="icloud-and-sharing-files-between-devices">iCloud and sharing files between devices</h3>
<div class="outline-text-3" id="text-icloud-and-sharing-files-between-devices">
<p>
Even though I'm generally skeptical of storing personal data in a cloud service,
I still use iCloud on my Apple devices. I don't use it for backup purposes, but
I've found it's the most convenient solution for sharing my documents and photos
across all my mobile devices.
</p>
</div>
</div>
</div>
<div id="outline-container-conclusion" class="outline-2">
<h2 id="conclusion">Conclusion</h2>
<div class="outline-text-2" id="text-conclusion">
<p>
In this post I've shown how I use <a href="https://restic.net/">restic</a> and <a href="https://rclone.org/">rclone</a> to implement a 3-2-1 backup
strategy for my data, in an automated fashion.
</p>

<p>
I've been running this setup for the past six months and it has worked
exceptionally well, with the exception of <a href="https://mpolden.no/blog/posts/2021-06-09-jottacloud.html">my cloud storage provider losing data</a>.
In my initial testing of restic, <a href="https://github.com/restic/restic/pull/2718">the pruning process was very slow</a>, but this was
fixed in version 0.12. Beyond that, both rclone and restic have been rock solid!
</p>
</div>
</div>
<div id="outline-container-appendix--once-sh" class="outline-2">
<h2 id="appendix--once-sh">Appendix: once.sh</h2>
<div class="outline-text-2" id="text-appendix--once-sh">
<p>
A simple script for running a command at most once per the given time unit. For
example <code>once d ls</code> will run <code>ls</code> once on the current day. Repeated executions
of <code>once d ls</code> won't actually run <code>ls</code> again until the day changes.
</p>

<div class="org-src-container">
<pre class="src src-sh" id="code1">#!/usr/bin/env bash

# Run a command successfully, at most once per given time unit. E.g. once daily
# or hourly.

set -euo pipefail

declare -r once_root="${ONCE_ROOT:-${HOME}/.once}"
declare -r once_cmd="${0##*/}"
declare -a once_locks

function fail {
    echo -e "$once_cmd: $*" 1&gt;&amp;2
    exit 1
}

function usage {
    echo -e "usage: $once_cmd Y|m|d|H|M|S COMMAND
       $once_cmd ls
       $once_cmd rm ID [ID]..."
    exit 1
}

function lock {
    trap 'rm -fd -- "${once_locks[@]}"' INT TERM EXIT
    local id
    local lock_dir
    for id in "$@"; do
        lock_dir="$once_root/$id/lock"
        if ! mkdir "$lock_dir" 2&gt; /dev/null; then
            fail "could not acquire lock: $lock_dir"
        fi
        once_locks+=("$lock_dir")
    done
}

function list {
    {
        echo -e "ID\tLAST\tCOMMAND"
        sort -k 2,2 -k 3,3 "$once_root"/*/state 2&gt; /dev/null
    } | column -t -s $'\t'
}

function once {
    local -r fmt="$1"
    [[ "$fmt" =~ ^[YmdHMS]$ ]] || fail "invalid format: $fmt"
    shift

    local -r cmd="$*"
    local -r hash="$(echo -n "$cmd" | openssl md5 -r)"
    local -r id="${hash%% *}" # Split on space and return first value
    local -r state_root="$once_root/$id"
    local -r state_file="$state_root/state"
    mkdir -p "$state_root"

    lock "$id"
    local -r now="$(date "+${fmt}=%${fmt}")"
    local -r last_run="$(cut -f 2 "$state_file" 2&gt; /dev/null)"
    if [[ "$last_run" != "$now" ]]; then
        "$@"
        echo -e "$id\t$now\t$cmd" &gt; "$state_file"
    fi
}

function remove {
    shift
    lock "$@"
    local id
    local cmd_dir
    for id in "$@"; do
        cmd_dir="${once_root}/$id"
        rm -f -- "${cmd_dir}/state"
        rm -fd -- "${cmd_dir}/lock" "${cmd_dir}"
    done
}

function main {
    local -r cmd="${1:-}"
    if [[ "$cmd" == "ls" ]]; then
        list
    elif [[ $# -ge 2 ]]; then
        if [[ "$cmd" == "rm" ]]; then
            remove "$@"
        else
            once "$@"
        fi
    else
        usage
    fi
}

main "$@"
</pre>
</div>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Immediate test feedback with entr</title>
      <link>https://mpolden.no/blog/posts/2021-09-29-immediate-test-feedback-with-entr.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-09-29-immediate-test-feedback-with-entr.html</guid>
      
        <pubDate>Wed, 29 Sep 2021 19:39:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-09-29">Sep 29, 2021</time></p>

<p>
When writing code I like receiving feedback from unit tests as quickly as
possible. Recently, I've been writing some Go code and decided to try <a href="https://eradman.com/entrproject/">entr</a> for
running tests automatically. <code>entr</code> is tool that runs arbitrary commands when a
monitored file changes.
</p>

<p>
Prerequisites for this workflow:
</p>
<ul class="org-ul">
<li><a href="https://eradman.com/entrproject/">entr</a>, obviously. It's available in most package repositories, such as <a href="https://tracker.debian.org/pkg/entr">Debian</a>
and <a href="https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/entr.rb">Homebrew</a></li>
<li>The ability to run your test suite from the command line</li>
<li>Nice-to-have: Fast tests</li>
</ul>
<div id="outline-container-example" class="outline-2">
<h2 id="example">Example</h2>
<div class="outline-text-2" id="text-example">
<p>
Consider the following Go source files:
</p>

<pre class="example" id="example1">
$ ls
foo.go  foo_test.go  go.mod
</pre>

<p>
To continuously test this code with <code>entr</code>, we can do:
</p>

<pre class="example" id="example2">
$ find . -name '*.go' -type f | entr -c go test

# or if it's a git repository:
$ git ls-files -co '*.go' | entr -c go test
</pre>

<p>
Whenever a <code>.go</code> file changes, <code>entr</code> will clear the screen (the <code>-c</code> option)
and run <code>go test</code>. Since both compilation and test-running in Go is very fast,
my tests usually complete in the time it takes me to switch from Emacs to my
terminal.
</p>
</div>
</div>
<div id="outline-container-working-around-ghost-files" class="outline-2">
<h2 id="working-around-ghost-files">Working around ghost files</h2>
<div class="outline-text-2" id="text-working-around-ghost-files">
<p>
When working with a Git repository, a watched source file may disappear and
reappear when switching and merging branches. Continuing from the example above,
we create a new branch and add additional files:
</p>

<pre class="example" id="example3">
$ git checkout -b develop
# create bar.go and bar_test.go
$ git ls-files -co '*.go' | entr -c go test
</pre>

<p>
We then commit these new files and switch back to the master branch:
</p>

<pre class="example" id="example4">
$ git add bar*.go &amp;&amp; git commit -m 'add bar'
$ git checkout master
</pre>

<p>
<code>entr</code> will then exit, because a watched file disappears when we switch
branches:
</p>

<pre class="example" id="example5">
entr: cannot open 'bar.go': Operation timed out
</pre>

<p>
Luckily we can work around this by running <code>entr</code> in a simple loop:
</p>

<pre class="example" id="example6">
while true; do git ls-files -co '*.go' | entr -c go test; done
</pre>
</div>
</div>
<div id="outline-container-conclusion" class="outline-2">
<h2 id="conclusion">Conclusion</h2>
<div class="outline-text-2" id="text-conclusion">
<p>
While file system events can be notoriously fiddly and hard to get right, <code>entr</code>
mostly succeeds in hiding these underlying complexities. With <code>entr</code> I was able
to automatically run tests on code changes and thus receive immediate feedback.
</p>

<p>
Mission accomplished!
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Riding in Hafjell</title>
      <link>https://mpolden.no/blog/posts/2021-08-22-riding-in-hafjell.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-08-22-riding-in-hafjell.html</guid>
      
        <pubDate>Sun, 22 Aug 2021 18:57:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-08-22">Aug 22, 2021</time></p>

<p>
For the past ~5 years I've had mountain biking as a hobby, mostly riding the
<a href="https://mtbmap.no/#13/63.4296/10.3102">excellent trails in Bymarka</a>, in all seasons. However, beyond various local
trails and mountains, I haven't visited many bike parks. I've ridden in Åre Bike
Park a few times as well as China Camp State Park in Marin County, as part of a
San Francisco visit. This summer I decided visiting a bike park in my own
country was long overdue.
</p>

<p>
After considering a few different parks, my choice landed on <a href="https://www.hafjellresort.no/en/hafjell-bike-park-in-norway">Hafjell Bike Park</a>.
One of Norway's best locations for downhill biking, and the host of multiple
downhill world cups. Instead of renting a bike, I wanted to try my own trusty
Rocky Mountain Altitude on the trails. While not a proper downhill bike, it's
described as an "aggressive trail" bike.
</p>

<p>
Hafjell offered a great <a href="https://www.hafjell.no/en/summer/trailmap">trail selection</a>, varying from single-track nature trails
with lots of rocks and roots to speedy banked trails with exciting jumps.
</p>

<p>
My favorite trails:
</p>

<ol class="org-ol">
<li>New school and Old school - Single-track nature trails with challenging
terrain, without being too gnarly.</li>
<li>Moetown - Probably the most popular. Not particularly challenging, but lots
of fun jumps and banked corners. Smooth enough to ride really fast!</li>
<li>Buldreløypa - A combination of nature trail and machine-built trail, and
jumps.</li>
<li>Ekspressen - Fast trail with many steep sections. Part of the World
Championship trail.</li>
</ol>

<p>
Over the course of three days I rode approximately 46 km of down hill. I also
found the threshold for how much continuous riding my grip my could handle as I
could barely force my fingers to brake on the last day.
</p>

<p>
For mountain bike enthusiasts I highly recommend visiting Hafjell, at least
once!
</p>

<p>
See below for a couple of videos captured with my GoPro.
</p>
<div id="outline-container-moetown" class="outline-2">
<h2 id="moetown">Moetown</h2>
<div class="outline-text-2" id="text-moetown">
<p>
(after a beer or two)
</p>

<video controls class="media">
    <source src="https://mpolden.no/media/mtb/2021-08-06_hafjell_moetown.mp4" type="video/mp4">

    Sorry, your browser doesn't support embedded videos.
</video>
</div>
</div>
<div id="outline-container-new-school" class="outline-2">
<h2 id="new-school">New School</h2>
<div class="outline-text-2" id="text-new-school">
<video controls class="media">
    <source src="https://mpolden.no/media/mtb/2021-08-06_hafjell_new_school.mp4" type="video/mp4">

    Sorry, your browser doesn't support embedded videos.
</video>
</div>
</div>
<div id="outline-container-buldrel-ypa" class="outline-2">
<h2 id="buldrel-ypa">Buldreløypa</h2>
<div class="outline-text-2" id="text-buldrel-ypa">
<video controls class="media">
    <source src="https://mpolden.no/media/mtb/2021-08-07_hafjell_buldreloypa.mp4" type="video/mp4">

    Sorry, your browser doesn't support embedded videos.
</video>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Emacs and ripgrep</title>
      <link>https://mpolden.no/blog/posts/2021-07-18-emacs-and-ripgrep.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-07-18-emacs-and-ripgrep.html</guid>
      
        <pubDate>Sun, 18 Jul 2021 09:38:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-07-18">Jul 18, 2021</time></p>

<p>
I've been using <a href="https://github.com/BurntSushi/ripgrep">ripgrep</a> for a number of years now. Before it came on the scene I
remember using the early versions of <a href="https://github.com/beyondgrep/ack1">ack</a> and <a href="https://github.com/ggreer/the_silver_searcher">ag</a>, but it appears <code>ripgrep</code> won in
the end and deservedly so. I'm guessing <a href="https://github.com/BurntSushi">BurntSushi's</a> relentless focus on making
it fast is why it eventually became the most popular.
</p>

<p>
Since <code>ripgrep</code> is so exceptionally fast, I use it multiple times a day to find
references in code, track down dead code and general searching in large code
repositories.
</p>

<p>
However, I've noticed that I usually call it from the terminal and as an avid
Emacs user that cannot stand. Emacs has excellent <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Grep-Searching.html">integration with Grep</a>, but it
doesn't support <code>ripgrep</code> by default. It does however support <code>git grep</code> through
its <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Version-Control.html">Version Control integration</a>, which is what I've been using this far.
</p>

<p>
Due to the popularity of <code>ripgrep</code> there are multiple packages that provide
integration with Emacs, such as <a href="https://github.com/Wilfred/deadgrep">deadgrep</a>, <a href="https://github.com/dajva/rg.el">rg.el</a> and <a href="https://github.com/abo-abo/swiper">counsel-ag</a>. However, since
my needs for <code>rigrep</code> integration are basic I wanted to see if I could just
implement it myself.
</p>
<div id="outline-container-considerations" class="outline-2">
<h2 id="considerations">Considerations</h2>
<div class="outline-text-2" id="text-considerations">
<p>
Before switching to <code>ripgrep</code> I used to call <code>git grep</code> by using the <code>vc-git</code>
package in Emacs. When invoked the function prompts for the pattern and then
runs <code>git grep</code> in the root directory of the Git repository of the current file.
</p>

<p>
This is basically how I generally want Grep integration in Emacs to work: I want
to grep interactively from any file and have it default to recursively searching
the repository root.
</p>

<p>
This was easy enough to implement with <code>git grep</code> as it's just a thin wrapper
around <code>vc-git-grep</code>:
</p>

<div class="org-src-container">
<pre class="src src-elisp">(defun mpolden/vc-git-grep ()
  "Run git grep interactively in the current VC tree."
  (interactive)
  (vc-git-grep (grep-read-regexp) "" (vc-root-dir)))
</pre>
</div>

<p>
A few searches for "emacs ripgrep" led me to this useful blog post: <a href="https://stegosaurusdormant.com/emacs-ripgrep/">Blazing-fast
jump-to-grep in Emacs using ripgrep</a> - apparently you can customize the command
used by <code>grep.el</code> by setting the <code>grep-template</code> variable.
</p>

<p>
While the examples in the blog post were fine I didn't copy them outright. I use
Emacs on multiple machines and therefore I try to ensure that any customizations
I add to my <a href="https://github.com/mpolden/emacs.d">emacs.d</a> continue to work even if preferred programs are not
installed.
</p>

<p>
I therefore decided to my custom grep code should support both <code>ripgrep</code>, <code>git
grep</code> and <code>grep</code>, preferring them in that order and falling back gracefully if
e.g. <code>ripgrep</code> isn't installed.
</p>
</div>
</div>
<div id="outline-container-implementation" class="outline-2">
<h2 id="implementation">Implementation</h2>
<div class="outline-text-2" id="text-implementation">
<p>
After a few iterations I ended up with the following:
</p>

<div class="org-src-container">
<pre class="src src-elisp">(defvar mpolden/rg-template "rg -nH --no-heading &lt;C&gt; -e &lt;R&gt; -- &lt;F&gt;"
  "The grep template to use when rg (ripgrep) is installed.")

(defvar mpolden/git-grep-template "git --no-pager grep -n &lt;C&gt; -e &lt;R&gt; -- &lt;F&gt;"
  "The grep template to use when git is installed.
This is only used when running grep in a Git repository.")

(defun mpolden/grep ()
  "Recursively grep in `default-directory' or current Git repository.
This tries to use either rg or git grep if available, and
otherwise falls back to regular grep."
  (interactive)
  (let* ((git-root-dir (locate-dominating-file default-directory ".git"))
         (dir (or git-root-dir default-directory))
         (use-rg (executable-find "rg"))
         (use-git (and git-root-dir (executable-find "git")))
         (grep-template (cond (use-rg mpolden/rg-template)
                              (use-git mpolden/git-grep-template))))
    (grep-apply-setting 'grep-template grep-template)
    ;; never use null device as all programs support -H
    (grep-apply-setting 'grep-use-null-device nil)
    (if (or use-rg use-git)
        (lgrep (grep-read-regexp) "" dir)
      (rgrep (grep-read-regexp) "*" dir))))
</pre>
</div>

<p>
First, we detect if the file we're visiting is inside a Git repository. If it is
we recursively grep starting at the root of the repository, if not we
recursively grep in the directory of the file we're visiting.
</p>

<p>
Second, we prefer using <code>ripgrep</code> if it's in <code>PATH</code> and otherwise we fall back
to <code>git grep</code> if we're in a Git repository and <code>git</code> is installed. Finally we
fall back to regular <code>grep</code> if neither of the programs are available.
</p>

<p>
Finally we call either <code>lgrep</code> or <code>rgrep</code> depending on if the program we
selected searches recursively by default. Since we now detect the Git repository
directly and only use functions from <code>grep</code> we no longer need <code>vc-git</code> at all.
</p>

<p>
That's it. Now I can use <code>ripgrep</code> from within Emacs with just a few lines of
Elisp!
</p>

<p>
(My complete Grep integration is available <a href="https://git.mpolden.no/mpolden/emacs.d/tree/lisp/init-grep.el">here</a>.)
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>On using software</title>
      <link>https://mpolden.no/blog/posts/2021-06-12-using-software.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-06-12-using-software.html</guid>
      
        <pubDate>Sat, 12 Jun 2021 13:23:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-06-12">Jun 12, 2021</time></p>

<p>
As a software engineer I hate using most software. This may seem
counter-intuitive so let me explain.
</p>
<div id="outline-container-the-mythical-expert-user" class="outline-2">
<h2 id="the-mythical-expert-user">The mythical expert user</h2>
<div class="outline-text-2" id="text-the-mythical-expert-user">
<p>
I find that non-technical people often believe that being a software engineer
automatically means being an expert user of all software.
</p>

<p>
Some examples:
</p>

<blockquote id="quote1">
<p>
Hey, you're good with computers right? How can I do X in Word?
</p>
</blockquote>

<blockquote id="quote2">
<p>
Why can't I save images in the Instagram app?
</p>
</blockquote>

<blockquote id="quote3">
<p>
Can you help me setup my cable box?
</p>
</blockquote>

<p>
However, I find that the more time I spend writing software the less software
I want to use.
</p>

<p>
But why is this the case? As a developer of software, shouldn't I also enjoy
using software? No, because most software is terrible.
</p>
</div>
</div>
<div id="outline-container-software-is-terrible" class="outline-2">
<h2 id="software-is-terrible">Software is terrible</h2>
<div class="outline-text-2" id="text-software-is-terrible">
<p>
There's many reasons why most software is a stream of endless trash. Here's a
few of them:
</p>

<ol class="org-ol">
<li><p>
Perverse incentives. Software was traditionally written with only one
incentive in mind: Provide you, the user, value and help you accomplish
tasks.
</p>

<p>
However, as personalized ads and user tracking became viable business
models, software changed to optimize for selling your attention to the
highest bidder and only incidentally providing you value.
</p>

<p>
Google Chrome and Facebook are obvious examples of this.
</p></li>

<li><p>
<a href="https://en.wikipedia.org/wiki/Dark_pattern">Dark patterns</a>. Closely related to 1. Designing user interfaces to trick
users into acting against their self-interest has become commonplace.
</p>

<p>
Social networks live and die by these tricks.
</p></li>

<li><p>
Holds your data hostage. The software provides no reasonable way to export
your data, or the exported data is in a undocumented binary format.
</p>

<p>
This is typically done to prevent you from switching to different
software. Applies to pretty much any <a href="https://en.wikipedia.org/wiki/Software_as_a_service">software-as-a-service</a>.
</p></li>

<li><p>
Churn and forced updates. Modern software changes constantly, UIs are
shuffled and redesigned with questionable rationale, platforms are
deprecated, yet another security issue must be patched and features are
added to increase "engagement".
</p>

<p>
Almost everything is a moving target, and changes are frequently
user-hostile.
</p></li>

<li><p>
Bugs. All software has bugs, ranging from minor to <a href="2021-06-09-jottacloud.html">critical</a>. The more
sophisticated the software is, the more bugs it likely has.
</p>

<p>
I once tried logging the bugs I encountered for a week in the few programs
I use. I quickly had to give up due to the sheer volume.
</p></li>

<li>Complexity. Modern software development consists mostly of haphazardly
gluing together pre-existing libraries, while praying that everything
doesn't collapse under its own weight. Kind of like <a href="https://en.wikipedia.org/wiki/Jenga">Jenga</a>, just with
abstract pieces.</li>
</ol>

<p>
Reasons 1-4 mostly apply to proprietary software. Some of these also apply to
open source software, but a to a lesser degree. See for example the countless
Linux desktop environments, and their endless churn in UI design.
</p>
</div>
</div>
<div id="outline-container-surviving-software" class="outline-2">
<h2 id="surviving-software">Surviving software</h2>
<div class="outline-text-2" id="text-surviving-software">
<p>
So what can a burnt-out software engineer to do combat this insanity?
</p>

<ol class="org-ol">
<li><p>
Limit the software you use and be a late adopter. A <a href="https://news.ycombinator.com/item?id=24590890">Hacker News comment</a>
put it well (paraphrasing):
</p>
<blockquote id="quote4">
<p>
Be a late adopter, and favour simplicity over sophistication
</p>
</blockquote></li>

<li>Take ownership your data. Products and services come and go, export your
data and store it on your own hardware. Fortunately, <a href="https://en.wikipedia.org/wiki/General_Data_Protection_Regulation">GDPR</a> has made it
harder for services to hold your data hostage.</li>

<li><p>
Prioritize privacy. Yes, this may sometimes be inconvenient, but it's
worth it in the long run. Another good <a href="https://news.ycombinator.com/item?id=26913405">Hacker News comment</a> puts it well:
</p>
<blockquote id="quote5">
<p>
Sometimes you gotta get off the train that speeds towards a cliff, even if
it means going by foot for a while.
</p>
</blockquote></li>

<li>Last, but not least: Prefer free software (<a href="http://www.gnu.org/philosophy/free-sw.en.html">free as in freedom</a>). If I had
to name some software I actually don't hate it would be <a href="https://www.gnu.org/software/emacs/">Emacs</a>, <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> and
<a href="https://www.debian.org/">Debian</a>.</li>
</ol>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Jottacloud and the reliability of cloud storage</title>
      <link>https://mpolden.no/blog/posts/2021-06-09-jottacloud.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2021-06-09-jottacloud.html</guid>
      
        <pubDate>Wed, 09 Jun 2021 00:00:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2021-06-09">Jun 09, 2021</time></p>

<p>
I use <a href="https://www.jottacloud.com/">Jottacloud</a> for backing up my personal data to a remote location.
</p>

<p>
While I've yet to write in detail about my backup setup, I've basically
implemented the <a href="https://www.backblaze.com/blog/the-3-2-1-backup-strategy/">3-2-1 backup strategy</a> where I keep my off-site copy at
Jottacloud.
</p>

<p>
Instead of their official client I use the excellent <a href="https://rclone.org/">rclone</a> program to
periodically mirror my backup data - <a href="https://rclone.org/crypt/">encrypted</a>, of course.
</p>
<div id="outline-container-missing-files" class="outline-2">
<h2 id="missing-files">Missing files</h2>
<div class="outline-text-2" id="text-missing-files">
<p>
This setup has worked fine for years, but a couple of months ago I noticed
strange errors from <code>rclone</code> when trying to download some files from
Jottacloud:
</p>

<pre class="example" id="example1">
2021-04-25 21:23:33 ERROR : my/file: Failed to copy: \
  failed to open source object: error 404: \
  no.jotta.backup.errors.PhysicalFileNotFoundException: \
  File unavailable directly on dfs bricks; \
  dfs=dfs-046, relativePathOnDfs=/404/&lt;user-id&gt;/&lt;some-id&gt;/&lt;checksum&gt; (Not Found)
</pre>

<p>
I didn't think much of it at first as cloud storage availability is typically
on the low end, especially for consumer-level services. However, when I
retried the same download a few days later I got a different message:
</p>

<pre class="example" id="example2">
2021-04-27 16:33:10 ERROR : my/file: Failed to copy: \
  failed to open source object: error 404: \
  MissingChecksumException{username='&lt;user-id&gt;', checksum='&lt;checksum&gt;'} (Not Found)
</pre>

<p>
Still failing. Did Jottacloud actually lose my files? But how is <code>rclone</code>
finding these files in the first place, if they're missing? Testing with
<code>rclone ls</code> and the Jottacloud web UI confirmed that Jottacloud thinks the
files exist, but any attempt to read them failed.
</p>

<p>
This is the worst kind of failure for a storage system. The file is clearly
corrupt, or non-existent, depending on how you interpret the errors above. And
the filesystem is lying about the file's existence. I figured it was time to
contact support.
</p>
</div>
</div>
<div id="outline-container-investigation" class="outline-2">
<h2 id="investigation">Investigation</h2>
<div class="outline-text-2" id="text-investigation">
<p>
I notified Jottacloud about this issue in late April. After a few emails
back-and-forth over the next weeks I was told that their developers were
digging into the issue.
</p>

<p>
A month after I initially reported the issue I finally received a conclusion
from support. Jottacloud had found 50 files that were corrupted and
permanently lost, and attached a CSV file listing the affected files.
</p>

<p>
I was told the unreadable files were stored on old disks with a legacy setup,
which are in the process of being retired. As an outsider I don't know much
about the Jottacloud architecture, but they could be referring to the system
described in <a href="https://blog.jottacloud.com/slik-lagrer-vi-filene-dine-75d126f7b3b9">this blog post from 2010</a>.
</p>

<p>
In any case they apologized profusely for losing my data and promised to
improve their service and routines in light of these issues.
</p>
</div>
</div>
<div id="outline-container-trust--but-verify" class="outline-2">
<h2 id="trust--but-verify">Trust, but verify</h2>
<div class="outline-text-2" id="text-trust--but-verify">
<p>
Since I had a local copy of the corrupted files, I could just re-upload them.
But how do I know that my other files are intact? Do I trust the CSV file I
received from support to be complete?
</p>

<p>
Luckily, <code>rclone</code> has a <a href="https://rclone.org/commands/rclone_check/">check command</a> that can compare local and remote files
and report any differences.
</p>

<p>
Running <code>rclone check</code> for all my files stored on Jottacloud found another 30
files corrupted. So that's <b>80</b> corrupted files in total.
</p>

<p>
Takeaways:
</p>
<ol class="org-ol">
<li>Keep local copies of your files, preferably two, on different mediums.</li>
<li>Cheap cloud storage is a great match for backups, but you cannot trust it
blindly.</li>
<li>Verify your backups periodically.</li>
</ol>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Media picks of the decade 2010-2019</title>
      <link>https://mpolden.no/blog/posts/2020-02-08-media-picks.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2020-02-08-media-picks.html</guid>
      
        <pubDate>Sat, 08 Feb 2020 00:00:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2020-02-08">Feb 08, 2020</time></p>

<p>
My top 10 TV shows, movies and games of the past decade.
</p>
<div id="outline-container-tv-shows" class="outline-2">
<h2 id="tv-shows">TV shows</h2>
<div class="outline-text-2" id="text-tv-shows">
<ol class="org-ol">
<li><a href="https://www.imdb.com/title/tt2356777/">True Detective (2014)</a> [season 1]</li>
<li><a href="https://www.imdb.com/title/tt2802850/">Fargo (2014)</a> [season 2]</li>
<li><a href="https://www.imdb.com/title/tt3032476/">Better Call Saul (2015)</a></li>
<li><a href="https://www.imdb.com/title/tt4093826/">Twin Peaks (2017)</a></li>
<li><a href="https://www.imdb.com/title/tt7366338/">Chernobyl (2019)</a></li>
<li><a href="https://www.imdb.com/title/tt2543312/">Halt and Catch Fire (2014)</a></li>
<li><a href="https://www.imdb.com/title/tt4378376/">Babylon Berlin (2017)</a></li>
<li><a href="https://www.imdb.com/title/tt2183404/">Rectify (2013)</a></li>
<li><a href="https://www.imdb.com/title/tt7660850/">Succession (2018)</a></li>
<li><a href="https://www.imdb.com/title/tt5290382/">Mindhunter (2017)</a></li>
</ol>
</div>
</div>
<div id="outline-container-movies" class="outline-2">
<h2 id="movies">Movies</h2>
<div class="outline-text-2" id="text-movies">
<ol class="org-ol">
<li><a href="https://www.imdb.com/title/tt0993846/">The Wolf of Wall Street (2013)</a></li>
<li><a href="https://www.imdb.com/title/tt1596363/">The Big Short (2015)</a></li>
<li><a href="https://www.imdb.com/title/tt7905466/">They Shall Not Grow Old (2018)</a></li>
<li><a href="https://www.imdb.com/title/tt2582802/">Whiplash (2014)</a></li>
<li><a href="https://www.imdb.com/title/tt7131622/">Once Upon a Time in Hollywood (2019)</a></li>
<li><a href="https://www.imdb.com/title/tt5027774/">Three Billboards Outside Ebbing, Missouri (2017)</a></li>
<li><a href="https://www.imdb.com/title/tt3808342/">Son of Saul (2015)</a></li>
<li><a href="https://www.imdb.com/title/tt2543164/">Arrival (2016)</a></li>
<li><a href="https://www.imdb.com/title/tt3416744/">The End of the Tour (2015)</a></li>
<li><a href="https://www.imdb.com/title/tt0816692/">Interstellar (2014)</a></li>
</ol>
</div>
</div>
<div id="outline-container-games" class="outline-2">
<h2 id="games">Games</h2>
<div class="outline-text-2" id="text-games">
<ol class="org-ol">
<li><a href="https://en.wikipedia.org/wiki/Red_Dead_Redemption_2">Red Dead Redemption 2 (2018)</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Witcher_3:_Wild_Hunt">Witcher 3 (2015)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Grand_Theft_Auto_V">Grand Theft Auto V (2013)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Doom_(2016_video_game)">Doom (2016)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Tomb_Raider_(2013_video_game)">Tomb Raider (2013)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Dying_Light">Dying Light (2015)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Age_of_Empires_II:_Definitive_Edition">Age of Empires II: Definitive Edition (2019)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Company_of_Heroes_2">Company of Heroes 2 (2013)</a></li>
<li><a href="https://en.wikipedia.org/wiki/The_Elder_Scrolls_V:_Skyrim">The Elder Scrolls V: Skyrim (2011)</a></li>
<li><a href="https://en.wikipedia.org/wiki/Wolfenstein:_The_New_Order">Wolfenstein: The New Order (2014)</a></li>
</ol>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Reproducible development environments using Vagrant</title>
      <link>https://mpolden.no/blog/posts/2013-11-12-vagrant.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2013-11-12-vagrant.html</guid>
      
        <pubDate>Tue, 12 Nov 2013 00:00:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2013-11-12">Nov 12, 2013</time></p>

<p>
<i>Meta: Originally published by me on the internal Statoil developer blog.</i>
</p>

<p>
The complexity of any given development environment often grows at the same rate
as the project itself.
</p>

<p>
A large project can have countless dependencies such as a web server, a
database, a caching system, a queue and more. This amounts to a lot of
configuration and administration overhead. Suddenly, adding a new developer to
the project means spending days just installing build tools, services, libraries
and other dependencies before he/she can write any code.
</p>

<p>
Each developer might also be running different operating systems and using
different tools, some might run Windows, others Linux or OS X. This adds to the
complexity as some dependencies might have subtle platform-specific differences
and/or bugs. Developing on an OS that differs from the production OS can also
lead to subtle bugs when the application is deployed.
</p>
<div id="outline-container-vagrant" class="outline-2">
<h2 id="vagrant">Vagrant</h2>
<div class="outline-text-2" id="text-vagrant">
<p>
Vagrant attempts to solve this problem by creating reproducible development
environments using virtual machines. Vagrant creates a virtual machine from a
base image and provisions it using either a basic shell script or a
configuration management tool.
</p>

<p>
When using Vagrant each developer will have an identical and isolated
environment which is configured with the necessary dependencies. This reduces
the setup overhead of the project and prevents "works on my machine"
situations.
</p>

<p>
Developers can still use the editor and tools of their choice and won't have
to sacrifice anything (editor and tools such as Git still run on the host
machine).
</p>

<p>
If you already have a configuration management tool in your current
production environment, you can reuse them to configure your Vagrant box. Or
if you're starting out with configuration management tools through Vagrant,
you can reuse what you learn when deploying the application in production.
It's also possible to combine Vagrant with Jenkins using the Vagrant plugin,
and have Jenkins use Vagrant when running jobs.
</p>
</div>
</div>
<div id="outline-container-configuration" class="outline-2">
<h2 id="configuration">Configuration</h2>
<div class="outline-text-2" id="text-configuration">
<p>
Vagrant is configured by creating a <code>Vagrantfile</code> in your project root.
Vagrant reads this file when managing the virtual machine for your project.
</p>

<p>
Vagrant mounts the project workspace inside the virtual machine, so the
actual project files remain on the host machine, but are made available in
<code>/vagrant</code> inside the VM.
</p>

<p>
The <code>Vagrantfile</code> describes the steps necessary to configure your development
environment, such as the base image to use, which ports to forward between
host and guest, the amount of memory for the VM and how it should be
provisioned.
</p>

<p>
The convention is to version this file along with the other files in your
project. You can think of it as just another project-dependent file, like a
<code>Makefile</code>, <code>pom.xml</code> or <code>requirements.txt</code>.
</p>
</div>
</div>
<div id="outline-container-provisioning" class="outline-2">
<h2 id="provisioning">Provisioning</h2>
<div class="outline-text-2" id="text-provisioning">
<p>
The provisioning of the virtual machine is usually done with a configuration
management tool (can also be a shell script for simpler projects).
Provisioning consists of several steps such as installing required packages,
copying configuration files or building configuration files from templates,
ensuring services are running and more. A configuration management tool
automates these steps.
</p>

<p>
How to use configuration management tools is beyond the scope of this blog
post, but Vagrant comes with support for Puppet, Chef, Ansible or Salt all of
which are very well documented.
</p>
</div>
</div>
<div id="outline-container-summary" class="outline-2">
<h2 id="summary">Summary</h2>
<div class="outline-text-2" id="text-summary">
<p>
Vagrant aims to reduce the complexity of working on any given project by
eliminating cumbersome configuration steps and simplifying the workflow.
Having used Vagrant on several projects it delivers on its promise, and it
does make for a more fluid and less error-prone workflow, especially for
complex projects with lots of dependencies.
</p>

<p>
Besides, developers are always more happy writing code than dealing with
mundane tasks.
</p>

<p>
Automate all the things!
</p>

<p>
<a href="http://www.vagrantup.com/">Vagrant</a>
</p>

<p>
<a href="http://docs.vagrantup.com/v2/">Vagrant documentation</a>
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>IPsec VPN with RouterOS and Android</title>
      <link>https://mpolden.no/blog/posts/2013-05-27-ipsec-vpn-with-android-and-routeros.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2013-05-27-ipsec-vpn-with-android-and-routeros.html</guid>
      
        <pubDate>Mon, 27 May 2013 19:06:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2013-05-27">May 27, 2013</time></p>

<p>
I occasionally use WiFi hotspots on my Android phone when I'm either running low
on my data plan quota, or when I require more bandwidth. The problem is that
most hotspots are insecure, and often use nothing but a basic captive portal for
authentication.
</p>
<div id="outline-container-security-considerations-when-using-a-hotspot" class="outline-2">
<h2 id="security-considerations-when-using-a-hotspot">Security considerations when using a hotspot</h2>
<div class="outline-text-2" id="text-security-considerations-when-using-a-hotspot">
<ul class="org-ul">
<li>No encryption between client and hotspot which means that traffic can
easily be eavesdropped</li>
<li>Any authenticated client can easily be spoofed by hijacking their MAC
address</li>
<li>No control over what happens to traffic when it leaves the hotspot router
(logging, fingerprinting, packet sniffing, MITM attacks etc.)</li>
</ul>

<p>
One possible solution to these issues is to use a VPN for end-to-end
encryption of all traffic leaving your device.
</p>
</div>
</div>
<div id="outline-container-configuring-ipsecl2tp-on-routeros" class="outline-2">
<h2 id="configuring-ipsecl2tp-on-routeros">Configuring IPsec/L2TP on RouterOS</h2>
<div class="outline-text-2" id="text-configuring-ipsecl2tp-on-routeros">
<p>
<a href="http://wiki.mikrotik.com/wiki/Manual:RouterOS_features">RouterOS</a> has builtin support for IPsec/L2TP. The following steps describe a
configuration that works with Android devices. This configuration also
includes NAT traversal, so it will work for clients behind NAT.
</p>

<ul class="org-ul">
<li>Enable L2TP server
<a href="http://wiki.mikrotik.com/wiki/Manual:Interface/L2TP#L2TP_Server">[doc</a>]</li>
</ul>

<pre class="example" id="example1">
/interface l2tp-server server set default-profile=l2tp enabled=yes
</pre>

<ul class="org-ul">
<li>Add an IP address pool for clients
<a href="http://wiki.mikrotik.com/wiki/Manual:IP/Pools#Setup">[doc</a>]</li>
</ul>

<pre class="example" id="example2">
/ip pool add name=l2tp-pool ranges=192.168.0.10-192.168.0.20
</pre>

<ul class="org-ul">
<li>Set the router IP inside the tunnel by adding a PPP profile
<a href="http://wiki.mikrotik.com/wiki/Manual:PPP_AAA#User_Profiles">[doc</a>]</li>
</ul>

<pre class="example" id="example3">
/ppp profile add local-address=192.168.0.1 name=l2tp remote-address=l2tp-pool
</pre>

<ul class="org-ul">
<li>Add a PPP user
<a href="http://wiki.mikrotik.com/wiki/Manual:PPP_AAA#User_Database">[doc</a>]</li>
</ul>

<pre class="example" id="example4">
/ppp secret add name=myusername secret=mypassword profile=l2tp service=l2tp
</pre>

<ul class="org-ul">
<li>Configure IPsec proposal (phase 2)
<a href="http://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Proposal_settings">[doc</a>]</li>
</ul>

<pre class="example" id="example5">
/ip ipsec proposal set [ find default=yes ] \
enc-algorithms=3des,aes-128,aes-192,aes-256 lifetime=1h
</pre>

<ul class="org-ul">
<li>Configure IPsec peer (phase 1)
<a href="http://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Peer_configuration">[doc</a>]</li>
</ul>

<pre class="example" id="example6">
/ip ipsec peer add enc-algorithm=aes-256 exchange-mode=main-l2tp \
generate-policy=yes hash-algorithm=sha1 nat-traversal=yes \
secret=mysharedsecret send-initial-contact=no
</pre>

<ul class="org-ul">
<li>Allow IPsec/L2TP traffic (and NAT traversal) in firewall</li>
</ul>

<pre class="example" id="example7">
/ip firewall filter add chain=input dst-port=4500 protocol=udp
/ip firewall filter add chain=input dst-port=1701 protocol=udp
/ip firewall filter add chain=input dst-port=500 protocol=udp
/ip firewall filter add chain=input protocol=ipsec-esp
</pre>

<p>
If RouterOS is not your thing, Debian has an excellent guide on setting up a
similar Android-compatible VPN stack on their <a href="http://wiki.debian.org/HowTo/AndroidVPNServer">wiki</a>.
</p>
</div>
</div>
<div id="outline-container-configuring-android-client" class="outline-2">
<h2 id="configuring-android-client">Configuring Android client</h2>
<div class="outline-text-2" id="text-configuring-android-client">
<p>
These are steps required to configure the client-side on Android 4.2.2:
</p>

<ul class="org-ul">
<li>Go to <i>Settings -&gt; Wireless &amp; Networks -&gt; More&#x2026; -&gt; VPN</i></li>
<li>Add a new VPN profile, give it a name and set the type to
<code>L2TP/IPSec PSK</code></li>
<li>Enter your pre-shared key under <code>IPSec pre-shared key</code></li>
<li>Connect and you should be prompted for your username and password</li>
</ul>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Thoughts about DevOps</title>
      <link>https://mpolden.no/blog/posts/2012-03-27-thoughts-about-devops.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2012-03-27-thoughts-about-devops.html</guid>
      
        <pubDate>Tue, 27 Mar 2012 18:13:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2012-03-27">Mar 27, 2012</time></p>

<p>
When I first heard about <a href="http://en.wikipedia.org/wiki/Devops">DevOps</a> a few years ago my immediate thought was "do we
really need to label this mindset?". I always assumed that development and
operations we're so codependent that trying to seperate them wouldn't make the
least bit of sense for anyone. All of the sudden we need to define a set of
principles for what can only be described as the most logical approach.
</p>

<p>
Developers need a thorough understanding of the complete application stack in
order to create a robust, stable and fast application.
</p>

<p>
The same goes for operations professionals, they need to atleast have a basic
understanding (the more, the better) of the applcation they're managing to make
sure it behaves the way it should under various circumstances.
</p>

<p>
Based on various experiences, discussions with fellow colleagues, both
developers and operations professionals I've come to the conclusion that there
still seems to be a pretty clear line between traditional operations and
software development, atleast in most environments.
</p>
<div id="outline-container-current-state" class="outline-2">
<h2 id="current-state">Current state</h2>
<div class="outline-text-2" id="text-current-state">
<p>
To put it somewhat harshly, developers are often not interested in the stack
that their application is deployed on. They prefer to concentrate on business
logic and leave such details it to the people actually doing operations.
</p>

<p>
Likewise, people doing operations often don't care about the intricate details
of the applications they're deploying and managing.
</p>

<p>
This often results in developers and ops professionals throwing integration and
deployment problems over the wall until they're resolved, which often consumes
loads of time and by extension, money.
</p>
</div>
</div>
<div id="outline-container-the-cloud" class="outline-2">
<h2 id="the-cloud">The cloud</h2>
<div class="outline-text-2" id="text-the-cloud">
<p>
In my experience the cloud changes the usual balance between development and
operations. With several providers now offering infrastructure as a service, the
bar for doing operations-related tasks is lowered significantly. Developers can
just provision new servers at will, and deploy/test their applications as much
as they'd like.
</p>

<p>
The cloud does not make ops professionals redundant however, it just changes
their roles and responsibilites slightly. Management of servers is still
required, but ideally ops professionals should embrace DevOps practices and
focus on automation which in turn is more closely related to development, than
traditional ops.
</p>

<p>
The cloud blurs the line.
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Keep your repository in shape</title>
      <link>https://mpolden.no/blog/posts/2012-03-05-keeping-your-repository-tidy.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2012-03-05-keeping-your-repository-tidy.html</guid>
      
        <pubDate>Mon, 05 Mar 2012 18:56:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2012-03-05">Mar 05, 2012</time></p>

<p>
Following a discussion I had with some friends this weekend, I wanted to write
down a few points I feel are important to maintain a clean and tidy code
repository. The following points usually help ensure developer happiness (for me
anyway). A few of these points may be taken for granted, but are included for
completeness sake.
</p>
<div id="outline-container-use-a-dvcs" class="outline-2">
<h2 id="use-a-dvcs">Use a DVCS</h2>
<div class="outline-text-2" id="text-use-a-dvcs">
<p>
Use a DVCS like <a href="http://git-scm.com/">Git</a> or <a href="http://mercurial.selenic.com/">Mercurial</a>. I'm not going to argue about the advantages
of using a proper DVCS over traditional version control like Subversion or
CVS, as <a href="http://joelonsoftware.com/items/2010/03/17.html">several</a> <a href="http://blog.stackoverflow.com/2010/04/stack-overflow-and-dvcs/">people</a> <a href="http://www.youtube.com/watch?v=4XpnKHJAok8">more</a> <a href="http://whygitisbetterthanx.com/">knowledgeable</a> than me have already done so.
</p>

<p>
The short story is that using distributed VCS is a superior way of working
with code and you'll be a better and more effective programmer if you learn
to use one.
</p>
</div>
</div>
<div id="outline-container-be-vigilant-about-ignoring-files" class="outline-2">
<h2 id="be-vigilant-about-ignoring-files">Be vigilant about ignoring files</h2>
<div class="outline-text-2" id="text-be-vigilant-about-ignoring-files">
<p>
Prevent garbage from appearing in your repository by ignoring the most common
clutter early on. Learn to love .gitignore or svn:ignore (but seriously,
don't use SVN). Typical examples are
</p>

<pre class="example" id="example1">
.class
.py[co]
.out
</pre>

<p>
&#x2026;and other build artifacts.
</p>

<p>
Do not version generated files (code or otherwise). This could for example be
code generated from a database or from XML. After a clean build you should
not have any unstaged files. Generated cruft will sooner or later be added
and commited if it's not ignored. Even people who use git can be lazy and do:
</p>

<pre class="example" id="example2">
git commit -a &amp;&amp; git push
</pre>
</div>
</div>
<div id="outline-container-single-step-builds" class="outline-2">
<h2 id="single-step-builds">Single-step builds</h2>
<div class="outline-text-2" id="text-single-step-builds">
<p>
Make your project build in a single step. After a checkout the developer
should be able to build, test, bundle and package the entire application in a
single step. The step should be completely independent of any local settings
or software, and should not have dependencies other than a compiler and the
build tool(s).
</p>

<p>
Bonus point: Your build server will love you. You do have one right?
</p>
</div>
</div>
<div id="outline-container-isolation" class="outline-2">
<h2 id="isolation">Isolation</h2>
<div class="outline-text-2" id="text-isolation">
<p>
Make your application as independent as possible of its environment.
Ideally a developer should be able to run and debug the complete
application on his local machine. A common way to accomplish this is to
make your application support multiple environments (e.g. "prod" and
"dev"). This simplifies development, debugging, integration testing and
deployment.
</p>
</div>
</div>
<div id="outline-container-your-project-is-not-your-ide" class="outline-2">
<h2 id="your-project-is-not-your-ide">Your project is not your IDE</h2>
<div class="outline-text-2" id="text-your-project-is-not-your-ide">
<p>
Do not version IDE-generated files or other artifacts from your tools. If you
must keep them somewhere, put them in their own directory (like
support/tool<sub>name</sub>) or somewhere that's not the root of the repository. If
you're versioning files containing absolute paths to your home directory and
other nonsense, you're doing it wrong and people will hate you.
</p>

<p>
Strive to make your project independent of the tools you use (e.g. IDE). It's
not a given that everyone will use or even know the same tools as you do. As
<a href="http://en.wikipedia.org/wiki/Pragmatic_Programmer">Pragmatic Programmer</a> so nicely put it, <a href="http://pragprog.com/the-pragmatic-programmer/extracts/tips">"Keep Knowledge in Plain Text"</a>, and
no, IDE-generated XML does not count as plain text.
</p>

<p>
Ending note: People who read Pragmatic Programmer love to work with people
who have read Pragmatic Programmer. Be one of those people.
</p>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>Top 20 XKCD comics</title>
      <link>https://mpolden.no/blog/posts/2009-09-30-top-xkcd-comics.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2009-09-30-top-xkcd-comics.html</guid>
      
        <pubDate>Wed, 30 Sep 2009 16:46:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2009-09-30">Sep 30, 2009</time></p>

<p>
My top 20 XKCD comics.
</p>

<ol class="org-ol">
<li><a href="http://xkcd.com/386/">Duty calls</a></li>
<li><a href="http://xkcd.com/519/">11th grade</a></li>
<li><a href="http://xkcd.com/528/">Windows 7</a></li>
<li><a href="http://xkcd.com/208/">Regular Expressions</a></li>
<li><a href="http://xkcd.com/349/">Success</a></li>
<li><a href="http://xkcd.com/323/">Ballmer Peak</a></li>
<li><a href="http://xkcd.com/327/">Bobby Tables</a></li>
<li><a href="http://xkcd.com/350/">Network</a></li>
<li><a href="http://xkcd.com/416/">Zealous Autoconfig</a></li>
<li><a href="http://xkcd.com/353/">Python</a></li>
<li><a href="http://xkcd.com/202/">YouTube</a></li>
<li><a href="http://xkcd.com/612/">Estimation</a></li>
<li><a href="http://xkcd.com/466/">Moving</a></li>
<li><a href="http://xkcd.com/281/">Online Package Tracking</a></li>
<li><a href="http://xkcd.com/155/">Search History</a></li>
<li><a href="http://xkcd.com/394/">Kilobyte</a></li>
<li><a href="http://xkcd.com/619/">Supported Features</a></li>
<li><a href="http://xkcd.com/181/">Interblag</a></li>
<li><a href="http://xkcd.com/572/">Together</a></li>
<li><a href="http://xkcd.com/352/">Far Away</a></li>
</ol>
]]></description>
    </item>
    
    <item>
      <title>Building a new computer</title>
      <link>https://mpolden.no/blog/posts/2008-04-08-building-a-new-computer.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2008-04-08-building-a-new-computer.html</guid>
      
        <pubDate>Tue, 08 Apr 2008 20:31:00 +0200</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2008-04-08">Apr 08, 2008</time></p>

<p>
I've recently been picking components for my new workstation, and I came up with
the following:
</p>

<ul class="org-ul">
<li>The new GeForce 9800 GTX card. This card apparently only performs a few
percent better than the 8800 Ultra cards, but it has a nice price tag.</li>

<li>A Intel Core 2 Duo E8400 3.0GHz processor. The overclocking potential of this
CPU is very appealing. I've seen a few reviews where they pushed it up to
4.0GHz with aircooling.</li>
</ul>
]]></description>
    </item>
    
    <item>
      <title>MySQL and fast wildcard search</title>
      <link>https://mpolden.no/blog/posts/2008-03-22-mysql-and-fast-wildcard-search.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2008-03-22-mysql-and-fast-wildcard-search.html</guid>
      
        <pubDate>Sat, 22 Mar 2008 09:09:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2008-03-22">Mar 22, 2008</time></p>

<p>
I recently had some speed issues with MySQL and wildcard searching. I wanted to
retrieve results from a table containing over 2.7 million rows using a simple
<code>SELECT FROM table WHERE col LIKE '%string%';</code> query. The problem was that this
took forever and MySQL kept thrashing the hard drive because it couldn't
optimize the query in any way.
</p>

<p>
First I started looking into the most natural solution: <a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html">Full text search</a>.
Creating a <code>FULLTEXT</code> index on the table and changing the query slighty, using
<code>MATCH</code> instead of <code>LIKE</code> speeded up the query a bit, but it still wasn't
enough.
</p>

<p>
Being not too satisfied with the fulltext search I just ended up creating a
temporary copy of the table using the <a href="http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html">MEMORY storage engine</a> and only included
the fields I needed to search. That way the query happens in-memory and the disk
thrashing is avoided. Afterwards, I made my script insert new rows in the
temporary table aswell as the on-disk one, to keep them in sync.
</p>
]]></description>
    </item>
    
    <item>
      <title>Finding a decent editor on Ubuntu</title>
      <link>https://mpolden.no/blog/posts/2008-03-22-finding-a-decent-editor-on-ubuntu.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2008-03-22-finding-a-decent-editor-on-ubuntu.html</guid>
      
        <pubDate>Sat, 22 Mar 2008 09:46:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2008-03-22">Mar 22, 2008</time></p>

<p>
As a recent Ubuntu convert I wanted a simple, yet useful editor for programming.
I was looking for something with a tabbed interface, syntax highlighting and
sessionsaving for starters.
</p>

<p>
My thoughts immediately landed on vim, even before I installed Ubuntu, so it was
one of the first editors I tried. Vim is powerful, no doubt about that, but it
just didn't satisfy my needs. After a week or so of real usage, I realized that
modal editors just isn't my cup of tea. I tried evim (easy vim), but I didn't
like that either, basic stuff like &lt;Ctrl&gt;+&lt;Left/Right&gt; didn't work etc.
</p>

<p>
I also tried <a href="http://www.jedit.org/">jEdit</a>, but no go. In the end I discovered that the included text
editor in GNOME, <a href="http://www.gnome.org/projects/gedit/">gedit</a>, in fact has support for almost everything I needed. And
the stuff it didn't have was available through <a href="http://live.gnome.org/Gedit/Plugins">plugins</a>.
</p>

<p>
The best part of all this was that gedit is installed by default on Ubuntu, as a
part of the GNOME desktop environment. So I didn't have to install anything,
except for the extra plugins. Props to Ubuntu for including useful stuff by
default.
</p>
]]></description>
    </item>
    
    <item>
      <title>PHP in contrast to Perl</title>
      <link>https://mpolden.no/blog/posts/2007-01-10-php-in-contrast-to-perl.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2007-01-10-php-in-contrast-to-perl.html</guid>
      
        <pubDate>Wed, 10 Jan 2007 16:35:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2007-01-10">Jan 10, 2007</time></p>

<p>
I came across this <a href="http://tnx.nl/php">interesting article</a> the other day that describes the main
differences between PHP and Perl (or why PHP is inferior compared to Perl). It's
a good read if you're interested in either one of these two languages.
</p>
]]></description>
    </item>
    
    <item>
      <title>Programmer&#39;s Notepad</title>
      <link>https://mpolden.no/blog/posts/2007-01-06-programmers-notepad.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2007-01-06-programmers-notepad.html</guid>
      
        <pubDate>Sat, 06 Jan 2007 23:40:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2007-01-06">Jan 06, 2007</time></p>

<p>
I recently stumbled over this little gem of a program called <a href="http://www.pnotepad.org/">Programmer's
Notepad</a>. It's likeweight in the same sense as Notepad, but it has a bunch of
features that are useful for programmers.
</p>

<p>
These features include syntax highlighting, regexp search and replace, code
folding and a lot more. I've been using <a href="http://www.editpadpro.com/">EditPad Pro</a> for a while, but it's a bit
heavy on resources (it has more features though) compared to Programmer's
Notepad, so I decided to ditch it. I now use it all the time for writing both
XHTML, CSS, PHP, Perl and Tcl. Oh, and did I mention it's free?
</p>
]]></description>
    </item>
    
    <item>
      <title>Getting usernames and passwords using Google Code Search</title>
      <link>https://mpolden.no/blog/posts/2006-12-31-google-code-search.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2006-12-31-google-code-search.html</guid>
      
        <pubDate>Sun, 31 Dec 2006 03:09:00 +0100</pubDate>
      
      <description><![CDATA[<p>
By using <a href="http://www.google.com/codesearch">Google Code Search</a> you can easily find usernames and passwords for
loads of websites/databases and whatnot. You can either use a simple text search
or a advanced regular expression.
</p>
]]></description>
    </item>
    
    <item>
      <title>ATI discontinuing their old control panel</title>
      <link>https://mpolden.no/blog/posts/2006-01-19-ati-old-control-panel.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2006-01-19-ati-old-control-panel.html</guid>
      
        <pubDate>Thu, 19 Jan 2006 22:19:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2006-01-19">Jan 19, 2006</time></p>

<p>
ATI has discontinued their old control panel in favor of the new Catalyst
Control Center (CCC). Most people won't notice a difference and will probably
not care at all.
</p>

<p>
However, the new CCC requires .NET framework and a lot of people can't stand it.
(Probably because of low performance in the earlier versions) The good news is
that you can still use updated drivers without having to install the CCC. It's
possible to download only the Display Driver package from <a href="http://www.ati.com/support/driver.html">ATI</a> and use different
a control panel like <a href="http://www.guru3d.com/article/atitraytools/189/">ATI Tray Tools</a>.
</p>
]]></description>
    </item>
    
    <item>
      <title>Trimming the OpenBSD kernel</title>
      <link>https://mpolden.no/blog/posts/2006-01-14-trimming-the-openbsd-kernel.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2006-01-14-trimming-the-openbsd-kernel.html</guid>
      
        <pubDate>Sat, 14 Jan 2006 00:48:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2006-01-14">Jan 14, 2006</time></p>

<p>
I've been building a few OpenBSD custom kernels lately and I've noticed that you
can <b>really</b> strip it down a bit.
</p>

<p>
Ok, here's size of the <code>GENERIC</code> kernel that is installed by default:
</p>
<pre class="example" id="example1">
[root@fw:/]$ du -sh bsd.GENERIC
5.1M bsd.GENERIC
</pre>

<p>
The <code>GENERIC</code> kernel comes loaded with a lot of stuff, including
PCMCIA/USB/SCSI/Audio/Radio etc. In the first kernel I compiled I didn't remove
much, mainly SCSI and audio support. This was the result:
</p>

<pre class="example" id="example2">
[root@fw:/]$ du -sh bsd.old
4.3M bsd.old
</pre>

<p>
I wanted to remove even more drivers from it so I stripped it down ever further.
This was the result of the second kernel:
</p>

<pre class="example" id="example3">
[root@fw:/FW]$ du -sh /bsd
2.9M /bsd
</pre>

<p>
As you can see, I managed to remove 2.2M from the <code>GENERIC</code> kernel.
</p>
<div id="outline-container-final-config" class="outline-2">
<h2 id="final-config">Final config</h2>
<div class="outline-text-2" id="text-final-config">
<p>
Here is my final config file:
</p>
<pre class="example" id="example4">
#       $OpenBSD: GENERIC,v 1.431 2005/08/16 16:40:48 deraadt Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

machine         i386
include         "../../../conf/GENERIC"
maxusers        32                      # estimated number of users

#option         I386_CPU        # CPU classes; at least one is REQUIRED
#option         I486_CPU
#option         I586_CPU
option          I686_CPU
#option         GPL_MATH_EMULATE        # floating point emulation.

option          USER_PCICONF    # user-space PCI configuration

#option         VM86            # Virtual 8086 emulation
option          USER_LDT        # user-settable LDT; see i386_set_ldt(2)
option          APERTURE        # in-kernel aperture driver for XFree86

#option         KGDB            # Remote debugger support; exclusive of DDB
#option         "KGDB_DEVNAME=\"pccom\"",KGDBADDR=0x2f8,KGDBRATE=9600

#option         DUMMY_NOPS      # speed hack; recommended

option          COMPAT_SVR4     # binary compatibility with SVR4
option          COMPAT_IBCS2    # binary compatibility with SCO and ISC
option          COMPAT_LINUX    # binary compatibility with Linux
option          COMPAT_FREEBSD  # binary compatibility with FreeBSD
option          COMPAT_BSDOS    # binary compatibility with BSD/OS
option          COMPAT_AOUT     # a.out binaries are emulated

#option         NTFS            # Experimental NTFS support

# or use                root on nfs swap on nfs
config          bsd     swap generic

mainbus0 at root

cpu0    at mainbus?
bios0   at mainbus0
apm0    at bios0 flags 0x0000   # flags 0x0101 to force protocol version 1.1
pcibios0 at bios0 flags 0x0000  # use 0x30 for a total verbose

isa0    at mainbus0
isa0    at pcib?
isa0    at ichpcib?
isa0    at gscpcib?
eisa0   at mainbus0
pci*    at mainbus0

#acpi0  at mainbus?
#acpitimer* at acpi?
#hpet*  at acpi?

option          ACPIVERBOSE
#option         ACPI_ENABLE

option          PCIVERBOSE
option          EISAVERBOSE
#option         USBVERBOSE

pchb*   at pci?                 # PCI-Host bridges
ppb*    at pci?                 # PCI-PCI bridges
pci*    at ppb?
pci*    at pchb?
pcib*   at pci?                 # PCI-ISA bridge
ichpcib* at pci?                # Intel ICHx/ICHx-M LPC bridges
gscpcib* at pci?                # NS Geode SC1100 PCI-ISA bridge
gpio*   at gscpcib?

# power management and other environmental stuff
#amdpm* at pci?                 # AMD768MPX
elansc* at pci?                 # AMD Elan SC520 System Controller
gpio*   at elansc?
geodesc* at pci?                # Geode SC1100/SCx200 IAOC
#piixpm* at pci?                # Intel PIIX PM
#gscpm* at pci?                 # NS Geode SC1100 SMI/ACPI module
#ichwdt* at pci?                # Intel 6300ESB ICH watchdog timer

# National Semiconductor LM7[89] and compatible hardware monitors
lm0     at isa? port 0x290
#lm1    at isa? port 0x280
#lm2    at isa? port 0x310
nsclpcsio* at isa? port 0x2e            # NS PC87366 LPC Super I/O
nsclpcsio* at isa? port 0x4e
gpio*   at nsclpcsio?
gscsio* at isa? port 0x2e               # NS Geode SC1100 Super I/O
gscsio* at isa? port 0x15c
iic0    at gscsio?                      # ACCESS.bus 1
iic1    at gscsio?                      # ACCESS.bus 2
lmtemp0 at iic1 addr 0x48               # NS LM75/LM77 temperature sensor

it0     at isa? port 0x290              # IT8705F, IT8712F and SiS970 hardware
                                        # monitors
viaenv* at pci?                         # VIA VT82C686A hardware monitor
viasio* at isa? port 0x2e flags 0x0000  # VIA VT1211 LPC Super I/O
viasio* at isa? port 0x4e flags 0x0000
aps0    at isa? port 0x1600             # ThinkPad Active Protection System

# ISA PCMCIA controllers
#option PCMCIAVERBOSE
#pcic0  at isa? port 0x3e0 iomem 0xd0000 iosiz 0x10000
#pcic1  at isa? port 0x3e2 iomem 0xe0000 iosiz 0x4000
#pcic2  at isa? port 0x3e4 iomem 0xe0000 iosiz 0x4000
#tcic0  at isa? disable port 0x240 iomem 0xd0000 iosiz 0x10000

# ISA Plug-and-Play PCMCIA controllers
#option DEBUG_ISAPNP
#pcic*  at isapnp?

# PCI PCMCIA controllers
pcic*  at pci?

# PCMCIA bus support
pcmcia*       at pcic?
#pcmcia* at tcic?

# CardBus bus support
cardbus*        at cardslot?
#pcmcia*                at cardslot?
cbb*            at pci?
cardslot*       at cbb?

# USB Controllers
#ehci*  at pci?                         # Enhanced Host Controller
#ehci*  at cardbus?                     # Enhanced Host Controller
#uhci*  at pci?                         # Universal Host Controller (Intel)
#ohci*  at pci?                         # Open Host Controller
#ohci*  at cardbus?                     # Open Host Controller

# USB bus support
#usb*   at ehci?
#usb*   at uhci?
#usb*   at ohci?

# USB devices
#uhub*  at usb?                 # USB Hubs
#uhub*  at uhub?                # USB Hubs
#umodem*        at uhub?                # USB Modems/Serial
#ucom*  at umodem?
#uvisor*        at uhub?                # Handspring Visor
#ucom*  at uvisor?
#uvscom*        at uhub?                # SUNTAC Slipper U VS-10U serial
#ucom*  at uvscom?
#ubsa*  at uhub?                # Belkin serial adapter
#ucom*  at ubsa?
#uftdi* at uhub?                # FTDI FT8U100AX serial adapter
#ucom*  at uftdi?
#uplcom* at uhub?               # I/O DATA USB-RSAQ2 serial adapter
#ucom*  at uplcom?
#umct*  at uhub?                # MCT USB-RS232 serial adapter
#ucom*  at umct?
#uipaq* at uhub?                # iPAQ serial adapter
#ucom*  at uipaq?
#uaudio* at uhub?               # USB Audio
#audio* at uaudio?
#umidi* at uhub?                # USB MIDI
#midi*  at umidi?
#ulpt*  at uhub?                # USB Printers
#umass* at uhub?                # USB Mass Storage devices
#scsibus* at umass?
#atapiscsi* at umass?
#uhidev*        at uhub?                # Human Interface Devices
#ums*   at uhidev?              # USB mouse
#wsmouse* at ums? mux 0
#ukbd*  at uhidev?              # USB keyboard
#wskbd* at ukbd? mux 1
#uhid*  at uhidev?              # USB generic HID support
#aue*   at uhub?                # ADMtek AN986 Pegasus Ethernet
#atu*   at uhub?                # Atmel AT76c50x based 802.11b
#axe*   at uhub?                # ASIX Electronics AX88172 USB Ethernet
#cue*   at uhub?                # CATC USB-EL1201A based Ethernet
#kue*   at uhub?                # Kawasaki KL5KUSB101B based Ethernet
#cdce*  at uhub?                # CDC Ethernet
#upl*   at uhub?                # Prolific PL2301/PL2302 host-to-host `network'
#udav*  at uhub?                # Davicom DM9601 based Ethernet
#url*   at uhub?                # Realtek RTL8150L based adapters
#wi*    at uhub?                # WaveLAN IEEE 802.11DS
#urio*  at uhub?                # Diamond Multimedia Rio 500
#uscanner* at uhub?             # USB Scanners
#usscanner* at uhub?            # USB SCSI scanners, e.g., HP5300
#scsibus* at usscanner?
#uyap*  at uhub?                # Y@P firmware loader
#udsbr* at uhub?                # D-Link DSB-R100 radio
#radio* at udsbr?               # USB radio
#ubt*   at uhub?                # USB Bluetooth
#ugen*  at uhub?                # USB Generic driver
#ural*  at uhub?                # Ralink RT2500
#option NATM
#ueagle* at uhub?               # Analog Devices Eagle ADSL
puc*    at pci?                 # PCI "universal" communication device

npx0    at isa? port 0xf0 irq 13        # math coprocessor
isadma0 at isa?
isapnp0 at isa?

option  WSDISPLAY_COMPAT_USL            # VT handling
option  WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
option  WSDISPLAY_DEFAULTSCREENS=6
option  WSDISPLAY_COMPAT_PCVT           # emulate some ioctls

pckbc0          at isa?         # PC keyboard controller
pckbd*          at pckbc?       # PC keyboard
pms*            at pckbc?       # PS/2 mouse for wsmouse
pmsi*           at pckbc?       # PS/2 "Intelli"mouse for wsmouse
vga0            at isa?
option          PCIAGP
vga*            at pci?
pcdisplay0      at isa?         # CGA, MDA, EGA, HGA
wsdisplay*      at vga?
wsdisplay*      at pcdisplay?
wskbd*          at pckbd? mux 1
wsmouse*        at pms? mux 0
wsmouse*        at pmsi? mux 0

pcppi0          at isa?
sysbeep0        at pcppi?

pccom0  at isa? port 0x3f8 irq 4        # standard PC serial ports
pccom1  at isa? port 0x2f8 irq 3
pccom2  at isa? port 0x3e8 irq 5
#pccom3 at isa? port 0x2e8 irq 9        # (conflicts with some video cards)
ast0    at isa? port 0x1a0 irq 5        # AST 4-port serial card
#ast1   at isa? port 0x2a0 irq 6        # 2nd AST 4-port serial card
pccom*  at ast?
#boca0  at isa? port 0x100 irq 5        # BOCA 8-port serial cards
#pccom* at boca?
#addcom0        at isa? port 0x108 irq 5        # Addonics FlexPort
#pccom* at addcom?
#rtfps0 at isa? port 0x1230 irq 10      # RT 4-port serial cards
#pccom* at rtfps?
#hsq0   at isa? port 0x140 irq 10       # Hostess 4-port serial card
#pccom* at hsq?
#pccom*  at pcmcia?                      # PCMCIA modems/serial ports
#pccom*  at isapnp?
#pccom*  at puc?
#pccom*  at cardbus?

# option for using CD1400 handshaking for incoming data
# requires a special cable that exchanges the RTS and DTR lines
# options CY_HW_RTS
cy0     at isa? iomem 0xd4000 irq 12    # ISA cyclom serial card
cy*     at pci?                         # PCI cyclom serial card
#cz*    at pci?                         # Cyclades-Z multi-port serial boards

lpt0    at isa? port 0x378 irq 7        # standard PC parallel ports
lpt1    at isa? port 0x278
lpt2    at isa? port 0x3bc
lpt*    at puc?

lms0    at isa? port 0x23c irq 5        # Logitech bus mouse
lms1    at isa? port 0x238 irq 5
mms0    at isa? port 0x23c irq 5        # Microsoft InPort mouse
mms1    at isa? port 0x238 irq 5

wsmouse*        at lms? mux 0
wsmouse*        at mms? mux 0

#bha0   at isa? port 0x330              # BusLogic [57]4X SCSI controllers
#bha1   at isa? disable port 0x334      # BusLogic [57]4X SCSI controllers
#bha2   at isa? disable
#bha*   at pci?
#bha*   at eisa?                # XXX eisa still runs in isa-compat
#scsibus* at bha?
#aha0   at isa? port 0x330      # Adaptec 154[02] SCSI controllers
#aha1   at isa? port 0x334      # Adaptec 154[02] SCSI controllers
#aha*   at isapnp?
#scsibus* at aha?
#ahb*   at eisa?                # Adaptec 174[024] SCSI controllers
#scsibus* at ahb?
#ahc0   at isa?                 # Adaptec 284x SCSI controllers
#ahc*   at eisa?                # Adaptec 274x, aic7770 SCSI controllers
#ahc*   at pci?                 # Adaptec 2940/3940/78?? SCSI controllers
#scsibus* at ahc?
#ahd*   at pci?                 # Adaptec 79?? SCSI controllers
#scsibus* at ahd?
#mpt*   at pci?                 # LSI Fusion-MPT SCSI/Fibre
#scsibus* at mpt?
#dpt*   at pci?                 # DPT SmartCache/SmartRAID PCI
#dpt*   at eisa?                # DPT SmartCache/SmartRAID EISA
#scsibus* at dpt?
#gdt*   at pci?                 # ICP Vortex GDT RAID controllers
#scsibus* at gdt?
#twe*   at pci?                 # 3ware Escalade RAID controllers
#scsibus* at twe?
#aac*   at pci?                 # Adaptec FSA RAID controllers
#scsibus* at aac?
#ami*   at pci?                 # AMI MegaRAID controllers
#scsibus* at ami?
#cac*   at pci?                 # Compaq Smart ARRAY [234]* RAID controllers
#cac*   at eisa?
#scsibus* at cac?
#ciss*  at pci?                 # Compaq Smart ARRAY [56]* RAID controllers
#scsibus* at ciss?
#iha*   at pci?                 # Initio Ultra/UltraWide SCSI controllers
#scsibus* at iha?
#isp*   at pci?                 # Qlogic ISP [12]0x0 SCSI/FibreChannel
#scsibus* at isp?
#aic0   at isa? port 0x340 irq 11 # Adaptec 152[02] SCSI controllers
#aic*   at pcmcia?              # PCMCIA based aic SCSI controllers
#aic*   at isapnp?              # isapnp configured aic SCSI controllers
#scsibus* at aic?
#esp*   at pcmcia?              # PCMCIA based NCR 53C9X SCSI
#scsibus* at esp?
#siop*  at pci?                 # NCR 538XX SCSI controllers(new)
#scsibus* at siop?
#adv*   at pci?                 # AdvanSys 1200A/B and ULTRA SCSI
#scsibus* at adv?
#adw*   at pci?                 # AdvanSys ULTRA WIDE SCSI
#scsibus* at adw?
#pcscp* at pci?                 # AMD 53c974 PCscsi-PCI SCSI
#scsibus* at pcscp?
#sea0   at isa? disable iomem 0xc8000 irq 5 # Seagate ST0[12] SCSI controllers
#scsibus* at sea?
#trm*   at pci?                 # Tekram DC-3x5U SCSI Controllers
#scsibus* at trm?
#uha0   at isa? port 0x330      # UltraStor [13]4f SCSI controllers
#uha1   at isa? disable port 0x334 # UltraStor [13]4f SCSI controllers
#uha*   at eisa?                # UltraStor 24f SCSI controllers
#scsibus* at uha?
#wds0   at isa? disable port 0x350 irq 15 drq 6 # WD7000 and TMC-7000 controllers
#wds1   at isa? port 0x358 irq 11 drq 5
#scsibus* at wds?

#sd*    at scsibus?             # SCSI disk drives
#st*    at scsibus?             # SCSI tape drives
#cd*    at scsibus?             # SCSI CD-ROM drives
#ch*    at scsibus?             # SCSI autochangers
#ss*    at scsibus?             # SCSI scanners
#safte* at scsibus?             # SCSI accessed fault-tolerant enclosures
#ses*   at scsibus?             # SCSI enclosure services
#uk*    at scsibus?             # unknown SCSI

fdc0    at isa? port 0x3f0 irq 6 drq 2  # standard PC floppy controllers
#fdc1   at isa? port 0x370
fd*     at fdc? flags 0x00

#mcd0   at isa? port 0x300 irq 10       # Mitsumi CD-ROM drives

# IDE controllers
pciide* at pci? flags 0x0000

wdc0    at isa? port 0x1f0 irq 14 flags 0x00
wdc1    at isa? port 0x170 irq 15 flags 0x00
#wdc*    at pcmcia?
wdc*    at isapnp?

# IDE hard drives
wd*     at wdc? flags 0x0000
wd*     at pciide? flags 0x0000

# ATAPI&lt;-&gt;SCSI
#atapiscsi* at wdc?
#atapiscsi* at pciide?
#scsibus* at atapiscsi?

#wt0    at isa? port 0x308 irq 5 drq 1  # Archive and Wangtek QIC tape drives

# Networking devices
#we0    at isa? port 0x280 iomem 0xd0000 irq 9  # WD/SMC 80x3 ethernet
#we1    at isa? port 0x300 iomem 0xcc000 irq 10 #
#we2    at isa? port 0x280 iomem 0xd0000 irq 3  # WD/SMC 80x3 ethernet
#we*    at isapnp?
#ec0    at isa? port 0x250 iomem 0xd8000 irq 9  # 3C503 ethernet
#ne0    at isa? port 0x240 irq 9                # NE[12]000 ethernet
#ne1    at isa? port 0x300 irq 10               # NE[12]000 ethernet
#ne2    at isa? port 0x280 irq 9                # NE[12]000 ethernet
#ne*    at isapnp?                              # NE[12]000 PnP ethernet
#eg0    at isa? disable port 0x310 irq 5        # 3C505/Etherlink+ ethernet
#el0    at isa? disable port 0x300 irq 9        # 3C501 ethernet
#ep0    at isa?                                 # 3C509 ethernet
#ep*    at isapnp?                              # 3C509 PnP ethernet
#ep*    at isa?                                 # 3C509 ethernet
#ef*    at isapnp?                              # 3C515 PnP ethernet
#ie0    at isa? port 0x360 iomem 0xd0000 irq 7  # StarLAN and 3C507
#ie1    at isa? port 0x300 irq 10               # EtherExpress
#lc0    at isa? port 0x200                      # DEC EtherWorks
#lc1    at isa? port 0x280                      # DEC EtherWorks
#le0    at isa? port 0x360 irq 15 drq 6         # IsoLan, NE2100, and DEPCA
#ex0    at isa? port 0x320 irq 5                # Intel EtherExpress PRO/10
#tr0    at isa? port 0xa20 iomem 0xd8000        # IBM TROPIC based Token-Ring
#tr1    at isa? port 0xa24 iomem 0xd0000        # IBM TROPIC based Token-Ring
#tr*    at isa?                         # 3COM TROPIC based Token-Ring
#ep0    at eisa?
#ep*    at eisa?                        # 3C579 ethernet
#fea*   at eisa?                        # DEC DEFEA FDDI
#lmc*   at pci?                         # Lan Media Corp SSI/T3/HSSI
#san*   at pci?                         # Sangoma PCI AFT card
#le*    at pci?                         # PCnet-PCI based ethernet
#le*    at isapnp?
#pcn*   at pci?                         # AMD PCnet-PCI Ethernet
#de*    at pci?                         # DC21X4X-based ethernet
fxp*    at pci?                         # EtherExpress 10/100B ethernet
fxp*    at cardbus?                     # Intel PRO/100 ethernet
#ne*    at pci?                         # NE2000-compat ethernet
#ep0    at pci?                         # 3C59x ethernet
#ep*    at pci?                         # 3C59x ethernet
#ne*    at pcmcia?                      # PCMCIA based NE2000 ethernet
#ep*    at pcmcia?                      # PCMCIA based 3C5xx ethernet
#sm*    at pcmcia?                      # PCMCIA based sm ethernet
#xe*    at pcmcia?                      # Xircom ethernet
#fpa*   at pci?                         # DEC DEFPA FDDI
xl*     at pci?                         # 3C9xx ethernet
xl*     at cardbus?                     # 3C575/3C656 ethernet
rl*     at pci?                         # RealTek 81[23]9 ethernet
rl*     at cardbus?                     # RealTek 81[23]9 ethernet
#mtd*   at pci?                         # Myson MTD800/803/891
#epic*  at pci?                         # SMC EPIC/100 ethernet
#tl*    at pci?                         # Compaq Thunderlan ethernet
#vr*    at pci?                         # VIA Rhine ethernet
#wb*    at pci?                         # Winbond W89C840F ethernet
#sf*    at pci?                         # Adaptec AIC-6915 ethernet
#sis*   at pci?                         # SiS 900/7016 ethernet
#ste*   at pci?                         # Sundance ST201 ethernet
dc*     at pci?                         # 21143, "tulip" clone ethernet
dc*     at cardbus?                     # 21143, "tulip" clone ethernet
#ti*    at pci?                         # Alteon Tigon 1Gb ethernet
#skc*   at pci?                         # SysKonnect GEnesis 984x
#sk*    at skc?                         #  each port of above
#em*    at pci?                         # Intel Pro/1000 ethernet
#txp*   at pci?                         # 3com 3CR990
#nge*   at pci?                         # NS DP83820/DP83821 GigE
#bge*   at pci?                         # Broadcom BCM570x (aka Tigon3)
#re*    at pci?                         # Realtek 8169/8169S/8110S
#re*    at cardbus?                     # Realtek 8169/8169S/8110S
#stge*  at pci?                         # Sundance TC9021 GigE
#lge*   at pci?                         # Level1 LXT1001 GigE
#hme*   at pci?                         # Sun Happy Meal
#bce*   at pci?                         # Broadcom BCM4401
#vge*   at pci?                         # VIA VT612x
#musycc*        at pci?                         # Conexant HDLC controller
#art*   at musycc?                      # Accoom Artery E1/T1 cards

# Wireless network cards
#ath*   at pci?                         # Atheros AR5k (802.11a/b/g)
#ath*   at cardbus?                     # Atheros AR5k (802.11a/b/g)
#atw*   at pci?                         # ADMtek ADM8211 (802.11)
#atw*   at cardbus?                     # ADMtek ADM8211 (802.11)
#wi*    at pci?                         # WaveLAN IEEE 802.11DS
#wi*    at pcmcia?                      # WaveLAN IEEE 802.11DS
#awi*   at pcmcia?                      # Bay Networks IEEE 802.11FH
#an*    at pci?                         # Aironet IEEE 802.11DS
#an*    at isapnp?                      # Aironet IEEE 802.11DS
#an*    at pcmcia?                      # Aironet IEEE 802.11DS
#cnw*   at pcmcia?                      # Xircom Netwave
#ray*   at pcmcia?                      # Raylink Aviator2.4/Pro 802.11FH
#ipw*   at pci?                         # Intel PRO/Wireless 2100
#iwi*   at pci?                         # Intel PRO/Wireless 2200BG/2915ABG
#ral*   at pci?                         # Ralink RT2500
#ral*   at cardbus?                     # Ralink RT2500
#rtw*   at pci?                         # Realtek 8180
#rtw*   at cardbus?                     # Realtek 8180

# Media Independent Interface (mii) drivers
exphy*  at mii?                         # 3Com internal PHYs
inphy*  at mii?                         # Intel 82555 PHYs
iophy*  at mii?                         # Intel 82553 PHYs
icsphy* at mii?                         # ICS 1890 PHYs
lxtphy* at mii?                         # Level1 LXT970 PHYs
nsphy*  at mii?                         # NS and compatible PHYs
nsphyter*       at mii?                 # NS and compatible PHYs
qsphy*  at mii?                         # Quality Semi QS6612 PHYs
luphy*  at mii?                         # Lucent LU6612 PHY
sqphy*  at mii?                         # Seeq 8x220 PHYs
rlphy* at mii?                          # RealTek 8139 internal PHYs
mtdphy* at mii?                         # Myson MTD972 PHYs
dcphy*  at mii?                         # Digital Clone PHYs
acphy*  at mii?                         # Altima AC101 PHYs
amphy*  at mii?                         # AMD 79C873 PHYs
tqphy*  at mii?                         # TDK 78Q212x PHYs
bmtphy* at mii?                         # Broadcom 10/100 PHYs
brgphy* at mii?                         # Broadcom Gigabit PHYs
eephy* at mii?                          # Marvell 88E1000 series PHY
xmphy*  at mii?                         # XaQti XMAC-II PHYs
nsgphy* at mii?                         # NS gigabit PHYs
urlphy* at mii?                         # Realtek RTL8150L internal PHY
rgephy* at mii?                         # Realtek 8169S/8110S PHY
ciphy*  at mii?                         # Cicada CS8201 10/100/1000 copper PHY
ukphy*  at mii?                         # "unknown" PHYs

#pss0    at isa? port 0x220 irq 7 drq 6  # Personal Sound System
#sp0     at pss0 port 0x530 irq 10 drq 0 # sound port driver

#eap*    at pci?                         # Ensoniq AudioPCI S5016
#eso*    at pci?                         # ESS Solo-1 PCI AudioDrive
#sv*     at pci?                         # S3 SonicVibes (S3 617)
#neo*    at pci?                         # NeoMagic 256AV/ZX
#cmpci*  at pci?                         # C-Media CMI8338/8738
#auich*  at pci? flags 0x0000            # i82801 ICH AC'97 audio
#auixp*  at pci?                         # ATI IXP AC'97 Audio
#autri*  at pci? flags 0x0000            # Trident 4D WAVE
#auvia*  at pci?                         # VIA VT82C686A
#clcs*   at pci?                         # CS4280 CrystalClear audio
#clct*   at pci?                         # CS4281 CrystalClear audio
#fms*    at pci?                         # Forte Media FM801
#maestro* at pci?                        # ESS Maestro PCI
#esa*    at pci?                         # ESS Maestro3 PCI
#yds*    at pci? flags 0x0000            # Yamaha YMF Audio
#emu*    at pci?                         # SB Live!
#sb0     at isa? port 0x220 irq 5 drq 1  # SoundBlaster
#sb*     at isapnp?
#ess*    at isapnp?                      # ESS Tech ES188[78], ES888
#wss0    at isa? port 0x530 irq 10 drq 0 # Windows Sound System
#wss*    at isapnp?
#pas0    at isa? port 0x220 irq 7 drq 1  # ProAudio Spectrum
#gus0    at isa? port 0x220 irq 7 drq 1 drq2 6   # Gravis (drq2 is record drq)
#ym*     at isapnp?
#mpu*    at isapnp?
#mpu*    at isa? port 0x300              # generic MPU, Yamaha SW60XG
#aria0  at isa? port 0x280 irq 10 drq 0 flags 0x1 # Prometheus Aria 16

# OPL[23] FM synthesizers
#opl0   at isa? port 0x388      # use only if not attached to sound card
#opl*   at eso?
#opl*   at sb?
#opl*   at ess?
#opl*   at yds?

# MIDI support
#midi*  at pcppi?               # MIDI interface to the PC speaker
#midi*  at sb?                  # SB MPU401 port
#midi*  at opl?                 # OPL FM synth
#midi*  at ym?
#midi*  at mpu?
#midi*  at autri?
#midi*  at eap?

spkr0   at pcppi?               # PC speaker

# Audio Support
#audio* at sb?
#audio* at gus?
#audio* at pas?
#audio* at sp?
#audio* at ess?
#audio* at wss?
#audio* at ym?
#audio* at eap?
#audio* at eso?
#audio* at sv?
#audio* at neo?
#audio* at cmpci?
#audio* at clcs?
#audio* at clct?
#audio* at auich?
#audio* at auixp?
#audio* at autri?
#audio* at auvia?
#audio* at fms?
#audio* at maestro?
#audio* at esa?
#audio* at yds?
#audio* at emu?

#bktr0  at pci?

# FM-Radio devices
#gtp*   at pci?                 # Gemtek/Guillemot Radio PCI Radio Card
#sfr0   at isa? port 0x384      # SoundForte RadioLink SF16-FMR FM Radio Card
#sf2r0  at isa? port 0x384      # SoundForte RadioLink SF16-FMR2 FM Radio Card
#az0    at isa? port 0x350      # Aztech/PackardBell FM Radio Card
#rt0    at isa? port 0x30c      # AIMS Lab Radiotrack FM Radio Card
#rt*    at isapnp?
#rtii0  at isa? port 0x30c      # AIMS Lab Radiotrack II FM Radio Card

# FM-Radio support
#radio* at bktr?
#radio* at fms?
#radio* at gtp?
#radio* at sfr?
#radio* at sf2r?
#radio* at az?
#radio* at rt?
#radio* at rtii?

# Joystick driver. Probe is a little strange; add only if you have one.
#joy0   at isa? port 0x201
#joy*   at isapnp?

#wdt0   at pci?                 # Ind Computer Source PCI-WDT50x driver

# crypto support
#hifn*  at pci?                 # Hi/fn 7751 crypto card
#lofn*  at pci?                 # Hi/fn 6500 crypto card
#nofn*  at pci?                 # Hi/fn 7814/7851/7854 crypto card
#ubsec* at pci?                 # Bluesteel Networks 5xxx crypto card
#safe*  at pci?                 # SafeNet SafeXcel 1141/1741
#ises*  at pci?                 # Pijnenburg PCC-ISES

# I2O
iop*    at pci?                 # I2O
ioprbs* at iop?                 # Random block storage
scsibus* at ioprbs?

pseudo-device   pctr            1
pseudo-device   mtrr            1       # Memory range attributes control
pseudo-device   nvram           1
pseudo-device   sequencer       1
#pseudo-device  raid            4       # RAIDframe disk driver
pseudo-device   bio             1       # ioctl multiplexing device
pseudo-device   hotplug         1       # devices hot plugging

# mouse &amp; keyboard multiplexor pseudo-devices
pseudo-device   wsmux           2
pseudo-device   crypto          1
</pre>
</div>
</div>
<div id="outline-container-helper-script" class="outline-2">
<h2 id="helper-script">Helper script</h2>
<div class="outline-text-2" id="text-helper-script">
<p>
Here is a simple bash script to make the
compiling easier:
</p>
<div class="org-src-container">
<pre class="src src-sh">#!/usr/local/bin/bash

# just a simple bash script for building a kernel on OpenBSD
# by martin.polden at c2i.net
#
# place your kernel config in /usr/src/sys/arch/${ARCH}/conf/
# run this script with the name of your config as the first argument

CONFIG="${1}";
ARCH=`uname -m`;
SYS=`uname -s`;

if [ $# = 0 ];
then
  echo "usage: buildkernel config-file";
  exit 3
elif [ $SYS != "OpenBSD" ];
then
  echo "You're not running OpenBSD. Shame on you!";
  exit 4
elif [ ! -e "/usr/src/sys/arch/${ARCH}/conf/${CONFIG}" ];
then
  echo "Kernel config (${CONFIG}) does not exist in /usr/src/sys/arch/${ARCH}/conf/";
  exit 5
else
  mkdir /${CONFIG} &amp;&amp; cd /${CONFIG};
  cp /usr/src/sys/arch/${ARCH}/conf/${CONFIG} .;
  config -s /usr/src/sys -b . ${CONFIG};
  make clean &amp;&amp; make depend &amp;&amp; make;
  cp /bsd /bsd.backup;
fi

echo "Your kernel (${CONFIG}) has been compiled in /${CONFIG}";
echo "Type 'cd /${CONFIG} &amp;&amp; make install' to install your kernel";
echo "A backup of your old kernel has been created in /bsd.backup";

exit 0
</pre>
</div>
</div>
</div>
]]></description>
    </item>
    
    <item>
      <title>µTorrent</title>
      <link>https://mpolden.no/blog/posts/2005-12-27-utorrent.html</link>
      <author>Martin Polden</author>
      <guid isPermaLink="false">/blog/posts/2005-12-27-utorrent.html</guid>
      
        <pubDate>Tue, 27 Dec 2005 15:10:00 +0100</pubDate>
      
      <description><![CDATA[<p class="meta"><time datetime="2005-12-27">Dec 27, 2005</time></p>

<p>
After four months of total silence, I've decided to finally write something. I
even forgot that I had Wordpress installed until I noticed it in the package
list on one of my FreeBSD servers.
</p>

<p>
Anyways, in September I discovered a new BitTorrent client called µTorrent. I
was currently using Azureus and I think that it's pretty well known that
Azureus was and still is a big resource hog because of the Java Runtime
Environment so µTorrent was a new experience for me.
</p>

<p>
I replaced Azureus after only a few days of testing. The first version I tried
was 1.1 and I was totally amazed by the low resource usage. It was clearly a
result of efficient programming, and this proved to be correct in the
following versions.
</p>

<p>
I tried alot of clients before I settled with Azureus, and eventually
µTorrent. Here's the list:
</p>
<ul class="org-ul">
<li><a href="http://www.bittorrent.com/">BitTorrent</a></li>
<li><a href="http://www.bittornado.com/">BitTornado</a></li>
<li><a href="http://pingpong-abc.sourceforge.net/">ABC (Yet Another Bittorrent Client)</a></li>
<li><a href="http://www.bitcomet.com/">BitComet</a></li>
<li><a href="http://g3torrent.sourceforge.net/">G3 Torrent</a></li>
<li><a href="http://www.int64.org/arctic.html">Arctic Torrent</a></li>
<li><a href="http://rufus.sourceforge.net/">Rufus</a></li>
</ul>

<p>
None of these clients has all the necessary features <b>and</b> a low footprint.
These clients either sacrifice features and usability to get a lower footprint
(Arctic Torrent) or they have a sh*tload of features and a large footprint.
µTorrent provides, more or less, the <b>necessary</b> features of Azureus minus the
bloat and the Java requirement.
</p>

<p>
The "installation" of µTorrent is quite easy, you download a single exe-file
(utorrent.exe) and put it wherever you want. The first time you launch it,
µTorrent will ask you if you want shortcuts on the start-menu and on the
desktop.
</p>

<p>
µTorrent stores all of it's settings and active torrents in
<code>%APPDATA%\uTorrent</code> so that they can easily be backed up. <code>%APPDATA%</code> is an
enviromental variable in Windows and refers to the <code>C:\Documents and
Settings\[username]\Application Data</code> folder. As of 1.2 you can also customize
the main icon, the tray icon and the toolbar of µTorrent. This done by putting
a main.ico, tray.ico, toolbar.bmp and tstatus.bmp in <code>%APPDATA%\uTorrent</code>.
</p>

<p>
<a href="http://www.utorrent.com/">Homepage</a>
</p>

<p>
<a href="http://forum.utorrent.com/">Forum</a>
</p>
]]></description>
    </item>
    
  </channel>
</rss>
