<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<?xml-stylesheet type="text/css" href="http://blog.ngas.ch/styles/feed.css"?>


<title type="html">Pas un Geek en tant que tel</title>
<subtitle type="html">No Geek As Such</subtitle>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch"/>
<link rel="self" type="application/atom+xml" href="http://blog.ngas.ch/atom.xml"/>
<updated>2011-12-18T21:46:19+01:00</updated>
<author>
<name><a href=&quot;https://plus.google.com/114292582268779510325&quot;>Tonnerre Lombard</a></name>
<uri>http://blog.ngas.ch</uri>
</author>
<id>http://blog.ngas.ch/</id>
<generator uri="http://nanoblogger.sourceforge.net" version="3.4.2">
NanoBlogger
</generator>

<entry>
<title type="html">The destructive desktop &mdash; Linux in trouble?</title>
<author>
<name><a href=&quot;https://plus.google.com/114292582268779510325&quot;>Tonnerre Lombard</a></name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2011/12/13/the_destructive_desktop__mdash_linux_in_trouble/index.html"/>

<id>http://blog.ngas.ch/archives/2011/12/13/the_destructive_desktop__mdash_linux_in_trouble/index.html</id>
<published>2011-12-13T01:48:00+01:00</published>
<updated>2011-12-13T01:48:00+01:00</updated>
<category term="free_software" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p align="justify">
 Linux on the desktop has come a long way. The Gnome and KDE
 communities have built themselves a big, very powerful set of tools
 to build on. And using these tools, they created an enormous amount
 of software for a large number of different purposes.
</p>
<p align="justify">
 Then they discovered that there is a lack of formality in the RPC
 mechanisms available under UNIX like operating systems. The Shared
 Memory IPC provides just shared memory and a little flow control,
 which is tedious. The sysvmsg API is still very inconvenient when
 communicating between various different processes, especially if
 they're arbitrary.  Sockets work much better in that respect and have
 a well-defined API, but it is still relatively hard to exchange data
 over them.
</p>
<p align="justify">
 UNIX offered the SUN RPC API which was used to implement NFS, among
 other things. However, it was &rdquo;just&ldquo; an RPC
 implementation and not a real service based middleware. Especially
 among Universities, a rather complex method of doing RPC had become
 fashionable: CORBA.
</p>
<p align="justify">
 At this time, the only available Open Soure CORBA ORB was
 <a href="http://www.mico.org/">Mico</a>. However, Mico still lacked
 some of the desired features and didn't support a lot of programming
 languages so the Gnome developers decided to implement their own ORB
 called ORBit.
</p>
<p align="justify">
 The KDE people faced a very similar issue. However, instead of
 implementing all of CORBA, they developed a much smaller, more
 lightweight protocol called
 <a href="http://en.wikipedia.org/wiki/DCOP">DCOP</a>. DCOP was more
 tailored to be used for communicating between the different
 applications.
</p>
<p align="justify">
 So the Gnome developers wanted to reduce the complexity of their
 protocol as well and started working on a protocol which was supposed
 to join the advantages of DCOP and CORBA. The result was called the
 <a href="http://www.freedesktop.org/wiki/Software/dbus">Desktop Bus
  (dbus) protocol</a>. Instead of complete remote objects it just
 offers remote interfaces with functions that can be called.
</p>
<h3>esd and PulseAudio</h3>
<p align="justify">
 The sound system underwent a similar development. Initially, the
 operating system provided an API called the Open Sound System. It is
 based on a read-write device in /dev and a number of IOCTLs.  It was
 the same API which is found in the BSD and Solaris operating system.
</p>
<p align="justify">
 However, the Linux incarnation of OSS was a particularly simplicistic
 one which only supported one sound channel at the same time and only
 very rudimentary mixing. As a workaround, the community came up with
 a daemon which accepted sound samples and mixed them in software: the
 <a href="http://en.wikipedia.org/wiki/Enlightened_Sound_Daemon">
  Enlightened Sound Daemon (esound)</a>. This daemon even acquired
 network capabilities so people could stream whatever they wanted over
 the network to other computers and play it there without having to
 resort to systems like the
 <a href="http://radscan.com/nas.html">Networked Audio System (NAS)</a>.
 The KDE developers went even further and implemented an audio system
 on top of DCOP called MCOP.
</p>
<p align="justify">
 Over time, the Linux kernel developers came up with a new API to
 control the various details of the sound card, have many different
 volume settings and to be able to mix in hardware. It was called the
 <a href="http://www.alsa-project.org/">Advanced Linux Sound
  Architecture (ALSA)</a>.
</p>
<p align="justify">
 Then, Gnome and KDE developed APIs to abstract the uses of OSS,
 esound and ALSA: gstreamer for Gnome and Phonon for KDE. Since
 gstreamer depended heavily on the Gnome libs and phonon on the KDE
 libraries, the rest of the community had to either adopt or try to
 keep up with the ever changing sound backends. Esound was deprecated
 and replaced with Pulseaudio, which triggered yet another shift of
 APIs.
