Search Results: "eof"

17 September 2007

Miriam Ruiz: Storing data in $HOME directory

When packaging games, one of the operations I often have to do to the source code is modifying it so that it uses absolute file and directory names instead of relative ones. When coders develop for Windows, or when they develop their games to be able to play them from their home directory, they just would go that way and won’t care about it, but when the idea is installing the files in the system, the Filesystem Hierarchy Standard (FHS) must be respected, and thus things will need to be place in their proper directories. For read-only files, this is not a big deal, all that has to be done is replacing the relative file name in the file opening commands with the absolute one, doing fopen(”/usr/share/games/package/dir/file”) instead of fopen(”dir/file”). I usually prefer to do it like fopen(DATADIR “/dir/file”) and set DATADIR from the Makefile, with a -DDATADIR=\”/usr/share/games/package\” switch added to the CFLAGS, and maybe also setting it inside the code if it’s not previously defined (#ifndef and so). There are some files and directories in which doing this is not possible, because they want read-write permissions. This files include saving the configuration, hiscores, new levels created with the game editor, game saves and so. They might be moved to some directory under “/var/lib/”, and create a new group en the system so that it’s writable, and so on. I don’t like that approach a single bit. I prefer to move all tthat data to the user’s directory. This is not as straightforward as it was for read-only data, but it’s not really that difficult anyway. It would be more or less like:
#ifndef _WIN32
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <pwd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#ifndef _WIN32
char file[PATH_MAX];
char *home;
struct passwd *passwd;
if (!getuid()   !(home = getenv("HOME"))) 
passwd = getpwuid (getuid());
home=passwd->pw_dir;
if (!home) 
fprintf(stderr, "$HOME is not defined.n");
exit(-1)
 
 
if (strlen(home) > PATH_MAX - sizeof("/.package/settings.ini")) 
fprintf(stderr, "$HOME is excessively long.n");
exit(-1)
 
snprintf(file, sizeof(file), "%s/.package", home);
mkdir(file, S_IRWXU   S_IRWXG   S_IROTH   S_IXOTH) == 0;
strncat(file, "/settings.ini", sizeof(file)-1);
#else
char file[21];
snprintf(file, sizeof(file), "./Data/settings.ini");
#endif
FILE *f = fopen(file, "w");
Sometimes you also need that the files are already created, you can check if they already exist with stat(), and then acting accordingly, either creating them from your C code, or maybe triggering a system() shell call whith whatever is needed.
struct stat stat_buf;
stat(file, &stat_buf);
if (stat(file, &stat_buf) == -1) 
int settings_fd = creat(file, O_WRONLY);
close(settings_fd);
 
NOTE: I’ve updated the code to add some suggestions. Thanks to Gon ri Le Bouder and Nico Golde.

10 September 2007

Neil Williams: Homebank vs gnucash - round 1

Homebank has had a few problems getting through NEW due to legacy problems from the original Amiga version (and it isn't ready yet) but I've been trying it out anyway and comparing to gnucash. Bearing in mind that I have done upstream work in gnucash (i.e. I like gnucash enough to tackle the massively scary gnucash source code) and have (almost) got used to the regular dependency hell that it imposes on my sid installation, I'm finding homebank quite friendly.
(See #441110, #441103, #441129 and #441363 for recent examples of gnucash causing dependency hell - again.)
(1:0 to Homebank).
Homebank is closer to the Quicken model with categories but internal transfers between accounts are supported to give some impression of double-entry. (1:1) My main interest is in data import/export because I've long been looking for a way to create invoices from PIM data e.g. in a Palm Pilot or similar. Homebank supports a CSV data import for data that can be handled as an invoice. OK, there's no fancy invoice printing but that doesn't bother me (I never used the gnucash invoice print support) (2:1 to Homebank) - my invoices are all electronic and I have to use the client system (MSDOS!). What I need is to create my own records of the invoices within my financial accounts and Homebank may be able to do that with far greater ease than gnucash. My data exists primarily in my Palm because I take and change my bookings on-the-move. I want to be able to HotSync my Palm through a query interface (pilot-qof) and XSL (datafreedom-qsfxsl) direct into a financial application that can correlate that data with the payments made into my bank by the client and thence with data from my bank statements to prepare data suitable for my tax report.
I'm thinking that if I can get half of the ease-of-use of Homebank into the rigorous double-entry support of gnucash in a small program (gpe-cash), I'll be doing very well.
One limitation of Homebank is the "wording" - the translations appear awkward and unfamiliar but that can be easily fixed. The link between "Archives" and "automated transactions" isn't clear - I think it means "templates" and "scheduled transactions". (2:2)
Homebank can't do all the things that gnucash can do but that is a weakness in gnucash, not homebank. (3:2 to Homebank) IMNSHO, GnuCash tries to do too much and that leads to an oversized and overly complex codebase as well as a dependency list that puts OOo to shame. The graph support in homebank is a lot better than gnucash and that is not the fault of libgoffice, it is entirely down to the choices made by gnucash upstream developers. Homebank graphs are fast, simple, intuitive and informative, displaying useful info at the first attempt instead of having to wade through the Options dialogue in gnucash. (4:2 to Homebank).
If I can work out some simple scripting that combines these external tools into 'HomeOffice' support in Homebank, everyone wins.
I've never liked CSV as a data format and the homebank main files are XML (like gnucash). Unlike gnucash, the XML appears sane and usable for XSLT - raising the prospect of creating reports directly from the homebank data files.
Homebank upstream have been very supportive of the various requests to assist getting Homebank through NEW so I'm hopeful that if an XML import/export method was proposed it could be included in future - especially if the donkey work is done by external tools.
This would tie in well with datafreedom-qsfxsl and datafreedom-perl. Initially, I'll look at XML->CSV - ugly, I know but at least Homebank can import data to be used as invoices; gnucash cannot. (5:2 to Homebank).

At the end of round one:
Homebank : 5 GnuCash: 2.

22 August 2007

Ian Wienand: Fun with <tt>-funroll-loops</tt>

I was playing with loop unrolling, and decided to investigate it a little. The basis is this very simple program which looks like it could do with some loop unrolling.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define SIZE (1500 * 1024 * 1024)
int fn(int *buf)  
        int i;
	for(i=0; i < (SIZE/sizeof(int)); i+=1)
		buf[i] = i;
	return 0;
 
int main(void)
 
        int *buf = malloc(SIZE);
        assert(buf);
	return fn(buf);
 
Firstly, lets have a look at what happens to the function when -funroll-loops is applied. Below is the de-compilation with some comments on what each line is doing.
Non-optimised
                           nop.m 0x0
r14=0                      mov r14=r0
save the "loop counter"    mov.i r2=ar.lc
                           nop.m 0x0
one less than iterations   movl r15=0x176fffff;;
                           nop.m 0x0
initalise loop counter     mov.i ar.lc=r15
                           nop.i 0x0;;
                           loop:
*buf = i, buf++            st4 [r32]=r14,4
i++                        adds r14=1,r14
dec lc, branch if > 0      br.cloop.sptk.few .loop
                           nop.m 0x0
restore loop counter       mov.i ar.lc=r2
Loop unrolled
                           nop.m 0x0
r26 = 0                    mov r26=r0
save lc                    mov.i r2=ar.lc
                           nop.m 0x0
iter / 32                  movl r14=0x2edffff;;
                           nop.m 0x0
setup loop counter         mov.i ar.lc=r14
                           nop.i 0x0
                           loop:
r3 = buf                   mov r3=r32
r8 = 1                     adds r8=1,r26
r25 = 3                    adds r25=3,r26
r23 = buf[3]               adds r23=12,r32
r24 = 4                    adds r24=4,r26
r22 = buf[4]               adds r22=16,r32;;
buf[0] = 0; r3=buf+1       st4 [r3]=r26,4
r21 = 5                    adds r21=5,r26
r19 = buf[5]               adds r19=20,r32
r20 = 6                    adds r20=6,r26
r18 = buf[6]               adds r18=24,r32
r16 = 7                    adds r16=7,r26;;
                           nop.m 0x0
buf[1] = 1, r3=buf+2       st4 [r3]=r8,4
r15 = buf[7]               adds r15=28,r32
r17 = 2                    adds r17=1,r8
r26 += 8                   adds r26=8,r26
buf += 8 (for next iter)   adds r32=32,r32;;
buf[2] = 2                 st4 [r3]=r17
buf[3] = 3                 st4 [r23]=r25
                           nop.i 0x0
buf[4] = 4                 st4 [r22]=r24
buf[5] = 5                 st4 [r19]=r21
                           nop.i 0x0
buf[6] = 6                 st4 [r18]=r20
buf[7] = 7                 st4 [r15]=r16
loop, dec branch           br.cloop.sptk.few .loop
                           nop.m 0x0
restore lc                 mov.i ar.lc=r2
                           br.ret.sptk.many b0;;
We can see that in the first case the loop counter is setup to run 393216000 times (e.g. 1500*1024*1024/sizeof(int)) and a very simple loop of storing the value and incrementing is undertaken. In the second version, the code becomes more complex. We can see the loop now executes 49152000 times (e.g. 1500*1024*1024/sizeof(int)/8) so we can infer that for each loop iteration, 8 values have been unrolled to be written into our buf array. Indeed, when pulled apart we can see the 8 stores (numbers just reflect the first time through). So, is it faster?
$ time ./loop
real    0m1.209s
user    0m0.388s
sys     0m0.820s
$ timme ./loop-unroll
real    0m1.056s
user    0m0.244s
sys     0m0.812s
Yes! Great. We can suggest a number of reasons why, but it would be interesting to get some hard statistics on why this is so. Thanks to the Itanium performance counters, we can. Firstly, lets start by seeing how cycles are being spent.
$ pfmon -e cpu_cycles,ia64_inst_retired_this,nops_retired,back_end_bubble_all ./loop
 547923609 CPU_CYCLES
1179995250 IA64_INST_RETIRED_THIS
    104431 NOPS_RETIRED
 154285534 BACK_END_BUBBLE_ALL
$ pfmon -e cpu_cycles,ia64_inst_retired_this,nops_retired,back_end_bubble_all ./loop-unroll
 311570590 CPU_CYCLES
1327451286 IA64_INST_RETIRED_THIS
 147560435 NOPS_RETIRED
  16088889 BACK_END_BUBBLE_ALL
Now, the Itanium can issue up to six instructions (IA64_INST_RETIRED_THIS) in two bundles of three instructions per cycle (CPU_CYCLES). However, you can't have dependencies between registers within a 3-instruction bundle (and branches and interruptions play havoc) so sometimes you need to pad with no-ops (this is why you need a good compiler). We can work out some figures from this, namely the useful instructions per cycle (e.g. instructions retired - nop instructions / cycles).
TestUseful instructions/cycle
loop1179995250 - 104431 / 547923609 = 2.15
unroll1327451286 - 147560435 / 311570590 = 3.78
This tells us that for each given cycle, the unrolled-loop version is doing more work (ideally we'd like that to be a the theoretical maximum of 6). So what is the unrolled version doing for all this time? Bubbles are where the CPU is waiting for something; a prime candidate is moving data from caches to registers. Bubbles make up (154285534/547823609) 28% of the cycles on the loop version, but only (16088889/311570590) 5% of the time for the unrolled version. This means the processor is spending a lot less time waiting for things to happen with the unrolled loop version. We can drill down further to see what bubbles are occurring.
$ pfmon -e be_l1d_fpu_bubble_all,be_exe_bubble_all,be_RSE_bubble_all,Back_end_bubble_fe ./loop
 14229581 BE_L1D_FPU_BUBBLE_ALL
    97669 BE_EXE_BUBBLE_ALL
     1260 BE_RSE_BUBBLE_ALL
131354866 BACK_END_BUBBLE_FE
$ pfmon -e be_l1d_fpu_bubble_all,be_exe_bubble_all,be_RSE_bubble_all,Back_end_bubble_fe ./loop-unroll
22676169 BE_L1D_FPU_BUBBLE_ALL
   83064 BE_EXE_BUBBLE_ALL
    1263 BE_RSE_BUBBLE_ALL
  718850 BACK_END_BUBBLE_FE
We are now breaking the stalls down to see where they are occuring. L1D_FPU_BUBBLES are essentially related to micro-architectural issues with the caches; things like the L1D cache being overwhelmend and interactions with the hardware page-table walker. BE_EXE bubbles are more simply described a waiting for data to come from caches (or even main memory) to registers. BE_RSE bubbles are related to the register stack engine, and "front end" bubbles (BACK_END_BUBBLE_FE) are where there are not enough instructions coming from the "front-end" for the "back-end" to issue out to functional units in the processor. In this case, the major cause of problems for the simple loop seems to be not being able to get enough instructions through to keep the processor busy. We can try to pin down what is happening in the front-end:
$ pfmon -e fe_bubble_imiss,fe_bubble_tlbmiss,fe_bubble_branch,fe_bubble_bubble ./loop
   27727 FE_BUBBLE_IMISS
    4910 FE_BUBBLE_TLBMISS
98094189 FE_BUBBLE_BRANCH
52615907 FE_BUBBLE_BUBBLE
$ pfmon -e fe_bubble_imiss,fe_bubble_tlbmiss,fe_bubble_branch,fe_bubble_bubble ./loop-unroll
780729 FE_BUBBLE_IMISS
  4858 FE_BUBBLE_TLBMISS
291620 FE_BUBBLE_BRANCH
111089 FE_BUBBLE_BUBBLE
What we can see here is that the increased code size of the unrolled version causes us a lot more i-cache misses, as expected. However, the problem for the unrolled version seems to be the time spent by the front-end dealing with the branch. This is not surprising since there is a rumor that there is a front-end buffer which fills up after 3 repeated cycles with branch instructions; apparently this is a problem addressed in the new Montecito chips (if anyone has one, I'll update this if you send me the numbers). Since we are doing 393216000 branches all within a single bundle its not surprising we've hit it! Just to confirm, we can break-down the BE_EXE bubbles. Remember, BE_EXE bubbles are caused by stalls in the execution phase primarily due to cache latencies or inter-register dependencies. Looking at our code, we don't re-use the same register over-and-over so we would not expect to spend a long time waiting for registers, and indeed this is what we see.
$ pfmon -e be_exe_bubble_grall,be_exe_bubble_grgr ./loop
79601 BE_EXE_BUBBLE_GRALL
  919 BE_EXE_BUBBLE_GRGR
$ pfmon -e be_exe_bubble_grall,be_exe_bubble_grgr ./loop-unroll
76627 BE_EXE_BUBBLE_GRALL
  918 BE_EXE_BUBBLE_GRGR
Therefore in this case, the speed increase isn't coming from better cache behaviour as we might have expected, but greater ability to keep the processor busy with instructions between branches. We can also examine the major events happening with the unrolled case. Here we see BE_L1D_FPU bubbles being the major overhead. On Itanium floating-point avoids the L1 cache (it is too big, and not re-used enough to make it useful) hence the concatenation of the event acronym. These bubbles can be broken down into the following events (measured in two runs, since you can only do 4 at a time).
$ pfmon -e be_l1d_fpu_bubble_l1d,be_l1d_fpu_bubble_l1d_dcurecir,\
  be_l1d_fpu_bubble_l1d_tlb,be_l1d_fpu_bubble_l1d_stbufrecir ./loop-unroll
 9623193 BE_L1D_FPU_BUBBLE_L1D_DCURECIR
     414 BE_L1D_FPU_BUBBLE_L1D_TLB
     282 BE_L1D_FPU_BUBBLE_L1D_STBUFRECIR
$ pfmon -e be_l1d_fpu_bubble_l1d_fullstbuf,\
    be_l1d_fpu_bubble_l1d_l2bpress,be_l1d_fpu_bubble_l1d_tlb ./loop-unroll
      23 BE_L1D_FPU_BUBBLE_L1D_FULLSTBUF
17220177 BE_L1D_FPU_BUBBLE_L1D_L2BPRESS
     425 BE_L1D_FPU_BUBBLE_L1D_TLB
These events expose micro-architectural details, the full extent of which is only gleaned by reading the processor manuals (a PhD in computer architecture probably helps too!). The store buffers are not an issue here -- the caches are more than able to keep up with our few writes. The TLB is also not involved; we have pretty good TLB coverage thanks to the virtual-linear page table and hardware page-table walker. The two clues are DCURECIR and L2BPRESS. Essentially DCURECIR happens when references have to "re-circulate"; this is a side-effect of the data not being available. The L2BPRESS figure suggests why this is so; this event happens when the L2 cache can not handle any more requests. The L2 cache keeps a queue of outstanding requests; when this queue is full (for example, full of long latency requests to get data from main memory) the L2 cache causes "back-pressure" which stops the L1 cache from issuing new requests. This suggests the program is chewing through a lot of data and not using the cache very effectively, which is exactly what we are doing. Pre-fetching hints can help (but as described in a previous entry on hacking Enigma may not always help), but in this case there probably isn't any spare bandwidth to pre-fetch in because essentially no processing is happening. What does all this mean? I don't know, but playing with performance monitors is fun!

21 August 2007

Theodore Ts'o: Thoughts about the Palm Foleo

I looked at the Foleo and played with one while I was at Linux World a few weeks ago, but it is so restrictive in what it can do that I was completely unimpressed. First of all, according to one of the people at the booth, it will only work with a select set of Treo's; mostly the newer ones. A colleague I was with had just gotten a Treo 650, and the person at the booth said that it wouldn't work with that model of Treo. (WTF?) Furthermore, it will only do e-mail (POP or IMAP) by linking with the Treo over bluetooth connection and letting the Treo pull down the e-mail and store it on the Treo. Given that it only has 128 megs of RAM and 256 megs of Flash, it just doesn't have enough storage apparently to run a stand-alone e-mail application, which is a little bit scary. The limited amount of memory is probably why it is using Opera as a web browser, which previous experience on the N800 has largely unimpressed me in terms of compatibility with Web 2.0 sites that aggressively use AJAX or flash. So OK, it's not supposed to be a laptop. But the problem is, for 0.2 pounds more, I can get a laptop. Let's review the critical statistics, shall we? The Foleo costs $499, weighs 2.5 pounds, and has a size of 10.5" by 6.7" by 0.9". As stated before it has 128 megs of RAM and 256 megs of flash, with a SD slot for expansion purposes, and it has a claimed 5-6 hours of battery life. But let's compare that with my IBM X41 which I recently purchased off of eBay for $800. It has 1.5 gigs of memory, and 60 gigs of hard disk. It has two batteries; with the 4 cell battery it weighs 2.7 pounds and delivers 2 hours of battery life, and with the 8 cell battery it weighs 3.2 pounds and delivers 4 hours of battery life. So true, even with the 8 cell battery the X41 is 1.7 pounds heavier and still has slightly less battery life. But you can do a lot more with the X41! Furthermore, the Foleo's weight advantage is somewhat nullified by the fact that you have to bring the Treo around to do certain activities, and the Treo has to be powered on since the Foleo is mostly designed around being a remote large screen for the Treo. At the end of the day it's all about tradeoffs. Perhaps if enough companies created enough killer apps that could fit in 128 meg of ram for the Foleo, it might be useful enough to justifying buying it. I hear for example, that even though the Foleo doesn't have any kind of PIM functionality, a 3rd party ISV is planning on making a product available that will provide calendar and contact functionality that can sync Palm PDA's. No word on how much it will cost or how usable it will be, but with enough applications, maybe Foleo could be useful enough to justify its size/weight. I imagine that these apps will probably be commercial ones, since open source apps like Evolution will probably have difficulty fitting in the Foleo's constrained environment. :-) And, of course, it's a lot cheaper than my used X41 laptop, never mind a brand-new Lenovo X61s, which could run 2 or 3 kilobucks fully outfitted with the 4 gigs of memory and 160 gig/7200 rpm drive. However, as a road warrior, my priorities are not just weight, but functionality. A 2.5 pound solid-state laptop with only 128 megs of memory which massively restricts what I can do is not a good use of the space in my laptop bag. What I'm waiting for is the next generation of the Thinkpad X series which has a solid state disk --- which shouldn't be that far off --- and the elimination of the spinning magnetic media would mean that we should have something with Foleo's battery life without the Foleo's limited usefulness. Sure, maybe I will need to wait another year or two for my perfect laptop (12", 1024x768 LED display, at least 60 gigs solid state disk, at least 2-4 gigs memory, Intel core 2 or follow-on processor, < 3 pounds, > 5 hours useful lifetime) to become available, but the technology to do this exists today; it's just a matter of making it affordable. But given that kind of long-term future, I'm willing to settle for now with either 2 or 4 hour battery life, and a slightly heavier laptop, than to use something today with a desperately slow ARM processor and only 128 megs of memory. The weight/size savings and the increased battery life of the Foleo isn't a fair tradeoff given its very limited capabilities. This is all really too bad, because if Palm is counting on the Foleo to allow it to succeed, I think the concept has some massive shortcomings, much like their claimed LifeDrive product, which didn't last very long. And I really like the Palm company; I still haven't found better PDA functionality on a decade-old Palm design compared to what is available on all of the Nokia phones I've looked at, the WinCE phones/PDA's, the N800, etc. So I want Palm as a company to stick around. But with Treo getting eclipsed by newer smart phones, and the Foleo not getting particularly good buzz by folks reviewing it --- and after I played with it, I have to agree with the majority of the reviewers that this is not the Next Big Thing --- I'm not sure how much longer Palm is going to be around.

20 August 2007

Jeff Bailey: Next stop: Buffalo

Hey'all! We're still in transit on our great trans-continental adventure! Sorry if you've emailed us and we've not gotten back, Internet access is spotty at best on this trip, and who wants to spend their vacation reading email anyway? =)

We just finished a good time in the kitchens of Opus and ConCentric. Angie, Sera, Chris and I all worked well together in a cohesive team, with a minimum of drama. It was really nice to work with such a solid group of people that we could say things like "Dude, I need a nap, can you cover for me?" and there was no problem with the rest of the team trading off.

Leif was an absolute hit at the con. We were able to participate in a couple worships where him singing along wasn't a distraction at all, and he totally loved being passed between people. It does mean that he caught his first cold, but he's doing alright.

There are always the people that I'll miss when I'm gone from there. Alexis was in the kitchen on a regular basis saying hi, Liz was always nearby, Karina with her star maps, lizzie the brit with her piles of energy, the frying-tofu master Geoff seemed to be in the kitchen often. In the kitchen, though, we got to see pretty much everyone so it was a nice chance to connect with people.

The staff was also a very neat set of people. I don't think there was anyone in the Opus staff that I couldn't see actively working hard to pull of great programming. There's always the curmudgeonly part of me that sits in the back corner and can nit pick things to death, but in doing so I wouldn't want to hide that by almost every measure this was a successful Opus. In particular, I was impressed that the staff faced head-on how to handle walk-ins at the staff meeting just before the con started. It was interesting to watch a consensus process work with a group of people who came in from wildly different personal perspectives and to watch people change from varying viewpoints to agree on the compromise that best suited the group.

So what's next? We've spent the night with Andrew from Koolu and will be heading down to Buffalo next to get an van and start on the adventure. We don't know where we're going yet, or how we'll get there, but the idea is to head down to the Creation Museum and then west towards Vegas and the Grand Canyon. On the way, we might see if we can visit Stephanie in Ohio, Sera in Albuquerque, and Karina in Flagstaff.

Peace, Love, Faith and Blessings to all.

David Welton: Hecl, DedaWiki updates

I had a pretty good week last week in terms of doing some open source work. I had the opportunity to do some consulting regarding Hecl, which was pretty cool. Some of the work was fed back into Hecl itself, including the beginnings of a "media" API (video streams, taking pictures with the camera), and some other fixes and updates. I've also been working on it a bit on my own time, adding a Canvas demo to the MIDP2.0 demo application (works in the emulator, haven't tried it on a phone yet), and today I'm going to look at updating some of the documentation that's been lagging the code. In the course of my work, I also happened on a cool idea to speed up the launch of Hecl applications: by creating the widgets as regular widgets in Java, right away, in the startApp MIDlet method, it's possible to get them on the screen quickly. At that point, you can start loading Hecl, and create some Hecl objects to hold the already created Java widgets. It goes something like this:
Form mainform = new Form("Initial Form");
TextField search = new TextField("search:", "", 30, 0);
... load script ...
interp.setVar("mainform", ObjectThing.create(mainform));
interp.setVar("searchwidget", ObjectThing.create(search));
... evaluate script ...
This is a good tradeoff, because it gets something in front of the user right away, and it's not a throwaway like a splash screen. On another front, I've updated some of the code in DedaWiki, to enable email notifications in the comment system, which has percolated into the Linux Incompatibility List, and, with a bit of tweaking, into Squeezed Books. I don't think the code is quite ready for a real release, but by running the incompatibility list on it, it's a great way to give it a thorough shakedown, and I'll attempt to release it sooner or later. Of course, in the meantime, interested parties can get the code out of subversion on rubyforge.

17 August 2007

Eddy Petri&#537;or: 2 of the cross compiling issues...

... I found when trying to cross compile rrdtool already have a fix.
I have these patches myself and they work. There shouldn't be any reason for the native build to fail.

The rrdtool issues [1] were not reported since:
  1. I am not sure if is really a bug (IEEE math test bug) and
  2. I don't have a clean fix (link-with-build's-library issue).



[1] look for 'xmerging rrdtool, the bugs don't stop'

15 August 2007

Simon Richter: VCS merges

Matthew, the situation you describe can be avoided by creating an explicit relationship between the values that need to change together, either by computing those that can be computed, or by having the build process error out at some point if you did something wrong. For example, I can use either char const *const keywords[] =

    "foo",
    "bar"
;
unsigned int const num_keywords = sizeof keywords / sizeof *keywords;
(for more correctness, use "(&keywords[1] - &keywords[0])" as the divisor), or you can explicitly tell the compiler how many keywords you expect, using unsigned int const num_keywords = 2;
char const *const keywords[num_keywords] =

    "foo",
    "bar"
;
What we lerned in our database courses is true in other places as well: redundant information has a habit of going out-of-sync, so we should avoid it (=> db normalisation), or create a connection between the redundant bits (=> foreign keys).

22 July 2007

Matthew Palmer: Why I'm Afraid of Flying

I'm happy to admit it -- I have a fear of flying. Strangely enough, though, my anxiety levels peak somewhere between 3 hours and 30 minutes before the plane takes off. Once we depart the terminal building, I'm fine -- the takeoff, cruise, and landing hold no fear for me, in fact I rather enjoy it. When I have the money and time, I plan on learning to do it for myself. The thing that does freak me out, though, is aptly described in this article. The idea that I could possibly suffer a similar fate, or worse, concerns me. The arbitrary nature of security screenings, and the fact that I cannot, through my own actions, ensure that I will not suffer at the hands of a security service when I have done nothing wrong really scares me.

28 June 2007

MJ Ray: Comments about another W3C WG and WGs in general

Alex Hudson commented:

"Similar comments about another W3C WG: http://ln.hixie.ch/?start=1181118077&order=-1&count=1 W3C should be about authoring material for the web. It seems at the moment, they're more concerned with the stuff that happens after authoring - e.g., how stuff relates in "the semantic web". IMHO we still don't have any powerful tools for authoring either, so the idea that authoring tools will automate many of the "bolt on accessibility" tasks is pretty naive."
After implementing pingback, I have some respect for hixie. It's disappointing but not surprising to read those comments. Not sure what is meant by powerful authoring tools there. My tools are powerful, but I know they're not easy for new users. As I'm getting old and cynical, I'm not sure whether power tools can ever be correct and truly easy - just look at the pigswill spewing out of some Web 2.0 sites. niq sent me a link to the WCAG Samurai Errata and commented:
"The problem with WCAG 2, as with WCAG 1, is precisely that it's a Work of Committee, and seeks to represent too many irreconcilable viewpoints and egos. In some cases, even the ideas behind it are inconsistent. Many (myself included) regard accessibility as being about ensuring a reader with a physical disability can make use of a site (think Steven Hawking). That's also what HTML is designed to support. Others are concerned with the mentally impaired, also a worthy cause, but one that becomes counterproductive when its advocates fail to distinguish between a site that's inherently inaccessible because it presents a complex and challenging subject, and one that's unnecessarily difficult due to poor presentation. Add the two together, blend in some stupidity, and you get "accessible" sites full of classic "friendly" little illustrations like a "helpful" government booklet, and a horribly intrusive "alt" to explain each pointless "ethnic mummy and child" picture."
I think a Work of Committee could be useful, as long as you have the right committee. Thinking about that, I found the group membership list and I'm not sure that's the right committee. For example, I think the ex-Adobe Google-worker must surely have an irreconcilable conflict of interest (inappropriate use of Adobe's Flash and PDF formats and Google's Web Apps have done more than many to harm accessibility in the past IMO), yet is a leading light of WCAG 2.0 - maybe that's why it's gone so dark? Update: Thijs Kinkhorst comments:
"As I read in the draft, suggestions are still possible until the 29th, not the 27th of June."
I'm sure that's different to the email which started me writing this, but please go comment and see if we can make WCAG-2.0 useful.

26 June 2007

Benjamin Mako Hill: Joining the FSF Board of Directors

When I was 12 years old, I discovered free software. That discovery changed my life and I've never recovered. Over what is now more than half of my life, I have looked to the Free Software Foundation for vision, guidance, and an example of a free world and I have rarely been disappointed. The list of directors of the FSF -- Richard Stallman, Eben Moglen, Lawrence Lessig, Henri Poole, Jerry Sussman, Hal Abelson, and Geoffrey Knauth -- doubles as a list of some of my greatest heroes and role models. As such, I lack the words to describe how it feels that, just yesterday, I was elected to the board of directors of the Free Software Foundation. With Moglen having stepped down I have staggeringly large shoes to fill. I'm more than a little intimidated. At 26 years old, I suspect that I'll be the youngest person on the board by quite a bit. This means I'll have to try and make up with hard work and passion what I lack in experience and wisdom. It's a challenge I look forward to. With free software becoming increasingly successful and widespread, we've already begun to see push back. I suspect that in the next years, we'll see much more. We reaching the dangerous part of the, "first they ignore you, then they laugh at you, then they fight you, then you win" progression. I'll do what I can to defend freedom until we've won. In order to ensure that I have the time necessary, I'm going to be resigning from the board of Software Freedom International and will consider reducing and resigning some of my other commitments as well. If you want to support my work with the foundation, you can become an associate member.

24 June 2007

Mike Hommey: Playing more with LVM, LUKS and the device mapper

Following my previous entry about playing around with LVM, LUKS and the device mapper, I documented myself about internals involved in pvmove, which is more of a challenge, considering there is no such documentation. I could find no useful documentation for either the device mapper or LVM. A bit of good old UTSL later, I could elaborate how to do what I wanted, and realized it was even possible to do in shell script. So here you are : a shell script to transform an LVM physical volume to a LVM over LUKS physical volume,. I’ll detail in between how it works. As the previous script, use at your own risk, it comes with no warranty.
Note you theorically can still access the filesystems underneath without problems. It’s an in-place and live conversion. Also note this is more a proof of concept than a proper, risk-less and well-written solution.

set -e
dev=$1
luks=$(mktemp)
cryptdev=$(basename $dev)_crypt
pvsize=$(pvs -o pe_start,pv_size --units s --noheadings --nosuffix "$dev" awk ' print $1 + $2 ')
devsize=$(blockdev --getsz "$dev")
mchunk=8
The script takes the physical volume device to convert as an argument. Note there is no check for the validity of its value.

dd of="$luks" seek=$devsize count=0 bs=512 2> /dev/null
luksdev=$(losetup -f)
losetup "$luksdev" "$luks"
trap "losetup -d \"$luksdev\"; rm -f \"$luks\"" EXIT
Next, we create a sparse luks file the same size as the device (in case luksFormat would use the size somehow, but I believe it doesn’t), and a loopback device on this file. The trap is here to avoid leaving the loopback device and the file when an error occurs later (though during the conversion itself, it will be pointless).

cryptsetup luksFormat -q "$luksdev"
cryptsetup luksOpen "$luksdev" $ cryptdev _real
read start length crypt format key IVoff cdev offset <<EOF
$(dmsetup table $ cryptdev _real)
EOF
We create a LUKS device, so that we can get the encryption key ($key), and the size of the LUKS header ($offset). Note you need to add –showkey to the dmsetup table command on sid.

if [ $(expr $devsize - $pvsize) -lt $offset ]; then
  echo Not enough free space after LVM physical volume
  cryptsetup luksClose $ cryptdev _real
  exit
fi
Check we have enough space after the LVM physical volume to offset everything by the size of the LUKS header. If not, you can still try again after you reduce the size of the LVM physical volume by an extent.

if [ $(expr $devsize % $offset % $mchunk) -gt 0 ]; then
  echo Last
  cryptsetup luksClose $ cryptdev _real
  exit
fi
This is another check to avoid surprises at the end, when dealing with the last chunk. As the script is written for the moment, it doesn’t support cases where this last chunk is not a multiple of $mchunk. So we need to abort in these.

read major minor <<EOF
$(stat -t "$dev" awk ' print $10,$11 ')
EOF
maps=$(dmsetup deps awk -F: "/\($major, $minor\)/ print \$1 ")
dmsetup create $cryptdev <<EOF
0 $length linear $dev 0
EOF
dmsetup reload $ cryptdev _real <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume $ cryptdev _real
for map in $ maps ; do
  dmsetup table "$map" sed s,$major:$minor,/dev/mapper/$cryptdev, dmsetup reload "$map"
  dmsetup resume "$map"
done
Here, we create the dev_crypt device mapper that is our fake LUKS device, which starts as a simple linear mapper and will end as a complete crypt mapper. This fake LUKS device is inserted as an intermediate mapper between the LVM device mapper and the real device. So, the LVM device mapper will have this fake LUKS device as backend, and, at the beginning, the fake LUKS device maps linearly to the real device. Note we look for all device mappers using the real device as backend before creating the fake LUKS device to avoid finding the fake LUKS device in the list. Also note dmsetup reload only loads a new table in the INACTIVE slot, and dmsetup resume makes this inactive table LIVE.

cursor=$length
chunk=$offset
while [ $cursor -gt 0 ]; do
  cursor=$(expr $cursor - $chunk)
  if [ $cursor -lt 0 ]; then
    chunk=$(expr $chunk + $cursor)
    cursor=0
  fi
  (
  [ $cursor -ne 0 ] && echo 0 $cursor linear $dev 0
  echo $cursor $chunk mirror core 1 $mchunk 2 $dev $cursor /dev/mapper/$ cryptdev _real $cursor
  [ $cursor -lt $(expr $length - $chunk) ] && echo $(expr $cursor + $chunk) $(expr $length - $cursor - $chunk) crypt $format $key $(expr $IVoff + $cursor + $chunk) $dev $(expr $offset + $cursor + $chunk)
  ) dmsetup reload "$cryptdev"
  dmsetup resume "$cryptdev"
  chunks=$(expr $chunk / $mchunk)
  while ! dmsetup status "$cryptdev" grep "$chunks/$chunks"; do
    true
  done
done
This is where the main work is done : moving the data around. We actually just let the device mapper deal with the data duplication, $offset blocks by $offset blocks ($offset being the LUKS header size), using a mirror target for the chunk being moved. So our disk looks like the following:

We use the extra dev_crypt_real device (the previously remapped LUKS device) as the encryption backend for the mirror.
I haven’t figured a better way to wait for the end of the mirroring than to do a loop checking with dmsetup status, dmsetup wait doesn’t seem to be very helpful here.
Anyways, this is the part of the script where you don’t want a crash to occur. Because if it does, all you can do is start on a rescue system, and try to find where the encrypted part of the disk start to setup a device mapper by hand.
And you’d better have the luks temporary file in a directory that is neither in RAM (think tmpfs) nor in the LVM you are converting (/tmp in a default etch install is, for instance ; note the script works nevertheless fine in this case). Also note the trap will remove the luks temporary file if the script exits…

dmsetup reload "$cryptdev" <<EOF
$start $length crypt $format $key $IVoff $dev $offset
EOF
dmsetup resume "$cryptdev"
dmsetup remove "$ cryptdev _real"
dd if="$luks" of=$dev count=$offset bs=512 2> /dev/null
Final steps of the conversion : our dev_crypt device becomes a full LUKS volume, so we can remove dev_crypt_real and add the LUKS headers at the top of the device we converted. At this moment, the LUKS volume is setup just as if it had been setup by cryptsetup. For LVM to recognize the change properly, you need to run pvscan. Once you ran it, you can do whatever you want with LVM. Now, you may want to add the following to your /etc/crypttab file:

$cryptdev $dev none luks
i.e. hda5_crypt /dev/hda5 none luks if the device was /dev/hda5. And if the LVM volume you converted contains your root filesystem, you should run (for Debian systems):

update-initramfs -u
I tested this successfully under qemu and will give it a shot on my laptop some time soon. Now, because I had a hard time not finding much about the mirror target of the device mapper, here is what I could gather about it. The target syntax is as follows:

<logical_start_sector> <num_sectors> mirror [ core disk ] <num_params> <param> ... <num_mirrors> [ <destination > <start_sector> ] ...
logical_start_sector, num_sectors, destination and start_sector have the same meaning as in other targets.
core and disk are two different log types (to track differences between mirrors), respectively in memory and on disk.
num_params and params depend on the log type: num_mirrors is the number of mirrors and for each mirror, we have a pair destination and start_sector. [ Update: after a quick look at the device mapper source code in Linus’s git tree, updated the mirror target description ]

20 June 2007

Mike Hommey: Playing around with LVM, LUKS and the device mapper

I finally decided myself to switch my laptop to using a LVM over LUKS setup instead of LVM alone. The problem it involves is that there is currently no way that I know to do this in-place. I do have an external disk on which I could pvmove everything and back, but that would not be very challenging ;). So I started wondering how doable that would be. LUKS has a 1032 sectors (a sector being 512 bytes) overhead in which it store the LUKS header. Following the header, encrypted data just takes as much space as its decrypted counterpart, linearly. So all it would take to do in-place LUKS conversion would be to move data by 1032 sectors, and encrypt it. Which means the main problem is to have 1032 sectors free after the current volume. Fortunately, LVM doesn’t take up all the space on the partition a physical volume is setup, except if you’re unlucky or created partitions specifically so that it uses all the space. Because LVM physical volumes use the space by big chunks, 4MB by default), if the size of the partition is not 4MB aligned (modulo the LVM header), you have some free space between the physical volume end and the partition end. We thus need this free space to be greater than 1032 sectors. On my laptop, there is more than 1.8MB free there, so there would be no problem.
Note the debian-installer seems to do more than a simple cryptsetup luksFormat, as LUKS volumes it creates have an overhead of 2056 sectors instead of the 1032 sectors I got creating a volume by hand. Next problem is how to move the data and encrypt it in-place. Bonus points if that can be done without unmounting the filesystems. My first guess was to play around with the device mapper and a specially crafted FUSE filesystem to create a fake LUKS volume that could be half encrypted and half not, and would evolve, with time, into a fully encrypted LUKS volume. Since I didn’t know much about the device mapper, I looked at it a bit, and discovered a FUSE intermediate would be unnecessary: not only can you remap on-the-fly (which I already guessed was somehow possible, considering how LVM can do it, though I didn’t know much about the interaction between LVM and the d-m), but you can also mix dm-crypt and linear chunks in the same d-m table. It also appears LVM over LUKS has an overhead that is actually not necessary. How sad both use the device mapper but yet can’t do an efficient setup with it. When you setup LVM over LUKS, you open a LUKS volume, which will create a dm-crypt device mapper, and use this device mapper as the physical volume for LVM. Logical volumes created with LVM are actually device mappers using the physical volume as destination device. When you access a block on an LVM logical volume, your access is first mapped through the LV device mapper and then mapped again through the dm-crypt mapper. So it goes through 2 device mappers, but it could do with only one: the linear mapping used in most of the cases with LVM could be replaced by crypt mappings, that are just as linear, but also handle the encryption/decryption part. Playing around under qemu with a freshly installed etch system, I was able to implement this and came up with the following script. It should work with most setups, but use at your own risk, it comes with no warranty.

MAJOR=$(awk '/device-mapper/ print $1;exit ' /proc/devices)
dmsetup ls --target linear while read map extra; do
  TABLE=$(dmsetup table $map while IFS=" :" read start length linear major minor offset; do
    map2=
    if [ "$major" -eq "$MAJOR" ]; then
      IFS=":" read map2 extra <<EOF
$(dmsetup info -c --noheadings -j $major -m $minor)
EOF
    fi
    if [ -z "$map2" ] [ $(dmsetup table "$map2" wc -l) -gt 1 ] [ $(dmsetup table --target crypt "$map2" wc -l) -eq 0 ]; then
      echo $start $length $linear $major:$minor $offset
    else
      IFS=" " read cstart clength crypt format key IVoff dev coffset <<EOF
$(dmsetup table "$map2")
EOF
      echo $start $length crypt $format $key $(expr $IVoff + $offset) $dev $(expr $coffset + $offset)
    fi
  done)
  if (dmsetup table $map; echo "$TABLE") sort uniq -c grep -v "^ *2 " > /dev/null 2>&1;
  then
    echo Diverting $map
    dmsetup reload $map <<EOF
$TABLE
EOF
    dmsetup resume $map
  fi
done
[ Update: There was a dmsetup resume missing in the script ] After running this script, you should be able to run cryptsetup luksClose on your LUKS volume. Once you’ve done it, pvdisplay and other LVM tools will show you nothing, because the physical volume will just have disappeared… but everything will still be in place. Note that if you leave the LUKs volume open, you’d better be careful NOT to do operations with LVM (such as pvmove) because it could break everything. Note that on sid, you would need to add a –showkey option into the $(dmsetup table "$map2") line. This option is necessary for dmsetup to display the encryption keys. I wonder if LVM upstream would consider supporting LUKS volumes directly… Anyways, back to the in-place conversion to LVM over LUKs. The idea would be to: If I got it all right, both LUKS and LVM should be believing they have done this setup themselves, so unmounting, lvchange, etc. should just be fine. It might be necessary to regenerate the initramfs, though. I’ll tell you when I fuck up my hard disk try it. To be continued…

7 June 2007

DebConf team: Wireless setup for DebConf7 (Posted by Holger Levsen)

Only in the beginning of May it became clear that we need a new wireless sponsor this year, which quite quickly was found: www.freifunk.net, which is a german grassroot movement, connecting people and communities with mesh networks. As some of them are also upstream OpenWRT developers, we didn’t only get 19 accesspoints, but I also got quite some intensive training, which resulted in this wikipage with quite extensive documentation and a nice 3D map, how+where+why to place accesspoints. So we’ll use the Kamikaze version of OpenWRT, whereever possible. Despite it’s name, Kamikaze is the new stable release of OpenWRT, the successor of WhiteRussian. The accesspoints will be simply running in bridge mode (and using DHCP to get their IP and not running a DHCP server themselves) and provide unencrypted wireless (authentification via chillispot, you’ll have to login once via a webfrontend, then your MAC address will be recorded and you don’t need to login again) on the ESSID DebConf7. We’ll have 802.11b+g everywere and additionally 802.11a in some places. We calculated that for Teviot we’ll need approximatly 15 accesspoints and three extra for the hackcenter we’ll be using at night. As we got 19 from freifunk, we should have enough. But I like to have some more, to be on the safe side and to be able to replace the least powerful ones with better ones. If you can bring an accesspoint that runs OpenWRT, please send a short mail to debconf-infrastructure@lists.debconf.org. We prefer OpenWRT, so we can easily include them into our monitoring with munin and because it’s a PITA to deal with lots of different web interfaces for administration (and look up lots of different manuals on different webpages…). If you really want to bring an AP which doesn’t run OpenWRT, make sure the config described above is possible and please pre-configure it like that. You can check if your accesspoint can run OpenWRT, a modell with broadcom or atheros chips would be best, simply because I already have preconfigured images. Alternativly, the above mentioned wikipage has instructions how to build an image. (And I have a build environment on my laptop. But that’s easy to setup.) On a personal note, I intend not to be much involved in the wireless setup this year after unpacking the hardware, there is a nice admin team this year and I want to concentrate on the video team and our work there. And last but not least, but again: don’t just plug your AP into the network in Teviot. God might kill a kitten, and we might loose our uplink if you do :-)

