<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0">

    <channel>

        <title>Topics</title>
        <link>http://bblank.thinkmo.de/blog/topics/debian</link>
        <description></description>

        <generator>basesyndication</generator>
        <!-- TODO
        <lastBuildDate>Mon, 30 Sep 2002 11:00:00 GMT</lastBuildDate>
        <copyright>Copyright 1997-2002 Dave Winer</copyright>
        <docs>http://backend.userland.com/rss</docs>
        <category domain="Syndic8">1765</category>
        <managingEditor>dave@userland.com</managingEditor>
        <webMaster>dave@userland.com</webMaster>
        -->

        <!-- TODO: Should there be an individual image associatable with each
        Weblog object?  I think so... -->
        <image>
            <title>Topics</title>
            <url>http://bblank.thinkmo.de/logo.png</url>
            <link>http://bblank.thinkmo.de/blog/topics/debian</link>
        </image>

        
            <item>
                <title>Setting up Ceph the hard way</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2013/09/09/setting-up-ceph-the-hard-way</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2013/09/09/setting-up-ceph-the-hard-way</link>
                <description>&lt;div class="section" id="components"&gt;
&lt;h3&gt;Components&lt;/h3&gt;
&lt;p&gt;Ceph consists of two main daemons.
One is the monitoring daemon, which monitors the health of the cluster and provides location information.
The second is the storage daemon, which maintains the actual storage.
Both are needed in a minimal setup.&lt;/p&gt;
&lt;div class="section" id="monitor"&gt;
&lt;h4&gt;Monitor&lt;/h4&gt;
&lt;p&gt;The monitor daemons are the heart of the cluster.
They maintain quorum within the cluster to check if everything can be used.
They provide referrals to clients, to allow them to find the data they seek.
Without a majority of monitors nothing will work within the cluster.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="storage"&gt;
&lt;h4&gt;Storage&lt;/h4&gt;
&lt;p&gt;The storage daemons maintain the actual storage.
One daemon maintains one backend storage device.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="configuration"&gt;
&lt;h3&gt;Configuration&lt;/h3&gt;
&lt;p&gt;The default config is understandable, but several things will just not work with it.&lt;/p&gt;
&lt;div class="section" id="monitor-on-localhost"&gt;
&lt;h4&gt;Monitor on localhost&lt;/h4&gt;
&lt;p&gt;By default the monitor daemon will not work on localhost.
There is an (undocumented) override to force it to work on localhost:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[mon.noname-admin]
 mon addr = [::1]:6789
&lt;/pre&gt;
&lt;p&gt;The monitor will be renamed to &lt;tt class="docutils literal"&gt;mon.admin&lt;/tt&gt; internaly.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="ipv6"&gt;
&lt;h4&gt;IPv6&lt;/h4&gt;
&lt;p&gt;Ceph supports IP (IPv6) or legacy-IP (IPv4), but never both.
I don't really use legacy-IP any longer, so I have to configure Ceph accordingly:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[global]
  ms bind ipv6 = true
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="one-osd-clusters"&gt;
&lt;h4&gt;One-OSD clusters&lt;/h4&gt;
&lt;p&gt;For testing purposes I wanted to create a cluster with exactly one OSD.
It never got into a clean state.
So I asked and found the answer in &lt;tt class="docutils literal"&gt;#ceph&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[global]
 osd crush chooseleaf type = 0
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="disable-authentication"&gt;
&lt;h4&gt;Disable authentication&lt;/h4&gt;
&lt;p&gt;While deprecated, the following seems to work:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[global]
 auth supported = none
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="complete-configuration"&gt;
&lt;h4&gt;Complete configuration&lt;/h4&gt;
&lt;pre class="literal-block"&gt;
[global]
 auth supported = none
 log file = $name.log
 run dir = …
 osd pool default size = 1
 osd crush chooseleaf type = 0
 ms bind ipv6 = true

[mon]
 mon data = …/$name

[mon.noname-admin]
 mon addr = [::1]:6789

[osd]
 osd data = …/$name
 osd journal = …/$name/journal
 osd journal size = 100

[osd.0]
 host = devel
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="installation"&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;This is currently based on my updated packages.
And they are still pretty unclean from my point of view.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="setup"&gt;
&lt;h3&gt;Setup&lt;/h3&gt;
&lt;p&gt;All the documentation tells only about ceph-deploy and ceph-disk.
This tools are abstractions that need root to mount stuff and do all the work.
Here I show how to do a minimal setup without needing root.&lt;/p&gt;
&lt;div class="section" id="keyring-setup"&gt;
&lt;h4&gt;Keyring setup&lt;/h4&gt;
&lt;p&gt;For some reason even with no authentication the monitor setup wants a keyring.
So just set one up:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ceph-authtool --create-keyring keyring --gen-key -n mon.
$ ceph-authtool keyring --gen-key -n client.admin
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="monitor-setup"&gt;
&lt;h4&gt;Monitor setup&lt;/h4&gt;
&lt;p&gt;Monitor setup by hand is easy:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ mkdir $mon_data
$ ceph-mon -c ceph.conf --mkfs --fsid $(uuidgen) --keyring keyring
&lt;/pre&gt;
&lt;p&gt;After that just start it:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ceph-mon -c ceph.conf
$
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="osd-setup"&gt;
&lt;h4&gt;OSD setup&lt;/h4&gt;
&lt;p&gt;First properly add the new OSD to the internal state:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ceph -c ceph.conf osd create
$ ceph -c ceph.conf osd crush set osd.0 1.0 root=default
&lt;/pre&gt;
&lt;p&gt;Then setup the OSD itself:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ mkdir $osd_data
$ ceph-osd -c ceph.conf -i 0 --mkfs --mkkey --keyring keyring
&lt;/pre&gt;
&lt;p&gt;And start it:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ceph-osd -c ceph.conf -i 0
starting osd.0 at :/0 osd_data $osd_data $osd_data/journal
$
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="health-check"&gt;
&lt;h4&gt;Health check&lt;/h4&gt;
&lt;p&gt;The health check should return ok after some time:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ ceph -c ceph.conf health
HEALTH_OK
$
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>ceph</category>
                
                
                    <category>debian</category>
                

                <pubDate>Mon, 09 Sep 2013 10:55:00 +0000</pubDate>

                
            </item>
        
        
            <item>
                <title>Using SECCOMP to filter sync operations</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2013/03/04/using-seccomp-to-filter-sync-operations</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2013/03/04/using-seccomp-to-filter-sync-operations</link>
                <description>&lt;p&gt;Linux includes a syscall filter since a long time.