</p>
<p align="justify">
 Over time, more and more subsystems started getting DBus based
 frontends.  hald was added to detect hardware properties. It turned
 into an official dependency for X.Org and was subsequently replaced
 with DeviceKit.  PackageKit was added as a generic API to instruct
 the system to find and install packages through a DBus
 interface. ConsoleKit replaced the regular session and pseudoterminal
 management environment. PolicyKit imposed additional restrictions on
 system calls and allowed other people to do privileged operations
 without changing to the superuser explicitly.  sssd is now in the
 process of replacing PAM as an authentication framework which is also
 contacted through DBus, without the need to use the system
 authentication and session management API (PAM and NSS, mostly).
</p>
<p align="justify">
 NetworkManager added a new abstract way to configure network devices,
 such as network cards, wireless LAN or 3G. Like everything else, it
 provides a DBus interface for executing various operations, such as
 discovering wireless LANs, connecting to a network and awareness if
 the computer is currently connected to a network. Various GUI
 programs such as Firefox, Pidgin, Gajim and similar tools use
 NetworkManager to clean up their caches and reconnect after the
 network connection was terminated. They also go to some sort of
 offline mode if NetworkManager tells them to, in which they don't
 attempt to connect to the network and try to do whatever you want
 locally (e.g. queuing messages to be sent, displaying web pages from
 cache, etc.)
</p>
<p align="justify">
 Another addition was systemd, which now replaces System V init and
 all other types of init derivates on various distributions. It is an
 init daemon which reads services from a database, somewhat like
 Solaris' svcadm. However, for starting and stopping services and
 telling the system to shut down or do something else, systemd has a
 DBus interface. The old /dev/initctl interface is no longer
 supported.
</p>
<p align="justify">
 And most recently, there was a new addition to the pool: Journal is a
 service which replaces syslog and which exposes a DBus API for
 logging messages into a binary log (instead of a plain text log like
 syslog did). The adoption rate among desktop and other programs is
 great because now finally everybody can use their favorite API to
 log, grant log permissions, search logs etc. The world is becoming
 more awesome every single day.
</p>
<p align="justify">
 Or did it? <a href="http://www.redhat.com/">RedHat</a> Enterprise
 Linux (RHEL) is a Linux distribution tailored for long-term support
 environments &mdash; which includes corporate desktops &mdash; and
 servers. Ubuntu LTS is following the same goal: to provide a modern
 distribution with long-term support for use in corporate workstations
 and servers.
</p>
<h3>NetworkManager</h3>
<p align="justify">
 The latest versions of both Ubuntu LTS and RHEL ship with
 NetworkManager for managing their network connectivity. If you don't
 use NetworkManager, a number of programs will refuse to connect to
 the Internet or behave in various weird ways. More so, a lot of
 system services now depend on NetworkManager and won't start unless
 it is running. And if you run NetworkManager, it starts periodically
 messing up any local system configuration. So you're basically bound
 to use NetworkManager.
</p>
<p align="justify">
 So you install a server in headless mode (Wait, the installer won't
 typically let you do that anymore. But let's assume you do it
 nonetheless because your server doesn't have a graphics card anyway,
 it's attached to a Cyclades SSH serial port adapter like any other
 one of your UNIX servers.) Then you try to figure out how to
 configure NetworkManager from the command line. There's no tool in
 the entire distribution which lets you do that.
</p>
<p align="justify">
 So from some time in the past you remember that you used to use a
 program called <i>cnetworkmanager</i> to operate NetworkManager from
 the command line. You install it and &mdash; the DBus API changed
 since the program was written, so the DBus call fails with a
 not-very-helpful error message.
</p>
<p align="justify">
 So the only way to actually use NetworkManager is to use nm-applet,
 an X11 system tray application. You install your i3, you install your
 stalonetray and you start nm-applet &mdash; hey, it works!  Now you
 can finally connect to the network. And if you wonder how you were
 supposed to install these packages without network access: by
 periodically calling <i>ifconfig</i> and <i>ip route add</i> until
 you finally managed to fetch all the data before NetworkManager would
 mess it up again.
</p>
<p align="justify">
 So you have a bit of a more complex network configuration and need to
 add routes or, even better, use OSPF to find routes to some targets
 which don't go straight via some default gateway. (Why? Perhaps
 because you wanted to run Linux on your default gateway.) Fire up
 Quagga and you will see how Quagga struggles to add routes while
 NetworkManager struggles to remove them again. Part of your packets
 make it to their destination. Also keep in mind that you're now
 running X11 and a network management GUI on your router!
</p>
<p align="justify">
 Now to your road warrior laptop. For simplicity sake and because you
 already exchanged SSH keys anyway, you decide to connect to your
 company via SSH-based VPNs. If you do that from the command line,
 NetworkManager gets very angry with you and does stupid things to
 ensure you can't put your default route over the new VPN device, or
 even use it at all.
</p>
<p align="justify">
 So you have to use NetworkManager, which only supports vpnc and
 OpenVPN.  However, Open Source vpnc servers are pretty much
 nonexistent and OpenVPN requires you to either set up a complete PKI
 or live with ridiculous preshared key algorithms. tinc supports
 simple public/private key algorithms, but it is not supported by
 NetworkManager. So the only way to make VPN work is to migrate to
 OpenVPN and to maintain your own PKI.