26 May 2007

Evan Prodromou: 5 Prairial CCXV

Incredible day here in Montreal. The temperature got over 31C today -- about 88 F -- which made for a steamy, jungly day. Remember how I said we had predictions of snow flurries two weeks ago? Things change quickly. Of course, hot weather and high humidity are a recipe for smog. Add on top of that the fact that Montreal is in the middle of a public transit strike, and you've got a serious air quality problem. Fortunately we should have some rain this weekend to shake that out. tags:

EC2 I spent a big part of my day twiddling around getting a nice Ubuntu server running on Amazon Web Services. Amazon's EC2 is an innovative server-provisioning API; beta testers for EC2 can build or tear down servers for any purpose in a few minutes using EC2 and Amazon S3. I wrote a few years ago, in a widely-reproduced email, a reply making fun of Jeff Bezos and Amazon's supposed innovations. But let me be frank: Amazon Web Services are a shithouse crazy idea. I think that Jeff Bezos must have been a complete nutjob to bet the company on these zany technologies; I also think it's brilliant, and it's going to change the way we think about using computers. I included EC2 in Ten Web 2.0 APIs you can really use. I think that decision was really justified. My EC2 instances now run Ubuntu Feisty Fawn; lighty, MySQL and PHP. It seems to be a winning combination; I'm looking forward to using EC2 for a production Web or database server. tags:

rel-edit I mentioned already the great work that AboutUs.org is doing to organize a Universal Wiki Edit Button. I decided to kick in on the machine-readable side and proposed a rel-edit microformat. So far the microformats-discuss mailing list has been pretty positive on the idea, but I'm going to wait a few days before posting a draft on the microformats wiki. tags:

Salt I just finished reading Salt: A World History, a nice non-fiction book by researcher extraordinaire Mark Kurlansky. The book covers this important mineral, its importance to human life, and the many ways to extract it to make it available for us. The book covers mummification in ancient Egypt, salt taxes in China, fish sauce in Vietnam, and Mahatma Gandhi's great salt march in India. It's so comprehensive that it can really make your head spin; but it's also exciting to see world history refracted through these whitish crystals. I think it's a great book, and I'm looking forward to reading Cod: A Biography of the Fish That Changed the World, by the same author. But we just got Everything is Miscellaneous from Amazon this week, so I think I'll be digging through that before I get to Cod. tags:

reCAPTCHA I heard about recaptcha via Hugh's article about same. Brilliant idea; why didn't someone think of this before? (Update: it was about 5 minutes after I posted this that I realized, "Hey! That can't work!" So I went back and re-read the docs on reCAPTCHA again. Now I'm even more impressed.) tags:

I want to ride my I've been thinking of picking up a bicycle for a few weeks now, as the weather has cleared here in town. So today I went up to Garantie Bicycle on rue Marie-Anne and bought the cheapest damn bike they had that wasn't made specifically for pre-pubescent children. Woohoo! The last time I had I bike, I lived in San Francisco. It was a beautiful cherry-red Cannondale hybrid -- with that great fat Cannondale tube, but light enough that I could lift it with one finger. I rode it around SF a lot, and took it out for trail biking on weekends in Marin County and the Peninsula and even the Sierra Nevada. It was a tough bike to ride, but once you got used to it it was a dream to take up hills. But that bike was stolen at Burning Man 2001, during the actual Burn. It's a classic mistake: professional bike thieves go to Burning Man each year to snag bikes left unlocked by tired and idealistic Burners, especially at times when camps are left empty, like during the Burn. To be honest, it was kind of a relief: I'd already moved out of my apartment and was planning a trip around North America, and I didn't have room in my Citro n DS for a bike. Nor in my storage locker at the weird and wonderful Sunshine Storage in Oakland. But it was too nice a bike to throw away or give to one of my no-good friends, who were mostly too short for it anyways. So bicycle theft was the best solution. Sam Phillips had his bike stolen at the same time. The bike thieves left a lot of cheapo bikes around our camp. They liked mine and Sam's, though. Anyways, my new bike was quite inexpensive, and it weighs a metric ton. It's built like you're supposed to drive trains over it. I could never, ever carry it up a steep and muddy hill, and I wouldn't bother. Fortunately for me Montreal is really, really flat, so I don't really need to worry about riding this thing up hills. It will look pretty good with a baby seat on the back, though. tags:

21 May 2007

Evan Prodromou: 1 Prairial CCXV

I just got back from taking Zach Copley to the airport, and for the first time in a few days I'm sitting in front of my desktop computer again, trying to get back on track. I think it's probably a good idea to get my notes about RoCoCoCamp down on electronic paper while the experience is still fresh in my mind. (I wrote about the first day in Journal/29 Flor al CCXV). Saturday morning I got up considerably later than I had the day before, and I took my time getting to SAT. Which was OK, since things went much smoother in the morning. The only really annoying thing about Saturday was that I had to wash about 50 cups by hand -- we'd run out of clean cups, and I couldn't figure out how to run the dishwasher. It didn't take long, but it meant that I had my head down in the sink as people came in and didn't get to spend as much time talking to them. I was glad to hear that people had a good time going to L'Utopik on Friday night. Apparently a few people who'd flown in late on Friday got a chance to meet up with the experienced crew at L'Utopik, so they were well-prepped for Saturday. Probably the biggest buzz of the pre-sessions was SJ Klein's pair of functional OLPC laptops. They were cute and fun -- I got a few minutes to play with them, and I enjoyed the interface tremendously -- although it took me a few tries to open it. People were fiddling with them throughout the day -- including Amita June, who came late in the afternoon -- and Tristan P loquin even blogged about them. My first session was about wiki and other technologies, which I titled Wiki And.... (I borrowed the name from Last Exit to Brooklyn, in which it seems no-one eats anything but "coffee and".) My main point was that a) wiki people tend to overuse wiki where other software tools may be more appropriate and b) we need to be careful with impedance mismatches when using wiki with technologies with other cultures behind them. Wikis and blogs mismatch; wikis and forums mismatch. You need to work out ways to make them work culturally. As a proof-of-concept that there are ridiculous applications for wiki, I created in about 3 minutes before the session the wikiclock. It's a computer clock that runs on wiki technology: the time is kept up-to-date by human beings editing the page, rather than with software. I was so pleased with myself that I twittered about it, and from there it's taken on a life of its own. The clock is implemented on the amazing minimalist system pageoftext.com. I heard about p.o.t. from Liz Henry's April report from Palo Alto Wiki Wednesday, and I think it's totally great. It's a cross between a pastebin and a wiki -- like an open-edited ImageShack for text. Brilliant. The second session I did was a hyper-focused one on a particular Semantic Web problem. Both Wikitravel and Open Guides have tons of information on "places" in various cities. (That is, restaurants, bars, nightclubs, hotels, museums, parks, etc.). It would be good to export our data on these places to each other, so we could possibly keep them in sync. For example, if a restaurant changes its hours , that info could be updated on The Open Guide to London and automatically synched to the Wikitravel page on London. So we went over some ways to do this kind of interchange; we'd brainstormed before about it on the Open Guides' RDF Workshop, but it was good to sit down with Earle Martin and do some face-to-face hacking on the idea. We don't yet have a vocabulary for it, but we'll get something going on the new wikirdf.org site (which also emerged from this session). I had a great lunch with a lot of people from RoCoCo on the terrace at the Bar St. Sulpice, about 8 blocks away on rue St. Denis. The sun was out, it was cool, and we had a very nice time. It was especially nice to see Marcus Bornfreund and Tina Pipers of Creative Commons Canada, who'd come to talk about the PDwiki, a project to collaboratively document Canadian works in the public domain (see Canadian Public Domain Registry Announced). We talked quite a bit about the social challenges of getting a community excited about such a dry subject, but I think we got some good ideas about it. In the afternoon I led a session on MediaWiki. We were lucky enough to have Tim Starling sit in, and he told everyone about the new developments going on with MW. He's refactoring some very deep parts of the storage and rendering sections of the code, which will result in considerably better reliability, performance, and flexibility. I think it sounds great. I had to work the registration desk for the last session of the day, which was pretty great because I ended up baby-sitting Anoushka Jaroski-Biava for most of the time. But I missed Robin Millette's cool talk about BuzzyBee, which looks to be really fun to play with. We rounded out the evening with music, pizza, and beer at the SAT. tobias.dj played some great dance music, and we had some wiki-collaborative VJ-ing using the SAT's fancy screen systems. All the kids were there -- Mark and Allegra's daughter No ma as well as Amita June. Fun. Sunday morning I didn't have to start coffee until 9AM -- luxury! We had a great Open Space Technology convergence -- a way to turn the discussions of the previous few days into action items for going forward. I did a convergence session on the future of RecentChangesCamp. We had most of the interested parties available (except for the RCC Portland organizers, who had to fly out early that morning). We made some decisions about future RCCs, and we made some plans for next year's RCC -- in the Bay Area (California). Last night we brought back the Keiki gang to our house, since it was great to have them all in Montreal for the event. We did a big brainstorming session on next steps to launching the project, and we also did some graphic design review of potential logos. We have some great designs coming; I'm really happy we got Sarven Capadisli and Bridget to work on the site. I had to crash out at 10:30PM -- Amita and I fell asleep together -- but others were up late talking and thinking. I don't know how they did it -- I was all talked out by the end of RoCoCo. All in all I had a fantastic time -- the event far surpassed my expectations. It was hard -- too hard. I bit off far more than I could chew. But I think we did a good job of establishing Montreal as a technology city -- Wiki City Canada -- in the international mind, and I think we also brought together some really interesting people for some fruitful and productive work. You can see some of the projects that came directly out of RoCoCo on the FutureChanges page -- an ingenious name courtesy of Pm. And there are some indirect ones that we can expect soon. tags:

Cause and solution So, Technorati has a good listing for rocococamp items, but I especially liked Steve Faguy's post: Wiki: The cause of, and solution to, all of life s problems. Steve was an extremely game participant in the event, which I think was pretty incredible. He wrote a good overview of wikis in the Montreal Gazette this year. A funny thing happened on Friday evening during the daily wrap-up known as "Evening News". We had Open Space's minimalist instructions posted on the walls of the SAT, so people would see and remember them. Steve pointed out that the first of Open Space's "four principles" is grammatically incorrect: Whoever comes is the right people. He said, "In the spirit of wiki, I'm going to correct it right now!" And to applause, he got up with a marker and changed the "is" to "are". This stimulated an interesting discussion. One person noted that the "is" is there because possibly only one person could show up for a session, and that's OK. Finally, Brandon CS Sanders stood up and said, "I like 'is' because when we come together like this, we form a cohesive group, however temporary -- 'a people'. So I'm going to change it back." And he did -- to lots of applause, again. Steve came up to me at the end of the night, laughing. "I got reverted! I should have started an edit war!" It was a hoot; he's got a good sense of humour. tags:

11 May 2007

MJ Ray: More Highway Code Cycling

More developments on cycling and the Highway Code: There was a written answer in parliament about the Highway Code which completely avoided the question - cyclists are voting 'no' to its 'Does this answer the above question?' poll. I have. bikeuser wrote about the Highway Code with excerpts and links to me and also linked Eleanor Blair - More Highway Code which mentions the Early Day Motion in parliament with a suggestion that you write to your MP and ask them to sign it. In a comment, Anonymous asked:
"I agree with you that cyclists should have the right to decide that a cycling road seems too hazardous. However, other than that, any reason why cyclists should get to use roads when cycle paths exist?"
Yes. The most important reason is that most cycle paths are built to a very low standard (design speed of 18mph on an unladen hybrid bike) which is unsuitable for commercial carriers and even ordinary road bicycles (what I used to call racers). Even national government suggests to use the road if you want to exceed the design parameters of cycle paths.
"As a general rule, if you want to cycle quickly, say in excess of 18 mph/30 kph, then you should be riding on the road."
Also, cycle paths usually get the lowest priority of all highways at every junction (contrary to national guidance) and are hopelessly badly signposted. Would you choose a bumpy-road that gives way at every piddling side road when you have the choice of a flat, smooth A road? I doubt it - that's the basic form of traffic calming in bypassed villages like Blisworth. There are some cycle tracks I use, but even those are so badly signed, it's taken me weeks to figure them out - and I've been visiting family in this area for years! For example, I don't enjoy riding on the exposed Somerset Avenue dual carriageway and the adjacent purpose-built shared-use path is segregated, with few junctions or pedestrians, but consider the junction complex at West Wick (the aerial picture shows the cycle path, but the roads on the bottom right have changed). It's faster to use the underpasses, cross Churchlands Way into Yew Tree Drive and then use the Summer Lane underpass to reach North Worle, but which way do the cycle route signs send you? Yep, round to the left, across four sets of traffic lights where the cyclists get the lowest priority (and a 'Cyclists Dismount' sign for good measure) and then along a path that level-crosses an estate road completely blind (under construction in the aerial pic, above the roundabout). Oh, and the cycle route map's wrong for that area, just to make it even more confusing. Because of the bad signposts and maps, it's also very difficult to report any problems with cycle paths and tracks to the highways maintenance team. Cycle paths often don't have names and I've sometimes had reports come back with "there is no fault" when it turns out they've looked at the nearby road, not the cycleway. Forcing cyclists to use cycle paths will probably always be the wrong choice, but there's a lot of improvements needed before you can expect many cyclists to use them by choice. Doing so now would be like directing all cars onto unsigned B-roads instead of motorways that exist for the same journey, just because vans and lorries have a bigger need for the motorways. I like having B-roads available for journeys which would be much longer otherwise, but I wouldn't want to be forced off the motorways just because they exist. Even if you're a car driver, write to your MP and object to directing classes of traffic off of roads that are safer than alternatives. Else, if you tolerate this... The bigger question is "why is so much money spent on the cycling equivalent of B-roads?" and I don't know the answer to that. We would do much better to widen roads to add cycle lanes (or allow safe in-lane overtaking by cars), instead of widening the adjacent paths and painting them as shared use.

