Search Results: "ean"

11 July 2007

Eddy Petrișor: More "RPM argh" or how to use %includes properly

It turns out that if you want to use includes in your .spec file and want the files to be included in the .src.rpm you have to declare those scripts as supplemental sources.

So instead of:
Name: foo
Version: x.y
Release: z
Summary: foo package
Group: Applications/System
Source: foo.tar.gz
Packager: Eddy Petrisor
BuildArch: noarch
BuildRoot: $RPM_BUILD_ROOT
....


You have to have:

Name: foo
Version: x.y
Release: z
Summary: foo package
Group: Applications/System
Source: foo.tar.gz
Source101: foo.pre.sh
Source102: foo.post.sh
Source103: foo.preun.sh
Source104: foo.postun.sh
Source105: foo.changelog
Packager: Eddy Petrisor
BuildArch: noarch
BuildRoot: $RPM_BUILD_ROOT
....

In case you want to have the scripts separated in different files and you use them all.

Note: the number in the "SourceXXX" is arbitrary but must be unique.

But mentioning the files as being Source... means you have to write:


%post
%include ../SOURCES/foo.post.sh

%preun
%include ../SOURCES/foo.preun.sh

%postun
%include ../SOURCES/foo.postun.sh


Instead of:


%post
%include foo.post.sh

%preun
%include foo.preun.sh

%postun
%include foo.postun.sh


Which should have been more reasonable...

RPM, please die... or grow some 21st century features... or some sense!!!


Update: Thanks to a few people, I was pointed out I am still not thinking in terms or RPM.
The proper way of writing the include without them looking odd is something like:

%post
%include % SOURCE102

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.

Decklin Foster: YouChoob

Russel notes a discussion of the problems with embedded media. I've been using a Greasemonkey script for a while to linkify EMBED tags for easier non-embedded downloading, but this doesn't help much on Flash sites such as YouTube. I haven t installed Flash in years, but I got sick of slinging URLs around and/or giving up and being the unpopular kid, so I took some other Greasemonkey code I was hacking on and mushed it all together:
http://www.red-bean.com/~decklin/userscripts/unembedtube.user.js
(I get a perverse sort of nostalgia out of bringing back the "puzzle piece" for links, and mocking people with it.) YouTube embeds will appear to work like any other, but the URL is changed from the Flash wrapper to the FLV file, which can be opened in MPlayer/Totem/whatever. Since we can figure out this URL, it is also, of course, possible to make such the link back into an embed usable by mplayer-mozilla or a similar plugin. Unfortunately, I don't have time to look up how to add a configuration menu, but this line of JS does have a certain charm to it:
var evil = 0; // need to make this user-settable
You know what to do. If you want true evil, there are some pointers in the comments. For YouTube videos embedded from other sites, the best I can kludge for now is link to the video's original YouTube page. If someone would like to write a routine to snarf that page with XMLHTTPRequest and yank the necessary arguments out, I would love to add it. (Insert five-page think piece here about the lost dream of MIME and the sad fact that the rise of Web 2.0 has been driven more by the fact that native installation is irreparably broken and pointless anyway on most PCs than it is by the fact that JavaScript actually works now and the implications of this for the Free Software movement especially in light of the fact that we are still human beings who occasionally do social things like sign up for Twitter even though they're running on some proprietary code base.)

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

9 July 2007

Biella Coleman: La Rogativa