</p>
<h3>Choice</h3>
<p align="justify">
 There are many more such effects with the new interfaces but these
 examples should suffice for now.
</p>
<p align="justify">
 The effect of all those changes are numerous. For one, it is no
 longer possible to run the system without a graphical user interface
 unless you plan to invest a huge amount of work and to throw out most
 of your system support. If you want to get vendor support, this is
 not the way you will want to go.
</p>
<p align="justify">
 You also can't implement complex network or authentication setups
 anymore. The number of possible combinations in the configuration has
 been significantly reduced by removing options which are not
 typically used for desktop systems. Also, since the APIs have a
 tendency to change very frequently, typically, only genuine supported
 Gnome or Ubuntu/Fedora software tends to work on the long run. If you
 try to use an alternative which has an user interface you prefer or
 has a feature you want, you will find very frequently that it is
 trying to call some DBus interface which is no longer implemented or
 has a different set of parameters.
</p>
<p align="justify">
 Even worse is if you try to use any window manager that is not KDE or
 Gnome. Both KDE and Gnome launch a very large amount of daemons which
 are required by a number of applications &mdash; pulseaudio, an user
 dbus session (in addition to the system dbus instance),
 gnome-settings-daemon, etc. pp. Many programs also require support
 from applications which exist as tray icons, so you need to find an
 application to emulate the Gnome tray &mdash; and not all of them do
 it correctly.
</p>
<p align="justify">
 Also, many of the advanced features like suspending the laptop when
 closing the lid or other ACPI events are no longer implemented as
 shell scripts in /etc, but have moved to be DBus APIs implemented by
 Gnome and KDE. The reason is that it becomes much easier to display
 things on the screen, but it also means that the /etc scripting API
 is rotting away and will not work on the long run. So if you want
 your laptop to suspend when you close the lid, your window manager
 must implement it.
</p>
<p align="justify">
 Even worse, some of the applications don't react very well under
 window managers which are not KDE and Gnome because they don't
 implement the original X11 protocol directly and rely on so-called
 window manager hints.
</p>
<h3>Debugging DBus based systems</h3>
<p align="justify">
 Which brings us to debugging. Even if your API uses DBus, it is not
 necessarily bug free. So under DBus based systems, you will sometimes
 see very weird interactions which seem to come out of nowhere, and it
 is absolutely not clear to you what happened.
</p>
<p align="justify">
 You can use dbus-monitor to get an idea of what is going on on the
 DBus, but if you have some weird interaction you typically have no
 clue what the name of the DBus call you're looking for may be, so you
 start dbus-monitor without any filters only to discover that there is
 a huge amount of traffic, some of which is log messages.
</p>
<p align="justify">
 So you try to read it from the logs but they are binary in some
 format Journal is writing&hellip;
</p>
<p align="justify">
 This makes the system appear very opaque to everybody who's trying to
 take a serious look at it and fix problems. The result is that even
 people like me start going for solutions like &rdquo;Restart the
 application&ldquo; or &rdquo;Delete the configs&ldquo;, because
 debugging a problem becomes extremely time consuming and the
 interactions between the different applications are no longer
 well-defined and obvious. This was one of the very basic design
 principles of UNIX.
</p>
<h3>Effects on other operating systems</h3>
<p align="justify">
 A very common reaction when people hear that the Linux distributors
 are doing something crazy is to say, &rdquo;Who cares, I'll just use
 my NetBSD/FreeBSD so this won't affect me&ldquo;. This, however, is
 only partially true.
</p>
<p align="justify">
 The problem is that even users of FreeBSD and NetBSD want to use some
 of the software which was implemented for one of the desktop
 environments will have to find ways to make the DBus services work
 and react in the correct way. Jared McNeill attempted this with the
 NetBSD port of DeviceKit, but most operating systems aren't designed
 to support the kind of APIs involved. As a result, it becomes
 extremely difficult to support such software, and makes all operating
 systems more like Linux if they want to be able to run this type of
 software.
</p>
<p align="justify">
 This is the exact opposite of the design principles of standards like
 POSIX and the Single UNIX specification. These specifications set a
 common high-level ground for all operating system interfaces, but
 leave the implementation details up to the systems. In order to honor
 the thought put into these design principles, the system shouldn't
 depend on anything other than a C API either so the implementation
 details are entirely up to the implementor.
</p>
<p align="justify">
 More than that, this again affects choice and diversity. One of the
 biggest arguments the Linux community has brought up for migration
 from Linux was diversity, but right now, Linux implementors are
 competely ignoring this plea of their own. Instead, they come up
 with, well, &rdquo;proprietary&ldquo; Open Source software which
 locks people to use Linux and Gnome/KDE.