3 May 2007

Romain Francoise: Xen security (or lack thereof)

Interesting paper by Tavis Ormandy (of Gentoo/Google fame) about the security of various virtualization products; one of the conclusions is that Xen is secure as long as hardware virtualization is not used: Xen's HVM mode uses a QEMU-based emulator to provide emulated devices, and is thus probably vulnerable to QEMU's many security flaws... To make matters worse, this emulator (xen-ioemu) runs in dom0 with ring0 privileges.

I don't use Xen's HVM mode even on hardware that supports it but if I did, I'd be migrating my domains away from it right now. And since QEMU is used in quite a few similar products (KVM, anyone?), this is probably just the start of a long series of headaches.

2 May 2007

Nico Golde: Setting up build chroots on Debian

Note to self: Installing build chroots on Debian quick&dirty (here testing and unstable).

Package: schroot
Description: Execute commands in a chroot environment
schroot allows users to execute commands or interactive shells
in different chroots. Any number of named chroots may be
created, and access permissions given to each, including root
access for normal users, on a per-group basis. Additionally,
schroot can switch to a different user in the chroot, using PAM
for authentication and authorisation. All operations are logged
for security.
.
Several different types of chroot are supported, including normal
directories in the filesystem, and also block devices. Sessions,
persistent chroots created on the fly from files and LVM snapshots
are also supported.
.
schroot also integrates with sbuild, to allow building packages with
all supported chroot types, including sessions.
.
schroot shares most of its options with dchroot, but offers vastly
more functionality.

