Search Results: "dom"

18 June 2006

Carlos Villegas: Bootchart vs Stopwatch (SoC2006)

Today I did some serious polishing of the first deliverable of the boot process project and made it available here. One of the things added were some hotspots ordered by how promising they are. The final version of the deliverable will be ready tomorrow evening.

One question that I had today was about the relationship between Debian's update-rc.d and Fedora's chkconfig command. Both of them seem to arrange the order of execution of the init scripts. The other question was about the acceptance of file-rc and it seems that, at least for debian, it is used quite seldom (1).

Finally, as a result from Petter Reinholdtsen's feedback to the previously published bootcharts of woody, sarge and etch, I compared the bootcharts time using a stopwatch. Petter considered that the times were too small and it looked like KDE autologin time was too short. The time results (in seconds) for Sarge and Etch are:

Sarge 0:44 (bootchart) and 1:06 (stopwatch). Difference = 0:22
Etch 0:34 (bootchart) and 0:49 (stopwatch). Difference = 0:15

Big difference. The stopwatch was activated when the key ENTER is pressed at the GRUB selection screen and stopped until the KDE in-progress window disappeared.It should be noticed that bootchart doesn't account for the time of initrd.

Besides, from the time that the message of starting kdm appears until the KDE stops loading there is an important time difference:

Sarge ~0:06 (bootchart) and 0:23.5 (stopwatch). Difference=0:17.5
Etch ~0:05.5 (bootchart) and 0:19 (stopwatch). Difference=13.5

Then, most of the time difference seems to be because of bootchart stopping to count the time before the KDE stops loading.

Just as a final remark, the PC time from pressing the ON botton to the grub is around 11.5 second. Then the total startup times of Sarge and Etch end up being as big as 1:17.5 and 1:00.5, respectively. Both above one minute.

(1)http://qa.debian.org/developer.php?popcon=file-rc

Steve Kemp: What we re dealing with here is a total lack of respect for the law

Right it is 23:43 and I’m just back from a dodgy metal night - picture the winners of the Eurovision song contest but with a lesser budget. Normally this would be described upon my real blog which contains adult language, and a mixture of random trivia, sadism, and geekyness in more detail than is displayed here. (You might think this is a hard mix, but I’ll tell you it isn’t suprising if you’ve ever programmed Gtk 2.x in raw C ;) ) Anyway the reason I went to the gig in the first place was that last year one of my partners was a bass-player, and she was often playing gigs in different locations. Unfortunately for the duration of our relationship I managed to never actually hear her play. Not deliberately - it was just the way things worked out. We kinda tailed off seeing each other because I was sleepy and she lived in a different city. Actually this is a common theme with me. I once lived with a concert chello player and for the entire 2.5. years of our relationship I managed to never hear her play, or practise (and we lived together!). Again not deliberate, it was just the way things worked out. (Even now I don’t think she’s ever heard me play the guitar.) Later I had a relationship with a Swedish dentist and for the duration of our relationship I refused to let her look inside my mouth [mostly ;) ]. It was only after we’d ceased being .. close .. that I let her extract some wisdom teeth of mine. Of course she was Swedish, living abroad, and all her friends were Swedish too - so I had a lot of Swedish “friends” around that time. Maybe one day I’ll even meet a genuine blonde Swede. (I can say “hello”, “goodbye”, “I love you”, “marry me”, and “you’re cute” in Swedish!) (I’m not a slut; I just know what I like.) Anyway .. enough side-tracking. The only reason this is coming up at all is because I think context is important when writing about people that aren’t known - I hate seeing people in blogs write about “J”, or “C”, with no hint of the nature of the relationship, or why we should know/care about their actions - people are important, and if you’re going to bring them up you should explain who they are, and why they are relavent. The fact that I’ve drunk 5 bottles of cider now is also helping extend this entry If it helps I almost promise not to mention these people again. So, to recap, I’m at this metal gig, and damn they were a fantastic band. Miranda (the woman I was “with”, previosuly if not recently) was a total camera-slut, and she was technically extremely competant. I guess I shouldn’t have been suprised but I was. So, why do I mention any of this? Well I was standing outside before the band started as it is illegal to smoke in public enclosed places in Scotland (since Marche this year) and this obviously rules out smoking in a pub in the basement bar. (The bar was unstaffed since the bands playing tonight were “too loud”. Sucky having to walk upstairs to find beer.) So .. stood outside, totally under-dressed for the occasion. Almost everybody else in the (very sweaty) basement bar was dressed in monochrome and I had shiny white shoes and colourful t-shirt. Still I was one of the tattoo’d + pierced people so all was good. “Excuse me, you look like Steve Kemp”. For the first time ever somebody recognised me from my planet debian hackergotchie. Neat huh? And now it is 23:58 and I’m going to listen to some nice Rammstein and go sleep. Tomorrow I must do some Debian work, and tidy a friends flat - since they just moved out and want their deposit back. In the future I will try to keep the entries here more on-topic, unless people actually care about this kind of entry …