Last night I came across an amazing photo of one of my favorite spots in Viejo San Juan, Puerto Rico, La Rogativa. It is one of the *best* spots to sit, at night, after a walk and few drinks, and watch the lights dazzle in front of you till the sun decides to rise. You will not be disappointed, especially during a winter’s night when there just may also be a slight touch of cool breeze to caress your skin. Here is the story of the statue:
A modern bronze statue of the Bishop of San Juan and three torch-bearing women stands in the Plazuela de la Rogativa. A good spot for scenic views, due to is fine location overlooking the bay. The beautiful bronze statue is the work of Lindsay Daen, created in 1971 to mark the old city’s 450th anniversary. Plazuela de la Rogativa (plaza of the procession) features a modern sculpture depicting a procession of religious women and a bishop. It commemorates an event that took place on the site in 1797. During the spring of that year, a fleet of British ships led by under Sir Ralph Ambercrombie sailed into San Juan Bay, meaning to launch an assault on the city and take control of the colony. When the attack was foiled, they undertook a naval blockade of San Juan, hoping to starve the residents into submission. As the town s people began to despair of any help from soldiers garrisoned in the inland towns, the governor ordered a rogativa, or plea, to ask the saints for assistance. The women of the town formed a procession through the streets, carrying torches and ringing bells. The British, hearing the commotion and seeing the moving lights, decided that reinforcements had arrived and quickly sailed off.

Gustavo R. Montesino: Summer of Code mid-term report

I. Introduction

Today, the mid-term evaluations of the Google Summer of Code starts. It means it's a good for a comprehensive summary of what I've done so far.

For those who don't remember, My GSoC project is the Bug Triaging and Forwarding Tool, whose aim is to help triaging of Debian bug reports. On my proposal, I had included the following timeline:

During the proposals evaluations and the community bounding period, it was pointed to me that there's already a lot of good tools to handle bug reports, so I've changed this a bit and already started to work on BTS-Bugzilla interaction, which seems to be the more novel part of the
tool.

The development has been fragmented in three modules: btsutils, bzutils and bug-triage.

II. btsutils

The btstutils is a python module to interact with the Debian Bug Track System. Currently, it can query the bts by bug number, package, source package, maintainer, submitter and usertag. For each bug, it returns bug number, package, summary, status, severity, submitter and tags. Support for returning usertags is under way.

Ths btsutils can use html or soap to access the bug data, and has also a backend-agnostic module wwith tries the best method and, if that fails, tries the other.

Steffano Zacchiroli has offered me to include the btsutils on the debian-bundle, a bundle of python modules for dealing with Debian infrastrcture. I'm very excited by this idea, and believe that if all or at least some of the Debian tools which interact with BTS end using a standardized module for access, this might end up being the major contribution of my GSoC project for the Debian community.

III. bzutils

The bzutils is similar to the bzutils, but is to interact with bugzillas instead. Currently it can do queries based on GNOME's bugzilla boogle and the more generic boolean charts. The later works (at least) on GNOME, KDE and standard bugzilla (i.e., landfill). For each bug, it returns bug id,
product, component, status, resolution, reporter, assignee, summary, priority and severity.

IV. bug-triage

The bug-triage is the Bug triaging and forwarding tool. It's being developed using python, gtk and glade.

Currently, it can query the BTS using any of the btsutils' supported fields (even though the usertags aren't really accessible through the interface yet). It can also launch one of the returned bug reports in a web browser.

Integration with bugzillas is under development. It already has an interface to establish links between Debian packages and upstream bugzilla's address, product and component. The next steps will be to add an upstream button in the toolbar/menu and make it show the bugs selected through these info, allowing the user to mark the bug as forwarded to one of them.

V. The future

After that, I'll work on these features (in no particular order): filling a new upstream bug using the Debian bug data as a starting point, more advanced filtering options to filter the upstream bugs (such as filtering by words in the bug summary, and maybe through backtraces if available) and more ways to manipulate the BTS through the interface.

To be sincere, it seems this project won't be as advanced as I would like on the end of the GSoC. There are some new, unexpected (and good ^_^) things going on my life, which are taking some of the time I expected to dedicate to GSoC, which means I'll likely keep the current pace until the end of the project (I expected to increase it during July). Even so, I believe the
project is going on a good path, and I hope it'll be very useful for the Debian community.

Lucas Nussbaum: Easy migration of a service to another, totally different host with iptables