</p>
<p align="justify">
 And this change in design principles is something which should be
 changed very soon. The current tendency towards DBus interfaces is
 actively harming the more proficient users in the various ways they
 made for themselves. Linux and UNIX have always been about the ease
 of customization.  Gnome and KDE are both based on the idea that this
 only confuses the first-time users and should not be offered, which
 is fine. However, these window managers are now forcing themselves
 onto the users, and limiting the user's choice of operating system to
 just one. This is harmful and obliterates most of the advantages UNIX
 and Linux systems have given us.
</p>
<p align="justify">
 So if you believe in the principles behind UNIX and Open Source,
 please don't write software which requires any of the Gnome/KDE and
 DBus API. Writing X11 programs with xcb and proper RPC APIs like
 SUNRPC or Thrift should be more than good enough. So, please support
 choice and freedom by implementing programs the right way instead
 of the Linux/Gnome/DBus way.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Frustration with the Thecus N5200</title>
<author>
<name><a href=&quot;https://plus.google.com/114292582268779510325&quot;>Tonnerre Lombard</a></name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2011/08/15/frustration_with_the_thecus_n5200/index.html"/>

<id>http://blog.ngas.ch/archives/2011/08/15/frustration_with_the_thecus_n5200/index.html</id>
<published>2011-08-15T01:23:47+01:00</published>
<updated>2011-08-15T01:23:47+01:00</updated>
<category term="broken" />
<category term="hardware" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 After a recommendation from a friend, I recently bought myself a Thecus
 N5200 NAS for home use, to replace the sluggishly slow Netgear ReadyNAS.
 Along with it, I bought 5 2TB hard disks, which should be enough to give
 me 6TB or more of storage on my home directories.
</p>
<p>
 So I installed the hard disks and booted it up. I created a big RAID 6
 volume over all disks and then realized that it wasn't helping a lot
 because, while there was a menu option to enable NFS support in the
 first place, there was none whatsoever to export my new file system via
 NFS. Also, showmount confirmed that it wasn't exported.
</p>
<h4>Follow the manual</h4>
<p>
 As I couldn't find anything in the online help or the user manual about
 exporting file systems to NFS, I found
 <a href="http://wiki.chaostreff.ch/Thecus_n5200_Debian">Thecus N5200
  Debian</a> on the Chaoswiki and tried to follow the procedure outlined
 there. However, it turned out that my NAS was running a much more recent
 version of the Thecus supplied Linux distribution and couldn't install
 any of the mentioned packages. Also, Thecus itself doesn't seem to offer
 any SSH server.
</p>
<h4>Do It Yourself, maybe?</h4>
<p>
 So since the whole thing is just an i386 which runs Linux I decided to
 try and go in to fix things up myself. I installed Debian onto an SD card
 and tried in kvm whether it boots up fine and configures the system.
 Then I got myself an adapter from <a href="http://www.pcengines.ch/">PC
  Engines</a> to mount the SD card into the Thecus NAS and tried to boot
 it up.
</p>
<p>
 Well, so much for the theory. The system did something but there was no
 output on any of the two serial consoles, ever. Not even the firmware
 of the box write anything anywhere. The system is really hard to interact
 with. And while, in qemu, I get a serial console, it didn't work at all
 in the Thecus.
</p>
<p>
 And while the network card was configured and the firmware installed,
 nothing moved on that front either. According to
 <a href="http://wpkg.org/Running_Debian_on_Thecus_n5200">Running Debian
  on Thecus n5200</a> on wpkg, the only way to tell what the NAS is doing
 seems to be to solder a VGA adapter onto the mainboard and attach a
 monitor.
</p>
<h4>Picking up the pieces</h4>
<p>
 So to summarize, so far I wasted more than CHF 1'000.- and 10 TB of space.
 All I got in return is a brick which sits on the ground and can only
 share files with Windows boxes. Yes, I know, most systems can mount SMB
 shares, but that's really not an option.
</p>
<p>
 So I really wonder where this is going. What I'd love is a tiny box with
 space for 5 hard disks which can at least do 1 Gbit/s and can be
 integrated easily with my LDAP and Kerberos setup. In my world, this
 shouldn't be too much to ask.
</p>
<p>
 However, instead of this, vendors seem to throw very expensive closed
 systems at us which attempt to prevent us to customize them or to really
 interact with them in any way which the vendor wasn't planning for. I
 don't see the reason though.
</p>
<p>
 What's the loss for Thecus if I can easily install my own operating
 system, like I can with my ALIX? They aren't losing any money form this
 or anything. What's the cost of making everything output to the existing
 serial port? It's not like this is expensive to implement or anything.
 And the operating system used in the box suppports it just as well.
</p>
<p>
 So far I'm getting the feeling that I just found a new brick I can use
 as a door stopper. But I guess I'll try to do some more stuff with it
 before I loot the hard disks. Perhaps I should buy a regular Mini-ITX
 PC and use that.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">The Debian Installation of Doom</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/09/01/the_debian_installation_of_doom/index.html"/>

<id>http://blog.ngas.ch/archives/2010/09/01/the_debian_installation_of_doom/index.html</id>
<published>2010-09-01T02:33:57+01:00</published>
<updated>2010-09-01T02:33:57+01:00</updated>
<category term="broken" />
<category term="free_software" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 For tonight I set myself a rather trivial task: install Debian on a remote server
 which I can only netboot grml on, and where I have no console access. I figured
 it wouldn't be too difficult. However, Debian figured that it would be best to
 throw any possible obstacle my way.