17 June 2006

Edd Dumbill: In search of agile infrastructure for web applications

Many advances have been made in agile software development. Frameworks such as Ruby on Rails embody agile principles by making software easy to write, easy to test, and above all, easy to change.If only we could say the same for the infrastructure on which we develop and deploy web applications. Not every application can be a Rails one, especially where it's been up and running for years. The systems we deploy on often rely on configuration files scattered all over the filesystem, and can be complex results of years of change.By extension, the systems we develop on often don't exactly mirror where we deploy. If we're lucky and careful, then we have a staging server which mirrors the live environment, but that's not too much of an advantage. Among other things, we need ways to evolve and refactor the live environment, and have our development environments easily track that.I'd like to call such an environment "agile infrastructure". Infrastructure that doesn't hamper developers, and allows live configurations to change and evolve. Infrastructure that allows new things to be tried with minimum cost, and can provide the best information possible to help future planning.Tools enable techniques, of course. It's a lot easier to be agile if you're programming in Rails rather than plain old PHP. So what are the tools enabling agile infrastructure?
Techniques I've found usefulWhile there's a long way to go, I'd like to describe some of the techniques I've been using to help create a flexible environment for developing a sizeable PHP/MySQL application.Operating systemAn operating system must be easy to bring into a known state with minimum interference. For this, I've found Ubuntu or Debian to be an ideal choice. Two of the main reasons include the constancy of stable releases and the fact that it's rare you need to stray outside the distribution's servers to get the software you need.DeploymentDeploying an application shouldn't break the cleanliness of your OS build. I prefer to package deployed applications into .deb files. This enables me to build on several advantages of the package management system:Source controlThe case for source control, thankfully, doesn't need making these days. Yet not every source control system is created equal. Developers shouldn't be constrained by source control, it should be cheap and easy to try new ideas and merge these in later.Not only cheap branching, but also easy merging, is required to keep development agile while still retaining the benefits of source control. Many people flock to Subversion these days, predominantly because it fixes some of CVS' more egregious misfeatures. However, merging can still be pretty difficult in Subversion.I prefer to use a system allowing easy merging, such as svk or bazaar. Because so many of us use laptops these days, disconnected operation is also a huge boon. Bazaar-NG offers both repository-oriented and completely decentralized operation, giving the best of both worlds. It also wins the competition for least setup overhead.VirtualizationPreviously a high-powered technology, cheap virtualization is now with us. Many identical virtual machines can be quickly created to enable testing and experimentation. Deployment to virtual machines can enable hardware independence for applications, reducing another big headache.Large organisations have it within their reach to bring new hardware online easily, and have invested much in management systems for it. Virtualization brings this in reach of small and one-man development teams.Desktop-based virtualizationSystems such as VMWare and Parallels untether developers from their desks. I use the OS X desktop daily for its productivity software, but an Ubuntu virtual machine for a large proportion of development work. A simple keypress lets me flick between the two. The advantages of multiple desktops to hand for web development are well known. (In fact, thanks to WINE and IES4Linux I can run Internet Explorer cheaply too from the same virtual machine).
Xen virtualizationAfter the initial novelty wears off, one of the most tedious tasks in the world is bringing new machines online. Combined with the tendency development environments have to get crufty as new ideas and tools are tried out, this makes for increasing disparity between the development and deployment environments.Wouldn't it be nice just to take a clean machine off the shelf, check out the source, and pick up again? Using Xen for Linux, this cheap virtualization is possible.Sadly, Xen isn't yet a packaged part of Ubuntu, but getting it up and running on Ubuntu Dapper isn't too hard. Warning: here's where things get pretty deep. Skip this bit if you're not interested in the nitty-gritty.I followed these steps:Getting over the DNS mountainIf you want it to be easy to bring new virtual machines up and down, you need to adopt a different approach to managing your DNS. You need to know how to predictably connect to a virtual machine. Yet it's going to get very boring and error prone to manage the IP address space manually in your DNS, or even to map the MAC addresses of your virtual machines in your DHCP configuration.
Help is at hand in the form of mDNS (also known as Rendezvous / Bonjour / ZeroConf). In the host machine, and in each virtual machine, I ensured the avahi-daemon and avahi-utils packages were installed, providing mDNS services. (You should also check that mdns is present in the hosts entry of /etc/nsswitch.conf).What all this does is allow the machines (virtual or otherwise) on the network to resolve names using mDNS. So if I create 3 VMs, alpha, beta and gamma, I can access these right away using the hostnames alpha.local, beta.local and gamma.local.Hey presto! Easily make machines appear and disappear without any need for sysadmin involvement. All the extra steps to add avahi installation can be easily scripted with xen-tools, to reduce the number of commands needed to birth a new machine to one.With this ease of creating new machines, it's much more straightforward to experiment with server topology and conduct experiments on server environments.ConclusionAgile development is necessarily constrained by the infrastructure on which it is conducted. The infrastructure itself is constrained by the tools and platforms of choice.By appropriate tool choice we can reduce the commitment and overhead of infrastructure. This enables developers to get on with the job they do best, and makes experimentation and evolution of infrastructure much simpler.When programming, it's dangerous to fall in love with your code, as the best solution may often involve throwing half of it away. The same hazard exists with infrastructure, with bizarre and awkward effects propagating back into code and operations. Get yourself a low commitment, agile environment, and you'll be able to keep up with the pace. 