I’m tired of googling for this every time I need it, so I’m blogging about it. Q: How can one redirect all connections to hostA:portA to hostB:portB, where hostA and hostB and in totally different parts of the Internet? A:
echo 1 > /proc/sys/net/ipv4/ip_forward
$IPT -t nat -A PREROUTING -p tcp --dport portA -j DNAT --to hostB:portB
$IPT -A FORWARD -i eth0 -o eth0 -d hostB -p tcp --dport portB -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth0 -s hostB -p tcp --sport portB -j ACCEPT
$IPT -t nat -A POSTROUTING -p tcp -d hostB --dport portB -j SNAT --to-source hostA
Connections are masqueraded, that means that, for hostB, all connections are coming from hostA. So be careful.

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.

Evan Prodromou: 19 Messidor CCXV

Busy weekend, and I haven't taken the time to blog over the last few days as I should have. On Thursday and then Friday, Maj, Amita June and Brian and I went down to the Montreal Jazz Festival, which took place last week. It was a great time -- we went and saw some free acts, including some Dixieland, some Latin jazz, and the awesome Klez Dispensers playing klesmer. We also went to the huge playground and crafts centre for children on-site. It had slides, a big moonwalk bouncy-room, tunnels, a sandbox, and a giant piano that kids can step on to play music. They also had cool drawing and crafts projects -- a neat, active addition. The Jazz Fest is a great place to bring little kids. Amita June loved dancing to the music and playing in the playground. tags:

Quebec City Yesterday and today we spent in Quebec City. Brian hadn't been before, and the old, walled city is on the list of UNESCO World Heritage Sites, so we dragged him up there. It was also the Festival d' t de Quebec while we were there, which was pretty fun. We had no idea the festival was happening, so it was a pleasant surprise. Hell, I have a hard time keeping the festivals in our own city straight. We got rooms at the really nice Hotel Ch teau Laurier just outside the walls near the festival site. It was really nice -- modern, sleek, and pretty affordable (we got a big double-queen room for $150). Then we walked around the Upper Old Town in on-again-off-again rain, and watched some of the street performers. There was a troupe of stilt-walkers dressed like stone angels and gargoyles -- an awesome performance that scared the bejeesus out of Amita June. But as they left she said, "Bye bye, monsters," so I guess they weren't all bad. We had dinner at the cozy Moine chanson, a really nice restaurant just outside the walls of the Upper Old City. Quebec's restaurant scene in this are is, well, pretty dreadful -- lots of mass-production restaurants that serve tourists mechanical food from conveyor belts. The Moine was an accidental find, and it was really a godsend -- pleasant, interesting pan-Mediterranean food. I had grilled sardines (memories of Portugal); Brian had a thoughtful paella and Maj had a roasted vegetables with polenta plate. They also had a choice selection of organic wines. I have preconceptions about organics, I admit, but we had a very tasty and complex organic Douro from Portugal last night that set me back in my seat. We walked home through the music festival just as Nickelback was coming on the main stage. Brian wandered a bit, Amita June and Maj and I went to bed. Unfortunately, that wasn't the last time we were up: AJ woke up vomiting in the middle of the night. She only barfed once, and we're not sure what caused it: whether she overate at the restaurant (she packed away a lot of food), or if she got some sausage or chicken in the couple of cupfuls of Brian's paella she ate. Either way, she was a sad toddler and we were freaked-out parents. Having your child get sick while you're traveling is really scary. You start thinking about helicopter rescue. But she was fine after one big purge, and we all slept well until this morning. Maj got up to change Amita's diaper, and we realized we didn't have any. Not in the hotel room, not in the car. I went out from the hotel in increasingly wide spirals looking for a convenience store, but those that had diapers weren't open on a Sunday morning, and those that were open didn't carry diapers. After a couple of hours (!), I came back to the hotel in defeat. Fortunately, Maj managed to find a diaper in the emergency stash in the trunk of the car. We picked up Brian and drove to another part of town, where we got a tasty brunch on the terrasse and found some diapers at the Jean Coutu drugstore. Brian kept going from Quebec City -- he's heading all the way around the Gasp Peninsula to New Brunswick, Nova Scotia and Prince Edward Island, and coming back to Montreal in about a week. Maj and I drove home on the South Shore -- Amita fell asleep as we hit the freeway and woke up when we pulled into the driveway -- and had a nice afternoon at home. tags:

Seafood windfall On Friday, our friend Sebastian called us with a problem: his sister, who lives in the les-de-la-Madeleine, had sent him too much fresh seafood. It had come out of the sea and been driven to Montreal, and there was too much for him and his family to eat. The fish was less than 24 hours out of the water -- could we help him out? So we ended up with two huge bags of succulent lobster meat and three more of scallops. Oh, man, were they good. On Saturday morning before we left for Quebec City I made up two giant lobster omelets for the four of us to share. They had just huge chunks of lobster in them, and it was the most decadent meal I've had in a while. It was so much, we all lay around on the couch moaning for about an hour. Tonight, I cooked up the scallops. They were gigantic, tender, and fresh, so I pan-seared them in butter and olive oil with salt & pepper and prepped garlic and oregano. I know, that seems too much for such a delicate meat, but it worked out great. I put them on a bed of whole-wheat linguine, arugula, and red peppers. They were really, really good. I don't think I'm going to have seafood this good again for a while. Mmmmm. Thanks, Sebastian! tags:

News in brief from the land of the Free Two Freedom news items: tags:

8 July 2007

Mirco Bauer: Hello World, how small can you get?

Today I was checking how much diskspace is need when a small CLI (.NET) application like gfax is installed. The last 2 years I am optimizing the Mono packages in Debian to reduce dependency chains. Dependency chains can cause a small application to become very big (at least it looks that way) when they are installed, as modern Linux distributions automaticly install all required dependencies. So first I worked against GUI dependencies for non-GUI applications, those are annoying for servers, you don't want to install a X server or other GUI libraries when you only serve webpages using ASP.NET.
Splitting CLI 1.0/1.1 vs 2.0 also seemed to be a very good candidate to split apart, as applications usually are target at 1.0/1.1 or 2.0.
Then I split Base-Class-Libraries that have dependencies on native libraries (via P/Invoke), as those packages must depend on those native libraries, like DB drivers.
Last but not least I split debug symbols in a different package, as those are not needed for normal production usage, and embedded systems don't have much diskspace. The mono-dbg package is 28.2MB in size when installed, that's alot.
The Mono source package in Debian is now building 67 binary packages, but thanks to APT nobody has to care for that, every part is installed when needed. So today I was checking the results of it, how much will a small application download and install?
I am testing with a clean minimal Debian system, that way all dependency chains will show up very easily.
Installing GFax + required libraries today takes 43MB to download and 138MB on the harddisk. GFax is a small GNOME application, it uses libraries like: Mono, GTK#, GNOME#, Evolution#, GConf#.
So someone might say: "of course, it is based on that bloaty Mono virtual machine!", well let's check a different application.
What about a GTK# only application (no GNOME) like graphmonkey + required libraries? That will download 19.5MB and uses 56.4MB on the harddisk. That's alot less, isn't it? graphmonkey only uses Mono and GTK#.
So it's not Mono taking all no diskspace? Well after all my packaging optimizations, it's not Mono smile.png
So how big is a install of a minimal Mono runtime + all required libraries then?
Minimal as in enough to run famous the "Hello World".
It's 2.4MB to download and 7MB on the harddisk, yes you read it correctly, the super monster bloaty virtual machine just needs 7MB. Mono only has glib as dependency which will be replaced by the eglib library some day. After I had this great result, I wondered how big other runtimes are.... like.... Java and Python? The results are interesting...
A minimal Python install takes 3.9MB to download and 13.4MB on the harddisk. Yes, that's almost double the size of Mono, I was surprised too.
So and Java? Here it becomes a bit unfair as SUN's license is not allowing to ship parts of a Java runtime. So the Java package in a distribution is one package. 34.5MB to download and 95.2MB on the harddisk. Yes, that's alot, but thats the smallest install you can get when you want to run anything on it. So, if you want to run Hello World on a virtual machine: use Mono! tongue.png just kidding...
Small runtimes are important when it comes to acceptance and adaption of new technologies, as nobody wants to kill all his computer resources for it. And I often hear the replies on Linux IRC channels, when people ask which software they can use to do $task: "No I don't want o install 100MB just for $task" and they decide to try some other software with less dependencies and less resource usage.
Also for the embedded area, resources are very limited, every MB still counts there. For the completeness of my report, here the naked numbers of other available Java runtimes: sablevm 22.0MB (63.2MB), kaffe 52.2MB (118MB), jamvm 28.3MB (65.4MB), cocoa 28.8MB (66.0MB).