</p>
<p>
 I booted into grml, set up the partitions and file systems (/dev/md0 as /boot,
 /dev/md1 with lvm and the root file system). Then I mounted them in place and
 ran debootstrap. However, debootstrap said the configuration phase of the
 packages failed. So I chrooted into the system and ran <i>dpkg --configure -a</i>.
</p>
<p>
 Then, I figured that Debian prefers to leave the most important programs uninstalled,
 so I ran <i>apt-get install less bzip2 pax openssh-server sysklogd grub-pc
  linux-image-2.6.32-5-amd64</i>. However, grub-pc decided it doesn't want to
 install itself successfully. A manual run of grub-install fixed this glitch as
 well. Then I set up a root password, enabled root logins for now in the ssh
 configuration and configured /etc/fstab and /etc/network/interfaces. I added
 a netconsole to the grub configuration, just in case.
</p>
<p>
 Then I figured it was time to test the system, so I rebooted. However, I never saw
 the system come up. Also, the netconsole didn't log a thing. So I booted back into
 grml, installed kvm and tried to boot the system, only to find grub saying:
</p>
<p><code>
 error while parsing number
</code></p>
<p>
 So I fixed the device paths and re-ran update-grub2. Then the system booted but
 still didn't respond to ping, and had nothing on the netconsole. So I booted grml
 and saw that there was finally at least a dmesg.0 file. This file contained a
 number of hints:
</p>
<p><code>
 netconsole: eth0 doesn't exist, aborting.<br/>
 e100: eth0: e100_request_firmware: Failed to load firmware
 &quot;e100/dm101m_ucode.bin&quot;
</code></p>
<p>
 So I figured that apparently the Debianists no longer ship firmwares anymore. I found
 a package called linux-firmware in the non-free repository and installed it. Then
 I rebooted and received ping replies from the system, but ssh never came up, the
 connection remained refused. So I booted into grml and found all logs in the chroot
 to be empty:
</p>
<p><code>
 grml# ls -l &nbsp;<br/>
 -rw-r----- 1 root adm       0 Aug 31 23:20 /mnt/vms-planck--root/var/log/messages<br/>
 -rw-r----- 1 root adm       0 Aug 31 23:20 /mnt/vms-planck--root/var/log/syslog<br/>
 -rw-r----- 1 root adm       0 Aug 31 23:20 /mnt/vms-planck--root/var/log/daemon.log<br/>
 grml# 
</code></p>
<p>
 So I installed Dropbear and configured it to listen to port 2222, then rebooted. The
 system pinged, but ports 22 and 2222 remained refused. When running the system in kvm
 again, I discovered strange messsages though and found the root cause to be a popular
 debootstrap bug:
</p>
<p><code>
 grml# cat /sbin/start-stop-daemon<br/>
 #!/bin/sh<br/>
 echo<br/>
 echo "Warning: Fake start-stop-daemon called, doing nothing"<br/>
 grml#
</code></p>
<p>
 So I moved /sbin/start-stop-daemon.REAL back to /sbin/start-stop-daemon, but
 instead of typing reboot I accidentally typed poweroff, and now I have to wait for
 the hoster to flip the power switch of the server again before I can continue, so
 things will remain interesting.
</p>
<p>
 I guess being bitten by debootstrap, defaults, grub, netconsole, firmware and
 start-stop-daemon on the same day was a bit too much. Time to watch
 <i>V for Vendetta</i> and go to bed.
</p>
<p>
 <b>Update</b>: Note to those who didn't realize: no, I didn't watch the film, I
 just found it fitting.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Quotes from the people who brought you PHP</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/07/18/quotes_from_the_people_who_brought_you_php/index.html"/>

<id>http://blog.ngas.ch/archives/2010/07/18/quotes_from_the_people_who_brought_you_php/index.html</id>
<published>2010-07-18T16:27:43+01:00</published>
<updated>2010-07-18T16:27:43+01:00</updated>
<category term="programming" />
<category term="broken" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 <a href="https://www.mirbsd.org/wlog-10.htm">Thorsten Glaser</a> from
 <a href="http://www.tarent.de/">Tarent</a> added a number of nice quotes
 from PHP developer
 <a href="http://en.wikipedia.org/wiki/Rasmus_Lerdorf">Rasmus Lerdorf</a>
 to the PHP source code of Evolvisforge, the gforge clone of his company:
</p>
<p><i>
 I have absolutely no idea how to write a programming language, I just
 kept adding the next logical step on the way.
</i></p>
<p>
 <a href="https://evolvis.org/scm/viewvc.php/trunk/gforge_base/evolvisforge/gforge/common/include/utils.php?root=evolvis&amp;r1=6547&amp;r2=6546&amp;pathrev=6547&amp;diff_format=u">gforge_base/evolvisforge/gforge/common/include/utils.php:1009</a>
</p>
<p><i>
 I was really, really bad at writing parsers. I still am really bad at
 writing parsers.
