davehttp://caterva.org/dave@weller-fahy.comShort Attention Span Theatretag:caterva.org,2011-06-11:/atom/http://caterva.org/favicon.icohttp://caterva.org/feed-logo.png2014-10-13T13:25:45ZacrylamidArch and ext4 on prgmr.comtag:caterva.org,2014-10-13:/posts/2014/10/13/08/25/arch-and-ext4-on-prgmr-com2014-10-13T13:25:45Zdavehttp://caterva.org/dave@weller-fahy.com<p>Getting Arch installed on a <a href="http://prgmr.com">prgmr.com</a> VPS is not
insanely complex, but I wanted to make sure my method is documented
somewhere I could find it again. The goal of this is to document the
steps taken, then flesh it out into a full set of scripts to install
Arch on a VM. Ideally this would be relatively simple, and provide an
installation with two separate partitions for the file systems
(<code>/boot</code> and <code>/</code>). Having <code>/boot</code> in a separate partition will allow
me to upgrade <code>/</code> to <a href="https://btrfs.wiki.kernel.org">btrfs</a> when prgmr.com upgrades to grub2 in a
few months.</p>
<p>This method is based on the <a href="http://wiki.prgmr.com/mediawiki/index.php?title=Arch_Linux&oldid=3849">old guide</a> that details
installing Arch, with some changes for my particular requirements. I
needed a bit more space than specified, so I created a VM with 2.5 GiB
on the hard drive. Use the <a href="https://www.archlinux.org/">Arch Linux</a> <a href="http://mirrors.acm.wpi.edu/archlinux/iso/2014.10.01/archlinux-2014.10.01-dual.iso">ISO</a> to boot
in the VM from the "Boot Arch Linux (x86_64)" grub menu item (should
be first).</p>
<p>Perform <a href="https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide">the Arch install</a> on the VM. To create a set of
scripts for the install paste the commands below into two separate
scripts (they are marked 1 and 2 for easy use). Note that the
provided scripts and commands are separated by commands you must
execute manually, assume a connection to the Internet, require you to
actually change the values assigned to some variables to make them
work properly, set your timezone to PST, and may kill kittens.</p>
<p>In the first set of commands the hard drive is prepared with an MBR,
an ext4 <code>/boot</code> and <code>/</code>, a base Arch install with wget and base-devel
installed as well, and an automatically generated <code>/etc/fstab</code>.</p>
<div class="codehilite"><pre><span class="c">#!/bin/sh</span>
<span class="c"># Script 1 (pre-chroot)</span>
<span class="nb">echo</span> -e <span class="s1">'o\nn\np\n1\n2048\n+256M\nn\np\n2\n\n+512M\nt\n2\n82\nn\np\n3\n\n\nw'</span> <span class="se">\</span>
| fdisk -u /dev/sda
mkfs.ext4 -F -L boot /dev/sda1
mkfs.ext4 -F -L root /dev/sda3
mkswap -L swap /dev/sda2
swapon /dev/sda2
mount /dev/sda3 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot
pacstrap /mnt base wget base-devel openssh
genfstab -p /mnt >> /mnt/etc/fstab
</pre></div>
<p>Next, enter the Arch chroot environment in your new system.</p>
<div class="codehilite"><pre>arch-chroot /mnt
</pre></div>
<p>Now, to the minimal things needed to prepare the system for actual
use. Replace all the "CHANGE_THIS_????????" values below with those
that apply to your VPS. Once run the commands below will</p>
<ul>
<li>set your short and fully qualified host name,</li>
<li>set your timezone to PST,</li>
<li>generate locales for US english,</li>
<li>set the default locale to UTF-8,</li>
<li>create a static network assignment for eth0,</li>
<li>enable the systemd network daemon,</li>
<li>enable the systemd name resolution daemon,</li>
<li>change the port on which systemd listens for ssh connections,</li>
<li>add the modules necessary for running as a Xen domU to the kernel,</li>
<li>generate a new kernel,</li>
<li>enable multilib compilation,</li>
<li>set the root password,</li>
<li>create a normal user and set its password,</li>
<li>install yaourt along with its dependency,</li>
<li>install grub-legacy using yaourt,</li>
<li>install grub to <code>/dev/sda</code>,</li>
<li>and create a link from <code>/boot/boot</code> to <code>/boot</code> (used when booting within the VPS).</li>
</ul>
<div class="codehilite"><pre><span class="c">#!/bin/sh</span>
<span class="c"># Script 2 (post-chroot)</span>
<span class="nb">export </span><span class="nv">THEUSER</span><span class="o">=</span>CHANGE_THIS_USERNAME
<span class="nb">export </span><span class="nv">THEHOST</span><span class="o">=</span>CHANGE_THIS_HOSTNAME
<span class="nb">export </span><span class="nv">THEDOMN</span><span class="o">=</span>CHANGE_THIS_DOMNNAME
<span class="nb">export </span><span class="nv">THEIPVF</span><span class="o">=</span>CHANGE_THIS_IPVFADDR
<span class="nb">export </span><span class="nv">THEGATE</span><span class="o">=</span>CHANGE_THIS_GATEIPVF
<span class="nb">export </span><span class="nv">THEPORT</span><span class="o">=</span>CHANGE_THIS_PORTNUMB
<span class="nb">echo</span> <span class="nv">$THEHOST</span> > /etc/hostname
perl -0777 -pi <span class="se">\</span>
-e <span class="s1">'s/me\>\n/me\>\nTHEIPVF THEHOST.THEDOMN THEHOST\n/'</span> <span class="se">\</span>
/etc/hosts
perl -0777 -pi -e <span class="s2">"s/THEIPVF/$THEIPVF/"</span> /etc/hosts
perl -0777 -pi -e <span class="s2">"s/THEHOST/$THEHOST/g"</span> /etc/hosts
perl -0777 -pi -e <span class="s2">"s/THEDOMN/$THEDOMN/"</span> /etc/hosts
-e <span class="s1">'s/me\>\n/me\>\nTHEIPVF</span>
<span class="s1">ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime</span>
<span class="s1">perl -0777 -pi -e '</span>s/<span class="se">\n</span><span class="c">#en_US/\nen_US/g' /etc/locale.gen</span>
locale-gen
<span class="nb">echo </span><span class="nv">LANG</span><span class="o">=</span>en_US.UTF-8 > /etc/locale.conf
cat > /etc/systemd/network/eth0_static.network <span class="s"><<EOF</span>
<span class="s">[Match]</span>
<span class="s">Name=eth0</span>
<span class="s">[Network]</span>
<span class="s">Address=$THEIPVF/24</span>
<span class="s">Gateway=$THEGATE</span>
<span class="s">DNS=71.19.145.215</span>
<span class="s">DNS=71.19.155.120</span>
<span class="s">DNS=208.67.222.222</span>
<span class="s">DNS=208.67.220.220</span>
<span class="s">EOF</span>
systemctl <span class="nb">enable </span>systemd-networkd
systemctl <span class="nb">enable </span>systemd-resolved
mkdir -p /etc/systemd/system/sshd.socket.d
cat > /etc/systemd/system/sshd.socket.d/sshd_new_port.conf <span class="s"><<EOF</span>
<span class="s">[Socket]</span>
<span class="s">ListenStream=</span>
<span class="s">ListenStream=0.0.0.0:$THEPORT</span>
<span class="s">FreeBind=true</span>
<span class="s">EOF</span>
perl -0777 -pi -e <span class="s1">'s/\nMODULES="/\nMODULES=" xen-netfront xen-fbfront/'</span> <span class="se">\</span>
/etc/mkinitcpio.conf
perl -0777 -pi -e <span class="s1">'s/\nMODULES="/\nMODULES=" xenfs xen-kbdfront/'</span> <span class="se">\</span>
/etc/mkinitcpio.conf
perl -0777 -pi -e <span class="s1">'s/\nMODULES="/\nMODULES="xen-blkfront/'</span> <span class="se">\</span>
/etc/mkinitcpio.conf
mkinitcpio -p linux
perl -0777 -pi -e <span class="s1">'s/\n#\[multilib\]\n#Inc/\n\[multilib\]\nInc/'</span> <span class="se">\</span>
/etc/pacman.conf
pacman -Syu
passwd
useradd -m -G wheel <span class="nv">$THEUSER</span>
perl -0777 -pi -e <span class="s1">'s/\n# %wheel/\n%wheel/'</span> /etc/sudoers
passwd <span class="nv">$THEUSER</span>
sudo -u <span class="nv">$THEUSER</span> mkdir -p /home/<span class="nv">$THEUSER</span>/aur
<span class="nb">cd</span> /home/<span class="nv">$THEUSER</span>/aur
sudo -u <span class="nv">$THEUSER</span> wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
sudo -u <span class="nv">$THEUSER</span> wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
sudo -u <span class="nv">$THEUSER</span> tar xf package-query.tar.gz
sudo -u <span class="nv">$THEUSER</span> tar xf yaourt.tar.gz
<span class="nb">cd </span>package-query
sudo -u <span class="nv">$THEUSER</span> makepkg -s
pacman -U package-query-1.4-*
<span class="nb">cd</span> ../yaourt
sudo -u <span class="nv">$THEUSER</span> makepkg -s
pacman -U yaourt-1.5-*
sudo -u <span class="nv">$THEUSER</span> yaourt -Sa grub-legacy
grub-install /dev/sda
<span class="nb">cd</span> /boot
ln -s . boot
rm -f /var/cache/pacman/pkg/*
rm -fr /home/dave/aur
perl -0777 -pi -e <span class="s1">'s/sda/xvda/g'</span> /etc/fstab
perl -0777 -pi -e <span class="s1">'s/sda/xvda/g'</span> /boot/grub/menu.lst
</pre></div>
<p>After that is complete exit the chroot environment, link
<code>/etc/resolv.conf</code> to the file managed by systemd-resolved (so name
resolution will work after boot on the VPS), and unmount the file
systems used during installation.</p>
<div class="codehilite"><pre><span class="nb">exit</span>
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
umount /mnt/boot /mnt
</pre></div>
<p>Now boot your VPS with the new "Debian Wheezy Live" rescue ISO (it
should be the second option on the first grub boot menu). Once logged
in as root (no password required), prepare the VPS hard drive with the
same partitions as used in the VM.</p>
<div class="codehilite"><pre><span class="nb">echo</span> -e <span class="s1">'o\nn\np\n1\n2048\n+256M\nn\np\n2\n\n+512M\nt\n2\n82\nn\np\n3\n\n\nw'</span> <span class="se">\</span>
| fdisk -u /dev/xvda
mkswap -L swap /dev/xvda2
</pre></div>
<p>Next, create a privilege separation directory for sshd, insert a copy
of your public ssh key into <code>/root/.ssh/authorized_keys</code>, the run sshd
on a particular port (this also only allows one connection at a time).</p>
<div class="codehilite"><pre>mkdir /tmp/sshd
ln -s /tmp/sshd /var/run/sshd
/usr/sbin/sshd -d -p PORT -f /etc/ssh/sshd_config
</pre></div>
<p>Now, on the VM on your local machine, initiate a connection to copy
the local ext3 and btrfs volumes to the VPS using the following
commands.</p>
<div class="codehilite"><pre>dd <span class="k">if</span><span class="o">=</span>/dev/sda1 | ssh -p 21773 root@CHANGE_THIS_IPVF <span class="s2">"dd of=/dev/xvda1"</span>
dd <span class="k">if</span><span class="o">=</span>/dev/sda3 | ssh -p 21773 root@CHANGE_THIS_IPVF <span class="s2">"dd of=/dev/xvda3"</span>
</pre></div>
<p>Once the transfers are complete, the only tasks remaining are to
verify the system boots, can connect to the network, and enable/start
your sshd.socket service to accept incoming connections. Reboot the
VPS, then execute the following commands to enable and start your
sshd.socket.</p>
<div class="codehilite"><pre>systemctl <span class="nb">enable </span>sshd.socket
systemctl start sshd.socket
</pre></div>
<p>Now ping something off the local network to make sure you can
communicate with the rest of the world, and you should be in business.</p>Stop gpg-agent from running on logintag:caterva.org,2014-09-19:/posts/2014/09/19/01/48/stop-gpg-agent-from-running-on-login2014-09-19T06:48:03Zdavehttp://caterva.org/dave@weller-fahy.com<p>Every time I install Arch Linux I am surprised when XFCE insists on
running gpg-agent when I log on. When it further doesn't work
properly with ssh-keys (admittedly, probably because I don't know how
to use it properly) and invokes pinentry to input another passphrase
so Gnome Keyring can protect the key the agent is supposed to
protect... well... that's when I start to get irritated. Irritation
leads to anger, and anger to research, and research to a solution.</p>
<p>Luckily the solution is easy to find every time, but this time I'm
making it easier to find. This makes XFCE use ssh-agent even if
gpg-agent is installed.</p>
<div class="codehilite"><pre><span class="nv">$ </span>xfconf-query -c xfce4-session -p /startup/ssh-agent/type -n -t string -s ssh-agent
</pre></div>
<p>The solution was (shockingly) located in the <a href="https://wiki.archlinux.org/index.php/xfce#SSH_Agents">Arch Linux wiki</a>.</p>Solarized cheat sheettag:caterva.org,2014-01-03:/posts/2014/01/03/03/34/solarized-cheat-sheet2014-01-03T08:34:41Zdavehttp://caterva.org/dave@weller-fahy.com<p>I grew tired of scrolling up and down the <a href="http://ethanschoonover.com/solarized">solarized web page</a>
to figure out which color was which hex code for HTML use, so I
created a cheat sheet.</p>
<p><a href="http://caterva.org/posts/2014/01/03/03/34/solarized-cheat-sheet/solarized-cheat-sheet.tex">Here</a> is the LaTeX source (compile with lualatex) and the
<a href="http://caterva.org/posts/2014/01/03/03/34/solarized-cheat-sheet/solarized-cheat-sheet.pdf">PDF file</a> produced.</p>Switching to a website generator that fits my scheduletag:caterva.org,2013-12-23:/posts/2013/12/23/18/47/switching-to-a-website-generator-that-fits-my-schedule2013-12-23T23:47:06Zdavehttp://caterva.org/dave@weller-fahy.com<p>In working with <a href="http://jaspervdj.be/hakyll/">Hakyll</a> the biggest problem was my lack of familiarity with
<a href="http://www.haskell.org/haskellwiki/Haskell">Haskell</a>, and my lack of time to learn it sufficiently to feel comfortable
with the software. After a while I started to get irritated by my lack of
understanding, and decided that (unless I dedicated more time to learning
Haskell) I needed to move over to something in a language I was more familiar
with (<a href="http://python.org">Python</a>)... thus the move to <a href="http://posativ.org/acrylamid/">Acrylamid</a>.</p>
<p>Installing on FreeBSD turned out to be relatively simple, given that the
software is available for install using <code>easy_install</code> or <code>pip</code>. I chose <code>pip</code>
because I have an issue with software that cannot be easily uninstalled.
Acrylamid was installed using the following incantation.</p>
<div class="codehilite"><pre><span class="c"># pip install acrylamid</span>
</pre></div>
<p>On my system, that actually installed a few other packages in addition to
acrylamid, specifically <a href="http://jinja.pocoo.org">Jinja2</a>, <a href="http://daringfireball.net/projects/markdown/">Markdown</a> (<a href="http://pythonhosted.org/Markdown/">in python</a>), and
translitcodec.</p>
<p>Configuration took a bit more finagling than I expected because the tokens for
the hour and minute of publication were not available when generating each post.
As a result I requested a fix via <a href="https://github.com/posativ/acrylamid/pull/193">pull request</a> which was accepted
within a day. Unfortunately the fix only applied to the current development
branch, not the release available via pip. The lack of a release which could be
installed via <code>pip</code> was not a show-stopper, because the procedure to have <code>pip</code>
install from a git repository was <a href="https://pip.pypa.io/en/latest/reference/pip_install.html#git">well documented</a> and only
required pointing pip at my forked repository.</p>
<div class="codehilite"><pre><span class="c"># pip install git+git://github.com/sinecure/acrylamid.git</span>
</pre></div>
<p>Another speed-bump was how to set the timezone within each post. Because of
previous conversions I had laboriously converted all time/date stamps to UTC
time, and it was not obvious how to indicate the timezone within the post ("UTC"
was not accepted with one error, "+0000" was not accepted with another).
Luckily, I found others had encountered a similar difficulty, and the solution
to my problem (setting <code>TZINFO = "UTC"</code> in <code>conf.py</code>) was <a href="https://github.com/posativ/acrylamid/pull/181#issuecomment-22867354">in the
comments</a>.</p>
<p>The next piece of the puzzle was getting all the ancillary files which may be
with a post (image/video/text files) into the same directory as the post. This
was easily solved using the STATIC definition in the <code>conf.py</code> file, and
translating the (hand-named) post directories to the standard "slug" format. It
turned out the slugs are generated using a <a href="http://flask.pocoo.org/snippets/5/">public domain python
function</a>.</p>
<p>Overall, this was a relatively painless and simple process requiring minimal
time before the site was transferred. Most of the delay was in the actual
conversion of date/time information to a format without timezone information,
and a few errors by the operator (me) along the way.</p>Mathopd and repreprotag:caterva.org,2013-04-28:/posts/2013/04/28/23/21/mathopd-and-reprepro2013-04-29T04:21:35Zdavehttp://caterva.org/dave@weller-fahy.com<p>Although the method of serving an APT repository I discovered when setting up
<a href="http://caterva.org/posts/2011/10/07/03/16/debian-on-macbook-pro-5-2/">Debian on MacBook Pro 5.2</a> is sufficient, it is not very robust. Thus
I began looking for something more useful for multiple repositories, and which
is packaged for debian itself.</p>
<p>The search led me to a <a href="http://davehall.com.au/blog/dave/2010/02/06/howto-setup-private-package-repository-reprepro-nginx">post</a> that demonstrated how to configure a
private repository using <a href="http://mirrorer.alioth.debian.org">reprepro</a>. Although that gave me almost
everything I needed, one final bit was required: permission adjustment. As I
use Mathopd, the easiest way to prevent visitors from accessing the <code>conf</code> and
<code>db</code> directories was to restrict their permissions to that of my user alone.</p>
<div class="codehilite"><pre><span class="err">$</span> <span class="n">chmod</span> <span class="n">go</span><span class="o">-</span><span class="n">rx</span> <span class="n">conf</span> <span class="n">db</span>
</pre></div>Setting hostname in FreeBSD when using dhclienttag:caterva.org,2013-04-27:/posts/2013/04/27/03/55/setting-hostname-in-freebsd-when-using-dhclient2013-04-27T08:55:03Zdavehttp://caterva.org/dave@weller-fahy.com<p>I experienced a problem for years on FreeBSD, but have never been motivated to
solve it until now. The problem presents when attempting to set FQDN of the
system (<code>nastie.weller-fahy.com</code>). I set <code>hostname</code> to the proper value in
<code>/etc/rc.conf</code>.</p>
<div class="codehilite"><pre><span class="n">hostname</span><span class="o">=</span><span class="s">"nastie.weller-fahy.com"</span>
</pre></div>
<p>When I type <code>hostname</code> at the prompt, I am given the unqualified hostname,
<code>nastie</code>. When it bit me tonight, I finally tried to find a solution, and
(shock of all shocks) <a href="http://forums.freebsd.org/showthread.php?t=5368">found one</a>!</p>
<p>So, to sum up, create an executable file <code>/etc/dhclient-enter-hooks</code> with the
following content.</p>
<table class="codehilitetable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4</pre></div></td><td class="code"><div class="codehilite"><pre><span class="c">#!/bin/sh</span>
check_hostname<span class="o">(){</span>
hostname nastie.weller-fahy.com
<span class="o">}</span>
</pre></div>
</td></tr></table>
<p>Next time you reboot, the <code>hostname</code> command will result in the FQDN of your
system, as it should.</p>Leaving bread crumbs and playing with Hakylltag:caterva.org,2013-03-28:/posts/2013/03/28/02/41/leaving-bread-crumbs-and-playing-with-hakyll2013-03-28T07:41:34Zdavehttp://caterva.org/dave@weller-fahy.com<p>One of the things I wanted most in my conversion to Hakyll was a way to show the
location breadcrumbs of the current page. For those unfamiliar with the
concept, these do not show the actual path the user took to get to the page, but
they do show the location of the current page in the website hierarchy. For
example, if I were on a post called "Having my bread crumbs and eating them
too!", then the bread crumb URLs on the page would be as follows.</p>
<blockquote>
<p><a href="http://caterva.org/">sast</a> ::
<a href="http://caterva.org/posts">posts</a> ::
<a href="http://caterva.org/posts/2013/03/28/02/41/leaving-bread-crumbs-and-playing-with-hakyll">Having my bread crumbs and eating them too!</a></p>
</blockquote>
<!-- more -->
<p>Having bread crumbs like these allows users to have a better feel for "where"
they are in a website, and they are neat. Determining how best to create those
bread crumbs using hakyll was not easy, and I am certain my implementation is
overly complicated, but I finally have something that works! The key insight
which led to a working implementation was the following:</p>
<blockquote>
<p><strong>An element of the page does not need to be visible.</strong></p>
</blockquote>
<p>That insight is not rocket science, and web designers are probably snickering
under their breath, but I had been struggling with how to get various levels of
the crumbs to appear and disappear depending on the visible level. The insight
started me down a path that ended with the idea of combining templates, inline
styles, and the CSS <code>display</code> property.</p>
<p>First, I assume that the website has three different levels: main (index and
facets), category (indexes of posts and projects), and page (individual posts
and projects). Changing the levels would require changing the code, but with
this pattern in place adding levels should (for certain values of should) be
trivial.</p>
<p>Next, I include the following HTML in the default template (<code>default.html</code>).</p>
<div class="codehilite"><pre><span class="nt"><div</span> <span class="na">id=</span><span class="s">"headercrumbs"</span><span class="nt">></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"headercrumb"</span> <span class="na">id=</span><span class="s">"headerpagetitle"</span> <span class="na">href=</span><span class="s">"$url$"</span><span class="nt">></span>$title$<span class="nt"></a></span>
<span class="nt"><span</span> <span class="na">class=</span><span class="s">"headercrumb"</span> <span class="na">style=</span><span class="s">"display:$categoryIs$"</span><span class="nt">></span>::<span class="nt"></span></span>
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"headercrumb"</span> <span class="na">style=</span><span class="s">"display:$categoryIs$"</span>
<span class="na">href=</span><span class="s">"/$category$"</span><span class="nt">></span>$category$<span class="nt"></a></span>
::
<span class="nt"><a</span> <span class="na">class=</span><span class="s">"headercrumb"</span> <span class="na">id=</span><span class="s">"sitelink"</span> <span class="na">href=</span><span class="s">"/"</span><span class="nt">></span>sast<span class="nt"></a></span>
<span class="nt"></div></span>
</pre></div>
<p>Note that one of the crumb separators ("::") is bare, not surrounded by a
<code>span</code>: this is because there will always be a "sitelink" (the link to the main
page of this website), and there will always be a "headerpagetitle". Thus,
there will always be at least one crumb separator and two links in the bread
crumbs.</p>
<p>Now comes the clever bit (or, at least I like to <em>think</em> it is the clever bit).
Contexts are generated which contain two metadata fields. If the page is part
of a category and <em>not</em> a category index, then the "category" field is set to
the category name and the "categoryIs" field is set to "inline". If the page
is <em>not</em> part of a category or <em>is</em> a category index, then the "category" field
is set to the empty string and the "categoryIs" field is set to "none". All
this magical manipulation happens with the help of three new contexts and two
new functions, listed below.</p>
<div class="codehilite"><pre>defaultCtx <span class="o">::</span> Context String
defaultCtx <span class="o">=</span> mconcat
<span class="p">[</span> crumbCtx
<span class="p">,</span> crumbIsCtx
<span class="p">,</span> defaultContext
<span class="p">]</span>
<span class="o">--</span> <span class="o">|</span> Return String with the HTML code <span class="kr">for</span> bread crumbs of the current item.
<span class="o">--</span> This assumes three levels to the site<span class="o">:</span> main <span class="p">(</span>index<span class="p">,</span> facets<span class="p">),</span> category
<span class="o">--</span> <span class="p">(</span>indices of posts<span class="p">,</span> projects<span class="p">),</span> page <span class="p">(</span>individual posts<span class="p">,</span> projects<span class="p">)</span>.
<span class="o">--</span>
crumbCtx <span class="o">::</span> Context a
crumbCtx <span class="o">=</span> field <span class="s">"category"</span> <span class="o">$</span> \item <span class="o">-></span> do
metadata <span class="o"><-</span> getMetadata <span class="o">$</span> itemIdentifier item
let crumb <span class="o">=</span> findCategory <span class="p">(</span>itemIdentifier item<span class="p">)</span> categories
<span class="kr">return</span> crumb
crumbIsCtx <span class="o">::</span> Context a
crumbIsCtx <span class="o">=</span> field <span class="s">"categoryIs"</span> <span class="o">$</span> \item <span class="o">-></span> do
metadata <span class="o"><-</span> getMetadata <span class="o">$</span> itemIdentifier item
let crumbIs <span class="o">=</span> findCategoryIs <span class="p">(</span>itemIdentifier item<span class="p">)</span> categories
<span class="kr">return</span> crumbIs
findCategory <span class="o">::</span> Identifier <span class="o">-></span> <span class="p">[</span>String<span class="p">]</span> <span class="o">-></span> String
findCategory id cats
<span class="o">|</span> notElem <span class="s">'/'</span> <span class="o">$</span> idPath <span class="o">=</span> <span class="s">""</span>
<span class="o">|</span> hcat <span class="o">==</span> <span class="p">[]</span> <span class="o">=</span> <span class="s">""</span>
<span class="o">|</span> hcat <span class="o">==</span> head <span class="p">(</span>splitDirectories <span class="o">$</span> idPath<span class="p">)</span> <span class="o">=</span> hcat
<span class="o">|</span> otherwise <span class="o">=</span> findCategory id <span class="o">$</span> tail cats
where idPath <span class="o">=</span> toFilePath id
hcat <span class="o">=</span> head cats
findCategoryIs <span class="o">::</span> Identifier <span class="o">-></span> <span class="p">[</span>String<span class="p">]</span> <span class="o">-></span> String
findCategoryIs id cats
<span class="o">|</span> notElem <span class="s">'/'</span> <span class="o">$</span> idPath <span class="o">=</span> <span class="s">"none"</span>
<span class="o">|</span> hcat <span class="o">==</span> <span class="p">[]</span> <span class="o">=</span> <span class="s">"none"</span>
<span class="o">|</span> hcat <span class="o">++</span> <span class="s">"/index.md"</span> <span class="o">==</span> idPath <span class="o">=</span> <span class="s">"none"</span>
<span class="o">|</span> hcat <span class="o">==</span> head <span class="p">(</span>splitDirectories <span class="o">$</span> idPath<span class="p">)</span> <span class="o">=</span> <span class="s">"inline"</span>
<span class="o">|</span> otherwise <span class="o">=</span> findCategoryIs id <span class="o">$</span> tail cats
where idPath <span class="o">=</span> toFilePath id
hcat <span class="o">=</span> head cats
</pre></div>
<p>The <code>defaultCtx</code> is only used when applying the <code>default.html</code> template, and
thus should have minimal impact on other pages.</p>
<p>With the above code (and a bit of CSS) I have a happy little breadcrumb
navigation section on the upper-right corner of my web site which updates based
on the current page. It certainly is not the most elegant solution: the two
functions have a <em>lot</em> of duplication, as do the two contexts. For now though,
until I figure out how to use the output of <code>findCategory</code> in <code>findCategoryIs</code>,
it will do.</p>Changing the expiration date of my GPG keytag:caterva.org,2013-03-04:/posts/2013/03/04/19/33/changing-the-expiration-date-of-my-gpg-key2013-03-05T00:33:30Zdavehttp://caterva.org/dave@weller-fahy.com<p>It is considered good practice to set an expiration date on your GPG/PGP keys.
Setting the expiration date prevents the possibility of losing the private key
leaving a valid, non-expired, key out on the key servers that you cannot revoke.
Revocation certificates may be one solution, but I found it more useful to
simply set the expiration date.</p>
<p>It is useful if one can also remember <em>how</em> to extend the expiration date of the
GPG key in question when the expiration date sneaks up without warning.
Luckily, I was able to find an article by George Notaras on <a href="http://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/">How to change the
expiration date of a GPG key</a>, which allowed me to change the date
with minimal fuss.</p>
<p>The short version follows, but requires some reading up... so do so before execution.</p>
<div class="codehilite"><pre><span class="nv">$ </span>gpg --edit-key <span class="o">[</span>key-id-of-key-to-edit<span class="o">]</span>
gpg> key 0
gpg> expire
...
gpg> key 1
gpg> expire
</pre></div>Conversion from ikiwiki to Hakylltag:caterva.org,2013-01-23:/posts/2013/01/23/03/25/conversion-from-ikiwiki-to-hakyll2013-01-23T08:25:21Zdavehttp://caterva.org/dave@weller-fahy.com<p><a href="http://ikiwiki.info">Ikiwiki</a> is a great idea in theory. For those unfamiliar with the concept,
it is basically a fully functional wiki integrated with a version control system
(VCS), all done in such a way that the pages are served statically unless you
are modifying the configuration or one of the pages.</p>
<p>An excellent solution for those who need that level of interactivity, but it is
a bit much for my purposes. <!-- more --> It is a fairly complex system
designed to be a wiki, but without some of the downfalls of other wikis which
serve all pages dynamically. It was this very complexity which led me to
eventually realize that I do not actually want a wiki. I want website
generation software with the following features:</p>
<ul>
<li>Allows me to write my posts and pages in Markdown.</li>
<li>Allows fully static pages (off site generation of pages, not "code as
website").</li>
<li>Allows files associated with the posts to be with the posts without having
to jump through <em>too</em> many hoops. The perfect example for this is a post
which has pictures: unless the pictures are being referenced from an
external gallery, they should be physically located in the same directory
as the post.</li>
<li>Does not require any on line configuration (think blob of pages with no
preferences).</li>
<li>Allows a hierarchical layout of the source files based on date.</li>
<li>Allows any VCS to be used, without requiring extraordinary efforts to be
made.</li>
<li>Allows a portion of the site to be formatted as a blog, where the most
recent post is on top, with the rest in reverse chronological order all the
way down (or, if one desires, with separate pages for each chunk of posts).</li>
<li>Lets me play with a new programming language<ul>
<li>This is my comfort food: some people like brownies, but I like new
programming languages... and brownies.</li>
</ul>
</li>
<li>Felt fun.</li>
</ul>
<p>There are quite a few website generation software packages available which
provide most of the above features, so the big two ended up being new
programming language and fun. <a href="http://www.haskell.org/haskellwiki/Haskell">Haskell</a> has had my attention for a while,
even if that attention was hidden behind thesis work, research, classes,
promotion testing, family, children, and life. This seemed the perfect time to
allow that attention to come to the fore, and learn a bit about a language
which seems interesting.</p>
<p>Fortunately, I am approaching my defense, so this provided something for me to
do when my brain was screaming, "STOP WITH THE RESEARCH STUFFESSES!"</p>
<p>Unfortunately, I am approaching my defense, so I had to take the "get it
working" route instead of the "learn the language thoroughly" route.</p>
<p>With that, here is an accounting of the conversion, lessons learned,
modifications required, and result (which, with any luck, is what you are
reading right now).</p>
<p>First, I discovered that <a href="https://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after-me-cabal-is-not-a-package-manager/">cabal is not a package manager</a> when
<a href="http://jaspervdj.be/hakyll/">Hakyll</a> bumped from version 3.X to version 4.X. My experience involved
fumbling about in the dark trying to figure out why my <code>cabal install hakyll</code>
was not working properly, and nothing would compile, all the way to having to
remove all ports beginning with <code>hs-</code> using <code>pkg delete hs-</code>. That resulted in
starting over with <code>portmaster devel/hs-haskell-platform</code>, which led me to the
second part of the conversion...</p>
<p>How the heck do I convert these 148 posts to the markdown with metadata format
used by <a href="http://jaspervdj.be/hakyll/">Hakyll</a>, and determine the proper published and updated dates? This
was complicated by the fact that the website has gone through so many
transitions, including converting from HTML (straight, no chaser) to
<a href="http://blosxom.sourceforge.net">Blosxom</a> to <a href="http://wordpress.org">WordPress</a> to <a href="http://ikiwiki.info">ikiwiki</a>. The last conversion including
mass conversion from a MySQL database to text files in Markdown format, with
the entire thing added to git and metadata adjusted to reflect the actual date
as recorded in the database. Not exactly impossible, but not something I
wanted to tackle without a bit of script-fu. Unfortunately there is no single,
"one script to rule them all," to share with you, the audience. Instead it
took a series of three to five line scripts which allowed me to extract my
dates, convert all similarly formatted posts, and then manually handle the 20
or so posts which did not match the common format. The total conversion took
about 2 hours, including building each script as needed and looking up metadata
within the historical MySQL dump, which is not bad.</p>
<p>In the process, however, I discovered the dangers of depending on file system
metadata to record modified dates when dealing with a DVCS: when you checkout a
file, <em>the file metadata changes</em>!!! Yep... all those preciously guarded
<code>modified</code> timestamps were lost whenever the file was checked out. That leads
to my first lesson from the conversion:</p>
<blockquote>
<p><strong>Always store your metadata explicitly.</strong></p>
</blockquote>
<p>Following the extra time the lesson imposed in digging out metadata from the
backups of the old website (which, thank goodness, I had), the next step was
determining a structure for the website.</p>
<p>Each example of a possible layout will be representing a post named, "Editing
my navel," that was (notionally) published on the 12th of January, 2013 at
23:48:09 UTC.</p>
<p>The default structure <a href="http://jaspervdj.be/hakyll/">Hakyll</a> uses is as follows.</p>
<ul>
<li><code>posts/2013-01-12-Editing_my_navel.md</code></li>
</ul>
<p>The default, being the default, seemed much less appealing on multiple grounds.
The primary being that it violated the, "keep the files with the post,"
requirement, with another, more minor issue being the lack of specificity: What
if I wanted to make two posts in the same day? Or hour? Or minute? Would the
two posts properly sort within the day (given that the file path is usually
used to sort in <a href="http://jaspervdj.be/hakyll/">Hakyll</a>)? Or would they be sorted arbitrarily? Three
alternative layouts occurred to me, illustrated by the following three
examples.</p>
<ol>
<li><code>posts/2013/01/12/23/48/09/Editing_my_navel.md</code></li>
<li><code>posts/2013-01-12-23-48-09-Editing_my_navel.md</code></li>
<li><code>posts/2013/01/12/23/48/09/Editing_my_navel/index.md</code></li>
</ol>
<p>While all three would be ideal with regards to specificity, they are awkward as
regards to human access of a given post. This led to further navel gazing, and
some searching, where I came across another <a href="http://jaspervdj.be/hakyll/">Hakyll</a> <a href="http://www.skybluetrades.net/blog/">blog by Ian Ross</a>
which used a limited version of one of my schemes.</p>
<ul>
<li><code>posts/2013/01/12/Editing-my-navel.md</code></li>
</ul>
<p>While this solved most of the problems I was anticipating (mostly from having
run into them on other website platforms), I wanted something that resulted in
clean URLs and allowed files that go with posts to be located with them on disk
(not all files of the same day go with all posts of the same day), which led to
the final version.</p>
<ul>
<li><code>posts/2013/01/12/Editing_my_navel/index.md</code></li>
</ul>
<p>With this layout <em>most</em> of the sorting can be done at the file system level,
files that go with posts can be located with the post on disk, and the URLs to
refer to the posts do not require the un-site-ly (yuk) <code>index.html</code> at the end.
As to clean URLs - I do not know why, but I have disliked having the <code>*.html</code>
file at the end of the URL for years. This does not solve the specificity
problem, but as each post will have an explicit <code>published</code> metadata field this
will do until I figure out how to sort using the <code>published</code> field.</p>
<p>Alright, the layout for posts has been figured, now what about the layout for
projects? The projects layout was much easier, as projects are supposed to be
longer, less time oriented pages, thus the date is omitted from the path and
the following title might be a new HOWTO on navel editing.</p>
<ul>
<li><code>projects/Navel_editing_HOWTO/index.md</code></li>
</ul>
<p>After that, and with the example of <a href="https://github.com/jaspervdj/jaspervdj/blob/master/site.hs">the site.hs of the author</a>, the
only significant problem was designing a sort routine to keep the posts in
chronological order, which turned out to be a non-issue. The <a href="http://www.skybluetrades.net/blog/">previously
mentioned blog</a> also uses a similar layout and had already <a href="https://github.com/ian-ross/blog/blob/master/build/Overrides.hs#LC203">rewritten the
chronological function</a>. With that as an example, generating my own
chronological function was relatively simple, resulting in the following.</p>
<div class="codehilite"><pre><span class="n">import</span> <span class="n">System</span><span class="p">.</span><span class="n">FilePath</span> <span class="p">(</span><span class="n">splitDirectories</span><span class="p">,</span> <span class="n">joinPath</span><span class="p">)</span>
<span class="n">import</span> <span class="n">Data</span><span class="p">.</span><span class="n">List</span> <span class="p">(</span><span class="n">sortBy</span><span class="p">)</span>
<span class="n">import</span> <span class="n">Data</span><span class="p">.</span><span class="n">Ord</span> <span class="p">(</span><span class="n">comparing</span><span class="p">)</span>
<span class="o">--</span> <span class="o">|</span> <span class="n">Sort</span> <span class="n">pages</span> <span class="n">chronologically</span><span class="p">.</span> <span class="n">This</span> <span class="n">function</span> <span class="n">assumes</span> <span class="n">that</span> <span class="n">the</span> <span class="n">pages</span> <span class="n">have</span> <span class="n">a</span>
<span class="o">--</span> <span class="err">@</span><span class="n">posts</span><span class="o">/</span><span class="n">year</span><span class="o">/</span><span class="n">month</span><span class="o">/</span><span class="n">day</span><span class="o">/</span><span class="n">title</span><span class="o">/</span><span class="n">index</span><span class="p">.</span><span class="n">md</span><span class="err">@</span> <span class="n">naming</span> <span class="n">scheme</span><span class="p">.</span>
<span class="n">chronological</span> <span class="o">::</span> <span class="p">[</span><span class="n">Item</span> <span class="n">a</span><span class="p">]</span> <span class="o">-></span> <span class="p">[</span><span class="n">Item</span> <span class="n">a</span><span class="p">]</span>
<span class="n">chronological</span> <span class="o">=</span> <span class="n">sortBy</span> <span class="err">$</span> <span class="n">comparing</span> <span class="err">$</span>
<span class="n">joinPath</span> <span class="p">.</span> <span class="n">take</span> <span class="mi">3</span> <span class="p">.</span> <span class="n">drop</span> <span class="mi">2</span> <span class="p">.</span> <span class="n">splitDirectories</span> <span class="p">.</span> <span class="n">toFilePath</span> <span class="p">.</span> <span class="n">itemIdentifier</span>
</pre></div>
<p>Note that I use this by importing <a href="http://jaspervdj.be/hakyll/">Hakyll</a> as follows.</p>
<div class="codehilite"><pre><span class="n">import</span> <span class="n">Hakyll</span> <span class="n">hiding</span> <span class="p">(</span><span class="n">chronological</span><span class="p">)</span>
</pre></div>
<p>Of course, shortly after I was able to get the above function functional, Hakyll
was upgraded to version 4.2.X, which automatically sorts based on "published"
metadata if it exists. Harumph.</p>
<p>The last item on the agenda was allowing access to the source files from within
the website itself (copy the source files along with the compiled files).
Making the original markdown files available turned out to be simpler than it
originally seemed, requiring only addition of another match and specification of
the version when loading snapshots. Just make sure to define the <code>postPattern</code>.</p>
<div class="codehilite"><pre><span class="n">postPattern</span> <span class="o">=</span> <span class="s">"posts/*/*/*/*/index.md"</span>
</pre></div>
<p>Copy the raw posts and define the version.</p>
<div class="codehilite"><pre><span class="o">--</span> <span class="n">Make</span> <span class="n">sure</span> <span class="n">to</span> <span class="n">copy</span> <span class="n">the</span> <span class="n">raw</span> <span class="n">posts</span>
<span class="n">match</span> <span class="n">postPattern</span> <span class="err">$</span> <span class="n">version</span> <span class="s">"raw"</span> <span class="err">$</span> <span class="k">do</span>
<span class="n">route</span> <span class="err">$</span> <span class="n">idRoute</span>
<span class="n">compile</span> <span class="err">$</span> <span class="n">getResourceBody</span>
</pre></div>
<p>When loading snapshots later on, just make sure to refer to the snapshots <em>not</em>
associated with a version... otherwise, the result will probably not be what you
intend.</p>
<div class="codehilite"><pre><span class="n">loadAllSnapshots</span> <span class="p">(</span><span class="n">postPattern</span> <span class="p">.</span><span class="o">&&</span><span class="p">.</span> <span class="n">hasNoVersion</span><span class="p">)</span> <span class="s">"content"</span>
</pre></div>
<p>With that, all the basics were in place, with nothing to do except tweak and
work on items that are not absolutely required (<a href="https://en.wikipedia.org/wiki/Breadcrumb_%28navigation%29">breadcrumbs</a> being a good
example of something desired but not required). As it is, you should be reading
this on the new and improved site. I will put a TODO list up on the
<a href="http://caterva.org/facets.html">facets</a> page to indicate what is left to be done.</p>Excellent example of WebGL programmingtag:caterva.org,2013-01-14:/posts/2013/01/14/13/51/excellent-example-of-webgl-programming2013-01-14T18:51:59Zdavehttp://caterva.org/dave@weller-fahy.com<p>Just came across <a href="http://codeflow.org/webgl/craftscape/">this</a> excellent example of <a href="https://www.khronos.org/webgl/">WebGL</a> programming, and lost
some productive time playing with it. This is a superb demonstration of what
the web could become, or, at least, could aspire to become... plus, it is fun!</p>Installing LXDE on HEADtag:caterva.org,2012-12-18:/posts/2012/12/18/03/18/installing-lxde-on-head2012-12-18T08:18:34Zdavehttp://caterva.org/dave@weller-fahy.com<p>When installing LXDE on FreeBSD-HEAD (at least, until imake is
eliminated from the ports tree, if that ever happens) the following
addition to the make.conf will help <em>immensely</em> in preventing stress and
hair tearing.</p>
<div class="codehilite"><pre># clang fallout: lxde has ports using imake, imake does not like clang
.if !empty(.CURDIR:M/usr/ports/*) <span class="err">&&</span> exists(/usr/local/bin/gcc46)
.if <span class="cp">${</span><span class="o">.</span><span class="n">CURDIR</span><span class="p">:</span><span class="n">M</span><span class="o">*/</span><span class="n">textproc</span><span class="o">/</span><span class="n">docbook</span><span class="o">-</span><span class="n">to</span><span class="o">-</span><span class="n">man</span><span class="cp">}</span> || <span class="cp">${</span><span class="o">.</span><span class="n">CURDIR</span><span class="p">:</span><span class="n">M</span><span class="o">*/</span><span class="n">x11</span><span class="o">/</span><span class="n">lxpanel</span><span class="cp">}</span>
CC=gcc46
CXX=g++46
CPP=cpp46
.endif
.endif
</pre></div>
<p>Note this only works if you have installed gcc 4.6, otherwise modify as
necessary.</p>Automate ZFS install on NAStie using mfsBSDtag:caterva.org,2011-11-26:/posts/2011/11/26/12/04/automate-zfs-install-on-nastie-using-mfsbsd2011-11-26T17:04:17Zdavehttp://caterva.org/dave@weller-fahy.com<p>When performing zfs perambulations after install (as noted in <a href="http://caterva.org/posts/2011/11/22/04/30/zfs-and-nastie-and-i386-and-not-reading-the-specification">ZFS and NAStie
and i386 and not reading the specification</a>), the chance of finger
fumbling errors is high. To prevent those errors, I modified the <code>zfsinstall</code>
script included in the mfsBSD 8.2-RELEASE-p2 ISO to configure the paths to
different dataset objects as described on the <a href="http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror">FreeBSD Wiki</a>.</p>
<p>A <a href="http://caterva.org/posts/2011/11/26/12/04/automate-zfs-install-on-nastie-using-mfsbsd/zfsinstall.patch">patch</a> is available for future use/reference, and the contents of
the patch are displayed below.</p>
<!--
filters: Jinja2
{% set p = "cat " ~ entry.filename |replace("/index.md", "/zfsinstall.patch") %}
wzxhzdk:0
-->ZFS and NAStie and i386 and not reading the specificationtag:caterva.org,2011-11-22:/posts/2011/11/22/04/30/zfs-and-nastie-and-i386-and-not-reading-the-specification2011-11-22T09:30:27Zdavehttp://caterva.org/dave@weller-fahy.com<p>Ahem.</p>
<p>Apparently one should not skim the docs when putting together a server.
Apparently one should actually <em>read</em> the portion which tells you what type of
processor you have (for example, if you have a 64-bit processor). Occasionally
that type of information would be useful... like... say... when you are trying
to get your FreeBSD installation using ZFS to be stable, which it is <em>NOT</em> on
32-bit (ok, some small portion of the population has aligned the stars, but I
did not)! <!-- more --> One should not depend on ones memory when one thinks,
"Self, that system is old so the processor <em>must</em> be 32-bit," and does not check
to be sure.</p>
<p>Yep... I noticed a few days ago the Pentium 4 2.8 GHz processor in my
server is indeed 64-bit, silly me. So I immediately attempted to load
9.0-RC2, only to have it fail to boot. RC1 (off of PC-BSD) failed as
well, and then I was off and running in an attempt to find out what
caused this <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=162708">PR</a> (filed recently).</p>
<p>After digging a bit I discovered the <a href="http://mfsbsd.vx.sk">mfsBSD images</a>, a <a href="http://www.keltia.net/howtos/zfsboot">ZFS boot
howto</a>, and re-discovered the <a href="http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror">FreeBSD Wiki page on ZFS
booting</a>. Those gave me everything I needed to get back up and
running using an amd64 image.</p>
<p>So, first thing was to download the ISO from the mfsBSD page (8.2p2
special edition) and boot... it works! The <code>zfsinstall</code> command line I
used follows.</p>
<div class="codehilite"><pre><span class="c"># zfsinstall -d ad6 -t /cdrom/8.2-RELEASE-p2-amd64.tar.xz -s 8G -p nastie</span>
</pre></div>
<p>After install I rebooted (instead of chrooting into /mnt) into the new
environment, and it had that new car smell... mmmm. Anyway, tasks I did
right after reboot.</p>
<p>I created lots of other mountpoints (the default only creates <code>/</code>,
<code>/var</code>, <code>/tmp</code>) following the <a href="http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror">FreeBSD Wiki page</a>.</p>
<p>Note about this: Remember to make sure you move any directories/files
out of the way <em>before</em> creating the mount point... confusion reigned
for a moment until my brain caught up with my fingers.</p>
<p>New mountpoints created (from the wiki - all commands copied from the wiki and
modified for my setup) follow. BUYER BEWARE: I am only showing the commands
necessary to create mountpoints and set options, not those necessary to destroy
the already created mountpoints or move files out of the way while creating a
mountpoint which was already created as a directory when installing mfsBSD.</p>
<p>Set the checksum algorithm.</p>
<div class="codehilite"><pre><span class="c"># zfs set checksum=fletcher4 zroot</span>
</pre></div>
<p>Create /tmp and set the proper permissions.</p>
<div class="codehilite"><pre><span class="c"># zfs create -o compression=lzjb -o exec=on -o setuid=off nastie/root/tmp</span>
<span class="c"># chmod 1777 /tmp</span>
</pre></div>
<p>Create the /usr and /usr/home.</p>
<div class="codehilite"><pre><span class="c"># zfs create nastie/root/usr</span>
<span class="c"># zfs create nastie/root/usr/home</span>
<span class="c"># cd / ; ln -s /usr/home home</span>
</pre></div>
<p>Create the ports hierarchy.</p>
<div class="codehilite"><pre><span class="c"># zfs create -o compression=lzjb -o setuid=off nastie/root/usr/ports</span>
<span class="c"># zfs create -o compression=off -o exec=off -o setuid=off nastie/root/usr/ports/distfiles</span>
<span class="c"># zfs create -o compression=off -o exec=off -o setuid=off nastie/root/usr/ports/packages</span>
</pre></div>
<p>Use the src, Luke!</p>
<div class="codehilite"><pre><span class="c"># zfs create -o compression=lzjb -o exec=off -o setuid=off nastie/root/usr/src</span>
</pre></div>
<p>A variety of various subdirectories of var.</p>
<div class="codehilite"><pre><span class="c"># zfs create nastie/root/var</span>
<span class="c"># zfs create -o compression=lzjb -o exec=off -o setuid=off nastie/root/var/crash</span>
<span class="c"># zfs create -o exec=off -o setuid=off nastie/root/var/db</span>
<span class="c"># zfs create -o compression=lzjb -o exec=on -o setuid=off nastie/root/var/db/pkg</span>
<span class="c"># zfs create -o exec=off -o setuid=off nastie/root/var/empty</span>
<span class="c"># zfs create -o compression=lzjb -o exec=off -o setuid=off nastie/root/var/log</span>
<span class="c"># zfs create -o compression=gzip -o exec=off -o setuid=off nastie/root/var/mail</span>
<span class="c"># zfs create -o exec=off -o setuid=off nastie/root/var/run</span>
<span class="c"># zfs create -o compression=lzjb -o exec=on -o setuid=off nastie/root/var/tmp</span>
<span class="c"># chmod 1777 /var/tmp</span>
<span class="c"># zfs set readonly=on nastie/var/empty</span>
</pre></div>
<p>Finally the service NAStie will provide.</p>
<div class="codehilite"><pre><span class="c"># zfs create -o compression=lzjb -o exec=off -o setuid=off nastie/root/srv</span>
</pre></div>
<p>That sets up the file systems. Now all that needs to be done is add a
normal user and start setting up the services on the machine. It is
interesting that this was much faster than installing normally. Have to
look into building my own custom release sometime.</p>
<p>I will add anything I notice <em>must</em> be done, but between this post, <a href="http://caterva.org/posts/2011/08/24/17/51/getting-nastie-with-zfs">Getting
NAStie with ZFS</a>, and <a href="http://caterva.org/posts/2011/08/21/03/28/rebuilding-nastie">Rebuilding NAStie</a> I should be able
to reconstruct this server.</p>Cygwin terminate batch annoyancetag:caterva.org,2011-10-21:/posts/2011/10/21/00/23/cygwin-terminate-batch-annoyance2011-10-21T05:23:02Zdavehttp://caterva.org/dave@weller-fahy.com<p>When installing CYGWIN in the future, remember to visit <a href="http://kt2t.us/terminatebatchjob.htm">this page</a>.
It tells you how to use <code>bash.exe --login -i</code> instead of the batch file.</p>Thunderbird defaults remindertag:caterva.org,2011-10-16:/posts/2011/10/16/02/50/thunderbird-defaults-reminder2011-10-16T07:50:41Zdavehttp://caterva.org/dave@weller-fahy.com<p>A tiny reminder to (when playing with Thunderbird) do the following in the config editor.</p>
<div class="codehilite"><pre><span class="n">mail</span><span class="p">.</span><span class="n">check_all_imap_folders_for_new</span> <span class="o">=</span> <span class="nb">true</span>
<span class="n">mailnews</span><span class="p">.</span><span class="n">default_sort_order</span> <span class="o">=</span> <span class="mi">22</span>
<span class="n">mailnews</span><span class="p">.</span><span class="n">default_sort_type</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">mailnews</span><span class="p">.</span><span class="n">default_view_flags</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">mailnews</span><span class="p">.</span><span class="n">headers</span><span class="p">.</span><span class="n">showSender</span> <span class="o">=</span> <span class="nb">true</span>
<span class="n">mailnews</span><span class="p">.</span><span class="n">headers</span><span class="p">.</span><span class="n">showUserAgent</span> <span class="o">=</span> <span class="nb">true</span>
</pre></div>
<p>Sigh... much better.</p>
<p>Oh, yeah, found at <a href="http://www.everything-mdaemon.com/general/threading-messages-in-thunderbird">http://www.everything-mdaemon.com/general/threading-messages-in-thunderbird</a>.</p>Xorg font follow-uptag:caterva.org,2011-10-07:/posts/2011/10/07/15/20/xorg-font-follow-up2011-10-07T20:20:48Zdavehttp://caterva.org/dave@weller-fahy.com<p>In <a href="http://caterva.org/posts/2011/10/07/03/16/debian-on-macbook-pro-5-2">Debian on Macbook Pro 5.2</a> I mentioned using the <code>xterm*font</code>
resource to get rid of the nasty fonts, and then could not find the TTF fonts in
<code>xfontsel</code>/<code>xlsfonts</code> (despite using my previous post about <a href="http://caterva.org/projects/xorg_font_hell.html">xorg font
hell</a>), and began to get very frustrated.</p>
<p>Apparently, the frustration was not necessary. Apparently, while I have spent
my time in OS X land, the Linux universe was moving further and further from
having X provide the fonts, instead using fontconfig and other tools. Also
xterm has a method to access ttf fonts separate from the normal X fonts.</p>
<p>The following (in combination with <a href="http://hivelogic.com/articles/top-10-programming-fonts/">a recent article on the top 10
programming fonts</a>) fixed me up.</p>
<div class="codehilite"><pre><span class="n">xterm</span><span class="o">*</span><span class="n">faceName</span><span class="o">:</span> <span class="n">DejaVu</span> <span class="n">Sans</span> <span class="n">Mono</span>
<span class="n">xterm</span><span class="o">*</span><span class="n">faceSize</span><span class="o">:</span> <span class="mi">8</span>
</pre></div>
<p>I just plopped it in my <code>.Xresources</code> file, removed the <code>xterm*font</code>
line, merged the resources using <code>xrdb -merge ~/.Xresources</code>, and
relaunched my xterms.</p>
<p>Now, why is FireFox giving me fits?</p>Debian on Macbook Pro 5.2tag:caterva.org,2011-10-07:/posts/2011/10/07/03/16/debian-on-macbook-pro-5-22011-10-07T08:16:23Zdavehttp://caterva.org/dave@weller-fahy.com<p>So, Mac OS X got on my last nerve and led me back to the holy land
(linux, what else?). While FreeBSD beckoned there are certain pieces of
software I must have working for this Quarter. It is the first of my
Master Degree classes, so I want to get in the proper habits (such as not
staying up all night getting Mathematica or MATLAB working in FreeBSD, when
Linux versions are available ;)).</p>
<p>Regardless, some notes about stumbling blocks would be helpful if I need
to do this again, so here goes.</p>
<p>WIFI - The wireless is a Broadcom Corporation BCM4322.</p>
<div class="codehilite"><pre><span class="err">$</span> <span class="n">lspci</span> <span class="o">-</span><span class="n">s</span> <span class="mo">04</span><span class="o">:</span><span class="mf">00.0</span>
<span class="mo">04</span><span class="o">:</span><span class="mf">00.0</span> <span class="n">Network</span> <span class="n">controller</span><span class="o">:</span> <span class="n">Broadcom</span> <span class="n">Corporation</span> <span class="n">BCM4322</span> <span class="mf">802.11</span><span class="n">a</span><span class="o">/</span><span class="n">b</span><span class="o">/</span><span class="n">g</span><span class="o">/</span><span class="n">n</span> <span class="n">Wireless</span> <span class="n">LAN</span> <span class="n">Controller</span> <span class="p">(</span><span class="n">rev</span> <span class="mo">01</span><span class="p">)</span>
</pre></div>
<p>Checking the <a href="http://wiki.debian.org/wl">debian wiki page about Broadcom wireless cards</a>
indicated the fix is not difficult... oh, unless you do not have a
connection to the Internet so you cannot get the software so you do not
have conne... ahem.</p>
<p>The solution (<em>some</em> might have simply plugged in upstairs by the router
and continued on their merry way - but certainly not <em>I</em>) was to
download the needed debs on another computer (thanks wif!), and create a
small temporary repository to hold them until I got connected. Why
did I not just use dpkg to install the debs? Good question: The dpkg
method does not handle dependencies, the local respository method does.</p>
<p>The method used was from <a href="http://linux.koolsolutions.com/2009/09/21/howto-create-your-own-local-debian-repository">a handy obsolete page about
repositories</a> and allowed me to install the two packages
([<code>broadcom-sta-common</code> and <code>broadcom-sta-source</code>]) with all their
dependencies, and move on to the configuration (remember, every time the
kernel changes, you must rebuild the broadcom-sta module).</p>
<p><a href="http://wiki.debian.org/WiFi/HowToUse">Configuring wireless is fairly painless</a>... at least it is once
you realize the <code>wlan0</code> interface <em>does not actually exist</em>! That is
right folks, it is a red herring to trick you into typing silly things
like <code>sudo ifup wlan0</code> (when what you really want is <code>sudo ifup eth1</code>).
Heh.</p>
<p>Next annoying thing to attract my wrath was the function keys... whoever
decided it was a good idea to make the function keys act like the cute
little alternate functions... well, let us just say there is a reason I
left Mac OS X. I will probably pick up an MS Natural Keyboard just to
have an MS product hooked to a Mac... well, that and (other than the
plus shaped extra arrow keys useless for gaming) it is my favorite
keyboard of all time.</p>
<p>While a fix to the function key problem was on a <a href="https://help.ubuntu.com/community/AppleKeyboard">page about the Apple
Keyboard</a>, someone also created a daemon which fixed all the problems I
had with function keys (without updating initramfs) and the brightness
adjustment which was my next stop on the way to insanity! Check out <a href="http://alioth.debian.org/projects/pommed/">pommed</a>
if you are installing on a Mac.</p>
<p>Next to fix was... erm... oh, yeah, nvidia drivers... wait! I almost
forgot, the annoyingly small font in xterm. The line I used in my
<code>.Xresources</code> file follows.</p>
<div class="codehilite"><pre><span class="n">xterm</span><span class="o">*</span><span class="n">font</span><span class="o">:</span> <span class="o">-</span><span class="n">misc</span><span class="o">-</span><span class="n">fixed</span><span class="o">-</span><span class="n">medium</span><span class="o">-</span><span class="n">r</span><span class="o">-</span><span class="n">normal</span><span class="o">-*-</span><span class="mi">17</span><span class="o">-*-*-*-*-*-</span><span class="n">iso10646</span><span class="o">-</span><span class="mi">1</span>
</pre></div>
<p><em>NOW</em> for the nvidia drivers which was very anticlimactic. First,
I am running <code>testing</code>, so YMMV if you are not. All I did was install
the <code>nvidia-kernel-dkms</code> package, then put the following in an
<code>/etc/X11/xorg.conf</code>.</p>
<div class="codehilite"><pre><span class="n">Section</span> <span class="s">"Device"</span>
<span class="n">Identifier</span> <span class="s">"My MASSIVE GPU"</span>
<span class="n">Driver</span> <span class="s">"nvidia"</span>
<span class="n">EndSection</span>
</pre></div>
<p>That was it, and it worked. Weird.</p>
<p>Last problem: Fonts do not want to show up with the new "modularitalized" xorg,
and my <a href="http://caterva.org/posts/2010/06/29/03/59/xorg-font-hell">xorg font hell</a> post did not help, so I will have to go digging.
Oh, yeah, firefox all of a sudden starts giving me fits (CPU hogging, machine
lagging, but never crashing fits). So, I have installed chromium (little
brother of chrome) until I can figure it out... wonder if adblock plus is
available for chromium. ;)</p>
<p>That is all for this set of adventures. Hopefully I will remember to look
here next time I install on a Mac.</p>Stability for i386 and ZFStag:caterva.org,2011-10-01:/posts/2011/10/01/02/32/stability-for-i386-and-zfs2011-10-01T07:32:17Zdavehttp://caterva.org/dave@weller-fahy.com<p>According to various sources, stability of ZFS on i386 boxes is going to
be... not a priority. Regardless, I decided to take up the challenge.</p>
<p>My first attempt to get everything stable was to use zero settings in
the loader.conf file. That lasted until my first big ports build.
That did not work.</p>
<p>A similar (but <em>not</em> the actual: I have received plenty and just chose the
last one) error message follows.</p>
<div class="codehilite"><pre><span class="n">panic</span><span class="o">:</span> <span class="n">kmem_malloc</span><span class="o">(</span><span class="mi">86016</span><span class="o">):</span> <span class="n">kmem_map</span> <span class="n">too</span> <span class="n">small</span><span class="o">:</span> <span class="mi">520044544</span> <span class="n">total</span> <span class="n">allocated</span>
<span class="n">cpuid</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">KDB</span><span class="o">:</span> <span class="n">enter</span><span class="o">:</span> <span class="n">panic</span>
<span class="o">[</span> <span class="n">thread</span> <span class="n">pid</span> <span class="mi">0</span> <span class="n">tid</span> <span class="mi">100228</span> <span class="o">]</span>
<span class="n">Stopped</span> <span class="n">at</span> <span class="n">kdb_enter</span><span class="o">+</span><span class="mh">0x3a</span><span class="o">:</span> <span class="n">movl</span> <span class="n">$0</span><span class="o">,</span> <span class="n">kdb_why</span>
</pre></div>
<p>This is consistent every time I load the disks heavily (such as trying
to copy the entirety of the HEAD svn repository to another directory).
Now, my goal is to attempt to get things stable under heavy load. I
started using the following loader.conf settings.</p>
<div class="codehilite"><pre><span class="cp"># /boot/loader.conf excerpt</span>
<span class="n">vm</span><span class="p">.</span><span class="n">kmem_size</span><span class="o">=</span><span class="s">"512M"</span>
<span class="n">vm</span><span class="p">.</span><span class="n">kmem_size_max</span><span class="o">=</span><span class="s">"512M"</span>
<span class="n">vfs</span><span class="p">.</span><span class="n">zfs</span><span class="p">.</span><span class="n">arc_max</span><span class="o">=</span><span class="s">"128M"</span>
<span class="n">vfs</span><span class="p">.</span><span class="n">zfs</span><span class="p">.</span><span class="n">vdev</span><span class="p">.</span><span class="n">cache</span><span class="p">.</span><span class="n">size</span><span class="o">=</span><span class="s">"5M"</span>
</pre></div>
<p>That did not work. To avoid such quoting throughout, I will refer to
such settings in the future as
vm.kmem_size/vm.kmem_size_max/vfs.zfs.arc_max/vfs.zfs.vdev.cache.size.
Using that the above values would be 512M/512M/128M/5M. Now, since that
did not work, and after some IRC goodness on #freebsd, I decided to just
try 384M/384M/64M/5M. Now, there is no real empirical reason to use
those, but they are close to the 330M/330M/40M/5M which worked when
NAStie had 784M of memory, so perhaps this will do the trick.</p>
<p>We will see, now to rsync and compile a lot!</p>
<p>Update: Hrm... after transfering the latest Mathematica download (about
800 MB), and then removing the Mathematica 7 ISO for Mac (I do not remember
how much), system dumped again. I am going back to the 330M/330M/40M/5M
which worked for me when I only had 768 MB of memory. We will see how
that works.</p>
<p>Update: Odd, had a middle of the night shutdown, did not notice until
this evening. I will reboot and see what is what. No change in values.</p>
<p>Update: Even odder, I can not get the server to stay stable for longer than
(about) a day. Every time I stress the drives it dies (technical term).
Going to try moving to AMD64 (more in the new post).</p>New chassis for NAStietag:caterva.org,2011-09-02:/posts/2011/09/02/01/37/new-chassis-for-nastie2011-09-02T06:37:39Zdavehttp://caterva.org/dave@weller-fahy.com<p>It is always exciting (and scary!) when a new system arrives, and arrive
it did: A brand spanking seller-refurbished Dell Optiplex GX620 with 512
MB of RAM and a 40 GB hard drive. Wooo!</p>
<p>Ahem.</p>
<p>Anyway, the first task was to confirm it worked, which I did and it did. The
second task was to move NAStie (of <a href="http://caterva.org/posts/2010/05/23/13/37/building-nastie">building NAStie</a>) over to the new
system.</p>
<p>Surprisingly (with a few burps because of SATA connected to the wrong
port and other fumbles) everything worked right away. I just made sure
to <code>zpool export</code> and <code>zpool import</code> as recommended on <a href="http://www.daemonforums.org/showthread.php?t=1539">a forum post
about similar hijinks</a> and the system is operational 20 minutes
after the switch!</p>
<p>Now, to upgrade the 512 MB of memory (barely useful) to a slightly
bigger value (4G should do ;)).</p>Getting NAStie with ZFStag:caterva.org,2011-08-24:/posts/2011/08/24/17/51/getting-nastie-with-zfs2011-08-24T22:51:53Zdavehttp://caterva.org/dave@weller-fahy.com<p>While my priorities have not changed a "shiny" moment had me read all
about ZFS and how it will change the world, save all the children, and
eliminate hunger for all time.</p>
<p>With advertisements like those, how could I resist trying to run it on a
<a href="http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&dlc=en&cc=us&docname=c00191902&product=424182">Compaq SR1103WM</a> with a lofty 768MB of RAM? Luckily, I found a
post which provided almost everything needed to do a ZFS-mostly install.
As it had only been three days since the server rebuild, and everything
I did to setup the server aspects (vs. the actual install and
filessystem aspects) was still in my head, I figured it was now or when
the next reinstall needed to be done. Needless to say I went with now.</p>
<p>Anywho, all the previous guidance regarding <a href="http://caterva.org/posts/2011/08/21/Rebuilding_NAStie">Rebuilding
NAStie</a> applies, but use the <a href="http://blogs.freebsdish.org/pjd/2010/08/06/from-sysinstall-to-zfs-only-configuration/">From
sysinstall to ZFS-only configuration</a> post to install. As I am limited
on RAM I found the <a href="http://wiki.freebsd.org/ZFSTuningGuide">FreeBSD Wiki ZFS Tuning Guide</a> particularly
helpful (especially the settings from CyShubert). Also useful during the
install and for the sake of research were <a href="http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror">Installing FreeBSD Root on ZFS
(Mirror) using GPT</a> and <a href="http://download.oracle.com/docs/cd/E19082-01/817-2271/gavwn/">Chapter 4 of the Solaris ZFS Administration
Guide</a>.</p>
<p>To summarize, follow the instructions in the <a href="http://blogs.freebsdish.org/pjd/2010/08/06/from-sysinstall-to-zfs-only-configuration/">From sysinstall to
ZFS-only configuration</a>, use the loader.conf values from
<a href="http://wiki.freebsd.org/ZFSTuningGuide">FreeBSD Wiki ZFS Tuning Guide</a>, and use the rest of the links
as reference and knowledge building.</p>
<p>Now to see how Samba likes serving files off of a ZFS platter.</p>htop on FreeBSDtag:caterva.org,2011-08-24:/posts/2011/08/24/15/58/htop-on-freebsd2011-08-24T20:58:19Zdavehttp://caterva.org/dave@weller-fahy.com<p>Installing <a href="http://htop.sourceforge.net">htop</a> on FreeBSD requires a particular directory under the
linux compatibility tree be mounted, but I did not want linux
compatibility installed. Luckily, I found <a href="http://forums.freebsd.org/showthread.php?t=10352">a thread about htop on
FreeBSD</a> which covered that issue, and <a href="http://daemon80.blogspot.com/2007/09/htop-in-freebsd.html">another which covered
loading the linux kernel module</a>.</p>
<p>Just create <code>/compat/linux/proc</code>, add the requisite entry to
<code>/etc/fstab</code>, and <code># mount linproc</code>. If you have problems, try putting
<code>linux_enable="YES"</code> in your <code>/etc/loader.conf</code>.</p>
<p>Done!</p>Rebuilding NAStietag:caterva.org,2011-08-21:/posts/2011/08/21/03/28/rebuilding-nastie2011-08-21T08:28:16Zdavehttp://caterva.org/dave@weller-fahy.com<p>After a recent spat with NAStie (my home NAS built in <a href="http://caterva.org/posts/2010/05/23/13/37/building-nastie">building
NAStie</a>) and its grub infestation, I decided to
go back to FreeBSD for my home server needs. I like Linux, but mostly for
desktop/remote server stuff. For home server on old hardware, I likes me some
*BSD.</p>
<p>So, I started my research at my post about RAID1 on FreeBSD (<a href="http://caterva.org/posts/2004/10/05/21/37/freebsd-5-2-1-and-cheap-raid1">FreeBSD 5.2.1 and
cheap RAID1</a>), learned about the
RAID-1 options in FreeBSD, and needed to decide whether there was any use in
trying for a volume management option.</p>
<p>Answer: NO.</p>
<p>As to why: In my home network server upgrades are driven not by space
requirements, but by old hardware breaking down. My servers are usually
hand-me-downs which have been abused by people who (speaking broadly)
are not computer savvy. This leads to interesting life-cycles for the
hardware, which tends to have had encounters with small humans for
extended periods of time before they are "rescued" by me. Since I have
never had to add storage to the home server, and I always overestimate
the total required space for us, it makes sense to set my priorities as
follows.</p>
<ol>
<li>
<p>Secure - the data stored should be safe from casual efforts to gain
access. I am not trying to stop a determined effort by a major
player, but I <em>am</em> trying to stop accidental disclosure and any
non-targeted attacks. In this case non-targeted means not targeting
me (Dave), it does not mean the attacks would not target an IP
address on which my computer happens to be accessible.</p>
</li>
<li>
<p>Safe - the data stored should be reasonably safe from hard drive
failure. I am not looking for perfect safety (impossible!) but expect
to be able to recover from a single failed drive. Any data stored on
this system will be either a backup of a laptop drive (so, three
copies extant), or non-critical data which can be recovered (copies
of CD/DVDs, working papers put there temporarily, etc.), thus even
failure of both drives at once should just be inconvenient, not
catastrophic.</p>
</li>
<li>
<p>Accessible - the data stored should be accessible by me anywhere I
have Internet access (sshfs or openvpn), and by my wife at home.
Speed of access outside the home is not critical, but being able to
access it is.</p>
</li>
<li>
<p>Growth - in the unlikely event my data outgrows my storage capacity
(1.5 TB), adding storage should be relatively simple.</p>
</li>
</ol>
<p>As growth is my last priority, and adding hard drives (and thus more
space) is not that difficult even with separate partitions to deal with
(instead of growing a file system using LVM), I shall not give it much
thought.</p>
<p>Now, asides aside, here is a brief "here's how I did it" install
description. This should help in the event I need to look back on how I
did it in the future.</p>
<p>Do a standard FreeBSD install but set up gmirror while installing. This
was remarkably easy to do once I found the <a href="http://onlamp.com/pub/a/bsd/2005/11/10/FreeBSD_Basics.html">Using Software RAID-1 with
FreeBSD</a> page.</p>
<p>Update and install some software.</p>
<div class="codehilite"><pre><span class="c"># freebsd-update fetch install</span>
<span class="c"># portsnap fetch extract</span>
<span class="c"># cd /usr/ports/ports-mgmt/portmaster</span>
<span class="c"># make install</span>
<span class="c"># portmaster shells/bash security/sudo editors/vim-lite www/lynx</span>
<span class="c"># portmaster sysutils/cdrecord sysutils/multitail net/rsync devel/git</span>
<span class="c"># portmaster x11/xorg x11/xlockmore x11-wm/i3 x11/dmenu www/firefox</span>
</pre></div>
<p><em>Note:</em> Some would frown at the presence of X11 on a server, and in a
perfect world they are correct. However, I also use this system for
playing with FreeBSD and I like three/four <code>uxterms</code> going at once.</p>
<p>Edit <code>/etc/ntp.conf</code> and <code>/etc/rc.conf</code> to make NTP behave. I used the
<a href="https://wiki.archlinux.org/index.php/NTP">Arch Linux wiki NTP page</a> and <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-ntp.html">FreeBSD Handbook NTP page</a>
for reference. NAStie will not be used as the home NTP server, this
server will just be used to keep proper time.</p>
<div class="codehilite"><pre><span class="c"># portmaster net/samba35</span>
</pre></div>
<p>Configure Samba in a way similar to <a href="http://caterva.org/posts/2010/05/23/13/37/building-nastie">building
NAStie</a>... same references, slightly different
internal structure: I will have a single big partition to store things on, but
they will be presented as two separate shares to anyone connecting via the
network. As I control all the computers writing to these shares, any issues
regarding uncontrolled usage of space should not happen (if they do I can fix
the problem as they are my computers ;)).</p>
<p>Finally, we will need some sort of email system on here which does not
store the email locally, as I prefer all mail to be sent through my mail
server. My preference has been qmail, but I have had thoughts of allowing
the default installed MTA to do its job... Hrm. I will try it for a
while, and see how things go. The only thing I had to do was modify
<code>/etc/mail/aliases</code>, so we will see how well it works.</p>
<p>That is it! The server is running well, the Wif can access her files as
can I, and the mirror is fully synced and running. We will see how long
that lasts... perhaps my next item will be on how to save the contents
of a Time Machine volume to NAStie, or something like that.</p>Building mutt from mercurial repository on FreeBSDtag:caterva.org,2011-08-20:/posts/2011/08/20/23/10/building-mutt-from-mercurial-repository-on-freebsd2011-08-21T04:10:46Zdavehttp://caterva.org/dave@weller-fahy.com<p>Just a note to remind myself of the ports needed to build mutt from the
mercurial repository on FreeBSD (because I recently had to figure that
out again).</p>
<div class="codehilite"><pre><span class="cp"># portmaster --force-config devel/mercurial devel/automake \</span>
<span class="cp"> devel/gettext textproc/docbook-xml textproc/docbook-xsl \</span>
<span class="cp"> textproc/libxslt databases/tokyocabinet www/lynx \</span>
<span class="cp"> security/cyrus-sasl2</span>
</pre></div>
<p>There are other combinations which might do the job, but IWFM.</p>LFS coreutils test errorstag:caterva.org,2011-05-30:/posts/2011/05/30/12/49/lfs-coreutils-test-errors2011-05-30T17:49:10Zdavehttp://caterva.org/dave@weller-fahy.com<p>A short note to remind me of the <a href="http://thread.gmane.org/gmane.comp.gnu.core-utils.announce/65/focus=867">patch for coreutils 8.10</a>
which allows its tests to pass when building <a href="http://www.linuxfromscratch.org">Linux From Scratch
(LFS)</a> <a href="http://www.linuxfromscratch.org/lfs/view/6.8/">version 6.8</a>.</p>LVM booted using grub2 in Archtag:caterva.org,2011-05-07:/posts/2011/05/07/18/24/lvm-booted-using-grub2-in-arch2011-05-07T23:24:47Zdavehttp://caterva.org/dave@weller-fahy.com<p>Unlike my previous experiment with <a href="http://caterva.org/posts/2010/05/23/13/37/building-nastie">building NAStie</a>
installing this variant of linux onto LVM-only partitions proved
difficult. My attempts left my sleep schedule a bit tweaked, and my
disgust for "automated" configuration-file-building-scripts found new
purpose. That aside, what worked when I installed Arch linux on LVM
partitions is below.</p>
<ul>
<li>
<p>Install Arch using the standard install tool.</p>
</li>
<li>
<p>While doing this, refer to the <a href="https://wiki.archlinux.org/index.php/LVM">Arch Wiki page on LVM</a>
and follow its instructions until it talks about changing the grub
configuration file.</p>
</li>
<li>
<p>Assigning <code>(VolumeGroupLabel-LogicalVolumeLabel)</code> to GRUB_DEVICE in
<code>/etc/default/grub</code> will cause the <code>/boot/grub/grub.cfg</code>-building
script to insert the parameter
'root=(VolumeGroupLabel-LogicalVolumeLabel)' when building the
kernel's command-line. This does not work. Once the
<code>/boot/grub/grub.cfg</code> file is build by grub-mkconfig, edit the
/boot/grub/grub.cfg file to change the kernel's root parameter to
'root=/dev/mapper/VolumeGroupLabel-LogicalVolumeLabel' (gathered from
various sources including the <a href="https://wiki.archlinux.org/index.php/GRUB2#LVM">LVM section on the Arch Wiki GRUB2
page</a>).</p>
</li>
<li>
<p>Boot happily ever after.</p>
</li>
</ul>
<p>This is quick and dirty, but I wanted it documented for the <em>next</em> time
I try this.</p>