Matt Brown: POSIX/NFSv4 ACL Inheritance Problems

I (as root) have a directory hierarchy that I want a particular group to always have write access to. The files and folders inside the hierarchy are owned and manipulated by a wide variety of diffrent users. Essentially I want to delegate ‘root’ access for a portion of the filesystem to a particular group. My first attempt at implementing this was to use the standard POSIX ACLs that are available for almost every filesystem Linux supports. I recursively set an ACL on the top-level directory to give the group write access to all files and directories that currently exist and then I recursively set a default ACL to give the group write access on all the directories. This default ACL should be inherited by any new files that are created ensuring that the group keeps write access to everything. Problem solved? Unfortunately not. The intricacies of complying with POSIX means that ACLs are implemented as an ACL plus a mask. To gain access to a particular file or directory the user or group must match an appropriate ACL granting the access and the mask for that file or directory must also allow the requested permission to be granted. When you add an ACL to a file or directory, the ‘group’ bits of the standard Unix permissions magically switch from controlling group access to controlling the mask portion of the ACL, effectively providing an upper bound on the permissions that an ACL entry can grant. This prevents legacy POSIX applications that do not understand ACLs from unintentionally granting excessive permissions - arguably a good thing. Unfortunately this also makes it very hard to preserve the ACL granting write access to the ‘root’ group which I legitimately intended to have in place on this portion of the filesystem. Newly created files under the hierarchy generally inherit the ACL as intended, as most applications attempt to create files with as many permissions as possible, leaving it up to the umask to remove undesired permissions. However any file that is copied into the hierarchy without the ‘group’ write bit set, or any file that has the ‘group’ write bit removed via chmod will actually remove the write bit from the ACL mask invalidating the ACL and leaving me back at square one! After a bit of Googling I thought that NFSv4 ACLs might be the answer to this problem, as they are marketed as “very similar to Windows ACLs” and I’m sure that I vaugely recall Windows being able to properly inherit ACLs from parent directories. Unfortunately after downloading the NFSv4 ACL patches and trying all the various mount options I cannot find any combination that will offer the functionality I need. The implementation conforms to POSIX, so it still has a mask parameter and the same problems as the standard POSIX ACLs. The only benefit from using NFSv4 ACLs that I can see is that you have more permissions to grant. So once again, I’m back to square one. I’m hoping that there is some fundamental point that I’m missing as this seems like a very common use-case that I would have thought would be well supported. If a command-line example is clearer to you look at:
http://www.mattb.net.nz/blog/dump/acl-inheritance-problems.txt My current solution is to run a cronjob every X minutes to recursively ‘chmod -R g+w /dir’, however that’s far from optimal as it exposes all sorts of race conditions and just seems ugly! Any suggestions or solutions will be gratefully received.

7 July 2007

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!

Russell Coker: Google is Good for the Environment

Google has just announced the Recharge project. They are converting some of their own fleet of Prius and other hybrid cars to be “plug-in hybrids”, this means that the car can be plugged in to mains power to charge it’s batteries and petrol will only be used as a fuel of last resort. If a car is mostly used for short trips then the petrol use is dramatically reduced - but the car still has the 1000Km range that a full tank of petrol provides! Google is also going to invest $10,000,000 in companies that develop technologies related to hybrid vehicles. If you have some ideas for new technological developments related to power saving then you might want to check out what Google is doing.

Martin F. Krafft: Bircher M esli