</i></p>
<p>
 <a href="https://evolvis.org/scm/viewvc.php/trunk/gforge_base/evolvisforge/gforge/common/include/minijson.php?revision=6547&amp;root=evolvis&amp;view=markup&amp;pathrev=6547">gforge_base/evolvisforge/gforge/common/include/minijson.php</a>
</p>
<p><i>
 I'm not a real programmer. I throw together things until it works
 then I move on. The real programmers will say &quot;yeah it works but
 you're leaking memory everywhere. Perhaps we should fix that.&quot; I'll
 just restart apache every 10 requests.
</i></p>
<p>
 <a href="https://evolvis.org/scm/viewvc.php/trunk/gforge_base/evolvisforge/gforge/www/pm/t_follow.php?revision=6547&amp;root=evolvis&amp;view=markup&amp;pathrev=6547">gforge_base/evolvisforge/gforge/www/pm/t_follow.php</a>
</p>
<p><i>
 We have things like protected properties. We have abstract methods.
 We have all this stuff that your computer science teacher told you
 you should be using. I don't care about this crap at all.
</i></p>
<p>
 <a href="https://evolvis.org/scm/viewvc.php/trunk/gforge_base/evolvisforge/gforge/www/pm/t_lookup.php?revision=6547&amp;root=evolvis&amp;view=markup&amp;pathrev=6547">gforge_base/evolvisforge/gforge/www/pm/t_lookup.php</a>
</p>
<p>
 I think people like Rasmus explain a lot about the poor design and the
 many implementation flaws of the PHP programming language.
</p>
<p>
 Thanks as well to <a href="http://www.slideshare.net/bsiegert">Benny
  Siegert</a> who provided the quotes.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Cassandra in pkgsrc</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/06/12/cassandra_in_pkgsrc/index.html"/>

<id>http://blog.ngas.ch/archives/2010/06/12/cassandra_in_pkgsrc/index.html</id>
<published>2010-06-12T07:44:11+01:00</published>
<updated>2010-06-12T07:44:11+01:00</updated>
<category term="programming" />
<category term="free_software" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 During this second quarter of 2010, I added a number of Cassandra related
 packages to the pkgsrc package collection. They will appear in the next
 quarterly branches. The following packages have been added:
</p>
<ul>
 <li>databases/apache-cassandra: Highly scalable, distributed structured key-value store</li>
 <li>databases/libcassandra: C++ interface to Cassandra</li>
 <li>databases/p5-Net-Cassandra: Perl5 module for accessing the Cassandra database</li>
 <li>databases/py-cassa: Python client library for Cassandra</li>
 <li>databases/ruby-activerecord-cassandra: ActiveRecord Cassandra adapter</li>
 <li>databases/ruby-cassandra: Ruby extension for Cassandra</li>
</ul>
<p>
 Apache Cassandra is a next generation, No-SQL, non-relational distributed
 database. Unlike SQL databases, it behaves more like a key-value store
 and can store nested data structures. Cassandra is already in use by a
 number of large web sites, and has clients for a number of programming
 languages, like the ones mentioned above.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Putting the fun in funionfs</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/05/24/putting_the_fun_in_funionfs/index.html"/>

<id>http://blog.ngas.ch/archives/2010/05/24/putting_the_fun_in_funionfs/index.html</id>
<published>2010-05-24T20:56:27+01:00</published>
<updated>2010-05-24T20:56:27+01:00</updated>
<category term="broken" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 Since a lot of the world still evolves around PHP, and a friend of mine
 asked me to host a PHP based blog, I was confronted with a typical PHP
 application which, like all typical PHP applications, enjoys heavily
 writing to its installation directory and keeping its own configuration
 there.
</p>
<p>
 Being the automation freak I am, I rolled an RPM package of the PHP
 application which installs it into <i>/usr/share</i>. Then, a Puppet
 rule creates an Apache vhost in <i>/home/www</i> and union mounts the
 shared installation into <i>htdocs</i>, with a vhost subdirectory named
 <i>confdata</i> as read-write layer.
</p>
<p>
 It turned out I had better used NetBSD for the task. The only unionfs
 implementation available in CentOS 5.5 is fuse based and called
 <i>funionfs</i>. However, funionfs doesn't support SElinux contexts,
 so everything ends up in the context <i>fusefs_t</i>, leaving it
 inaccessible to Apache. A small SElinux module fixed that:
</p>
<p><code>
module serendipity 1.0;<br/>
<br/>
require {<br/>
&nbsp;&nbsp;&nbsp;&nbsp;type httpd_t;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;type fusefs_t;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;class lnk_file read;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;class dir { read write remove_name getattr create search add_name };<br/>
&nbsp;&nbsp;&nbsp;&nbsp;class file { read write getattr create setattr rename };<br/>
}<br/>
<br/>
#============= httpd_t ==============<br/>
allow httpd_t fusefs_t:dir { read write remove_name getattr create search add_name };<br/>
allow httpd_t fusefs_t:file { read write getattr create setattr rename };<br/>
allow httpd_t fusefs_t:lnk_file read;
</code></p>
<p>
 This might not be the most secure solution but nothing other than Apache
 runs on this VM anyway, so I didn't care enough. It's still better than
 turning off SElinux entirely.