Lars Wirzenius: Random thought: Dick and Ollie

My friend Dick rarely asks anyone anything. If he needs some information, he looks it up himself, on the Internet, in a book, from source code, or wherever. Only after spending considerable effort himself will he ask someone else. He takes this so far that he'll get very upset if you give him the information. It ruins his day to get derailed, and then he sulks the rest of the day. My other friend Ollie, on the other hand, always asks immediately when he has a problem. Either on IRC, by e-mail, by calling on the phone, or by shouting over a cubicle wall. He'll even run to the other side of the building to find someone he suspects has the answer. Only if he can't find anyone with the answer will he start looking for the answer himself. Both Dick and Ollie are smart. Both are successful in their careers and both are regarded well enough by their colleagues, but only Dick is considered an expert. Looking things up yourself is slower and harder, in the short run. You spend a lot of energy finding the little bit of information that solves your immediate problem. On the other hand, you learn things on the way. You learn about things related to or surrounding the immediate bit, and most importantly, you learn where to find more information. You might even learn that the bit you're looking for is the wrong bit, and there's an altogether different way of looking at the problem that lets you do things in a much better way. There's nothing wrong in asking questions, but on the whole, it's better for yourself to try finding the answer yourself first. In a hacker culture, where being good at something is valued exceptionally highly, someone asking frequent questions is often considered annoying. Doubly so, if they seem to be an Ollie. Don't be an Ollie. Do yourself a favor and be a Dick. (This entry was written some time ago, in reaction to a certain someone's umpteenth question of the day, and seeing people responding simply with Google's domain. I've postponed publishing it because I didn't want to attack that person directly.)

David Pashley: Invalid Characters in Encoding with JAVA

Imagine you've got some text you've been told is ASCII and you've told java that it's ASCII using:
Reader reader = new InputStreamReader(inputstream, "ASCII");
Imagine your surprise when it happily reads in non-ascii values, say UTF-8 or ISO8859-1, and converts them to a random character.
import java.io.*;
public class Example1  
   public static void main(String[] args)  
      try 
         FileInputStream is = new FileInputStream(args[0]);
         BufferedReader reader 
            = new BufferedReader(new InputStreamReader(is, args[1]));
         String line;
         while ((line = reader.readLine()) != null)  
            System.out.println(line);
          
        catch (Exception e)  
         System.out.println(e);
       
    
 
beebo david% java Example1 utf8file.txt ascii
I t rn ti n liz ti n
beebo david% java Example1 utf8file.txt utf8
I t rn ti n liz ti n
So, I hear you ask, how do you get Java to be strict about the conversion. Well, answer is to lookup a Charset object, ask it for a CharsetDecoder object and then set the onMalformedInput option to CodingErrorAction.REPORT. The resulting code is:
import java.io.*;
import java.nio.charset.*;
public class Example2  
   public static void main(String[] args)  
      try 
         FileInputStream is = new FileInputStream(args[0]);
         Charset charset = Charset.forName(args[1]);
         CharsetDecoder csd = charset.newDecoder();
         csd.onMalformedInput(CodingErrorAction.REPORT);
         BufferedReader reader 
            = new BufferedReader(new InputStreamReader(is, csd));
         String line;
         while ((line = reader.readLine()) != null)  
            System.out.println(line);
          
        catch (Exception e)  
         System.out.println(e);
       
    
 
This time when we run it,we get:
beebo david% java Example2 utf8file.txt ascii
java.nio.charset.MalformedInputException: Input length = 1
beebo david% java Example2 utf8file.txt utf8
I t rn ti n liz ti n
On a slightly related note, if anyone knows how to get Java to decode UTF32, VISCII, TCVN-5712, KOI8-U or KOI8-T, I would love to know.

16 June 2006

Michael Janssen: Random Technological Stuff

Programming, windows style
I'm now in the thick of a bunch of win32 programming at my Honeywell part-time job. I don't mind it that much, but I continue to be amazed that Microsoft's IDE is still the one used most often. The autocompletion is nice, but that's about the only good thing about it. I am continually annoyed that the IDE doesn't know which definition of a function I want to use, and only seems to pop up it's hints when it decides. Add this to the fact that most win32 libraries aren't apparently setup in a way so you can put their source in the repository, and I have a lot of admin work which I'm not particularly thrilled to do. 10% programming, 90% random crap. I'm beginning to understand why the average lines of code per day is so low. I can't really complain that much though, I knew the tools we'd be using when I accepted the job.