Due to popular demand and a related story, I am herewith sharing my recipe for what I consider to be among the best types of food available: the Bircher M esli. As you'll see shortly, I am talking about mush, about a creamy, cereal-and-fruit-based mix of all kinds of ingredients. Its creator, Mr. Bircher designed this M esli to release the contained energy into the body very slowly. Thus, with some M esli in the morning hours, I can easily make it through to dinner without losing blood sugar or feeling down. And from the recipe, you'll be able to conclude that it's also, in fact, quite healthy. My recipe started out from a recipe by Aline's mother, but it bears little resemblance to the original, I've spent two years experimenting on it. No kidding. This also means that you don't have to copy the recipe, but you can freely replace, add, or leave out ingredients to your liking. Especially the ginger, kardamon, and chili aren't exactly what the Swiss would put in there (I almost never use ginger or chili anymore, but kardamon works really well). Without further ado:
martin's M esli
Ingredients (4-6 servings)
  • 1 large banana, mushed
  • 2 apple (not too sour) or pear, grated, but not too fine
  • 1-2 kiwi fruits, cut, not too fine.
  • Optionally a mango or papaya, mushed or cut to small pieces
  • 175g frozen raspberries
  • 125g frozen blueberries
  • 30g ground hazelnuts
  • 30g ground walnuts
  • 500g single-fruit or plain yoghurt (can be low fat; alternatively quark, fromage blanc, cottage cheese)
  • 100-150ml milk or cream (can be low fat)
  • 200g oat flakes, fine
  • several squirts of lemon juice
  • a bit of lemon peel, ground
  • a slush of orange juice
  • kardamon, ginger, grated; chili powder
Preparation
  1. Combine mushed banana and grated apple into tuppaware container, squirt lemon juice and mix to prevent discolouring.
  2. Add yoghurt, kiwi fruits, nuts, lemon peel, frozen berries, and mix.
  3. Stir in oat flakes, use milk/cream and orange juice to balance viscosity, which should be a bit thicker than the fruit yoghurt. Keep in mind that you can always add a bit of milk when eating it, but you can't really make it less viscous later. Also, the oats soak up a bunch of liquid, so it'll be more solid the next morning anyway.
  4. Add kardamon, ginger, chili powder according to taste.
  5. Seal tuppaware container and leave in fridge for several hours.
Now enjoy; the M esli is best if consumed within 3-4 days. NP: Dream Theater: Octavarium Update: because licences suck, I am releasing the recipe to the public domain. Yet, if you make any worthwhile changes, I'd appreciate if you fed them back to me, and if your M esli wins a price, at least note my name in the acknowledgements of your biography.

6 July 2007

Benjamin Mako Hill: Official Ubuntu Book Second Edition

I announced the Official Ubuntu Book roughly a year ago. Several months ago, I wrote this in the preface of the second edition:
As we write this, it is one year since we penned the first edition of The Official Ubuntu Book. The last year has seen Ubuntu continue its explosive growth, and we feel blessed by the fact that The Official Ubuntu Book has been able to benefit from, and perhaps in a small even contribute to, that success.
It's an honor indeed. The first edition received almost universally good reviews and sold very well. Due to the book's success, most of the group that brought out the first edition (plus a few others) reunited to update the text for Ubuntu 7.04 (Feisty Fawn). After months of hard word and waiting, printed copies of the Official Ubuntu Book Second Edition arrived in my office today! They should be shipping out of the online stores very soon. The new version is updated throughout to reflect changes in Ubuntu over the last two releases and to document new features and improvements. Trying to keep a book like this up to date is a great way to learn about just how fast moving Ubuntu is (answer: very). Meanwhile, Edubuntu has blossomed over the last year. Through the work of Peter Savage, we've included a new chapter that deals with Edubuntu in depth. The book is bigger (almost 450 pages!), better, and more up-to-date. It provides a great introduction for those that are uninitiated to Ubuntu or to GNU/Linux and free software in general. We've tried to keep the price down (it is available for $27 plus shipping from most online stores) and should ship almost immediately. Best of all (at least to me), the whole book is released under a free culture license (CC BY-SA). The book is a major improvement on what was already a very solid piece of documentation. Everyone who contributed to the book (the list is too long to put up here) should feel proud. It was a lot of work but it shows. The opportunity to represent the Ubuntu community in this way, and to try to live up the distribution's high technical standard with the "official" branding, is a challenge and a reward that is worth the effort. You can order the book from Amazon or find it in any of many other sources.