</p>
<p>
 In order to allow the software to access the database, I had to flip another
 SElinux switch:
</p>
<p><code>
 httpd_can_network_connect_db --&gt; on
</code></p>
<p>
 Now things almost worked. However, installing templates via the web
 interface does not, so I went on to investigate:
</p>
<p><code>
 % cd /home/www/s9y.zrh.internetputzen.com/htdocs/templates<br/>
 % mkdir test<br/>
 mkdir: cannot create directory `test': No such file or directory<br/>
 % ls -ld test<br/>
 ls: test: No such file or directory<br/>
 % touch test<br/>
 touch: setting times of `test': File exists<br/>
 % ls -ld test<br/>
 -rw-r--r-- 1 root root 0 May 24 20:49 test<br/>
 % rm test
</code></p>
<p>
 It's impossible to create directories in the funionfs. Apparently it's
 some kind of bug. Creating the template in <i>confdir</i> worked but
 it means the web interface is not working.
</p>
<p>
 Looking forward to <i>aufs2</i> in later versions of CentOS.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">RPM package for Nanoblogger and preparing a new package repository</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/03/10/rpm_package_for_nanoblogger_and_preparing_a_new_package_repository/index.html"/>

<id>http://blog.ngas.ch/archives/2010/03/10/rpm_package_for_nanoblogger_and_preparing_a_new_package_repository/index.html</id>
<published>2010-03-10T14:28:40+01:00</published>
<updated>2010-03-10T14:28:40+01:00</updated>
<category term="free_software" />
<category term="programming" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 Since I was searching for my <i>nanoblogger</i> RPM or .spec file for the
 third time now, I decided that now that I'm leaving
 <a href="http://www.sygroup.ch/">SyGroup</a> it's time to move my software
 development and packages to a well-defined place. As I recently saw the
 domain <i>young-solutions.ch</i> and as I'm the owner of
 <a href="http://www.ancient-one.ch/">ancient-one.ch</a>, I figured it would
 be a nice fit to put it all on
 <a href="http://www.ancient-solutions.ch/">ancient-solutions.ch</a>.
</p>
<p>
 If you're expecting content there yet, you're a tad too early. The idea is
 merely a sketch at this point. So far my plans comprise an installation of
 <a href="http://www.gitorious.org/">Gitorious</a> so I can migrate my
 projects away from <a href="http://github.com/tonnerre/">Github</a> to my
 own hosted place. Of course, <a href="http://bsdprojects.net/">bsdprojects.net</a>
 was meant for this initially, but it's less private.
</p>
<p>
 The current idea of the domain looks as follows:
</p>
<table border="0">
 <thead>
  <tr>
   <th>Host</th>
   <th>Content</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><a href="http://www.ancient-solutions.ch/">www.ancient-solutions.ch</a></td>
   <td>A small web site describing the whole thing, with links to the other subsites; or maybe the gitorious site?</td>
  </tr>
  <tr>
   <td><a href="http://blog.ancient-solutions.ch/">blog.ancient-solutions.ch</a></td>
   <td>A blog with progress information</td>
  </tr>
  <tr>
   <td><a href="http://git.ancient-solutions.ch/">git.ancient-solutions.ch</a></td>
   <td>The git repositories with a gitweb for everyone to see</td>
  </tr>
  <tr>
   <td><a href="http://bcollect.ancient-solutions.ch/">bcollect.ancient-solutions.ch</a></td>
   <td>A short web site (wiki?) about bcollect</td>
  </tr>
  <tr>
   <td><a href="http://clib.ancient-solutions.ch/">clib.ancient-solutions.ch</a></td>
   <td>A short web site (wiki?) about clib</td>
  </tr>
  <tr>
   <td><a href="http://rpm.ancient-solutions.ch/">rpm.ancient-solutions.ch</a></td>
   <td>RPM package repositories</td>
  </tr>
  <tr>
   <td><a href="http://deb.ancient-solutions.ch/">deb.ancient-solutions.ch</a></td>
   <td>Debian package repositories</td>
  </tr>
 </tbody>
</table>
<p>
 The spec files etc. would eventually end up on <i>git.ancient-solutions.ch</i>.
</p>
<p>
 Anybody got a cthulhu logo?
</p>
</div>
</content>

</entry>
<entry>
<title type="html">End of an USB stick</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/03/10/end_of_an_usb_stick/index.html"/>

<id>http://blog.ngas.ch/archives/2010/03/10/end_of_an_usb_stick/index.html</id>
<published>2010-03-10T13:46:55+01:00</published>
<updated>2010-03-10T13:46:55+01:00</updated>
<category term="hardware" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 Yesterday and today I tried using an USB stick as a medium for installing
 <a href="http://fedoraproject.net/">Fedora 13</a> on my netbook
 (a HP Mini 110). In the course, I discovered a bug in
 <i>liveusb-creator</i> which appears to umount the target file system
 (type vfat) properly before running <i>syslinux</i> in order to install
 the boot code. As <i>syslinux</i> also scribbles on the device, the result
 is a botched file system.