It was restricted to a pre-defined set of syscalls.
Since some versions Linux got a more generic filter.&lt;/p&gt;
&lt;p&gt;Linux can use a BPF-filter to define actions for syscalls.
This allows a fine granular specification on which syscalls to act.
Also it supports different outcomes assigned to the filter.
This filter can be used to filter out sync operations.&lt;/p&gt;
&lt;p&gt;Debian already got a tool to do this called &lt;tt class="docutils literal"&gt;eatmydata&lt;/tt&gt;.
It is pretty limited as it uses a shared library to drop the library functions.
It needs to be available at all times, or it will not do anything.&lt;/p&gt;
&lt;p&gt;I wrote a small tool that asks the kernel to filter out sync operations for all children.
It sets a filter with all currently supported sync-like operations and makes them return success.
However it can't filter the &lt;tt class="docutils literal"&gt;O_SYNC&lt;/tt&gt;-flag from the &lt;tt class="docutils literal"&gt;open&lt;/tt&gt;-syscall,
so it just makes it return an error.
It executes the command given on the command-line after that.&lt;/p&gt;
&lt;p&gt;This is just a proof of concept, but lets see.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
/*
 * Copyright (C) 2013 Bastian Blank &amp;lt;waldi&amp;#64;debian.org&amp;gt;
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#define _GNU_SOURCE 1
#include &amp;lt;errno.h&amp;gt;
#include &amp;lt;fcntl.h&amp;gt;
#include &amp;lt;seccomp.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;

#define filter_rule_add(action, syscall, count, ...) \
  if (seccomp_rule_add(filter, action, syscall, count, ##__VA_ARGS__)) abort();

static int filter_init(void)
{
  scmp_filter_ctx filter;

  if (!(filter = seccomp_init(SCMP_ACT_ALLOW))) abort();
  if (seccomp_attr_set(filter, SCMP_FLTATR_CTL_NNP, 1)) abort();
  filter_rule_add(SCMP_ACT_ERRNO(EINVAL), SCMP_SYS(open), 1, SCMP_A1(SCMP_CMP_MASKED_EQ, O_SYNC, O_SYNC));
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(fsync), 0);
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(fdatasync), 0);
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(msync), 0);
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(sync), 0);
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(syncfs), 0);
  filter_rule_add(SCMP_ACT_ERRNO(0), SCMP_SYS(sync_file_range), 0);
  return seccomp_load(filter);
}

int main(__attribute__((unused)) int argc, char *argv[])
{
  if (argc &amp;lt;= 1)
  {
    fprintf(stderr, &amp;quot;usage: %s COMMAND [ARG]...\n&amp;quot;, argv[0]);
    return 2;
  }

  if (filter_init())
  {
    fprintf(stderr, &amp;quot;%s: can't initialize seccomp filter\n&amp;quot;, argv[0]);
    return 1;
  }

  execvp(argv[1], &amp;amp;argv[1]);

  if (errno == ENOENT)
  {
    fprintf(stderr, &amp;quot;%s: command not found: %s\n&amp;quot;, argv[0], argv[1]);
    return 127;
  }

  fprintf(stderr, &amp;quot;%s: failed to execute: %s: %s\n&amp;quot;, argv[0], argv[1], strerror(errno));
  return 1;
}
&lt;/pre&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>linux</category>
                

                <pubDate>Mon, 04 Mar 2013 18:35:00 +0000</pubDate>

                
            </item>
        
        
            <item>
                <title>LDAP, Insignificant Space and Postfix</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2013/03/02/ldap-insignificant-space-and-postfix</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2013/03/02/ldap-insignificant-space-and-postfix</link>
                <description>&lt;p&gt;For some, LDAP, just like X.500, is black magic.
I won't argue against.
Sometimes it really shows surprising behavior.
It always makes sense, if you think about what LDAP is built for.
One surprising behavior is the handling of the &amp;quot;&lt;a class="reference external" href="https://tools.ietf.org/html/rfc4518#section-2.6.1"&gt;Insignificant Space&lt;/a&gt;&amp;quot;&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;LDAP supports syntax and comparator methods.
The syntax specifies how the entry should look.
Usually this is some form of text,
but numbers or stuff like telephone numbers are supported as well.
The comparators specifies how the values are compared.
Most of the text comparators are defined to apply the handling of insignificant spaces.&lt;/p&gt;
&lt;p&gt;Insignificant space handling normalizes the use of spaces.
First all leading and trailing spaces are removed.
All the internal spaces are normalized to at most two spaces.
At the end all strings starts and ends with one space to allow proper sub-string matches.
The resulting strings are used for comparisons.&lt;/p&gt;
&lt;p&gt;This behavior makes sense most of the time.
If the user want to find something in the directory,
he usually don't cares about spaces,
but about content.
But I found one occurrence where this produces some grieve.&lt;/p&gt;
&lt;p&gt;Postfix supports &lt;a class="reference external" href="http://www.postfix.org/LDAP_README.html"&gt;LDAP&lt;/a&gt; since some time.
And lets say, it does not care about spaces in its queries.
This is no problem as e-mail addresses do not contain spaces.
Or do they?&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes, e-mail addresses can contain spaces.
This is not widely known, but still allowed.
This addresses are quoted and the command looks like &lt;tt class="docutils literal"&gt;RCPT &lt;span class="pre"&gt;TO:&amp;lt;&amp;quot;␣test&amp;quot;&amp;#64;example.com&amp;gt;&lt;/span&gt;&lt;/tt&gt;.
The local part is quoted and contains a space at the beginning.
And this is where the problem starts.&lt;/p&gt;
&lt;p&gt;Postfix sanitizes the address.
It uses a simplified internal representation of the address for all lookups.
So the address gets &lt;tt class="docutils literal"&gt;␣test&amp;#64;example.com&lt;/tt&gt;.
This form is used in all table lookups.&lt;/p&gt;
&lt;p&gt;The LDAP table uses the internal form of the address.
This address is copied verbatim into the query.
This query may look this way &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;(mail=␣test&amp;#64;example.com)&lt;/span&gt;&lt;/tt&gt;.
It is sent to the server this way.&lt;/p&gt;
&lt;p&gt;The LDAP server applies the insignificant space modifications.
The query is now interpreted and the comparator specified modifications are applied.
The query gets effectively changed to &lt;tt class="docutils literal"&gt;(mail=test&amp;#64;example.com)&lt;/tt&gt;.
And this is where the fun starts.&lt;/p&gt;
&lt;p&gt;Postfix accepts undeliverable mails.
Depending on the setup,
such LDAP queries may be used to check for valid addresses.
Because of the space handling,
the sender can add spaces to the beginning of the address and it will still be considered valid.
In later steps this addresses are not longer valid.&lt;/p&gt;
&lt;p&gt;Addresses starting with spaces are considered invalid in some locations of Postfix.
What surprised me a bit is that virtual alias handling did not map them.
The unmodified addressed showed up on the LMTP backend server.
That's why they showed up my radar.&lt;/p&gt;
&lt;p&gt;I would say Postfix is wrong in this case.
The LDAP server applies the spec correctly and defines spaces in e-mail addresses as insignificant.
Postfix on the other side considers them significant.
The easiest fix would be to not allow any spaces in the LDAP table.&lt;/p&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>ldap</category>
                

                <pubDate>Sat, 02 Mar 2013 10:10:00 +0000</pubDate>

                
            </item>
        
        
            <item>
                <title>New software: LMTP to UUCP gateway</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2012/12/25/new-software-lmtp-to-uucp-gateway</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2012/12/25/new-software-lmtp-to-uucp-gateway</link>
                <description>&lt;p&gt;I use UUCP to get my mails.
It works fine but lacks support for modern SMTP features like DSN.
While it may be possible to bolt support into the the rmail part,
both the sendmail interface used to submit mails and the Postfix pipe daemon used to extract mail are not able to do so.
So I started a small project to get around this problem.&lt;/p&gt;
&lt;p&gt;This software uses LMTP to retrieve and SMTP to send all mails.
LMTP (a SMTP derivative with support for all extensions) is used to inject mail via a small daemon.
The mails are transported using a format similar to batched SMTP to the remote system.
It is then injected via SMTP to the local MTA.&lt;/p&gt;
&lt;div class="section" id="sender"&gt;
&lt;h3&gt;Sender&lt;/h3&gt;
&lt;p&gt;LMTP is used to supply mail.
As a SMTP derivative, LMTP inherits support for all the available SMTP extensions.
The only difference between LMTP and SMTP is the support for one result per recipient after end-of-data.
This allow proper handling and mails with multiple recipients without a queue.&lt;/p&gt;
&lt;p&gt;Mails are supplied to a special LMTP server.
This server may currently run from inetd or in foreground by itself.
A real daemon mode is not yet implemented.&lt;/p&gt;
&lt;p&gt;Each mail is submitted to the UUCP queue in its own format.
We need to store a lot of meta-data along with the real mail.
This data is stored in a custom format.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="protocol"&gt;
&lt;h3&gt;Protocol&lt;/h3&gt;
&lt;p&gt;All data is transferred using a custom protocol.
It is a SMTP derivative, but it is only used in uni-directional communication, so no responses exists.
It uses its own Hello command and supports the SMTP commands MAIL, RCPT and DATA.&lt;/p&gt;
&lt;p&gt;This format allows exactly one mail in each file.
An EOF ends the mail transaction.
Also all data must be in dot-escaped form like in SMTP.&lt;/p&gt;
&lt;div class="section" id="hello-uhlo"&gt;
&lt;h4&gt;Hello (UHLO)&lt;/h4&gt;
&lt;p&gt;A sender must start the transaction with this command.
It specifies the name of the sender and all requested SMTP extensions.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
uhlo = &amp;quot;UHLO&amp;quot; SP ( Domain / address-literal ) *( SP ehlo-keyword ) CRLF
&lt;/pre&gt;
&lt;p&gt;The receiver must check if all requested SMTP extensions are available.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="receiver"&gt;
&lt;h3&gt;Receiver&lt;/h3&gt;
&lt;p&gt;Each mail is submitted by the UUCP system.
It calls the supplied receiver tool called &lt;cite&gt;rumtp&lt;/cite&gt;.
This tool reads the protocol stream and submits the mail to a local SMTP server.&lt;/p&gt;
&lt;p&gt;There is no error handling right now in this tool.
All errors will create a mail to the local UUCP admin by the UUCP system itself.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="license-and-distribution"&gt;
&lt;h3&gt;License and distribution&lt;/h3&gt;
&lt;p&gt;This package is licensed GPL 3. It is for new distributed via &lt;a class="reference external" href="git://git.debian.org/users/waldi/uucp-lmtp.git"&gt;Alioth&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>software</category>
                
                
                    <category>debian</category>
                
                
                    <category>email</category>
                

                <pubDate>Tue, 25 Dec 2012 15:10:00 +0100</pubDate>

                
            </item>
        
        
            <item>
                <title>Relaying e-mail over unreliable connections</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2012/12/24/relaying-e-mail-over-unreliable-connections</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2012/12/24/relaying-e-mail-over-unreliable-connections</link>
                <description>&lt;div class="section" id="introduction"&gt;
&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I still prefer to handle all my mails at home.
I got backup set-up on my own and have anything in direct access.
This network is connected to the internet via an end-user DSL connection without a static IP-address and without any useful SLA.
However relaying mails over such an unreliable connection is still an unsolved problem.&lt;/p&gt;
&lt;p&gt;There exists a lot of solutions for this problem.
I'm currently building a new e-mail setup, so I tried to collect all the used and maybe possible solutions for the relay problem.
I will show some of them.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="don-t-do-it"&gt;
&lt;h3&gt;Don't do it&lt;/h3&gt;
&lt;p&gt;The easiest solution is to just don't try to collect mails at home.
This solution is somewhat against the rules, but I know people who prefers it.
Access to the mails is usually done with IMAP and a copy is made if needed.
This is not really a solution, but it works for many people.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="smtp"&gt;
&lt;h3&gt;SMTP&lt;/h3&gt;
&lt;p&gt;&lt;a class="reference external" href="http://en.wikipedia.org/wiki/SMTP"&gt;SMTP&lt;/a&gt; is &lt;em&gt;the&lt;/em&gt; mail protocol used in the internet.
It is used for all public mail exchanges.
By itself it can't be used to submit mails to remote destinations&lt;/p&gt;
&lt;p&gt;With some preparations it can be used to relay mail over unreliable connections.
There are three different turn commands in SMTP that can be used to start the mail flow.
Two of them will be&lt;/p&gt;
&lt;div class="section" id="vpn-or-dynamic-dns-with-tls-with-or-without-extended-turn-etrn"&gt;
&lt;h4&gt;VPN or dynamic DNS with TLS with or without extended turn (ETRN)&lt;/h4&gt;
&lt;p&gt;Using SMTP themself is an easy solution.
It can relay mails without much hasle
But it needs either a fixed or authenticated connection.&lt;/p&gt;
&lt;p&gt;SMTP can use a fixed connection.
This is usually provided by some sort of VPN.
The VPN can be encrypted, but does not need to.
This allow the MTA to connect to the downstream server if it is available.&lt;/p&gt;
&lt;p&gt;The other solution is to authenticate the downstream server.
Authentication is available via TLS and X.509 certificates.
It still needs some way to find it, but with dynamic DNS this is no real problem.
Both variants can be combined with the extended turn command.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="http://tools.ietf.org/html/rfc1985"&gt;Extended turn&lt;/a&gt; allows to request a queue flush for a domain.
It can be used to request mails only to be delivered if the downstream server is available at all.
This reduces the load on the MTA.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="authenticated-turn-atrn"&gt;
&lt;h4&gt;Authenticated turn (ATRN)&lt;/h4&gt;
&lt;p&gt;&lt;a class="reference external" href="http://en.wikipedia.org/wiki/On-Demand_Mail_Relay"&gt;On-demand mail relay&lt;/a&gt; is a rarely supported ESMTP feature.
The Authenticated turn command effectively reverses the SMTP connection and allows, after authentication, the flow of mails from the server to the client via standard SMTP.
There exists some stand-alone implementations, but no widely used MTA includes an implementation.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="pop3-imap-and-fetchmail-getmail"&gt;
&lt;h3&gt;POP3/IMAP and fetchmail/getmail&lt;/h3&gt;
&lt;p&gt;All e-mails can be delivered to mailboxes and retrieved by the end-users system and re-injected into the delivery system.
Both &lt;a class="reference external" href="http://packages.debian.org/fetchmail"&gt;fetchmail&lt;/a&gt; and &lt;a class="reference external" href="http://packages.debian.org/getmail"&gt;getmail&lt;/a&gt; are able to retrieve mail from POP3 and IMAP servers.
They are either directly delivered via a MDA like &lt;a class="reference external" href="http://packages.debian.org/procmail"&gt;procmail&lt;/a&gt; or &lt;a class="reference external" href="http://packages.debian.org/maildrop"&gt;maildrop&lt;/a&gt;.
Otherwise they are submitted via the sendmail interface or SMTP and delivered by the MTA.&lt;/p&gt;
&lt;p&gt;Neither POP3 nor IMAP have support for meta data like the real recipient or sender.&lt;/p&gt;
&lt;div class="section" id="mailbox-per-address"&gt;
&lt;h4&gt;Mailbox per address&lt;/h4&gt;
&lt;p&gt;The mails for each address are delivered to its own mailbox.
This allows proper identification of the recipient address.
It still have no real idea of the sender address.
Because it needs to poll one mailbox per address, this highers the resources needed on both sides dramatically.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="multi-drop-mailbox"&gt;
&lt;h4&gt;Multi-drop mailbox&lt;/h4&gt;
&lt;p&gt;The mails for all addresses are delivered into one mailbox.
The original recipient must be saved in a custom header to allow this information to be restored.
Only one mailbox needs to be polled for mail addresses.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="uucp"&gt;
&lt;h3&gt;UUCP&lt;/h3&gt;
&lt;p&gt;One of the oldest transports used for mail is UUCP.
It effectively copies a file to a different system and pipes it into a program.
UUCP can be used to transport mails in various ways.&lt;/p&gt;
&lt;div class="section" id="rmail"&gt;
&lt;h4&gt;rmail&lt;/h4&gt;
&lt;p&gt;Each mail is copied verbatim to the client.
It saves the sender address in form of a &amp;quot;From&amp;quot; pseudo header in the mail itself and supplies the recipient on the command-line.
So it have access to both sender and recipient address.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="batched-smtp"&gt;
&lt;h4&gt;Batched SMTP&lt;/h4&gt;
&lt;p&gt;Batched SMTP transfers old-style SMTP transactions over UUCP
The MTA (Exim supports this) or a special tool (in the &lt;tt class="docutils literal"&gt;bsmtpd&lt;/tt&gt; package) writes this files and after a given time or size they are dispatched via UUCP to the remote system.&lt;/p&gt;
&lt;p&gt;The &lt;tt class="docutils literal"&gt;bsmtpd&lt;/tt&gt; packages was removed from Debian some years ago.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="dovecot-synchronization"&gt;
&lt;h3&gt;Dovecot synchronization&lt;/h3&gt;
&lt;p&gt;&lt;a class="reference external" href="http://dovecot.org/"&gt;Dovecot&lt;/a&gt; support &lt;a class="reference external" href="http://wiki2.dovecot.org/Tools/Dsync"&gt;bi-directional synchronization&lt;/a&gt; of mailbox contents.
It holds all data on both sides.
The internal log is used to merge changes done on both sides, so it should not loose any data.
This synchronization can be used to work with the data on both sides (via Dovecot of cause) or create backups.
It needs shell access to the user owning the data on both sides.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="conclusions"&gt;
&lt;h3&gt;Conclusions&lt;/h3&gt;
&lt;p&gt;There is no one size fits all solution for this problem.
If you admin the remote system, you can implement any of this solutions
If it is managed by someone else you need good luck.&lt;/p&gt;
&lt;p&gt;Almost all solutions does not support current SMTP features.
The one I'm really missing is DSN, aka configurable delivery notices.
POP3 and IMAP handle already delivered mail and have no need for this.
All UUCP variants does not handle it, because they are much older anyway.
Only SMTP itself supports all of its features.&lt;/p&gt;
&lt;p&gt;I still use rmail over UUCP for my mails at home and it works flawless.
UUCP itself runs over SSH, it can compress data on the fly and authenticate using private keys.&lt;/p&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>email</category>
                

                <pubDate>Mon, 24 Dec 2012 16:50:00 +0100</pubDate>

                
            </item>
        
        
            <item>
                <title>DDoS against DNS-Servers</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2012/06/17/ddos-against-dns-servers</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2012/06/17/ddos-against-dns-servers</link>
                <description>&lt;p&gt;Today I found out that the DNS-Server at home is used for a DDoS against a DNS-Server.
The attackers send a small query, &amp;quot;ripe.net ANY&amp;quot; in this case, with a faked sender IP.
The DNS-Server answers with a much larger packet to the (faked) sender.&lt;/p&gt;
&lt;p&gt;Because the domain is not local, the nameserver should have only produced an error.
But the bind-config allowed everyone to get answers to cached answers:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
allow-query-cache { 0.0.0.0/0; ::/0; };
&lt;/pre&gt;
&lt;p&gt;With proper restriction, the server only returns errors now.&lt;/p&gt;
&lt;p&gt;Restricting answer for cached entries does not help if the queried nameserver is authoritative for the domain.
In this case it can help to drop queries for the ANY type.
In ferm this looks like this:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
proto udp dport domain mod string from 40 algo bm hex-string '|0000ff0001|' DROP;
&lt;/pre&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>dns</category>
                

                <pubDate>Sun, 17 Jun 2012 22:55:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Installing Wheezy on Thinkpad X130e</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2012/05/27/installing-wheezy-on-thinkpad-x130e</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2012/05/27/installing-wheezy-on-thinkpad-x130e</link>
                <description>&lt;p&gt;I installed a Lenovo Thinkpad X130e with Wheezy.&lt;/p&gt;
&lt;div class="section" id="uefi"&gt;
&lt;h3&gt;UEFI&lt;/h3&gt;
&lt;p&gt;The X130e does not want to boot via BIOS emulation.
The Wheezy D-I installs only BIOS Grub.
It does not provide the selection to use EFI at all.
So the initial installation was BIOS only and EFI refused to boot it without an error.
BIOS emulation simply don't want to work on the X130e.&lt;/p&gt;
&lt;p&gt;Partman does not align partitions in GPT.
For some reasons the partitions created by partman are not aligned in the partition table at all.
This is bad for performance.
Also it makes it impossible to create an EFI partition on it that is recognizable by Grub.&lt;/p&gt;
&lt;p&gt;EFI Grub needs the EFI partition.
This partition needs to be properly aligned and formatted with FAT16.
It must be mounted on /boot/efi.
Grub gets installed on this with the following commands:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
apt-get install grub-efi-amd64
grub-install --bootloader-id=GRUB --removable
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="grub"&gt;
&lt;h3&gt;Grub&lt;/h3&gt;
&lt;p&gt;Grub fails to load EFI console stuff.
Grub needs extra modules to allow the kernel to write on the console.
Otherwise the kernel just hangs without output.
This can be done via /boot/grub/custom.cfg to load them:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
insmod efi_gop
insmod efi_uga
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="radeon"&gt;
&lt;h3&gt;Radeon&lt;/h3&gt;
&lt;p&gt;The Radeon card needs a firmware.
It just produces random output.
To get a usable output, Radeon modeset must be disabled on the kernel command line:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
radeon.modeset=0
&lt;/pre&gt;
&lt;p&gt;Now the firmware can be installed:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
apt-get install firmware-linux
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="wireless-card"&gt;
&lt;h3&gt;Wireless card&lt;/h3&gt;
&lt;p&gt;The Broadcom wireless card needs a firmware:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
apt-get install firmware-brcm80211
&lt;/pre&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                

                <pubDate>Sun, 27 May 2012 22:55:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Booting Debian via AoE (ATA over Ethernet) and PXE</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2012/04/07/booting-debian-via-aoe-and-pxe</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2012/04/07/booting-debian-via-aoe-and-pxe</link>
                <description>&lt;p&gt;AoE is one of the protocols supported by Linux to access storage via network.
It uses plain Ethernet for communication and includes a discovery mechanism to find all available targets.
I use it to provide disk space to VMs running on different machines.&lt;/p&gt;
&lt;p&gt;Next step is to boot via AoE.
It is no real problem to use AoE in running systems.
However with some help it is even possible to actually boot disk-less machines via AoE.
The PXE implementation iPXE provides the AoE support to actually boot from.
I will describe the necessary parts.&lt;/p&gt;
&lt;div class="section" id="setup-vblade"&gt;
&lt;h3&gt;Setup vblade&lt;/h3&gt;
&lt;p&gt;The AoE target used it vblade.&lt;/p&gt;
&lt;p&gt;vblade needs access to raw sockets.
As I prefer to not have run anything as root if it is not necessary,
I use filesystem capabilities to allow it access to the network.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
setcap cap_net_raw+ep /usr/sbin/vblade
&lt;/pre&gt;
&lt;p&gt;vblade gets the mac address of the initiator, the shelf and slot number, the network device and the block device.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
/usr/sbin/vblade -m $mac 0 0 eth0 $dev
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="setup-a-tftp-server-and-ipxe"&gt;
&lt;h3&gt;Setup a tftp server and iPXE&lt;/h3&gt;
&lt;pre class="literal-block"&gt;
apt-get install atftpd ipxe
ln -s /usr/lib/ipxe/undionly.kpxe /var/lib/tftpboot
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="setup-isc-dhcpd"&gt;
&lt;h3&gt;Setup ISC dhcpd&lt;/h3&gt;
&lt;p&gt;The dhcp server needs to be configured.
It needs to hand out two distinct parameter sets.
The first is used to chain-load iPXE into the normal PXE stack.
The second is for iPXE and sets the root path to the AoE device.
They are selected on the iPXE marker in the request.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
if exists user-class and option user-class = &amp;quot;iPXE&amp;quot; {
  filename &amp;quot;&amp;quot;;
  option root-path &amp;quot;aoe:e0.0&amp;quot;;
} else {
  filename &amp;quot;undionly.kpxe&amp;quot;;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="support-aoe-via-initramfs-tools"&gt;
&lt;h3&gt;Support AoE via initramfs-tools&lt;/h3&gt;
&lt;p&gt;The initramfs needs to initialize AoE support.
It needs to enable the network device used for communication with the AoE server and wait until it is up.
After that it needs to load the aoe module and run aoe-discover.
We should have all devices now.&lt;/p&gt;
&lt;p&gt;The root device can now be used like any other normal device.
After the AoE device is initialized, it can be found via UUID and all the other ways.
So no further modifications are necessary over the usage of local disks.
The initramfs finds the device as usual and boots from it.&lt;/p&gt;
&lt;p&gt;The initramfs support is still a prototyp, but seems to work.
For initramfs-tools it needs a hook to include all necessary stuff in the initramfs and a script to actually do the work.
Both are shown here.&lt;/p&gt;
&lt;p&gt;/etc/initramfs-tools/hooks/aoe:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
#!/bin/sh

case $1 in
prereqs)
  echo &amp;quot;udev&amp;quot;
  exit 0
  ;;
esac

. /usr/share/initramfs-tools/hook-functions

copy_exec /sbin/aoe-discover

manual_add_modules aoe
&lt;/pre&gt;
&lt;p&gt;/etc/initramfs-tools/scripts/local-top/aoe:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
#!/bin/sh

case $1 in
prereqs)
  echo &amp;quot;udev&amp;quot;
  exit 0
  ;;
esac

ifconfig eth0 up
sleep 10
modprobe aoe
aoe-discover
udevadm settle --timeout=30
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="section" id="problems"&gt;
&lt;h3&gt;Problems&lt;/h3&gt;
&lt;p&gt;Not all parts of this works 100%.
Some parts works not for all hardware.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;My old notebook is not able to run Linux with this setup.
grub loads the kernel via AoE and nothing comes later.&lt;/li&gt;
&lt;li&gt;The network may need more time. Especially in large environments with spanning tree enabled, it may need half a minute until any packets will flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some of the problems can be addressed later.
Some can't.&lt;/p&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>linux</category>
                

                <pubDate>Sat, 07 Apr 2012 12:35:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Linux 3.0 and Xen</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2011/06/23/linux-3.0-and-xen</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2011/06/23/linux-3.0-and-xen</link>
                <description>&lt;p&gt;It took a long time to get all the parts of the Xen support into the Linux kernel.
While rudimentary Dom0-support was available since 2.6.38, support for device backends were missing.
It was possible to replace this backend with a userspace implementation included in qemu, but I never tested that.&lt;/p&gt;
&lt;p&gt;With Linux 3.0, both the traditional block backend and the network backend are available.
They are already enabled in the current 3.0-rc3/-rc4 packages in experimental,
so the packages can be used as Dom0 and run guests.
Right now the backend modules are not loaded, so this still needs some work.
Neither the init scripts loads them, because the names where in flux the last time I laid hand on it,
nor does the kernel themself expose enough information to load them via udev.
I think using udev to load the modules is the way to go.&lt;/p&gt;
&lt;p&gt;This step marks the end of a five year journey.
Around 2.6.16 the Xen people started to stay really close to Linux upstream.
With the 2.6.18 releas this stopped and the tree was pushed in different states into Debian Etch and RHEL 5.
After that, Xen upstream ceased work on newer versions completely,
only changes to the now old 2.6.18 tree where done.
SuSE started a forward port of the old code base to newer kernel versions and Debian Lenny released with such a patched 2.6.26.
Around that time, minimal support for DomU on i386 using paravirt showed up and Lenny had two different kernels with Xen support.
Since 2.6.28 this support was mature and works rather flawless since.
Somehow after that, a new port of the Dom0 support, now using paravirt, showed up.
This tree based on 2.6.32 is released with Debian Squeeze.
After several more rounds of redefining and polishing it is now mostly merged into the core kernel.&lt;/p&gt;
&lt;p&gt;I don't know what the future brings.
We have two virtualization systems supported by Linux now.
The first is KVM that converts the kernel into a hypervisor and runs systems with help of the hardware virtualization.
The later one is Xen that runs under a standalone hypervisor and supports both para- and hardware virtualization.
Both works, KVM is easier to use and even works on current System z hardware.
It can be used by any user with hopefully enough margin of security between them.
Xen's home is more suited for servers, where you don't have users at all.
Both have advantages and disadvantages, so everyone have to decide what he needs, there is no &amp;quot;one size fits all&amp;quot;.&lt;/p&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>xen</category>
                
                
                    <category>debian</category>
                

                <pubDate>Thu, 23 Jun 2011 18:35:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>New software: python-dvdvideo</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2010/08/29/new-software-python-dvdvideo</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2010/08/29/new-software-python-dvdvideo</link>
                <description>&lt;p&gt;After a long time, I decided to write again.
I decided to start with software I wrote for my own usage that could be usefull for other people.
I'll start with python-dvdvideo, a DVD-Video reader written in Python 3, and the reference tool dvd-video-backup-image, a generic DVD-Video dumper.
Lets see, if this blog will see more postings in the future.&lt;/p&gt;
&lt;div class="section" id="intention"&gt;
&lt;h3&gt;Intention&lt;/h3&gt;
&lt;p&gt;I started to write this software, because libdvdread was often unable to decipher my newly purchased video DVDs.
libdvdread expects a rather valid structure of the filesystem and other metadata on the disk.
It will forcefully bail out on several error conditions.
So I often ended patching libdvdread to make dvdbackup able to read the new disks.&lt;/p&gt;
&lt;p&gt;Usually there are two ways to create backups of such DVDs, as files or complete images.
Dumping them as files have large problems if there are certain defects in the filesystem, like some space is referenced in several titlesets.
I have a disk that produces 25GiB of output during such a dump.
So the less problematic way to do that is to dump the complete image.
That is the way I used in the tool I built on top of this.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="parts"&gt;
&lt;h3&gt;Parts&lt;/h3&gt;
&lt;p&gt;The software is devided into several parts.
First a small UDF reader.
On top of this comes a DVD video reader.
It makes use of libdvdcss wrapper.
All of this is used to implement a small tool to dump whole images.
I will describe this parts here.&lt;/p&gt;
&lt;div class="section" id="udf-reader"&gt;
&lt;h4&gt;UDF reader&lt;/h4&gt;
&lt;p&gt;The UDF reader implements a minimal set of features.
I implemented only the stuff I found as needed and used in the available DVDs.
This reader allows to read the lowlevel UDF, used as base of all video DVDs.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="dvd-video-reader"&gt;
&lt;h4&gt;DVD video reader&lt;/h4&gt;
&lt;p&gt;The dvd video reader uses the UDF reader to get the necessary information from the disk.
Again this reader is quiet smallish.
It only trusts the UDF for the starts of titlesets and expects that anything else is listed in the info files.
This allows to read even discs with broken filesystems, which are really common.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="libdvdcss-wrapper"&gt;
&lt;h4&gt;libdvdcss wrapper&lt;/h4&gt;
&lt;p&gt;The libdvdcss wrapper is implemented using ctypes.
The ctypes library allows easy access to functions defines in shared object.
The library allows calling of the functions and maps arguments and return values to the Python datatypes.
This wrapper allows me to read also encrypted DVDs.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="image-dumper"&gt;
&lt;h4&gt;Image dumper&lt;/h4&gt;
&lt;p&gt;This tool allows to dump a encrypted video DVD into a file.
It tries to detect encrypted (video/vob files) and unencrypted (info files, otherwise used space) parts of the disk.
This way it is able to dump anything, as long as it can read the filesystem and info files.
However, some discs contains overlapping areas, which can't be that easily deguised.&lt;/p&gt;
&lt;p&gt;The tool includes a small conflict resolver that handles overlapping parts.
It uses a set of rules to allow some types to coexist and some to be modified.
On of the rules relabels things included in an info files but also a title vob as always unencrypted.
With this resolver, most of the problems can be handled and we get a playable result.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="license-and-distribution"&gt;
&lt;h3&gt;License and distribution&lt;/h3&gt;
&lt;p&gt;This package is licensed GPL 3 or later.
It is for new distributed via &lt;a class="reference external" href="git://git.debian.org/users/waldi/python-dvdvideo.git"&gt;Alioth&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="conclusion"&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;This tool allows me to dump all video DVDs I got my hands on in the last time.
It allows me to watch the videos on my notebook that have no optical disc reader on its own.
Maybe someone may need such a tool also.&lt;/p&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>dvd</category>
                
                
                    <category>debian</category>
                
                
                    <category>software</category>
                

                <pubDate>Sun, 29 Aug 2010 19:20:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Almighty root</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2009/04/04/almighty-root</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2009/04/04/almighty-root</link>
                <description>&lt;p&gt;I was asked to take a look at a machine where &lt;tt class="docutils literal"&gt;aptitude&lt;/tt&gt; don't even want to do the upgrade to etch.
A first inspection shows some weird repositories in the source.list file and many daemons noone ever should use on that machine.
I was able to do the upgrade with &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;apt-get&lt;/span&gt;&lt;/tt&gt; then.&lt;/p&gt;
&lt;p&gt;After some time I got asked over modifications in &lt;tt class="docutils literal"&gt;/etc/exports&lt;/tt&gt;.
It basically included the following content:&lt;a class="footnote-reference" href="#id2" id="id1"&gt;[1]&lt;/a&gt;&lt;/p&gt;
&lt;pre class="literal-block"&gt;
/     *(rw,async,no_root_squash)
/home *(rw,async,no_root_squash,nohide)
/usr  *(rw,async,no_root_squash,nohide)
/var  *(rw,async,no_root_squash,nohide)
&lt;/pre&gt;
&lt;table class="docutils footnote" frame="void" id="id2" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label"&gt;&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;For those who don't speak NFS: This exports the specified filesystems (&lt;tt class="docutils literal"&gt;/&lt;/tt&gt;, &lt;tt class="docutils literal"&gt;/home&lt;/tt&gt;, &lt;tt class="docutils literal"&gt;/usr&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;/var&lt;/tt&gt;) to everyone, and accepts whatever the client system say.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The machine was taked out of service immediately.
We'll have no chance to answer the question whether this was silliness or intend.&lt;/p&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                

                <pubDate>Sat, 04 Apr 2009 19:45:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Ubuntu, Ubuntu</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2008/10/10/ubuntu-ubuntu</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2008/10/10/ubuntu-ubuntu</link>
                <description>&lt;p&gt;I was forced to try Ubuntu Hardy in the new university pool.
The setup includes one Linux server dedicated for the pool, one Windows AD for Kerberos authentication, one Windows fileserver with user data and 20 clients.
The clients are new HP machines with a Radeon Xpress 200 card.&lt;/p&gt;
&lt;p&gt;First problem was nasty, the X server turned the display black and then crashed, leaving an unusable console behind.
Even a blacklist of the &lt;tt class="docutils literal"&gt;radeon&lt;/tt&gt; module does not work.
Somehow the Xorg radeon driver loads the module on its own, ignoring the modprobe blacklist.
Only a hard blacklist using &lt;tt class="docutils literal"&gt;install radoen /bin/false&lt;/tt&gt; in the modprobe config was able to prevent this.
Lets hope that the endeavors to remove much priviledges from the X server goes good.&lt;/p&gt;
&lt;p&gt;For the homes two setups was tested:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Homes on the Windows server via cifs, mounted via pam_mount using NTLM password.&lt;/li&gt;
&lt;li&gt;Homes on the Linux server via nfs version 3.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first one just produced an error that some Gnome component was unable to lock &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.ICEauthority&lt;/span&gt;&lt;/tt&gt;.
This could be worked around in the Xsession.
Otherwise it was usable to slow, which may be a problem with the Windows server.&lt;/p&gt;
&lt;p&gt;The later, plus a reinstallation with fglrx, produced first unresponsive OpenOffice.org windows and then a complete unusable Gnome desktop.
I would not completely vote against a problem with fglrx or even a broken installation, but the amount of problems exceeded the threshold.&lt;/p&gt;
&lt;p&gt;Now we will try Lenny and see if this also happens there.
Especially home via nfs is not that uncommon that we can let it broken in a release.&lt;/p&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>debian</category>
                
                
                    <category>ubuntu</category>
                

                <pubDate>Fri, 10 Oct 2008 15:20:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Xen update</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2008/09/28/xen-update</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2008/09/28/xen-update</link>
                <description>&lt;p&gt;I found a machine which is not so ancient and did some tests with Xen on it.&lt;/p&gt;
&lt;div class="section" id="kernels"&gt;
&lt;h3&gt;Kernels&lt;/h3&gt;
&lt;p&gt;First was some tests with different Linux kernels and hypervisors (3.2 and 3.3).
I have to say the overall compatibility got better.
As unpriviledged domain (DomU) only one of the kernels failed, the one from Etch (2.6.18-6-xen-686) on the x86_64 hypervisor because of missing setup code.&lt;/p&gt;
&lt;p&gt;For the operation as priviledged domain (Dom0) it looks not so good.
The 2.6.18 from Xen 3.1 works mostly, the Lenny-targeted 2.6.26 is a little bit picky about the hardware and seems to work better in the 64bit variant, the 2.6.18 from 3.3 is old but rock-stable.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="stub-domain"&gt;
&lt;h3&gt;Stub domain&lt;/h3&gt;
&lt;p&gt;Xen 3.3 adds the possibility to move a the qemu which provides the emulated hardware for full virtualized domains in its own (paravirtualized) domain.
The documentation is not really complete and the whole thing rather fragile.
Error messages from the emulation domain are swallowed and depending on the config it also likes to crash.&lt;/p&gt;
&lt;p&gt;It wants a new service, a filesystem backend, which is implemented in a root process in the dom0, even if it is not needed for operation.
This service is not configurable, exports anything in /exports and allows writing, the code have similar quality then qemu.&lt;/p&gt;
&lt;/div&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>xen</category>
                
                
                    <category>debian</category>
                
                
                    <category>linux</category>
                

                <pubDate>Sun, 28 Sep 2008 23:10:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>Smallest UTF32 to UTF8 converter</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2008/09/13/smallest-utf32-to-utf8-converter</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2008/09/13/smallest-utf32-to-utf8-converter</link>
                <description>&lt;p&gt;I found some weird opcodes in the s390 instruction set &lt;a class="reference external" href="/blog/2006/09/18/s390-assembler"&gt;some time ago&lt;/a&gt;.
I finally want to use it as I have access to such a machine.
The result is rather slim:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
.globl cu41
        .type   cu41, &amp;#64;function
cu41:
.L2:
        cu41    %r2,%r4
        ipm     %r1
        srl     %r1,28
        chi     %r1,3
        je      .L2
        ltr     %r1,%r1
        je      .L3
        lcr     %r1,%r1
        lgfr    %r3,%r1
.L3:
        lgr     %r2,%r3
        br      %r14
&lt;/pre&gt;
&lt;p&gt;The &lt;tt class="docutils literal"&gt;cu41&lt;/tt&gt; opcode translates UTF32 to UTF8. Each &amp;quot;parameter&amp;quot; is a register pair &lt;a class="footnote-reference" href="#id2" id="id1"&gt;[1]&lt;/a&gt;, which describes address and length of the buffer. This opcode will return after a not specified number of translated characters. The rest is boiler plate code for condition code checking. The loop makes sure that anything is converted within the function unless another error occured.&lt;/p&gt;
&lt;table class="docutils footnote" frame="void" id="id2" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label"&gt;&lt;col&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;An even pair. gcc is not yet able to allocate such pairs on its own, so it is hardcoded.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>s390</category>
                
                
                    <category>debian</category>
                

                <pubDate>Sat, 13 Sep 2008 12:30:00 +0200</pubDate>

                
            </item>
        
        
            <item>
                <title>PV-GRUB and partitions</title>
                <guid>http://bblank.thinkmo.de/blog/archive/2008/09/13/pv-grub-and-partitions</guid>
                <link>http://bblank.thinkmo.de/blog/archive/2008/09/13/pv-grub-and-partitions</link>
                <description>&lt;p&gt;Xen 3.3 added a tool called PV-GRUB.
It is a GRUB (legacy aka 0.97) built against MiniOS and bootable as a PV kernel.
It works fine on a Xen 3.2.1.&lt;/p&gt;
&lt;p&gt;It is easy to use, I just set this in my config:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
kernel = &amp;quot;/usr/local/lib/xen/boot/pv-grub-x86_64.gz&amp;quot;
extra = &amp;quot;(hd0)/boot/grub/menu.lst&amp;quot;
&lt;/pre&gt;
&lt;p&gt;However it decided to not load my config as defined in the config and simply show me that:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
    GNU GRUB  version 0.97  (524288K lower / 0K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grubdom&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The reason is quite easy:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
grubdom&amp;gt; root (hd0)
 Filesystem type unknown, using whole disk
&lt;/pre&gt;
&lt;p&gt;Some debugging later, the reason is &lt;a class="reference external" href="http://lists.xensource.com/archives/html/xen-devel/2008-09/msg00495.html"&gt;known&lt;/a&gt; and fixed.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
grubdom&amp;gt; root (hd0)
 Filesystem type is ext2fs, using whole disk

grubdom&amp;gt; kernel /boot/vmlinuz-2.6.27-rc5-amd64

grubdom&amp;gt; initrd /boot/initrd.img-2.6.27-rc5-amd64

grubdom&amp;gt; boot
block error -1 for op 2
close blk: backend at /local/domain/0/backend/vbd/23/51712
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.27-rc5-amd64 [...]
[    0.000000] Command line:
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] ACPI in unprivileged domain disabled
[...]
[    0.022093] Booting paravirtualized kernel on Xen
[    0.022101] Xen version: 3.2-1
&lt;/pre&gt;
</description>
                <author>Bastian Blank</author>

                
                    <category>xen</category>
                
                
                    <category>debian</category>
                

                <pubDate>Sat, 13 Sep 2008 11:35:00 +0200</pubDate>

                
            </item>
        

    </channel>
</rss>