$ apt-get install schroot cdebootstrap
$ mkdir -p /home/chroot/ sid,testing
$ addgroup sbuild && adduser nion sbuild

$ cat > /etc/schroot/schroot.conf EOF
[sid]
description=Debian sid (unstable)
location=/home/chroot/sid
priority=3
groups=sbuild
root-groups=root
aliases=unstable,default
run-exec-scripts=true
run-setup-scripts=true

[lenny]
description=Debian lenny (testing) 32-bit
location=/home/chroot/testing
priority=3
root-groups=root
groups=sbuild
aliases=testing,lenny
run-exec-scripts=true
run-setup-scripts=true
EOF

$ # the necessary setup apart from binding directories will be done by schroot now
$ # stable chroots are added in the same way

$ cat >> /etc/fstab EOF
proc /home/chroot/sid/proc proc defaults 0 0
/home /home/chroot/sid/home none bind 0 0
proc /home/chroot/testing/proc proc defaults 0 0
/home /home/chroot/testing/home none bind 0 0
EOF

$ cdebootstrap --arch i386 testing /home/chroot/testing/ http://ftp2.de.debian.org/debian/
$ cdebootstrap --arch i386 sid /home/chroot/sid/ http://ftp2.de.debian.org/debian/
$ # you need to add (if you are not using unstable)
   Suite: lenny
   Config: sid
   to /usr/share/cdebootstrap/suites, unfortunatly it wasn't added before the etch release.