</p>
<p>
 Thinking I had found the cause of my problems, I went on to create my own
 bootable USB stick &mdash; unsuccessfully of course. The <i>/boot</i>
 partition, which is located at the beginning of the device, always
 remounted itself read-only when I tried to install the kernel or grub.
 Sometimes it even showed up as read-write in <i>/proc/mounts</i>, yet
 it wasn't writable. So I started looking for SElinux context problems
 &mdash; none.
</p>
<p>
 Attempting to set an explicit SElinux context for the <i>/boot</i>
 partition upon mounting, I unmounted the <i>/boot</i> partition, only
 to get some terrible notifications in my dmesg:
</p>
<pre>
 Mar 10 11:51:54 methusalix kernel: ext3_abort called.
 Mar 10 11:51:54 methusalix kernel: EXT3-fs error (device sdb1): ext3_put_super: Couldn't clean up the journal
</pre>
<p>
 Yet somehow, it was unmounted. I tried to mount the partition again, which yielded:
</p>
<pre>
 Mar 10 11:56:24 methusalix kernel: journal_bmap: journal block not found at offset 12 on sdb1
 Mar 10 11:56:24 methusalix kernel: Aborting journal on device sdb1.
 Mar 10 11:56:25 methusalix kernel: __journal_remove_journal_head: freeing b_committed_data
 Mar 10 11:56:41 methusalix kernel: ext3_abort called.
 Mar 10 11:56:41 methusalix kernel: EXT3-fs error (device sdb1): ext3_journal_start_sb: Detected aborted journal
</pre>
<p>
 In the end, the file system was not mounted. Great. So I ran a file system check,
 which crashed with &rdquo;Too many errors in inode &hellip;&ldquo;
</p>
<p>
 So my next idea was to run badblocks, so I tried to umount the root partition
 of the new system on the stick, and got some more nice kernel messages:
</p>
<pre>
 Mar 10 11:57:01 methusalix kernel: EXT4-fs error (device sdb2): ext4_mb_generate_buddy: EXT4-fs: group 0: 6936 blocks in bitmap, 7095 in gd
 Mar 10 11:57:01 methusalix kernel: JBD: Spotted dirty metadata buffer (dev = sdb2, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
 Mar 10 11:57:01 methusalix kernel: JBD: Spotted dirty metadata buffer (dev = sdb2, blocknr = 0). There's a risk of filesystem corruption in case of system crash.
</pre>
<p>
 Mount returned &rdquo;umount: /mnt: device is busy.&ldquo; although
 <i>lsof</i> did not reveal any users of the file system. All I could do
 at this point was to reboot and run badblocks thereafter. After
 running for approximately 1 &frac12; hours, it finally displayed:
</p>
<pre>
 3921914
 3921915
 3921916
 3921917
 3921918
 3921919
 done                                
 Pass completed, 798052 bad blocks found.
 tonnerre@methusalix:~% 
</pre>
<p>
 I don't think there's any rescue for this USB stick.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Poor nobody</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2010/03/04/poor_nobody/index.html"/>

<id>http://blog.ngas.ch/archives/2010/03/04/poor_nobody/index.html</id>
<published>2010-03-04T20:33:22+01:00</published>
<updated>2010-03-04T20:33:22+01:00</updated>

<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Login name: nobody                      In real life: Nobody
Directory: /nonexistent                 Shell: /sbin/nologin
Never logged in.
No Mail.
No Plan.
No Future.
No Past.
No Hope.
</pre>
<p>
 (Thanks to salo for this nice one)
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Ubuntus Frequently Unanswered Questions</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2009/09/26/ubuntus_frequently_unanswered_questions/index.html"/>

<id>http://blog.ngas.ch/archives/2009/09/26/ubuntus_frequently_unanswered_questions/index.html</id>
<published>2009-09-26T00:54:29+01:00</published>
<updated>2009-09-26T00:54:29+01:00</updated>
<category term="free_software" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 In a FAQ (Frequently Answered Questions), people usually expect answers to
 the questions they might ask. <a href="http://www.ubuntu.com/">Ubuntu</a> is
 taking things to a new level there and simply repeats the question, adding a
 new one in the end:
</p>
<p>
 <cite><big>Question:</big> Ubuntu One Client FAQ #588: &quot;My Account says that
 I have had an account for x months. What does this mean?&quot;</cite>
</p>
<p>
 <cite><big>Answer:</big> The My Account page says that I have had an account for x
 months. This is confusing. What does it mean? Does this represent the age of
 my subscription?</cite>
</p>
<p>
 <a href="https://answers.edge.launchpad.net/ubuntuone-client/+faq/588"
   title="Ubuntu One FAQ #588 remains unanswered">Source</a>
</p>
<p>
 Thanks for clarifying, <a href="https://edge.launchpad.net/~mattgriffin"
  title="Launchpad user page of Matt Griffin">Matt Griffin</a>!
</p>
</div>
</content>

</entry>

</feed>