Programming, rails style
I have been working with Ruby on Rails lately, mostly to make some new web applications which aren't released yet. Things which are possibly in the works:

I also have a couple of smaller applications which won't really go anywhere, and an internal application upgrade from php. I really enjoy building web applications in the Rails framework, and I have honed my skills at Ruby enough that I actually use it for small scripts when I get frustrated with bash. I tend to do my Ruby Coding in TextMate and with Locomotive on the iBook, although I may do some on the Debian machine soon.

14 June 2006

Lars Wirzenius: Random thought: Nettiaddressi tiedostomuodoista

This is in Finnish, since it internal to Finland. Sorry. FLUG, FIMUG, FUUG ja Linux-Aktivaattori pistiv t pystyyn nettiaddressin sen puolesta, ett valtionhallinto k ytt isi vapaita tiedostomuotoja. Kannatan. Menk lukemaan ja allekirjoittamaan: addressi.

Steve Kemp: I grew heavy, and my sight grew dim

Due to constant frustration that two unrelated projects were sharing the same domain name for mailing lists I finally bit the bullet and looked into what was required to setup a simple mailing list manager with easy virtual domain support. (ie. not mailman. which I am coming to loathe.) “Enemies of Carlotta” looked the simplest, but documentation was scant and I had trouble making it work. Instead I’m now using ecartis combined with an installation of hypermail to make archives. The upshot of this is that the xen-tools-commits mailing list has now moved from shellcode.org over to lists.cvsrepository.org. I’ve also created a xen-tools mailing list for users/questions/bugreports. I’m still limping towards a new release with the pretty new webpages, but a bit more work to do. Although people who wish to live dangerously have the CVS repository to play with.

Gunnar Wolf: Mr. Fox should have abolished the Congress five years ago