$ mount /home/chroot/sid/proc && mount /home/chroot/sid/home
$ mount /home/chroot/testing/proc && mount /home/chroot/testing/home

Et voila
$ schroot -c sid
build:~#

You don't need to be root to execute this and you have your home directory available in the chroot because of the mount bind.

The host used for bootstrapping is automatically added to your sources.list in the chroot but you need an apt-get update to install packages afterwards. Suggestions welcome.

28 April 2007

Adam Rosi-Kessel: Four Cheers for Geoffrey s!

Just recently, Rachele complained about a drop in quality at our neighborhood restaurant, Salute. No sooner did she complain than the restaurant changed name, ownership, and chef. Witness the power of the blogosphere! Geoffrey’s (link, anyone?) just opened this week is the old Roslindale location of Salute, having taken a three year hiatus from its last location in the Back Bay, and the South End before that. Back when I worked in the South End in the late 1990’s, it was one of my favorite lunch/brunch places, so I was delighted to discover they’ve reopened in Roslindale. We were the new restaurant’s first brunch customers ever. They open at 8am, and with a natural alarm clock that wakes us up at 6am (our daughter), we were prompt for the opening. The brunch was great. We shared a “DonutMuffin” as an appetizer. There was enough pleasure in that pastry to equal at least half a dozen commercial-grade donuts. I had a tomato, basil, and fancy-cheese-of-some-sort quiche with a side of fresh cantaloupe. It was a very generous serving with a thick tasty crust (no toast necessary!). I was particularly impressed with the volume of fresh basil, and the juiciness of the cantaloupe. Rachele has vegetarian eggs benedict (also delicious) and Esther had a side of heart-shaped waffles, which was just right for her. The coffee was definitely on the high end for restaurant coffee (which, somehow, seems to go on a different scale from coffee-shop coffee.) Next time I’ll try a cappuccino. All this for only $35 (including tip). The meal was comparable to (but slightly cheaper and more filling than) our other favorite brunch place, Bon Savor in Jamaica Plain. The owner/chef explained that they had moved out of the South End when the rent tripled. He’s keeping prices in the 1997-range, since the rent he is paying in Roslindale is comparable to what he paid in the South End in that era. (Although actually I’m sure other costs have gone up significantly). The Chowhound and Universal Hub folks are also pleased. Roslindale is certainly in need of a good brunch place — although I am fond of the Blue Star Diner conceptually, in practice the service has been poor and the food irregular. We will certainly be making fewer trips to JP for brunch now. The dinner menu also looks excellent, with several good vegetarian options. The chef also assured me the couscous dish is vegan. We were the only people in the restaurant in the opening hour. I predict in a month the place will be packed. If so, it will be proof of this blog’s influence!

Next.

Previous.