Patrick Winnertz: German law

Hey for everybody who doesn’t already know it: The upper house of the German Parliament (Bundesrat) decided today that in germany now programs like nessus and nmap are illegal.. since only hacker will use them. This means that not only the use of that programs is illegal, but having them installed already. Mh… I think I’m now one of the many persons who is doing, when the law is published, something illegal… having nmap (and nessus) installed.
Time to think about emigration to another country, better than this one. Keep hacking! ;-)

MJ Ray: One-eyed iPlayer

So iPlayer, the BBC's on-demand 7-days TV download service, launched as Microsoft-only, despite the feedback to the trial service. They come along to events like hackday pretending to be our friends, but they're really not. It's more BBC Backdoor than BBC Backstage. My IMDB-listed friend Martyn Drake estimates the cost of using iPlayer as at least 215 for GNU/Linux users and you can't do it with free software. It seems to be even more expensive for a Mac.
"The BBC should remain impartial, but they're currently having hot patootie with Bill Gate and his chums in Redmond. They continue to use OUR license fee regardless of our objections to their dimwitted decision to use DRM, and now say they'll review the situation is six months. Thanks, BBC. Thanks a lot. Can I get some of my license fee back to afford these additional costs, please?"
No wonder the Open Source Consortium says they'll complain to the European Commission - it's blatent bundled sales. TV has got away with worse in the past (for example, Channel4-satellite requires you to buy Sky), but the BBC's TV-tax-funded services had been getting progressively freer. This latest reversal of that makes me wonder whether Freesat will be fully-viewable with free software. Also, they're up against another big problem: given a choice between the expensive and inconvenient legal iPlayer and the free and easy illegal torrents (which I'm told have US imported shows earlier), which will users choose? Surely not even the BBC's advertising power will overcome iPlayer's 200 quid bundled sale and auto-delete? Let them know it won't: petition the Prime Minister to open iPlayer. The BBC is a Royal Charter Corporation and should act in the public interest.

Rob Taylor: Introduction to Codethink

As those of you who’ve been a bit more observant may have noticed, I now have a new company - Codethink Ltd. It’s really just starting up, but so far we’ve been doing work on HAL, OHM and Tinymail and it’s been good fun. However I don’t want to go the normal contracting house route of taking on employees to supply demand. This inevitably leads to static power structures and static role assignments which generally seems to lead to inefficiency, conflict and boredom as a company grows. Where I want to take Codethink: In business, I believe the future lies in loosely connected individual contractors, dynamically coming together to attack a project or idea, much as was described a few years ago in the seminal article ‘The Dawn of the E-lance Economy’ by Malone and Laubacher (Though I have to admit I hate the term ‘E-lance’..). Back then a few businesses were started up to try to facilitate this, like guru.com and elance.com, but I think these fail fundamentally as they don’t represent the knowledge of the network - that requires real people who actually know each other. Of course here in open source we implicitly understand the importance of knowing each other’s strengths, the importance of introducing new people to our community and building new expertise. This can only happen in loosely-bound structures, where cost of entry is negligible - quite the opposite of the standard large-corporation model. So with Codethink I propose to act as an agent of change. I plan to provide support and help to groups and individuals who want to strike out on their own. I will use my knowledge of the management, architectural and coding expertise of these individuals to provide the service of assembling teams to attack projects for clients. There needs to be another side to the equation. For this to scale, I also need to invest in bringing new people into our open source world and training them as experts able to strike out on their own. So that means taking on employees of a kind - but with the covenant that I will be expecting each employee to be looking at becoming her own boss in time. So my cards are on the table now - for this plan to work it needs to be transparent by default. It may turn out to be a crazy idea that’ll never work in practice, but lets see. If anyone wants to chat with me about these plans, you can find me at rob.taylor@codethink.co.uk on email and XMPP and I’m always around as robtaylor on Freenode and GIMPNet.

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.

Next.

Previous.