Search Results: "sf"

10 July 2007

Cameron Dale: DebTorrent Release 0.1.2

Today I have released the next version of DebTorrent. It's been over a month since the last release, which means there are lots of new features in this one. This is also the first release that I consider actually useable, as it now listens for HTTP requests from APT for packages to download, and feeds the downloaded packages back to APT. It also includes a backup HTTP downloader that will use a Debian mirror to download packages from, only when no peers can be found that have them. This means your download always works, even if you're an early adopter (which I hope you are) and there aren't that many peers available. Finally, the larger packages have now been split into multiple pieces, which makes downloading them much more efficient. Here's the changelog: I've already started work on the next release, which will include almost no new features, but will be much easier (I hope) to use. It will also be distributed in a .deb binary format for the first time, and (again I hope) be available in the Debian archive. Here are the plans I've come up with for the steps to complete for the next release:
  1. Make a debtorrent daemon script based on btlaunchmany
  2. Make a config file with lots of explanations
  3. Load configuration info from /etc
  4. Save downloads and state to /var/cache
  5. Log all messages to /var/log
  6. Clean up the debug logging, possibly add debug levels
  7. Use bittornado packaging files (debian/)
  8. Add init script
I've never created/packaged a daemon before, so hopefully I haven't made any blunders in those plans.

Zak B. Elep: Getting back to the Action

I’ve been away from blogging. I’ve been away from doing Debian and Ubuntu work (although there has been a few package updates, as well as a new one.) I’ve been away from a lot of happenings (like how the excellent Knightlust got to convince my fellow townsfolk at Lourdes College Foundation to use FOSS,) but that’s fine, since I know there will be others who can keep up the flame burning. I’ve been away because I’ve been looking at stuff. Lots of stuff. Various stuff. Stuff like Plan 9 from Bell Labs, and Inferno, and dabbling into distributed computing, working on an implementation of Plan 9’s file protocol. Stuff like thinking about programming, meditating upon it as an art, exercising a discipline of simplicity, clarity and frugality. All that stuff. I first looked at Plan 9 last March, when I was wanting to go another round at the Google Summer of Code. While I was not selected, just getting Plan 9 to run on my machines (first as a qemu terminal, then as standalone CPU server replacing my old Ubuntu dapper install on my desktop) exposed me to that other side,’ and that got me thinking about how software ought to be good. Of course, I could have just chosen to drop it all (after all, I wasn’t selected, so…) but I knew that if I stick long enough, I might just learn something. And yes, I am learning something. Like how a lot of software isn’t really simple, just appearing to be. Or how sophisticated software development methodologies rob the clear picture gained from a well-thought, clear, and simple analysis of problems. Or when push comes to shove, I will have to make a choice, between tolerating software complexity and status quo, or facing it and attempt to simplify it. Well, there’s much to tell, but I’m lazy, and I’d rather tell stories in bits. Anyway, I think I’ll have some time to spare, especially as I have accepted a new job at an up-and-coming company that, I hope and endeavor, will rock the local and international tech scene. And, while doing that, get around to make great tools to get my job done, and other people’s jobs too. I’m getting back to the action.

Jose Carlos Garcia Sogo: Miguel Angel Blanco

One day like today, ten years ago, E.T.A. kidnapped Miguel Angel Blanco and gave the Goverment 48 hours to transfer all E.T.A. prisioners to prisions in Basque Country. On 12th July 1997, they shoot him twice at back of head, after one of the biggest demonstrations in Spain against terrorism, with millions of people out at the street asking for him to be freed. Anyway, there are still people that considers them only a separatist group, though they are considered a terrorist group by European Union, United States, and United Nations.

Miguel Angel Blanco
Miguel Angel Blanco

newspapers
The first day. Newspapers talk about him.

image on TV
When the given day and hour arrived, every TV channel showed this image.

Miguel Angel Blanco entering the hospital
He is found yet alive and taken to the Hospital. He fighted for life during 12 hours more.

Spain on the street
Spain at the street on 14th July. 1.5 million people in Madrid.

All photos were taken from elmundo.es

Ian Haken: Summer of Code Midterm Update

As we reach mid-summer, I think now is a good time to provide a more detailed update on my summer of code project, vlosuts. For anyone not familiar (or for anyone forgetful) the following is a brief summary of my project proposal. In order to assist in distribution upgrades, vlosuts (Virtual Live Operating System Upgrade Test Suite) aims at performing upgrades of live systems (between releases and/or repositories) while logging any errors encountered. By running on a live system (virtualized via QEMU/KVM/Xen/other) problems that may only be encountered with services upgrading can be identified early. The full proposal can be found at: http://code.google.com/soc/2007/debian/appinfo.html?csaid=24C7766EC4271F15