...If that is what it would have taken for his mediocre term to be positive for our nation.
Today he says that it's because of the congress that he could not solve the conflict in Chiapas (a deed he promised in his campaign that would take not more than 15 minutes). The congress didn't vote the correct laws to solve the conflict, it seems. Of course, the promised 15 minutes seemed not to be the time it would take for him to mediate, negotiate and agree with the unhappy indigenous population, but just to sign the needed paper. The Congress did not send the right law, it seems... Strange, I would say, as the Law for Indigenous Rights and Culture that was approved was approved by PRI, PAN and PVEM almost five years ago. That law, instead of fixing the problems requested by EZLN and many other groups, ignored the proposed beginnings of a solution. It was voted by PAN (Fox's party), PRI (the historical dominant party, now shrinking every day more) and PVEM (so called ecologist party). Of course, had Fox wanted to solve the problem, it would have taken him over 15 minutes to read the proposed law - but he would have been able to ask his party not to vote for it.

Gunnar Wolf: Frustration comes on ISO/OSI layer 2 (or: On one of the ways 3Com sucks)

Over one month ago, I truly hoped an evasive network misbehavior issue was solved. In the institute, we had a strange situation which caused a (seemingly random) stack of switches to go out to lunch and leave one of the floors without network access until it decided to restore itself (usually power-cycling it was not enough). The equipment, ten 4200 SuperStack switches, is new, we got it ~September, so I expected 3Com to give me at least some support on the issue. The behavior was apparently random, and I could not track it down, only (thanks to the very nice Cacti) prove it existed.
December 5 was terrible. The whole building's network refused to work. Switches were able to reply to my pings for no more than a minute after booting before they got flooded with "Spanning Tree CTRL MAC PAUSE: Quanta 65535" (according to another great tool, the Ethereal protocol analyzer).
I had been bugging the support people at 3Com for at least three weeks before this incident, they kept promising they would come soon to help us track the cause of the ellusive problem - We threatened to send the switches back and pursue reimbursement through whatever means we could (we had much better stability and performance with our old 10Mbps hubs, so my boss insisted on replacing them), so we got them to come. The answer they gave me? Upgrade your firmware to version 2.50 (not available at their website, of course) and disable spanning tree functionality at the switches.
I have to admit the big problem immediately ceased. This is not to say I was pleased with the response time or with the switches' software quality, but at least we could work.
Happily, ~7 weeks passed by with no major outages (although with a few small ones).
Yesterday, we got back the complete chaotic conditions. This time, though, I was able to get a good and useful tcpdump snapshot, passed it through Ethereal, and actually got something interesting (available to whoever requests it to me if it sounds interesting). In short: Something happens that confuses a switch (I guess it's a faulty NIC), and makes it request to all of the neighbouring switches (via spanning tree protocol - Yes, it's disabled, but still) for their complete ARP tables. But somehow, this noise or whatever keeps confusing it, so the spanning tree requests start repeating every two seconds for slightly over one minute. Then, the same switch which requested this information gets tired of too many ARP tables being thrown at it, and sends out a storm of packets (one each 0.04 seconds) asking every other switch _not_ to send updates anymore. This is broadcasted to all of each of the switches' ports, and the network dies.
My grudge against 3Com is: How come this frigging noise (at least that's what I assume it to be) on one of the ports kill all of the network? If a switch is supposed to be smart, would it be too much for it just to disable the misbehaving port?
Anyway... One and a half days went down the drain trying to find the cause for the problem, sending the report to the 3Com guy (who is very nice in person, yes, but that's by far not enough!), running up and down the stairs to reset different switches, lock down on the source of distress... And as my 3Com contact was busy with another client (who presumably had not yet given them money), I never got a call back from them.
All my good intentions to spend a nice quiet time coding for three projects we currently need to have ready soon (one of them is in production and many of you have used, my dear Comas conference management system, but requires heavy tinkering to be able to extend it) were stuck at that: Good intentions.
I seem to have locked down the problem in one of three computers (that is, network seems stable again once I disconnected them). I insist it must be a faulty NIC. My boss bets it's an ber-contaminated Windows machine. My boss' boss insists we should get the switches double-grounded just to be sure that's not the reason for failure. I am tired, bad mooded, and -again- bored you to death with a too-long blog entry.
Blame it all on 3Com.

13 June 2006

Aigars Mahinovs: F-word on BBC and shot Muslims

Pre-story: In Forestgate in London police stormed inside a house, shot one man and arrested him and his brother. After 10 days it turned out that no evidence of any gilt to them was found in the raid and the raid is only based on some secret intelligence. During the day when I was watching the news the brother that was shot was describing how policemen dragged him down the stairs shouting him to "Shut the f*** up!", the F-word was bleeped and that was ok. The real surprise to me was that it was not bleeped out when retransmitted in the evening news at 22:00. I am glad that UK's media are not as puritan as USA's. P.S. I think that this incident with another innocent Muslim person being brutally shot by the police without any warning is the best thing that Al Quaeda could have organized. I just hope that this will get the same outcry internationally as here in UK and that will turn the tide from "war" to "freedom".

Bartosz Feński: step closer to upgrade of my server

I've got a new second hand hardware for my server, so I'm step closer to upgrade it eventually. Right now server is running on an old Celeron 300MHz, 256MB of RAM and 80GB hard disk.
(fenio@serwer)~$uptime
14:19:07 up 59 days, 21:57, 1 user, load average: 10.70, 10.75, 10.61
(fenio@serwer)~$
As you can see it's very loaded. Mainly because of Apache which eats almost whole CPU power serving about 40 domains. In addition almost each domain have virtual mails, ftp and sql base. So it's about time to upgrade it. New hardware is 2xPentium III 733MHz, 1GB of RAM and 2x250GB disks. I hope that'll be enough for some time. I didn't decided yet how to use disks... LVM comes to my mind, but maybe RAID since I've got hardware controller for that? RAID0 seems to be interesting solution and should increase overall performance. Changing hardware seems to be great opportunity to finally switch from Woody to something newer. Am I last person still using Woody these days? :) I'm going to finally use some software that'll allow me to put some duties on users instead of me. I mean some software helping administration of virtual hosts. I found three interesting projects for that purpose: Any experience with some of them? Any recommendations? Or maybe something else I missed during search? My personal wishlist is: Any hints? ;)

11 June 2006

Michael Janssen: Go Go Gadget Vacuum

The gift which I bought Di last week came this Thursday - a iRobot Roomba Sage. So far we have ran it about 4 times - the first three times it's bin filled up completely, today when it was finished it wasn't even half full. The robot is really maddening to watch, because the pseudo-random walk that it uses doesn't seem like it is covering the floor that well. The roboticist in me knows better though, and the proof is in the particle-free floor which our apartment is now sporting.

It's not to say that there is no setup before turning the Roomba on - you need to clean up the floors just as you would for any low-powered vacuum, picking up pieces of deitrius which will not be picked up. The Roomba doesn't deal well with the type of rugs which we have in apartment either, so those need to be picked up and placed somewhere while it's running. After these steps, it's just turning it on and waiting basically. It easily gets to the 3 rooms which we have it vacuuming in (living room w/attached kitchen, bedroom, bathroom) multiple times in one cleaning cycle, but our apartment is not that large. After it's done you need to empty the bin and clean the brushes of hair and other debris, which takes about 2 minutes. All told I would say that using it takes about 10 minutes total interactive time.

Other than that, this week has been pretty dull actually, work and more work. Completed some code for Marsupial Player/Stage but it doesn't quite work the way I want yet. Monday went out with Di to look at couches and found a great table for the dining area. You can see pictures of it on my flickr page.

I need to install a backup system which works on Windows, OS X and Linux on the server machine, and figure out a network file system which works with all of them as well. I'm fairly sure that I am going to use Samba as the file serving capabilities. The machine has been rock-solid stable since the removal of the DWL-G520 which was providing network for it before the upgrade to a wireless bridge. I suspect that the madwifi drivers were not playing well with the amd64 architecture.

10 June 2006

Martin F. Krafft: DNS server selection, and why not to BIND yourself

I have been searching for a new DNS server for quite some time now. Among the ones I inspected were:
  • MyDNS, which seems interesting, but so far hasn't won my fancy because it has hardcoded SQL table names which do not at all fit in with our infrastructure, so I'd have to provide translation views (which isn't that much trouble). Upstream seems active, the bug count is low, but according to popcon, a whopping total of 0 participating people have mydns-pgsql installed. No wonder. Mh. Also, the package is unavailable on amd64 at the moment.
  • MaraDNS, which looks good and has a nice configuration file format, very similar to the djbdns (which I really like). The maintainer has indicated he'd prefer someone to adopt the package, not sure if I want to do that. Upstream seems active (and responsive), the bug count is equally low, popcon lists 35 installations.
  • nsd, which looks good but uses BIND-style zone files. No thanks! Read this about parsing them. I am just not all too thrilled about redundancy and brittleness.
So with all of the above, it comes down to MaraDNS or PowerDNS for me, depending on whether I want flat files (easy to maintain by separate users, with permissions set with per-domain granularity) or SQL (flexible, but not as easy to control access). My goal is to give certain users complete control over their own zones. Anyway, in the process, I did look at BIND 9 again, simply because it certainly has some interesting features the others do not have, namely nsupdate, DNSSEC, TSIG, and IPv6. So with the help of this awesome document on starting with a secure BIND configuration, I got the name server up and running with only few problems (zone files suck). However, it did not take me long to abandon it for good: The reason is #372591. I have found that the only way to give users the ability to create and modify zone files for their own domains in a fail-proof manner (so that they don't accidentally screw up permissions), is by using POSIX ACLs, so that each zone file has permissions like this:
# file: zones/belligerence.net
# owner: madduck
# group: dnsmasters
user::rw-
group::r--
group:bind:r--
mask::r--
other::---
BIND, however, insists on checking the standard Unix permissions of files it reads and fails rather verbosely if it decides that it cannot, or rather should not be able to read them:
Jun 10 15:36:15.871 client 84.7x.xx.129#33283: query: belligerence.net IN A
Jun 10 15:36:15.871 client 84.7x.xx.129#33283: error
I've let of most of my steam on IRC, but for the record, here's Bernhard R. Link's explanation, quoted with permission. He did point out that he knows only very little about BIND and comes at this rather from the point of view of the system-level privileges.
When POSIX permissions fail, it's always hard to decide. The system might not be able to drop root permissions properly and one might end up reading stuff not intended to be read. It took some time in Unix history to get privilege dropping right, and there's nothing worse than a BIND suddenly sending out your shadow file. the point is, bind needs root to bind to its ports. Then it has to make sure that root privilege is not abused. That can be either done by making sure on is only the specific user (which is hard to do portably, and sometimes fails), or double check you only access what you are allowed. Ideally it should drop privileges good enough, but given how often this failed in the past, double checks are a good thing.
I disagree. Of course it's hard to argue that double checks aren't a good thing, especially when it comes to security issues with respect to an application that has one of the worst security track records of all Unix applications. However, what BIND is doing here is covering up a potentially greater problem: if the underlying system does not handle privilege drops properly, then that needs fixing. If an admin runs such a system, there's the root of the problem. It helps only marginally that BIND is trying to help prevent attacks. Fix the problem at its root, don't fix or patch for the symptoms! Now, of course, it does not really hurt that BIND does these checks. However, if it does them, it should at least be less na ve about them. POSIX ACLs have been around for, what, almost 10 years now. Go figure. Btw: this applies to many other tools/standards in the Unix world. scp, for instance, also cannot handle ACLs. So MaraDNS or PowerDNS?

9 June 2006

Ross Burton: Domke Camera Inserts

Quick question to the Interweb: does anyone out there have a Domke camera bag or inserts, specifically the Adjustable Insert? I have some questions about it and other Domke inserts. If you do, please email me. NP: Worldwide Underground, Erykah Badu

8 June 2006

Matthew Palmer: [Ruby] Blocks as Resource Management

One of the really neat things about Ruby is the extensive use of blocks (closures, I think the rest of the world calls them) in the standard library to control the allocation and deallocation of resources. Take the following snippet:
 File.open('something.txt') do  fd 
   # Manipulate the file through 'fd'
 end
 # File handle is now closed
There's no way that you can escape from that block without the file being closed (well, in theory, you could lose the file handle if there was an exception thrown in the block, but the File::open method can take care of that internally by catching, closing, then rethrowing). I've loved this feature since I first saw it -- "holy crap!" I thought to myself, "I never have to call close again!". And I was pretty well right -- I think I can count (in unary, not binary!) on one hand (well, I'd use grep wc) the number of times I've used IO#close in my Ruby code. The funny thing is, though, that I don't think I've used this pattern in my own code enough. But I just had an epiphany whilst waiting for a train home -- and I think I'm cured. Take this hideous piece of test code I had laying around in an app I'm working on at the moment:
 def test_something_funny
   faux_path_on
   d = Domain.new('127.0.0.1', 'somethingfunny.com')
   faux_path_off
   
   # assert writ large
 end
Domain::new calls out to a shell command (dig(1) to be precise -- take a guess at what I'm writing <grin>, and yes, it will be released shortly) but for test purposes I can't run dig (because I'm not guaranteed to have all the infrastructure available for a real dig to succeed). So I have a flimsy mock of dig in a directory in my test suite, which is where faux_path_on sets ENV['PATH'] to look at. This is, of course, pretty untidy, because when (not if!) I forget to call faux_path_off, everything goes to complete poop, and my children will have two heads or something. The much cleaner version is like this:
 def test_something_funny
   d = faux_path   Domain.new  
 
   # Assert ahoy!
 end
And my faux_path method (I've even saved a method!) is as simple as simple can be:
 def faux_path
   realpath = ENV['PATH']
   ENV['PATH'] = my_fake_path
   rv = yield
   ENV['PATH'] = realpath
   return rv
 end
I also have a trickier faux_* method, which sets a couple of environment variables which tell my mock nsupdate(8) where to write the data it gets sent from my application -- again, it's a block-taking method that sets the environment, yields, reads in the data from the temporary file, cleans it up, and returns the contents of the aforementioned file. The power of the Ruby is growing within me, I can feel it. And I like it.

7 June 2006

Mike Beattie: I speak proper england!

(... well, I like to think I can!) So, on a completely unimportant website that I frequent, I've ended up being a moderator on the site forums. Something about knowing *nix and PHP apparently.. Anyway, I've always had a beef with the way english is used and abused on the Internet. You know, all those abbreviations, and incorrect word usage that just seethes "I'm an illiterate prick." U, 2, ur, da, r, etc etc.. and also the so incredibly common misuse of your/you're and they're/there/their. GAH. Yech. Anyway, this particular site is no exception. Some of the users have appalling habits. (Ab)using my powers as a moderator, I've started to demand some care and attention to the most glaring errors - mainly towards my most intense pet peeve, misuse of "your" and "you're". Looking for a place that describes all this stuff well, I stumbled across this site. I couldn't have said it better. Thank you Sarah D. Bunting! (I especially liked, and agree with this:
And no, in fact, I don't know what you mean when you write me a hate mail that reads, "You're site sucks," because that doesn't mean anything. Because it's grammatically incorrect. Because you've substituted a contraction of a verb phrase for an adjective, thus rendering the sentence nonsensical. And it makes you look stupid, and therefore I cannot take you seriously.
)

6 June 2006

Lars Wirzenius: Rant: SMS and e-mail tax in the EU

The European Union wants to tax SMS and e-mail messages (see digitoday news in Finnish). Or at least the French MEP Alain Lamassoure has suggested that, it seems. The tax would be 1.5 cents per SMS, and 0.00001 (one hundred thousandth) cent per e-mail. Current prices in Finnish operators seem to be around 7-10 cents per SMS message. A 1.5 cent tax on top of that seems pretty high. Collecting it would be simple: all SMS messages go through operators. For e-mail, however, the thing is going to be a nightmare. Much e-mail goes not via operators, and there is no good way of tracking it. This could be fixed (from the tax collecting viewpoint) by requiring all e-mail servers to be registered for proper accounting (nevermind freedom and privacy). Update: This paragraph is rubbish, due to my inability to calculate simple things; I'll keep it here in the interest of historical accuracy (randomly changing already published log entries is impolite, to say the least). Anyone operating a busy mailing list will want to move it outside the EU. Even at such a low price, a list with a thousand subscribers and a hundred messages a day is going cause a tax burden of around four hundred euros a year. A company might be willing to pay that; a free software project would probably not.

5 June 2006

Eric Dorland: Belated DebConf Conclusion

I'm terrible at the whole blogging thing, I've been back for two weeks and haven't found the time to summarize my time at DebConf. I had an excellent time. I met a lot of great people and even found a squash partner for the next DebConf. It was really quite unforgettable, so thanks to everyone involved.

Hanging out with [info]sfllaw there, I was exposed to a lot more Ubuntu-esque things that I really had before. Some people there were quite unhappy about Ubuntu. To me, it's just not really that interesting, one because I don't see it as being substantially better or different from Debian and two because it looser stand on freedom. But hey, this is free software, people seem to like it, and I'm glad to see something related to Debian getting money and attention, rather than say RedHat or SUSE. I think a lot of developers would be happier with Ubuntu if it was just easier to ignore.

Then there was that dinner, and the events surrounding it. While I and many others won't miss Ted, I don't think he was treated at all fairly. Being thrown out in the middle of conference when seemly he did nothing wrong there was not very civil. If people could not stand to be around him, they did not have to be around him. He could have just as easily been removed from the project after the conference was over.

Enough griping though. If I came away with anything from the conference, it was a renewed vigor to work on Debian. Now if only my schedule would permit it.

4 June 2006

Enrico Zini: Dapper on XEN (part 1/1, unfinished)

I need to do some work on a Dapper system, so it's time to try out xen:
apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0-i386 xen-utils-3.0 xen-tools
xen-tools tries to recommend xen, which is old and has been requested to be removed from the archive. The recommends needs to be ignored, which is not that trivial to do with aptitude. The linux-image doesn't happen to have an initrd. The bug has already been reported. One can recreate one using:
mkinitrd -o/boot/initrd-2.6.16-2-xen-686.img  2.6.16-2-xen-686
Then one adds this to /boot/grub/menu.lst:
title Xen
root (hd0,0)
kernel /boot/xen-3.0-i386.gz
module /boot/vmlinuz-2.6.16-2-xen-686 root=/dev/hda1
module /boot/initrd.img-2.6.16-2-xen-smp
And it boots lovely:
# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0      939     2 r-----  4677.9
Now xen-tools provides xen-create-image. I'll try to create the Dapper image (deboostrap in my system has already been changed to be able to install dapper):
xen-create-image --size=4G --swap=128M --dhcp --volume=marvin \
                 --hostname=cavazza --dist=dapper --fs=xfs
But I get:
[...]
Creating swapfile : /dev/marvin/cavazza-swap
Done
Creating disk image: /dev/marvin/cavazza-root
Done
Creating xfs filesystem
Done
Installing the base system.   This will take a while!
Copying files from host to image.
Finished
Something went wrong with the debootstrap installation
Aborting
I love detailed error messages. This one is not. So I'll have to do by hand. The documentation says:
Before you can start an additional domain, you must create a configuration file. We provide two example files which you can use as a starting point:
  • /etc/xen/xmexample1 is a simple template configuration file for describing a single VM.
  • /etc/xen/xmexample2 file is a template description that is intended to be reused for multiple virtual machines. Setting the value of the vmid variable on the xm command line fills in parts of this template.
But in Debian there's no trace of the two example files. I've reported to Guido Trotter. Then I googled for the two files and found them. Now, on to adapt Dapper to run under Xen. The good Ubuntu wiki has an HOWTO which crudely makes you install the Tarballed Pre-built installations of Xen 3.0. It's sad that xen-enabled kernels didn't make it into Dapper roper. I can make this:
kernel = "/boot/vmlinuz-xen-domu"
memory = 128
name = "Dapper"
disk = [ 'phy:marvin/dapper,hda1,w' ]
dhcp="dhcp"
root = "/dev/hda1 ro"
I used the pre-built kernel as a domU, but:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
Sigh. I'll try with the Debian Xen-enabled kernels. Installing yaird and linux-image-2.6.16-2-xen-686_2.6.16-14_i386.deb and linux-modules-2.6.16-2-xen-686. It WORKS! Now, that's not Dapper: that's a debootstrap install of it. No user, no root password, no desktop, no shiny Ubuntu custom config. How to finish the installation? No idea. In the past, I could run base-config, but now it doesn't exist anymore. It seems that the best bet is not to use debootstrap, but to install the CD in the LVM partition using QEMU and then chroot into it and then install the debian xen kernel to boot it. A QEMU install will take ages, and I expect some trouble, like getting partman to see LVM. Maybe I better install on a disk image file and then use tar and netcat to bring the ubuntu installation out of the disk image and into the LVM image. For today, I didn't make it. This job slips another day. Frustration. I hope that at least this description of my efforts so far can be helpful to someone trying similar things. One suggestion I got was to boot the Dapper CD and install from there. I can't: this computer has no bootable CD. Update: I found out http://xensource.com/summerofcode.html and it says:
Project Idea 3: Xen Desktop Outside of Domain 0 This project would deliver a Xen desktop to the user of a client system that presents an abstraction of a virtual desktop to the user in which multiple guests share the virtual desktop, each with a subset of the desktop resources (pixels, etc). Smart management of the sound drivers would allow mixing of sound from multiple guests to the single device used for output. Microphone input could be broadcast to all guests. Technologies such as ALSA already emulate playback settings by downsampling for the hardware etc. so its not hard to imagine a xen-snd-front device munging the data to a common format used for the internal sound card. Issues: synchronization of playback.
So, what I'm trying to do has been proposed as a SoC project and (I guess) is something that can't be done overnight. Although I was planning to run a diskless gdm accessed with XDMCMP from domain0's X server, and to just hand out the audio card to the domU using pciback, so my task would have been easier. Thus I give up using Xen for this one. I'll work around the lack-of-bootable-cd limitation of this computer by installing Ubuntu using QEMU. Which I found out requires using the "Alternate install" CD. The desktop install CD is a live CD installing with Ubuntu Expresso, and the live CD doesn't seem to work in QEMU. Or, I'll install in a LVM partition in the laptop and then move it around using the network. This one's probably faster. Could this experience be an interesting use case for Edgy Eft?

Next.

Previous.