I am happy to say that vlosuts is successfully in alpha, with most of the desired features already implemented. Based on my initial project propasal timeline, I'm well on schedule.

Some of the features that were proposed included the ability to run the upgrade with packages selected by priority, from a list, and as mirrored from an existing system (packages can even have a specific version specified, though of course the repository used must have that version available). Additionally, when mirroring this package list, configuration files can optionally saved as well. This allows testers to (as nearly as possible) reproduce a specific system.
These options have all been implemented among others. I have also put in support for running with QEMU, KVM, and Xen backends.

For the remainder of the summer, my goal will be adding additional features and tackling a few bugs that have come up. In particular I'm trying to take advantage of QEMU's ability to emulate various architectures. However, the stability of user-mode emulation has been uneven for me (segmentation faults whenever any program is launched), which is required in order to cross bootstrap. Once this is worked out, one should be able to test upgrades on any of QEMU's supported architectures.

Additionally, vlosuts is not yet available as a package, which is clearly something that needs to be fixed soon. I'll be spending some time in the next couple weeks packaging it and making sure it sets up correctly.

I think that about sums up the current state of things. It's been a good experience thus far, and hopefully the rest of the summer continues to go well.

9 July 2007

Matthew Palmer: Hell is other people('s code)

I've been working (part-time) on an existing Rails application for the last month or so, getting comfortable with it, modifying some sections to support needed functionality, and beginning an all-out, carpet-bombing "shock and awe" assault on it's test suite. However, a significant portion of the system is (or rather was, since I've already gutted a lot of it) a chunk of rather messy and unpleasant auto-generated code. I've always been a bit iffy about code generation tools, ever since my first encounters with them whilst working on some $DEITY-awful access application years ago. (First encounters with anything Microsoft usually have that effect on me, though). Since then, I've never found any reason to change my mind, and dealing with this particular chunk of auto-generated code has pushed me over the edge into "wild-eyed extremist" territory. Please note that when I say "code generator", I'm talking here about programs or wizards or whatever that create a block of code that you're then expected to tweak to suit your conditions. If it's just a mechanical transformation of an input format to an output format, where a human is never expected to maintain the output by hand, that's not code generation in my book -- that's just a compiler being used for it's intended purpose. I like compilers. I'm fairly sure you do too. Code generators, though? EVIL. Consider what you get out of your generator: A big blob of code in your application that you then have to understand and maintain. It's like you gave a commit bit to some random person who dropped a 5000 line change into your tree and then ran away into the night, cackling. If there's bugs in the generated code (and remember, there's always bugs in software), when they get fixed upstream you're up the creek unless you haven't modified the code at all (and thus can regenerate), or you're willing to apply the necessary patches to your modified version, often by hand. Hand-patching is error-prone, and if you've modified the code at the same place that has to be patched, things can get unpleasant. In the case of the generator I'm dealing with at the moment, I'm not even blessed with it being decent code. It's ugly code, in every possible sense of the word. There's inconsistent formatting, poor commenting, it uses some totally whack coding constructs[1], the hard-coded text strings are ungrammatical, it's got very few (and poorly covering) test cases, the methods are huge and unwieldy, and it's got security bugs (not so hot for something that's supposed to be guarding your application). In short, it looks like some quick-and-dirty internal hack that escaped one night and is now wreaking havoc on the world. There's probably some really good code generators out there. I've been poking around a bit, and there's some written for Rails by people who I know produce good code. However, no matter how good the author of the code generator is, the very best you can hope for is solid, clean code that is the equivalent of some portion of your application having been coded by some member of your team who you (and nobody else) has ever met, who didn't follow your team's coding conventions, and who has never looked at any other part of your application to make sure that everything hung together in a consistent manner. Which you now have to maintain. I've read a lot of books, articles, blog posts, and mailing list messages, and participated in no shortage of "why software sucks" discussions with other programmers, but I've never heard anyone advocate that the way to clean code, minimal bugs, and happy programmers was to drop a big chunk of unknown code right in the middle of things. Before you start charging up the e-mail-delivered tasers, ready to fry my delicate braincells for the twin crimes of Xenocodophobia and a vicious case of Not Invented Here syndrome, though, please understand that I'm not against code reuse in the right place. That right place is a library, component, or other abstract, documented, fairly static, and presumably-replaceable chunk of code. By using a library, you get a relatively simple interface to somebody else's complexity. This is a good thing, for all the reasons that everyone should already be able to recite. Items such as a comprehensible interface, minimal learning curve, and so on. Things you don't get with generated code because, pretty much by definition, the entire chunk of code is you "interface". There are some times, though, when what you want to do can't be done in a library. Either the thing has too many tentacles to be able to easily encapsulate behind an abstracted interface, or you need to modify it's behaviour in too many places to be able to get away with a few simple callbacks to get the job done. Hence, it might be tempting to fire up the code generator to get yourself out of a hole quickly. Don't do it though. Don't succumb to the temptation of saving yourself a little bit of time by firing up a code generator. What you're doing there is just making pain for yourself, by inheriting a big chunk of code that you don't fully understand, probably doesn't solve your problem particularly well, and which you (or whichever poor slob gets the job after you) will have to maintain into perpetuity -- most likely by gradually rewriting large pieces of it so that it fits your application better. The output of a code generator is likely to be the least maintainable code in your tree -- either by virtue of the fact that it's crap code, or at the very least because you just don't understand it. The general principle of good codebase hygiene is that you get rid of unmaintainable code quickly, so it doesn't infect everything else (a la the "broken window theory"). With that in mind, why would you ever consider deliberately introducing a huge chunk of unmaintainable code into your application? The closest I can come to a defence of code generators is something like Rails' scaffolding, where the controller and views for a set of simple CRUD operations on a table are auto-generated. The key word there, though, is scaffolding. It's very name suggests that it's temporary, to be replaced with something more robust and useful as soon as is reasonable. The default scaffolding is ugly as sin, besides, which encourages you to replace it, and -- as of Rails 1.1 (I think), there's a 'scaffold' method which creates the scaffolding output at runtime, so you never, ever need to generate scaffolding code any more. Anyone planning on producing any significant piece of their application through the use of code generators is, in my book, committing a crime against software decency.
1. My favourite whack code construct thus far has been this gem:
 case somevar
   when 17
     do_something_here()
 end
Because, you know, if statements are for people who know how to program, or something.

7 July 2007

Mike Hommey: Finding where a tarball came from with git

I got the idea reading this question on the webkit-dev list, and from my recollection of the git documentation. Well, for the webkit case, the basic script I put up would be of no help because the tarballs don’t contain all the files (plus, they use subversion, not git, so it would also require a long importing process). Anyways… Considering how SHA-1 hashes of objects are created with git, it is actually pretty easy to generate a SHA-1 hash from a random (non-git) tree, and then, the corresponding commit. First, you have git-hash-object that helps you creating a hash for a particular object (though it’s also trivial to do with sha1sum). For regular files, git-hash-object -t blob $filename is enough. For symbolic links, you have to read the link destination, and give it without a trailing character (be it the NULL character or a carriage return) to git-hash-object -t blob --stdin. For directories, you have to generate a tree “structure” by yourself and pass it to git-hash-object -t tree --stdin. I haven’t bothered looking at other file types. The tree structure can be guessed by either looking at mktree.c or at the output of git-cat-file tree $sha1 where $sha1 is the SHA-1 hash for a tree object. It contains 3 informations for each node in the tree : the file mode, with the same format as what stat() returns, except for some reason, permissions are 000 for directories and symbolic links ; the file name ; and the SHA-1 hash. These informations are written with the following format : file mode in octal ascii and no padding zero (”%o”) followed by a space character, then the filename followed by a NULL character, and the binary form of the SHA-1 hash. Nodes are sorted in a not-so-quite lexical order (take a look at base_name_compare in read-cache.c) and are not separated by any special character: the mode of a file just follows the SHA-1 hash of its predecessor. With all this new knowledge, you should be able to write some code that would return the SHA-1 from an arbitrary directory. Okay, since you must be at least as lazy as I am, you can take the script I wrote. Now, let’s take a look at a real life case : what commit is the latest nightly snapshot for the linux kernel from ? First, download the latest snapshot patch and its baseline, and extract the whole. Then, run my git-hash-tree.pl script with the directory containing the extracted kernel as an argument. It will return, after a while, the SHA-1 hash for the whole tree. During this long process, you also have plenty of time to git clone linus’s tree. Once you’re all done, you can search for the commit corresponding to the tree hash (let’s call it $hash) with the following command :

git-rev-list --all while read h; do git-cat-file commit $h grep -q "^tree $hash" && echo $h && break; done
If you just followed these steps, you should just have spent a great moment having no result at all. There are actually 2 things that prevent this method to properly work with the linux kernel nightlies : Note this is a naive method, because I haven’t dedicated much time going through git documentation and code to find better ways, if there are any. Also note it’s pretty much worthless to do this with the kernel nightly snapshots, since a file containing the SHA-1 hash of the corresponding commit can be found alongside the patch. I guess a similar method could be used with mercurial, though I could not find a documentation detailing what are the hashes calculated from (I’ve not searched a lot, I must say, but for git, it was just before my eyes).

Matthew Palmer: Exceptional Flow Control

(or: finally, a use for ActiveRecord#save!) I recently found Rescue To The Rescue!, a short article on structuring your Rails controllers differently. Today, I started using it in some code I was writing that I think really benefitted from the change. The code was a big case that did things like this:
 case some_variable
   when 'X'
     process-based-on-X
     if save
       post-processing
     else
       throw_an_error
     end
   when 'Y'
     process-based-on-Y
     if save
       some-other-post-processing
     else
       throw_an_error
     end
   when 'Z'
     process-based-on-Z
     if !save
       throw_an_error
     end
 end
In each case, the pre-save processing was unique, and -- more importantly -- the action to take after a successful save was different, so I couldn't just save-and-handle after the case statement. However, the throw_an_error code was the same in each case, so I just changed the code to do this:
 begin
   case some_variable
     when 'X'
       process-based-on-X
       save!
       post-processing
     when 'Y'
       process-based-on-Y
       save!
       some-other-post-processing
     when 'Z'
       process-based-on-Z
       save!
   end
 rescue ActiveRecord::InvalidRecord
   throw_an_error
 end
My mind was blown. Soooo much clearer now. I have an "everything's OK" code path, and a "bugger me, something broke" path, cleanly separated. But something didn't feel quite right... And now I know what it is. I'm bothered by the fact that I'm sailing very close to using exceptions as an ordinary, every day flow control mechanism. I think I've convinced myself that, in this case, it's OK, but I'm a little concerned that I might go power-hungry and start using it in places that it really isn't warranted. I guess I'll just have to keep an eye on myself. Just remember, everyone: save! isn't a dirty word!

6 July 2007

Anthony Towns: GPLv3 and Debian

So with the GPLv3 and LGPLv3 finally out (hurray!) it’s time to actually pay attention to the practical consequences of an upgrade to the world’s premier copyleft licenses. One of the things I hadn’t noticed, though I should have, is that the LGPLv3 is not compatible with the GPLv2 – that is, GPLv2 programs that used LGPLv2 libraries cannot make use of new versions of those libraries released under the LGPLv3 without also updating their license to GPLv3 (or “GPLv2 or above”, or LGPLv2 or LGPLv3 or something similar). Fortunately one of the major LGPLv2 libraries out there – glibc – is reportedly going to remain available under the LGPL v2.1 but for other libraries, it could become a problem, and it’s something GPLv2 authors will need to pay attention to. Also fortunately the opposite problem – GPLv3 apps using LGPLv2 libraries isn’t a problem, because the LGPLv2 explicitly allows redistribution and modification under the terms of GPLv2 or later, so you can take an LGPLv2 library and incorporate it in a GPLv3 application and just release the whole thing under the GPLv3. Unfortunately, the LGPLv3 doesn’t have a similar clause, so when the GPLv4 comes out, if it ever does, we could easily find the GPLv4 apps can’t use LGPLv3 libraries, and GPLv3 apps can’t use LGPLv4 libraries. Really these are side-effects of a fundamental change: up until now, almost everything we’ve distributed – and certainly all the low level stuff: the kernel, the C library, the compiler, the shell and basic tools – have all been under a GPLv2 compatible license. Some of them have been more flexible than that, due to being under a BSD or MIT license, or being under the LGPL or having a “GPLv2 or later” clause, but we’ve been essentially able to ignore all that and just treat everything as GPLv2. There are a few exceptions that we have to deal with – the occassional app that’s not GPL compatible doesn’t cause much of a problem, because things that depend on it don’t usually create copyleft issues, which just leaves checking that it doesn’t use any GPL-only libs, such as gnutls or libreadline. Openssl is a nuisance, in that it’s a popular, GPL-incompatible library, but it’s also reasonably easy to deal with on a case by case basis. But with the GPLv3, that changes: as GPLv3 apps and LGPLv3 libraries get uploaded, the assumption that more or less everything is GPLv2 compatible goes out the window, and while some things are GPLv2 only (such as the kernel!) we also can’t assume everything is GPLv3 compatible. Fortunately, both the GPLv2 and GPLv3 have what is known as the “system library” exception, which allows you to not bother distributing the source to your C compiler or C library or kernel with your app, because everyone’s assumed to have one of those already. Unfortunately, the GPLv2 version of that exception includes the phrase “unless that component itself accompanies the executable”, so Debian has always cautiously assumed the exception doesn’t apply to us, because everything we distribute in main “accompanies” everything else in main – kernel, C library, C compiler, etc. Equally unfortunately, while the GPLv3 avoids that problem, but ends up with a clause that’s not terribly comprehensible, despite a couple of rewrites during the drafting process. What’s all that mean? The big thing is that it means Debian’s going to have to put a bit more attention into the system library exception, both for GPLv2 and GPLv3 apps, because our current policy of trying to avoid needing it is probably not going to be sustainable. I’m not sure how in depth we’ll need to go for that; we’ve already contacted the FSF licensing folks for an explanation of the GPLv2 clause in relation to the CDDL, but it’s possible the FSF might prefer to be ambiguous in responding so as to keep their options open for defending or enforcing the GPL later, in which case we might need to get legal advice of our own as to what we should do. The second thing is that in reviewing our understanding of the system library exception, we might be in a position to have a Debian GNU/OpenSolaris port, making use of the exception for the CDDL-licensed OpenSolaris kernel and libc, as Nexenta do. That seems to me to be almost certainly possible for GPLv3 (or “GPLv2 or above”) applications, and probably possible for GPLv2 apps as well. If so, that’ll let us expand Debian to supporting four kernels in the near future: Linux, Hurd, FreeBSD and OpenSolaris, which will be pretty fun, in my book. The downside, is that if we find an interpretation of the system library exception that lets us mix and match licenses comfortably, that same interpretation might be able to be used to let propietary software vendors mix and match GPLed software with non-free software, rather than just free software with different copyleft licenses – and thus defeat the entire point of copyleft. What’s worse, is that by following Debian’s lead, they’d have some moral authority in doing that, beyond just having a legal argument as to why it’s okay. And that’s the rub. (My thoughts on the license texts as posted to -legal are here, here, here and here.)

5 July 2007

Cameron Dale: Simulating DebTorrent

I've been spending some time on the #bittorrent channel on Freenode, to see if I could get any good information from other bittorrent client developers. After some poor initial contact, I did get some good suggestions, as well as some tidbits of information I wasn't aware of. One of the tidbits was that most of the bittorrent client developers frowned on the use of selective downloading for torrents, to the point where some refuse to implement it in their clients (apparently the latest mainline client doesn't even have it, though I haven't checked due to license issues). This concerned me, as the DebTorrent client I'm working on will rely heavily on selective downloading to only download packages to be installed by the user. It's not clear to me that it would be an issue though. I'm sure it will make it more difficult to find a rare package in a large swarm of peers, but that's to be expected, and is nicely solved by using an HTTP download from a backup mirror. This backup downloading could become extreme though, making the bittorrent-like download (peer-to-peer) mostly just an HTTP download (client-server). To see if it will be a problem, I conducted a simulation of different sized swarms to determine the amount of unnecessary HTTP downloading that will occur. First, some assumptions to make the simulation easier: With these assumptions, the simulation becomes quite simple. I used the popcon data to assign packages appropriately to the N peers. The peers download their assigned packages from the C previous peers, if possible, or otherwise by HTTP. I ran this multiple times, varying N and C, and calculating each time how much was downloaded through the debtorrent protocol, and how much through HTTP. debtorrent wasted.png This graph shows the percentage of the total download that used HTTP from a mirror. The optimal line shows the minimum possible (i.e. all peers are connected), which corresponds to only one copy (the first) of every package being downloaded using HTTP. This verifies my previous thinking, which is that fracturing the download population into multiple small swarms results in lots of inefficiencies, and lots of HTTP downloading. All efforts will need to be taken to keep the downloading populations together. (This is especially difficult for unstable, when a new swarm could be created twice a day due to archive updates.) Swarms of 1,000 peers or more seem to be sufficient to minimize the HTTP downloading. debtorrent unnecessary.png This graph shows the amount of unnecessary HTTP downloading that occurred, which is just the difference of each line from the optimal one in the previous plot. This shows the danger of selective downloading, as all of this unnecessary HTTP downloading occurs because the swarm is too big to find peers that have the desired package (they do exist). Fortunately, this unnecessary downloading seems to approach a maximum as the swarm size increases. For the large swarm sizes needed to make the downloading efficient, and assuming a reasonable number of connections of 100 (bittorrent defaults to maintaining at least 40, and large swarms usually means a large number of connections), we can expect to be using HTTP for about 4% of the download. This number is surprisingly low due to the popularity distribution of packages (only rare ones are hard to find, but they aren't downloaded very often). I think 4% is manageable in our situation, given that there is a backup method to find the rare packages, though it does show the need to have that backup method available. This is probably more of a problem for regular bittorrent clients, in which there is no backup method.

Benjamin Mako Hill: DRM-FREE

Just a couple years ago, music and technology companies would advertise their DRM schemes. While these technologies only served to prevent users of computers and consumer electronics devices from doing things, the media and technologies companies tried to spin it positively. Think of all the wonderful media that the music, film, and publishing industries will be willing to distribute to you at the click of a button, they said. All they asked for in return is the keys to your computer and the legal right to attack and sue you if you try to take control. As everyone who purchased iTunes music and made the mistake of buying a non-Apple DAP incapable of reading Apple DRMed music knows, DRM is a bad deal for consumers. Users are always better off with an unencumbered media file. In all the excitement over major label content, some consumers didn't see this immediately. With time though, the inconvenience of a computer that does the Apple and the RIAA wants over what you want hit home. This, combined with activist projects like the FSF's Defective By Design, have turned the tide. The DRM label that used to be a badge of honor is now a stigma that smart companies are going out of their way to avoid. This past weekend, I saw this flier from Calabash Music in the crepe store across the street: /copyrighteous/images/calabash_drm_table.jpg /copyrighteous/images/calabash_music_flyer.jpg The store served a general, non-technical audience. DRM-FREE, it turns out, is a good way to sell music. Not just to geeks but to any consumer who has been stymied unfairly by DRM or knows someone who has. That, it turns out, is a whole lot people. Consumers know what DRM is and they know don't like it. As consumers learn more about DRM, they want to avoid it. Seeing this, the companies that produce DRM are looking for ways to escape. The Apple/EMI deal seems to be an attempt to protect market share that the use of DRM is threatening. Others, like HBO's Bob Zitter, are disingenuously attempting to escape the stigma of DRM by simply rebranding the technology. Of course, DRM suffers from a much more fundemental problem than bad branding. The problem with DRM is that consumers don't like what it does and are only sometimes willing to suffer through it when not given the choice. Increasingly often, as with in the example of the flier I found, consumers have a choice. Things don't look good for DRM. For DRM opponents, the self-defeating nature of the technology is our greatest ally.

MJ Ray: More on Tardorrists

Kevin Mark commented:
"I see--Redarded Terrorist--ok. So this Gareth fellow is making a comparison with smarter, more intelligent terrorist that was the IRA. Which kind of says that everyone should be far less afraid of the current crop of folks and yet the media, as it does so well, inflates their dangerousness for the sake of ... well, beats me. Oh, maybe it help Tony get a job ;-) If the IRA came to the US, what color (or is that colour) code would their activities get on our terror scale as opposed to these Tardorrists?"
How about Emerald Green? More seriously, I think it's entirely fair to suggest we should fear this lot less than the often-USian-funded Provisional IRA, or local groups like animal liberationists. Those didn't just attack the big cities - it was everywhere, an attempt at terrorism. I lived about three miles outside Milton Keynes, then a fairly small midlands city, which was firebombed by both those groups. Ultimately, it didn't work. Most people weren't terrified. We carried on regardless. The government may be over-hyping this threat to ride in a new load of "expensive and ineffective" Security Theatre measures, like ID cards. Some media is sceptical, but the Murdoch-run media is mostly complicit, which is hardly surprising given the historic relationship. We should not let these "tardorrists" change our way of life, yet that is exactly what our spineless politicians seem to be doing. Let's continue as before: beware, but be happy. Update: niq comments:
"Recommended reading: Terry Pratchett "Interesting Times". Written before "9/11" and set in the wrong part of the world, but nevertheless beautifully relevant."

3 July 2007

Gustavo R. Montesino: Debbugs SOAP

Following the hints by Bastian Venthur, which answered my last post (thanks, Bastian), and some suspicious mails to debian-debbugs, I've finally gotten to know that the debbugs' SOAP get_bugs is finally fixed. Of course, this means that btsutils has just got its query function implemented in SOAP besides the html parsing stuff.

Also great news on the debbugs' SOAP camp is that get_status now works on more than one bug per call. Yay! Debbugs people rocks. I'm not realy in place to ask something more drom these great folks, but it would be great if those cool features they keep adding were announced somewhere.

Now, the downside: Querying through SOAP is still quite slower than parsing the html. According to Python's timeit, getting a list with the bugs on all packages maintained by me takes about 17 seconds, while the same operation through HTML parsing takes about 10 seconds. I believe this differences comes from accessing the server one time on the HTML parsing and two times (get_bugs and get_status) on the SOAP.

Dirk Eddelbuettel: More on 'nicer charts'

Via the Planet Debian aggregator and his blog, Sven followed up on my post regarding Lucas' plot of the package age distribution. As some of my points didn't seem to make it across, I will reiterate them more plainly: Sven also addresses the fact that what we really want is to see the quantiles of the data set. Quite right, and taking logs makes that easier. Consider the two charts below which plot the 'package age in days' as an empirical cumulative distribution function using built-in R functions ecdf and plot.stepfun (rather than redoing it ad-hoc as I had done), and also add explicitly quantiles. The two charts use the exact same instructions; however the second chart transforms the x-axis to a logarithmic scale. Debian Package Age-since-recompile Distributions charted two ways While it is close to impossible to find the 25 or 50 percentile on the first chart, it becomes a lot easier on the second chart because the x-axis is 'stretched' using the log transform. About one quarters of the distribution appears to be rebuild within 1.5 months old, and about half is younger than four months (as a quick call to summary(pkgAge) confirms). Reading these proprtions off the original chart, or the non-log chart, is much more difficult.

2 July 2007

Evan Prodromou: 13 Messidor CCXV

More weekend stories: on Friday, we had a Geek Lunch at La ka to welcome Tara Hunt to Montreal. She's in town for a few days for Montreal Jazz Fest, and she asked to meet some people in the local Web/BarCamp/hacker scene. Lunch was good and interesting people came. Austin Hill made it, as well as Patrick Tanguay, Fred Ngo and Ben Yoskovitz, and Niko. I was especially glad to see Seb Paquet, who I don't get enough time with. All in all a good time was had. tags:

Rest of the weekend Friday night John Usher came over for our weekly Pizza Night and we had beers until very late indeed. Saturday I got a nice glass desk for my office, and we got a big square wooden coffee table off of Montreal Craigslist. We went down to the Pont Jacques Cartier to see the fireworks on Saturday night, part of the International Fireworks Competition. Except there weren't any fireworks on Saturday night. Doh! Long walk home. Yesterday, Canada Day, we had our new neighbours Jake and Magda over for a get-to-know-you brunch. Jake is a structural engineer, and Magda is a professor of history at UQ M. They're expecting a baby any day now, so we figured it was a good idea to hang out with them before the madness begins. I made a couple of quiches, a big green salad, and some banana bread. It was a good meal. tags:

Russell Coker: New Storage Developments

Eweek has an article on a new 1TB Seagate drive. Most home users don’t have a need for 1TB of storage (the only way I’ve ever filled a 300G drive is by using it for multiple backups) and enterprise customers generally want small fast drives (with 100G drives still being sold for servers). One interesting thing to note about this is the fact that the new drive is described as being able to sustain 105MB/s (although I suspect that is only for the first few zones of the disk - see my ZCAV results page for graphs of the performance of some typical disks). The previous disks that I have seen have topped out at about 90MB/s. However even if the drive could deliver 105MB/s over it’s entire capacity it would take almost 3 hours to perform a backup - increases in IO speeds have not been keeping up with capacity increases. Another interesting thing is the potential for using the same technology in low power 2.5 inch disks. While a 1TB disk isn’t going to be much use to me a 300G 2.5inch disk that uses less power will be very useful - and it might be possible to perform a backup of such a disk in a reasonable amount of time! The latest trend in PCs seems to be small form factor (SFF) and low power machines that don’t have space for two drives. If you want RAID-1 on your home machines for reliability then that isn’t very convenient. But two 2.5 inch disks can fit in less space than a single 3.5 inch disk and therefore all the SATA based SFF machines that are currently being shipped with a single 3.5 inch disk can be upgraded to a pair of 2.5 inch disks - this will be convenient for me when those machines start going cheap at auction next year! Even for servers the trend seems to be towards 2.5 inch disks. I recently bought a 2U HP server that supports up to 8 hot-swap SFF disks, I wonder how the performance of 8*SFF disks would compare to 4 of the bigger and faster disks. The next thing we need is a method of backing up large volumes of data. The 650M data CD came out when a 150M disk was considered big. The 4.7G data DVD started to become popular when 45G disks were considered big. Now almost everyone has 300G disks and 1TB disks are becoming available yet the best commonly available backup method is a double-layer DVD at 9.4G - it seems that the vast majority of home users that make backups are using cheap IDE disks to do so. Fortunately there are some new technology developments that may improve the situation. Call/Recall has developed technology that may permit multiple terabytes of storage on an optical disk. It’s yet to be seen whether their technology lives up to the claims made about it, but we have to hope. The current storage situation is getting unmanagable.

1 July 2007

Simon Huggins: Courgettes!

My courgette plants started taking over the world a while back and covered the raised bed I made in green. I had some of the courgettes a week or two ago and went out today and found more. Some have been rotting slightly on the plants so I removed those too but I'm really excited that the tiny, tiny plants I put in ages ago have turned into giant courgette plants and now have started producing things I can eat! Obvious but satisfying.

Clint Adams: El justiciero, cha, cha, cha

On February 14, 2004, Gage & Tollner, ostensibly New York's oldest restaurant, closed down and, if that weren't traumatic enough, became a TGI Friday's. Finally, Friday's is gone, and the fa ade sports a banner advertising a fully-equipped restaurant for rent. What will it become next?

Russell Coker: Committing Data to Disk

I’ve just watched the video of Stewart Smith’s LCA talk Eat My Data about writing applications to store data reliably and not lose it. The reason I watched it was not to learn about how to correctly write such programs, but so that I could recommend it to other people. Recently I have had problems with a system (that I won’t name) which used fwrite() to write data to disk and then used fflush() to commit it! Below is a section from the fflush(3) man page:
NOTES
Note that fflush() only flushes the user space buffers provided by the
C library. To ensure that the data is physically stored on disk the
kernel buffers must be flushed too, e.g. with sync(2) or fsync(2).
Does no-one read the man pages for library calls that they use? Then recently I discovered (after losing some data) that both dpkg and rpm do not call fsync() after writing package files to disk. The vast majority of Linux systems use either dpkg or rpm to manage their packages. All those systems are vulnerable to data loss if the power fails, a cluster STONITH event occurs, or any other unexpected reboot happens shortly after a package is installed. This means that you can use the distribution defined interface for installing a package, be told that the package was successfully installed, have a crash or power failure, and then find that only some parts of the package were installed. So far I have agreement from Jeff Johnson that RPM 5 will use fsync(), no agreement from Debian people that this would be a good idea, and I have not yet reported it as a bug in SUSE and Red Hat (I’d rather get it fixed upstream first). During his talk Stewart says sarcastically “everyone uses the same filesystem because it’s the one true way“. Unfortunately I’m getting this reaction from many people when reporting data consistency issues that arise on XFS. The fact that Ext3 by default will delay writes by up to 5 seconds for performance (which can be changed by a mount option) and that XFS will default to delaying up to 30 seconds means that some race conditions will be more likely to occur on XFS than in the default configuration of Ext3. This doesn’t mean that they won’t occur on Ext3, and certainly doesn’t mean that you can rely on such programs working on Ext3. Ext3 does however have the data=ordered mount option (which seems to be the default configuration on Debian and on Red Hat systems), this means that meta-data is committed to disk after the data blocks that it referrs to. This means that an operation of writing to a temporary file and then renaming it should give the desired result. Of course it’s bad luck for dpkg and rpm users who use Ext3 but decided to use data=writeback as they get better performance but significantly less reliability. Also we have to consider the range of filesystems that may be used. Debian supports Linux and HURD kernels as main projects and there are less supported sub-projects for the NetBSD, FreeBSD, and OpenBSD kernels as well as Solaris. Each of these kernels has different implementations of the filesystems that are in common and some have native filesystems that are not supported on Linux at all. It is not reasonable to assume that all of these filesystems have the same caching algorithms as Ext3 or that they are unlike XFS. The RPM tool is mainly known for being used on Red Hat distributions (Fedora and RHEL) and on SuSE - these distributions include support for Ext2/3, ReiserFS, and XFS as root filesystems. RPM is also used on BSD Unix and on other platforms that have different filesystems and different caching algorithms. One objection that was made to using fsync() was the fact that cheap and nasty hard drives have write-back caches that are volatile (their contents dissappear on power loss). As with such drives reliable operation will be impossible so why not just give up! Pity about the people with good hard drives that don’t do such foolishness, maybe they are expected to lose data as an expression of solidarity with people who buy the cheap and nasty hardware. Package installation would be expected to be slower if all files are sync’d. One method of mitigating this is to write a large number of files (EG up to a maximum of 900) and then call fsync() on each of them in a loop. After the last file has been written the first file may have been entirely committed to disk, and calling fsync() on one file may result in other files being synchronised too. Another issue is that the only time package installation speed really matters is during an initial OS install. It should not be difficult to provide an option to not call fsync() for use during the OS install (where any error would result in aborting the install anyway).

Bastian Venthur: Python, os.fork(), webbrowser and debbugs

Gustavo writes about python, it’s webbrowser module, os.fork and parsing bugreports from our BTS via html. This all sound very familiar, so here are some hints from me:

30 June 2007

Gustavo R. Montesino: Python, os.fork() and GSoC

This one was a bit tricker to find, so I'm going to post it here: if you use os.fork() on Python, you will want to use os._exit() on the child process, or it will clean stuff it shouldn't and you will have segfaults with doubled memory free.

That said, python's webbrowser module is quite useful; check it if you ever has to open a browser from a Python script/program. The only downside I see on it is exactly that it doesn't takes care of the forking stuff for you. I'm using it on bug-triage to show a bug report on the user browser.

Talking about GSoC, during the last week the Debian BTS was updated, breaking, between other things, btsutils' 0.1 version. The current development version of btsutils, which uses BeautifulSoup to parse the HTML stuff more realiable, wasn't affected by the update.

That's all for now, time to code.

Next.

Previous.