Search Results: "cas"

25 November 2010

Michal Čihař: Upgrading OpenWrt

While doing some bigger downloads, my wifi network used to have big problems, seeing tx errors, frame errors on the router. The router is old ASUS WL-500g Deluxe which was running OpenWrt Kamikaze up to now. I was anyway thinking going for something with 802.11a or 802.11n support, so I started to look for replacement. While looking for it and checking what newer boxes are supported by OpenWrt, I noticed, that I can finally try using 2.6 kernel and I should get working wireless as well with free (what was not possible for very long time). I gave it a try and upgraded to Backfire 10.03.1-rc4. And looks there is no need to upgrade hardware right now. No more tx errors, the wireless is much more stable and faster. Thanks to anybody who helped to create free drivers for Broadcom 4306 wireless chip. PS: Upgrading OpenWrt while keeping configuration lead to horrible mess in my case, so I rather did clean install reconfiguring everything and rediscovering all errors I've made in the past.

Filed under: Linux 3 comments Flattr this!

Cyril Brulebois: Debian XSF News

Since people seem to like it, I ll be trying to publish some news about ongoing work on the XSF side, on a (possibly) regular basis. Let s have a look at what happened since last time I blogged about X in Debian, mostly by checking what appeared in my =debian-x mailbox. Debian XSF News #1 What are the XSF plans?

Stefano Zacchiroli: h-index spoofing

Next time you are asked your h-index ... Next time you are asked your h-index, I suggest replying by pointing to related work by Ike Antkare [1].
[1] Ike Antkare. Ike Antkare one of the great stars in the scientific firmament.
April, 2010.
http://membres-lig.imag.fr/labbe/Publi/IkeAntkareSub.pdf,
retrieved November 25th, 2010.
Although some people still don't get it, the bottom line is always the same: you can't rely on a fully automatic method to evaluate intelligent entities which are aware of the evaluation method, as they are very likely to adapt to it. This is even more so when the automatic method relies on a data source which is not under the control of the evaluator(s). Thanks to Lucas for sharing the bibliography entry.

Raphaël Hertzog: People behind Debian: Colin Watson, the tireless man-db maintainer and a debian-installer developer

Colin Watson is not a high-profile Debian figure, you rarely see him on mailing lists but he cares a lot about Debian and you will see him on Debconf videos sharing many thoughtful comments. I have the pleasure to work with him on dpkg as he maintains the package in Ubuntu, but he does a lot of more interesting things. I also took the opportunity to ask some Ubuntu specific questions since he s worked for Canonical since the start. Read on. My questions are in bold, the rest is by Colin. Who are you? Hi. I m 32 years old, grew up in Belfast in Northern Ireland, but have been living in Cambridge, England, since I was 18. I m married with a stepson and a daughter. I became interested in Debian due to the critical mass of Debian work happening in Cambridge at the time (and perhaps more immediately because my roommate was running Debian: hey, what s that? ), started doing random bits of development in 2000, and joined as a developer in 2001 (a really exciting time, with lots of new people joining who became integral parts of the project). I d only really been intending to do QA work and various bits of packaging around the edges, and maybe some work on the BTS, but then Fabrizio Polacco died and I took over man-db from him, and it sort of snowballed from there. I graduated from university shortly before becoming a Debian developer. I worked for a web server company (Zeus), then a hardware cryptography company (nCipher), before moving to work for Canonical in 2004, since when I ve been working full-time on Ubuntu. By this point, I suspect that going back to work in an office every day would be pretty tough. What s your biggest achievement within Debian or Ubuntu? One thing I should say: I rarely start projects. Firstly I don t think I m very good at it, and secondly I much prefer coming on to an existing project and worrying away at all the broken bits, often after other people have got bored and wandered off to the next new and shiny thing. That s probably why I ended up in the GNU/Linux distribution world in the first place, rather than doing lots of upstream development from the start I like being able to polish things into a finished product that we can give to end users. So, I ve had my fingers in a lot of pies over the years, doing ongoing maintenance and fixing lots of bugs. I think the single project I m most proud of would have to be my work on the Debian installer. I joined that team in early 2004 (a few months before Canonical started up) partly because I was a release assistant at the time and it was an obvious hot-spot, and partly because I thought it d be a good idea to make sure it worked well on the shiny new G4 PowerBook I d just treated myself to. I ended up as one of the powerpc d-i port maintainers for a while (no longer, as that machine is dead), but I ve done a lot of core work as well: much of the work to put progress bars in front of absolutely everything that used to have piles of text output, rescue mode, the current kernel selection framework, a good deal of udev support, several significant debconf extensions, lots of os-prober work, and I think I can claim to be one of the few people who understands the partitioner almost top to bottom. :-) d-i is the very first thing many of our users see, and has a huge range of uses, from simple desktop installs to massive corporate deployments; it s unspeakably important that it works well, and it s a testament to its design that it s been able to trundle along without actually very much serious refactoring for the best part of five years now. I have a soft spot for man-db too. It was my first major project in Debian, starting out from an embarrassingly broken state, and is now nice and stable to the point where I recently had time to spawn a useful generic library out of it (libpipeline). What are your plans for Debian Wheezy? d-i has a lot of code to deal with disks and partitions. Of course a lot of it is in the partitioner, and for that we use libparted so we don t have to worry very much about the minutiae of device naming. But there are several other cases where we do need to care about naming, mainly before the partitioner when detecting disks, and after the partitioner when installing the boot loader. Back in etch, we introduced list-devices , which abstracted away the disk naming assumptions involved in hardware detection. In wheezy, I would like to take all the messy, duplicated, and error-prone code that handles disk naming in the boot loader installers, and design a simple interface to cover all of them. This has only got more important following the addition of the kFreeBSD and Hurd d-i ports in squeeze, but it bites us every time we notice that, say, CCISS arrays aren t handled consistently, and it s a pain to test all that duplicated code. I d also like to spread the use of libpipeline through C programs in the archive, which I think has potential to eliminate a class of security vulnerabilities in a much simpler way than was previously available. If you could spend all your time on Debian, what would you work on? I would love to systematically reduce the need for the current mass of boot loaders. There s a significant cost to having so much variation across architectures here: it s work that needs to be done in N different places, the wildly differing configuration means that d-i has to have huge piles of code to manage them all differently, and there are a bunch of strange arbitrary limitations on what you can do. The reason I m working on GRUB 2 is that, in my view, it s the project with the best chance of centralising all this duplicated work into a single place, and making it easier to bring up new hardware in future (in a way that doesn t compromise software freedom, as many proprietary boot loaders of the kind often found on phones do). Of course, with flexibility tends to come complexity, and some people have a natural objection to that and prefer something simpler. The things I don t quite have time to do here are to figure out a coherent way to address the specific over-complexity problems people have with the configuration framework while still keeping the flexibility we need, and to do enough QA and porting work to be able to roll out GRUB 2 at installation time to all the Debian architectures it theoretically supports. What s the biggest problem of Debian? Backbiting, and too much playing the man rather than the ball. With one or two honourable exceptions, I ve largely stopped reading most Debian mailing lists since it just never seems a productive way to spend time compared to writing code and fixing bugs; and yet I m conscious that they re one of the primary means of communication for the project and I m derelict in not taking part in them. I do find it a bit frustrating that people are seen primarily in terms of their affiliations. I suppose it s natural for people to see me as an Ubuntu guy , but I don t really see myself that way: I ve been working on Debian for nearly twice as long as I ve been working on Ubuntu, and, while I care a great deal about both projects, I ve put far more of my own personal time into Debian and I try to make sure that a decent number of the things I m involved with there aren t to do with work. Work/life separation is a good thing, not that I m very good at it. Generally speaking, when I m working on Debian, I m doing so as a Debian developer, because I want Debian to be better. When that s not the case, if it matters, I try to indicate it explicitly. You re working for Canonical since Ubuntu s inception. If you were Mark Shuttleworth, is there something that you would have done differently? We had many good intentions when we founded Ubuntu. We also had a huge amount of work to deliver, to the point where it wasn t at all clear whether it would be possible (the warty release was named based on the expectations of it, after all, and came out much more usable than we d dared to hope). In hindsight, it might have helped to be quieter about our good intentions, so that we could exceed expectations rather than in some cases failing to meet them. That might have set a very different tone early on. (Personally, I m happy I m not Mark. The decisions in my office are much easier to take.) It seems to me that the community part of Ubuntu is much more eager to cooperate with Debian than the corporate part. It s probably just that more and more Canonical employees are not former Debian contributors. Do you also have this feeling? Are there processes in place to ensure everybody at Canonical is trying to do the right thing towards Debian cooperation? Just to be clear, I m wearing my own hat here which, ironically, is a fedora rather than a company hat. It makes sense for Canonical to be taking on more non-Debian folks; after all, we can t simply hire from the Debian community forever, and a variety of backgrounds is healthy. As you say, it may well be natural that Ubuntu developers who don t work for Canonical are more likely to have a Debianish background, as it tends to take something significant to get people to switch to a very different family of GNU/Linux distributions, and changing jobs is one of the most obvious of those things. Certainly, there was a definite sense among the early developers that we were all part of the Debian family and cared about the success of Debian as well. As Ubuntu has developed its own identity, people involved in it now tend to care primarily about the success of Ubuntu. At the same time, pragmatically, it s still true that getting code changes into Debian is one of the most economical ways to land them; changes made in Debian or upstream land once and tend to stay in place, while changes made only in Ubuntu incur an ongoing merge overhead, which is not at all trivial. In many ways it s human nature to try to fulfil your immediate goals in the most direct way possible. If your goal is to deliver changes to Ubuntu users, then it s natural to concentrate on that rather than looking at the bigger picture (which takes experience). Debian developers often fail to send changes upstream for much the same reason, although there s more variation there because they re normally working on Debian of their own volition and thus tend to have wider goals; the economics are more or less parallel though. Thus, I think the best way to improve things is to make it the path of least resistance for Ubuntu developers to send changes to Debian. We re already seeing how this works with the Ubuntu MOTU group; if you send a patch for review, or work on merging a package from Debian, very often the response includes have you sent these changes to Debian? . We re working on both streamlining our code review through a regular patch pilot programme and requiring more code review for changes in general, so I think this will be a good opportunity to ask more people to work with Debian when they propose changes to Ubuntu. For myself, this may be obvious, but I notice that I m much better at getting changes into Debian when I already have commit access to the Debian package in question. All the work on improving collaborative maintenance in Debian can only help, for Ubuntu as well as for everyone else. It doesn t make so much difference for large changes that require extensive discussion, but there are lots of small changes too. Canonical is upstream of many software projects (unity, indicators infrastructure, etc.). Why aren t those software immediately packaged in Debian? Do you think we can get this to change? I m not sure what the right approach is here, particularly as I haven t been involved with much of that on the Ubuntu side. I suspect it would be helpful to look at this in a similar way to Ubuntu changes in general. It s understandable that those developers have getting changes into Ubuntu as their first goal. And yet, having code in Debian offers a wider, and often technically adept, audience, and most developers like having their code reach a wider audience even if it s not their first priority, particularly if that audience is likely to be able to help with finding problems and fixing bugs. It should be seen as something beneficial to both distributions. The hardest problems will be with things that aren t merely optional add-ons (which should generally be fairly non-controversial in Debian, given the breadth of the archive in general the existence of things like bzr and germinate as Debian packages was never a hard question), but which require changes in established packages. For example, gnome-power-manager in Ubuntu is built with application indicator support, and that s an important part of having a good indicator-based panel: a lot of the point of indicators is consistency. Since I do very little desktop work myself, I don t know exactly what would be involved in making it possible to choose this system based on a Debian desktop, but I think it s probably a bit more complicated than just making sure all the new packages exist in Debian too. Obviously you have to start somewhere. Is there someone in Debian that you admire for his contributions? Christian Perrier is absolutely tireless and has done superb things for the state of translations in Debian. And Russ Allbery, even aside from his fine ongoing work on policy, Lintian, and Kerberos, is a constant voice of sanity and calmness. Release management is incredibly hard work, as I know from my own experience, and anyone who can sustain involvement in it for a long period is somebody pretty special. Steve Langasek and I got involved at about the same time but he outlasted me by quite a few years. He deserves some kind of medal for everything he s done there.
Thank you to Colin for the time spent answering my questions. I hope you enjoyed reading his answers as I did. Subscribe to my newsletter to get my monthly summary of the Debian/Ubuntu news and to not miss further interviews. You can also follow along on Identi.ca, Twitter and Facebook.

11 comments Liked this article? Click here. My blog is Flattr-enabled.

24 November 2010

Sergio Talens-Oliag: The Freaky Wall (Part 2: Initial Installation)

For the Freaky Wall I have installed a Debian GNU/kFreeBSD system using the installer with ZFS support announced on: http://robertmh.wordpress.com/2010/09/06/debian-installer-with-zfs/ I used the mini.iso found on: http://people.debian.org/~rmh/zfs/kfreebsd-amd64/monolithic/mini.iso the 12th of October of 2010; as I had some problems and reported them to Robert is possible that the current image solves part of them. Installation plan I did a standard installation on a machine with two hard disks, but only used the first one from the installer. The plan was to use ZFS with RAID-1, but current versions of grub do not support booting from a ZFS + RAID file system, so I had to use the same technique used for Linux for a long time; three partitions: a swap partition, a small /boot partition and a big partition for /; / and /boot were formated to use ZFS. First reboot After the installation the system failed to boot because of a bug when building the /boot/grub/grub.cfg (some routes were missing a //@ prefix); to be able to boot Iwe edited the config on the grub prompt and later fixed the file:
    --- grub.cfg.orig       2010-10-13 16:40:39.000000000 +0200
    +++ grub.cfg    2010-10-13 18:38:47.535436766 +0200
    @@ -64,7 +64,7 @@
            set root='(hd0,1)'
            search --no-floppy --fs-uuid --set a371979bb836d1fe
            echo                    'Loading kernel of FreeBSD 8.1-1-amd64 ...'
    -       kfreebsd                /kfreebsd-8.1-1-amd64.gz
    +       kfreebsd                //@/kfreebsd-8.1-1-amd64.gz
            insmod part_msdos
            insmod zfs
            set root='(hd0,3)'
    @@ -75,7 +75,7 @@
            insmod zfs
            set root='(hd0,1)'
            search --no-floppy --fs-uuid --set a371979bb836d1fe
    -       kfreebsd_module         /zfs/zpool.cache type=/boot/zfs/zpool.cache
    +       kfreebsd_module         //@/zfs/zpool.cache type=/boot/zfs/zpool.cache
            set kFreeBSD.vfs.root.mountfrom=zfs:dkfbf1-ad4s3
            set kFreeBSD.vfs.root.mountfrom.options=rw
      
I haven't tested the installer since that day, but I believe that the current ZFS installer was fixed by Robert to deal with that problem. Once the system was booted I had to fix a couple of things: Adjusting ZFS to do RAID-1 On the second disk I created the same partitions as the ones on the first disk using parted; the final result was:
    # parted -l     
    Model: ST3250620NS/3BKS (ide)
    Disk /dev/ad6: 250GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Number  Start   End     Size    Type     File system  Flags
     1      1049kB  256MB   255MB   primary
     2      256MB   4256MB  4000MB  primary
     3      4256MB  250GB   246GB   primary
    Model: ST3250620NS/3BKS (ide)
    Disk /dev/ad4: 250GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Number  Start   End     Size    Type     File system     Flags
      1      1049kB  256MB   255MB   primary
      2      256MB   4256MB  4000MB  primary  linux-swap(v1)
      3      4256MB  250GB   246GB   primary
To use the second partition of both disks as swap I added the following to /etc/fstab:
    /dev/ad4s2      none            swap    sw              0       0
    /dev/ad6s2      none            swap    sw              0       0
To configure the mirroring for the root file system I did the following:
    zpool attach dkfbf1-ad4s3 ad4s3 ad6s3
As the /boot can't work as a replica I adjusted it to make two copies of every file:
    zfs   set copies=2     dkfbf1-ad4s1
Leaving the second disk copy alone, although my plan is to configure it to hold a copy of the /boot partition synchronized with rsync each night. After all those changes the system didn't boot, as the grub-pc generates a buggy /boot/grub/grub.cfg; the problem is on the /etc/grub.d/10_kfreebsd section:
    ### BEGIN /etc/grub.d/10_kfreebsd ###
    menuentry 'Debian GNU/kFreeBSD, with kFreeBSD 8.1-1-amd64' --class debian \
      --class gnu-kfreebsd --class gnu --class os  
          insmod part_msdos
          insmod zfs
          set root='(hd0,1)'
          search --no-floppy --fs-uuid --set a371979bb836d1fe
          echo 'Loading kernel of FreeBSD 8.1-1-amd64 ...'
          kfreebsd /kfreebsd-8.1-1-amd64.gz
          set kFreeBSD.vfs.root.mountfrom=unknown:/dev/ad4s3
          set kFreeBSD.vfs.root.mountfrom.options=rw
     
    ### END /etc/grub.d/10_kfreebsd ###
To fix it there has to be a copy of the modules for ZFS on the boot partition (in my case I moved the /lib/modules directory to /boot and created a link on the root partition to the new directory):
    cd /boot
    mkdir lib
    mv /lib/modules lib
    cd /lib
    ln -s ../boot/lib/modules
And instead of fixing the /etc/grub.d/10_kfreebsd code I wrote a new script (/etc/grub.d/09_zfs_kfreebsd) that creates the right config for my current configuration on the grub.cfg file:
    #!/bin/sh
    prefix=/usr
    exec_prefix=$ prefix 
    bindir=$ exec_prefix /bin
    libdir=$ exec_prefix /lib
    . $ libdir /grub/grub-mkconfig_lib
    prepare_boot_cache="$(prepare_grub_to_access_device $ GRUB_DEVICE_BOOT    sed -e "s/^/\t/")"
    kfreebsd_versions="$(ls /lib/modules/)"
    zfs_root_device="$(zfs list   awk '/\/$/   print $1  '   head -1)"
    for kversion in $kfreebsd_versions; do
      cat << EOF
    # Entry when using ZFS (we have issues with /etc/grub.d/10_kfreebsd)
    menuentry 'Debian GNU/kFreeBSD, with kFreeBSD $kversion and ZFS' --class debian --class gnu-kfreebsd --class gnu --class os  
    $ prepare_boot_cache 
          echo                    'Loading kernel of FreeBSD $kversion ...'
          kfreebsd                //@/kfreebsd-$kversion.gz
          kfreebsd_module_elf     //@/lib/modules/$kversion/opensolaris.ko
          kfreebsd_module_elf     //@/lib/modules/$kversion/zfs.ko
          kfreebsd_module         //@/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:$zfs_root_device
          set kFreeBSD.vfs.root.mountfrom.options=rw
     
    EOF
    done
I solved the problem this way to have a working solution that does not break with squeeze upgrades, assuming that a future grub-pc package will deal well with my config and I'll be able to remove this script, but I guess I'll have to install it from backports. The entry generated by the script when called from update-grub will be similar to:
    ### BEGIN /etc/grub.d/09_zfs-kfreebsd ###
    # Entry when using ZFS (we have issues with /etc/grub.d/10_kfreebsd)
    menuentry 'Debian GNU/kFreeBSD, with kFreeBSD 8.1-1-amd64 @ ITI' --class debian --class gnu-kfreebsd --class gnu --class os  
          insmod part_msdos
          insmod zfs
          set root='(hd0,1)'
          search --no-floppy --fs-uuid --set a371979bb836d1fe
          echo                    'Loading kernel of FreeBSD 8.1-1-amd64 ...'
          kfreebsd                //@/kfreebsd-8.1-1-amd64.gz
          kfreebsd_module_elf     //@/lib/modules/8.1-1-amd64/opensolaris.ko
          kfreebsd_module_elf     //@/lib/modules/8.1-1-amd64/zfs.ko
          kfreebsd_module         //@/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:dkfbf1-ad4s3
          set kFreeBSD.vfs.root.mountfrom.options=rw
     
    ### END /etc/grub.d/10_iti-kfreebsd ###
And after rebooting the machine with this new configuration the system boots OK. On my next post I'll continue explaining how to compile a kernel that supports the use of the OpenBSD Packet Filter and related technologies (CARP, pflog, etc.).

Tim Retout: The Archers website

For those who are not aware, The Archers is a soap opera about rural life, broadcast on BBC Radio 4. Its website has recently been revamped. Unfortunately, I appear to be served the mobile version when I visit the front page (in all of Chromium, Iceweasel and Epiphany on Debian - admittedly not the most mainstream of browsers). BBC Mobile is doing some over-zealous useragent sniffing, it seems. Also amusing: there's a "Who's Who" database of Archers characters, and several of them share the birthday "1st Jan 1970". There was I thinking that Harry Mason and Fallon Rogers had a 15 year age gap... but no. This will be as a result of the underlying database storing values in Unix time, and having a default value of "0". An explanation of Unix time popped up in an episode of The Infinite Monkey Cage the other week, which was nice to hear.

Alexander Wirt: Cool things with grub2 and syslinux - booting floppy and iso images

From time to time I have to boot an iso or even a floppy. Unfortunately my X200 doesn't have a CD-Rom or a Floppy. Grub isn't able to boot isos and floppy images on its own, thats the point where syslinux comes into play: from version 4.x the syslinux memdisk driver is able to boot most iso and floppy images. The syslinux wiki has some details about the supported image types. Yesterday I had to boot an iso image and instead of editing grub.cfg by hand I decided to create a snippet for grub.d to automate things. If you drop an .iso or an .img into the IMAGES path and run update-grub2 afterwards you get a nice boot entry that boots the floppy or iso image. The only thing you have to do is to install syslinux and copy /usr/lib/syslinux/memdisk to /boot. And here it comes:
#!/bin/sh
set -e
IMAGES=/boot/images
. /usr/lib/grub/grub-mkconfig_lib
if test -e /boot/memdisk ; then
    MEMDISKPATH=$( make_system_path_relative_to_its_root "/boot/memdisk" )
    echo "Found memdisk: $MEMDISKPATH" >&2
    find $IMAGES -name "*.iso" -o -name '*.img'   sort   
    while read image ; do
        IMAGEPATH=$( make_system_path_relative_to_its_root "$image" )
        case "$image" in
            *.iso)
                echo "Found iso image: $IMAGEPATH" >&2
                cat << EOF
menuentry "Bootable ISO Image: $(basename $IMAGEPATH   sed s/.img//)"  
EOF
                prepare_grub_to_access_device $ GRUB_DEVICE_BOOT    sed -e "s/^/\t/"
                cat << EOF
    linux16 $MEMDISKPATH iso
    initrd16 $IMAGEPATH
 
EOF
                ;;
            *.img)
                echo "Found floppy image: $IMAGEPATH" >&2
                cat << EOF
menuentry "Bootable Floppy Image: $(basename $IMAGEPATH   sed s/.img//)"  
EOF
                prepare_grub_to_access_device $ GRUB_DEVICE_BOOT    sed -e "s/^/\t/"
                cat << EOF
    linux16 $MEMDISKPATH raw
    initrd16 $IMAGEPATH
 
EOF
                ;;
        esac
    done
fi
P.S. I got the idea and some code snippets from several blog and wiki entries in the net and just added the iso part, so thats not all my code :)

23 November 2010

Russell Coker: Links November 2010

Guy Deutscher wrote an interesting article for the New York Times about how language shapes how we think [1]. The example of people who have no language construct for self-sentered directions and how they describe things is particularly interesting.TED published an interesting interview with Shaffi Mather the founder of India s first organised ambulance service (with differential pricing based on ability to pay) [2]. He also talks about founding schools in small towns and his BribeBusters.com company.World Changing has an interesting article about a legislative change in California that allows car-sharing of personal vehicles [3]. The concept is that if you own a car that you don t use most of the time (as is usually the case) then you can contract with a car-share company to share it to others when you don t need it. This saves the car share company from the capital expense of owning cars and thus allows them to place cars in remote locations that wouldn t otherwise be financially viable (IE the street in front of random people who sign up). The person who owns the car may get about $2 per hour for the time when it s rented. The car owner gets to specify when the car may be available.Charles Stross wrote an entertaining and informative rant about Steam-Punk [4]. He cites Michael Moorcock s informative essay about Starship Troopers and other right-wing apologist themes in sci-fi [5] as well as China Mieville s essay about politics and The Lord of the Rings [6].Glenn Greenwald wrote an informative article about the New York Times defending torture by the US military [7]. I have unsubscrubed from the @Times mailout and will avoid citing NYT articles wherever possible. I sent the URL for Glenn s article to the NYT feedback address but I don t expect them to take any notice.Fate Of the World is a new computer game that s in beta where you have a simulation of the next 200 years of climate change [8]. It s currently in beta for Windows only, they hope to have a Mac version in March and have no stated plans for Linux support.Cory Doctorow wrote an interesting article for Locus about Sci-Fi fans and cosmopolitanism taking the best option after consideration rather than doing what s locally fashionable [9]. He uses the term Martian to refer to some of the viewpoints, but it seems to me that Vulcan would be more appropriate.The Wall St Journal has an interesting article about people who manufacture drugs that aren t yet illegal, every time one drug gets banned they market a new one [10]. This is yet another example of the War on Drugs doing more harm than good, instead of taking drugs which have well known effects (that can be treated by hospitals) people are taking weird new drugs and no-one knows what will happen to them.Mieke Meijer in the Netherlands has invented a new product known as newspaper wood [11], it involves gluing paper together to create a form of chip-board that keeps the layers of paper distinct to give a result like wood grain. The World Changing commentary suggests that this could give a heirloom quality to objects made with it, while I m dubious about that I think that the surface would be pleasing to look at in a kitchen or office environment.Ze Frank gave an interesting TED talk about unusual social projects that he s run on the Internet [12]. This includes an attempt to reconcile Red and Blue voters after the 2008 US presidential election, the creation of inspirational songs, and remixing the Whip Somebody s Ass song. This is really worth watching!The Chronicle Review has an interesting article by someone who is paid to complete academic assignments for other people [13]. The scope of cheating that is claimed is profound. Naturally we have to take claims by someone who admits acting unethically with a grain of salt, but if there is any truth to this then it s a serious matter. I m surprised that no-one has made a serious attempt to catch the customers of such people.David Brin (the famous sci-fi author) gave an interesting short lecture about the future of humanity [14]. He promotes the Lifeboat Foundation (of which he is a director) and describes his concern about the Fermi Paradox.Shimon Schocken gave an inspiring TED talk about his work rehabilitating juvenile prisoners through taking them mountain-bike riding [15]. This shows that anyone can do great things to help other people, he got this idea when riding past a prison, convinced the prison governor that it was a good idea and then started doing it.Conrad Wolfram gave an insightful TED talk about math education [16]. His claim is that the entire mathematical education system is wrong in it s focus on hand calculation, instead the aim should be to teach children how to use computers to solve problems which is what is mostly done in the real world.

Julien Danjou: Color contrast correction

I finally took some time to finish my color contrast corrector. It's now able to compare two colors and to tell if they are readable when used as foreground and background color for text rendering. If they are too close, the code corrects both colors so to they'll become distant enough to be readable. To do that, it uses color coordinates in the CIE L*a*b* colorspace. This allows to determine the luminance difference between 2 colors very easily by comparing the L component of the coordinates. The default threshold used to determine readability based on luminance difference is 40 (on 100), which seems to give pretty good results so far. Then it uses the CIE Delta E 2000 formula to obtain the distance between colors. A distance of 6 is considered to be enough for the colors to be distinctive in our case, but that can be adjusted anyway. That depends on reader's eyes. If both the color and luminance distances are big enough, the color pair is considered readable when used upon each other. If these criteria are not satisfied, the code simply tries to correct the color by adjusting the L (luminance) component of the colors so their difference is 40. Optionally, the background color can be fixed so only the foreground color would be adjusted; this is especially handy when the color background is not provided by any external style, but it the screen one (like the Emacs frame background in my case). Here is an example result generated over 10 pairs of random colors. Left colors are randomly generated, and right colors are the corrected one. <style type="text/css"> </style>

bg: DarkSeaGreen4 fg: gray67 ->                             fg: #4a6b4b bg: #cccccc
bg: SlateGray4 fg: forest green ->                          fg: #9faec0 bg: #005700
bg: grey13 fg: grey36 ->                                    fg: #131313 bg: #6c6c6c
bg: MediumPurple2 fg: honeydew ->                           fg: #9e78ed bg: #f0fff0
bg: grey43 fg: chartreuse3 ->                               fg: #5e5e5e bg: #79de25
bg: linen fg: DeepPink2 ->                                  fg: linen bg: DeepPink2
bg: CadetBlue4 fg: blue1 ->                                 fg: #6c9fa4 bg: #0000e1
bg: gray33 fg: NavajoWhite3 ->                              fg: #525252 bg: #cfb58c
bg: chartreuse1 fg: RosyBrown3 ->                           fg: #9cff38 bg: #b28282
bg: medium violet red fg: DeepPink1 ->                      fg: #9c0060 bg: #ff55b9
All this has been written in Emacs Lisp. The code is now available in Gnus (and therefore in Emacs 24) in the packages color-lab and shr-color. A future work would be to add support for colour blindness. As a side note, several people pointed me at the WCAG formulas to determine luminance and contrast ratio. These are probably good criteria to choose your color when designing a user interface. However, they are not enough to determine if displayed color will be readable. This means you can use them if you are a designer, but IMHO they are pretty weak for detecting and correcting colors you did not choose. Flattr this

Mike Hommey: Improving libxul startup I/O by hacking the ELF format

If you have been following this blog during the past months, you might have gathered that I ve been focusing on I/O patterns on library initialization, more specifically libxul.so. The very patterns there s not much to do about, except enduring them, or hacking ld.so and/or the toolchain. The latter is not necessarily easy, and won t benefit everyone until all linux distros use an improved glibc and/or toolchain. This could take years before any actual result would reach end users. But with a little creativity, one can overcome these limitations and improve the situation today. Here is a summary of my recent hacks. Backwards static initializers As Taras showed in the past, static initializers are executed in reverse order. It turns out it is an unfortunate design choice in gcc, and it also turns out not to impact all ELF binary files. As far as I know there are currently two different implementations of the static initializers call loop, one provided by gcc, and one provided by ld.so. In the gcc case, the compiler creates a .ctors section, starting with 0xffffffff, ending with 0x00000000, and filled with pointers to the various static initializer functions, in ascending order. The compiler also injects an initializer function, called from .init, going through this .ctors section, starting from the end (__do_global_ctors_aux in crtend.o). A similar .dtors section is created for functions to run when the library is unloaded, and the pointers in it are called in ascending order. There is actually no importance in the order in which .ctors and .dtors are executed. All that matters is that they are executed in reverse order from each other, because that limits the risks of bad ordering. It is only unfortunate that .ctors was chosen to be the one backwards. In the ld.so case, the compiler creates a .init_array section, filled with pointers to the various static initializer functions, in ascending order. It also stores the location and the size of this section in the PT_DYNAMIC ELF header. At runtime, ld.so itself reads this information and executes the static initializers in ascending orders. A similar .fini_array section is created for functions to run when the library in unloaded, and ld.so goes through it in descending order. The .init_array section is newer, and for backwards compatibility reasons, is not used on systems that have been using the .ctors approach forever. On the other hand, some newer ABIs, such as arm EABI, uses the new facility, which means they are not victim of backwards static initialization. I however wonder if backwards compatibility is still needed, considering how long .init_array support has been around (more than 11 years, according to glibc git repository). While we could obviously bug the gcc maintainers to revert their .ctors execution order, or ditch .ctors support on glibc systems, which means we wouldn t get any immediate global benefit, we can also just revert the .ctors section content. Please note the source code out there doesn t take care of reverting the .dtors section accordingly, because it is currently empty in libxul.so. Relocations As I mentioned in an earlier post, relocations are what make it possible to load libraries at arbitrary locations. Unfortunately, a great number of relocations means awful I/O patterns: ld.so reads and applies them one by one, and while the kernel reads ahead by 128 KB chunks, when your relocation section exceeds that amount by more than an order of magnitude, it means I/O goes back and forth a lot between the relocation section and where the relocations take place. There are two classes of relocations: REL and RELA. In both cases, there are several types of relocations, some of which require an addend. The difference between both classes is in REL relocations, the addend is stored at the offset the relocation takes place, and in RELA relocations, the addend is stored in the relocation entry. It means that RELA relocations effectively waste space, as the addend ends up actually being stored twice: it is also stored at the offset the relocation takes place, like with REL relocations, though it could technically be nulled out, there ; in any case, the space is wasted. REL relocations thus take 2 words of storage, and RELA relocations, 3. On x86, the ELF ABI only uses REL relocations, and words are 32 bits, making each relocation take 8 bytes ; on x86-64, the ELF ABI only uses RELA relocations, and words are 64 bits, thus making each relocation take 24 bytes, 3 times that of x86 relocations. On ARM, both may be used, but apparently the compiler and the linker only use REL relocations. These words of storage are used to store 3 or 4 bits of informations: The linker splits relocations in two main categories: those for dynamic linking at startup and those for procedure linkage table (PLT) resolution at runtime. Here is what the repartition look like on libxul.so (taken from the mozilla-central nightly from Nov, the 22nd):
dynamic relocations PLT relocations
Architecture number size (bytes) number size (bytes)
x86 231,836 1,854,688 3,772 30,176
x86-64 235,893 5,661,432 3,773 90,528
So, PLT relocations are quite negligible, and dynamic relocations are just huge, especially on x86-64. Compared to the binary size, it s pretty scary:
Architecture libxul.so size relocations size %
x86 21,869,684 1,884,864 8.61%
x86-64 29,629,040 5,751,984 19.41%
Let me remind you that not only do we need to read these relocations at startup (at least the dynamic ones, but the PLT ones are just negligible), but we only read them by chunks, and need to read other data in between. Of the many existing types of relocations, only a few are actually used in dynamic libraries. Here is a summary of those in use in libxul.so:
x86 relocation type number x86-64 relocation type number
dynamic relocations
R_386_TLS_DTPMOD32 1 R_X86_64_DTPMOD64 1
R_386_GLOB_DAT 213 R_X86_64_GLOB_DAT 238
R_386_32 27,643 R_X86_64_64 27,611
R_386_RELATIVE 203,979 R_X86_64_RELATIVE 208,043
PLT relocations
R_386_JUMP_SLOT 3,772 R_X86_64_JUMP_SLOT 3,773
The above types can be separated in two distinct categories: In the second category, it means we are wasting all the bits for the symbol reference in each entry: 24 on x86 and 32 on x86-64. Unfortunately, the vast majority of the relocations in libxul.so are from that category. At this point, this is how much waste we identified:
description num. entries waste per entry (bytes) total % of relocation size
x86
Relocation without symbol ref. 203,980 3 611,937 32.46%
x86-64
Duplicated addend 239,666 8 1,917,328 33.33%
Relocation type encoded on 32 bits 239,666 3 718,998 12.49%
Relocation without symbol ref. 208,044 4 832,176 14.46%
Total 3,468,502 60.30%
On top of that, one could argue that we don t need 24 or 32 bits for symbol reference (which is the entry number in the symbol table), and that we re really far from requiring 64 bits for r_offset on 64 bits systems, as libxul.so is far from being bigger than 4GB. Anyways, that means we have room for improvement here, and it means that the ELF format, especially on 64 bits systems with RELA relocations, really doesn t help with big programs or libraries with a lot of relocations. (For that matter, the mach-o format used on OS-X has some kind of similar issues ; I don t know for the DLL format) Another interesting data point is looking at how relocations r_offset are following each other, once relocations are reordered (to avoid too much symbol resolution, they are actually grouped by symbol). It turns out 206,739 relocations r_offset are at 4 bytes from the previous one on x86 (i.e. strictly following it), and 210,364 at 8 bytes from the previous on x86-64. The main reason why this happens is that most relocations are happening in pointer tables, and libxul.so has lots of them: And when I say libxul.so has lots of them, that s not an understatement: there are 184,320 relocations due to vtables (function tables you get when using virtual methods in C++) on x86 and 184,098 on x86-64. That s respectively 78.23% and 76.81% of the total number of relocations. Interestingly, while most of these relocations are R_*_RELATIVE, 26,853 are R_386_32, and 26,829 are R_X86_64_64. Except for a very few, these non relative relocations are for the __cxa_pure_virtual symbol, which is a dummy function that does nothing, used for pure virtual methods, such as the following:
class Abstract
public:
virtual void pure_virtual() = 0;
;
As for the remaining relative relocations, there are a few pointer tables responsible for several thousand relocations, such as JSString::length2StringTable, gEntries, GkAtoms_info, Html5Atoms_info, kUnixCharsets, nsIDOMCSS2Properties_properties, etc. Packing relocations While they are not detrimental to most binaries, we saw that relocations can have a bad effect on startup I/O for big binaries. Reducing how much space they take would have a direct impact on these startup I/Os. One way to do so is obviously to reduce the number of relocations. But as we saw above, the vast majority are due to vtables. While reducing vtables would be a nice goal, it s a long way before this can have a significant impact on the relocations number. So another possible way is to try to avoid wasting so much space in relocations. The main problem is that relocations are applied by ld.so, and that, as mentioned in the introduction, while we can hack ld.so to do what we want, it won t work everywhere before a long time. Moreover, it s difficult to test various implementations, and binary compatibility needs to be guaranteed once something is applied in the upstream libc. The idea I started to test a few weeks ago, is to effectively apply relocations by hand instead of relying on ld.so doing it. Considering the first thing ld.so does with a library after applying relocations is to call its DT_INIT function, the idea was to replace the dynamic relocations we can with a new DT_INIT function we would inject that d apply those relocations, while storing them in a more efficient manner. The function would obviously need to call the original DT_INIT function once done. Some parts of the PT_DYNAMIC section also obviously need to be adjusted accordingly. The first iteration I tested a few weeks ago helped validating the idea, but didn t change much of the binary: the dynamic relocation section still was taking all the space it took before, though its content was mostly empty (we ll see further below how efficient even the current dumb format is). Once the theory that an injected DT_INIT function could apply the relocations without breaking everything, I went on to implement a program that would actually strip the ELF binary. I won t get too much into the gory details, but it required PT_LOAD splitting, thus program headers growth, which means moving the following sections, then removing a huge part of the relocations, shrinking the relocations section, injecting our code and the packed relocations as sections, and moving the remaining sections after these new sections, to avoid empty space, but still respecting the proper offsets for both PT_LOAD and the code itself. So far, I only took care of the R_*_RELATIVE relocations. Some but not all other relocations could be taken care of, too, but everything involving symbol resolution from other libraries would be really difficult to handle from the injected code. The relocations are currently stored with a quite dumb format: As we only take care of one type of relocations, we can skip any information about the type. Also, the addend already being stored at r_offset, we just strip it from RELA relocations ; the binary being far from 4GB big, 32 bits is enough on 64 bits systems too. We also saw that a lot of relocations were next to the following ones, so instead of storing r_offset for each one, storing some kind of range is more efficient. As I ve so far been focusing on getting something that actually works more than on getting something really efficient, I only tested this format, but the results are already nice:
x86 x86-64
before
dynamic relocations (bytes) 1,854,688 5,661,432
libxul.so size 21,869,684 29,629,040
after
dynamic relocations (bytes) 222,856 668,400
injected code size 129 84
packed relative relocations (bytes) 224,816 228,568
libxul.so size 20,464,836 (-6.42%) 24,865,520 (-16.07%)
Getting rid of the __cxa_pure_virtual relocations would help getting this even further down, and an even better storage format could be used, too. Gathering new startup coverage data should be interesting as well. The code is available via mercurial. Please note the Makefile deeply sucks, and that the code is in the middle of its third refactoring. Anyways, once you get the code to compile, you just need to run test-x86 or test-x64 depending on your architecture, from the build directory, and give it the libxul.so file as an argument. It will create a libxul.so.new file that you can use to replace libxul.so. You may successfully use the tool on other libraries, but chances are you ll bump into an assert(), or in the worst case, that the resulting library ends up broken. The tool might work on PIE executables, but most probably not on other executables. If you wonder, Chrome is not PIE. It s not even relocatable (which means ASLR won t work with it) ; or at least the x86-64 binaries I just got aren t. More possible ELF hacking The code I wrote to pack relocations allows to do various tricks on ELF files, and it opens various opportunities, such as: Some of the above could probably be done with linker scripts, but using linker scripts is unnecessarily over complicated: as soon as you start using a linker script to fiddle with sections, you need to reimplement the entire default linker script (the one you can see with ld --verbose). And it s not guaranteed to work (Taras told me he had a hard time failing to align the .bss section). And as far as I know, you can t use the same thing depending whether you use ld or gold (AIUI, gold doesn t support the whole ld linker script syntax).

Biella Coleman: An unlikely story about a pit bull attack, free software, and a New York Times reporter

If I told you that in the last two days, I have been caught in a vortex of coincidence, a vortex composed of pit bulls, free software, diaspora (the software), mold, and a New York Times reporter, I bet you would think not likely. So the story started on Jet Blue, which offers snacks, lots of them, and Direct TV. Since I don t have TV I kinda go on a binge, watching all sorts of shows as I make my way home. I watched a pretty distributing but interesting documentary on Jim Jones on CNN and a show on Animal Planet on pit bulls and parolees. When I rolled into my my current digs in northern Manhattan (I am currently banished from my downtown apt due to mold, but that is a whole other story), there was a dinner party well underway. At some point in the evening prompted by me, we talked pit bulls as my friends want to get one but their family has issued a threat of disavowal if they do. The next morning, I was scoping out the website for the Animal Planet show as I was intrigued by it and frankly I kinda like pit bulls (maybe less now although I think they are unfairly maligned). Five minutes into pursuing the site, I hear screeches from hell. It sounds like a woman is being attacked. And she is. A woman right outside of my window was being attacked by a pit bull. So I am staying with a friend, an open source developer, Karl Fogel and good soul that he is, he runs out to help the lady (since I have been subject to 5 weeks of sickness due to mold or so that is what we think it is was enough for me; I could not stomach the idea of getting bit so I played the role of concerned spectator). It took minutes upon minutes, really just too many minutes to get the pit bull off, even a brick pounded against his head failed (apparently, a cigarette or match held to the throat does the trick, which I found out later). Eventually, the dog was extracted, a huge team of cops showed up, the dog was whisked away, the victim taken to the hospital, and life returned to calm and quiet. So the next day, I was being interviewed by a New York Times reporter Jim Dwyer who wrote a story about Diaspora for the New York Times back in the summer, helping to propel it from relative obscurity to near insta-fame (one of the Diaspora developers, Max, was my student). We were running out of time (I had another appointment) so I asked him if he lived in northern Manhattan as that is what his bio page indicates. He confirmed, I explained I was up there and that we could meet up there later to finish up. He inquired what part, I told him roughly where I was, he remarked he was near there, and so naturally I told him about the crazy pit bull attack I witnessed from my window as I can t shut my trap when it comes to things like that. Well yes you know what is coming next next: he was there, helping Karl (and others) deal with the pit bull attack. He lives nearby and heard the shrieks of agony and came out to aid. All and all it was pretty horrific. He also met Karl in so far as Karl gave him his phone number and email just in case he was needed as a witness (Karl had to dash off to catch a plane). Well, the funny thing, or as you also might guess: Jim, who is doing some more writing on tech, free software etc, should really talk to Karl given his key role in the community, so they already met, although under odd and terrible circumstances. I am not sure if I am more wigged out by the fact that I was reading about pit bulls when the attack happened or whether the reporter I was interviewed by was there along side with a free software developer he really needs to interview. Whatever the case, I kinda hope the vortex of coincidence now leaves me to hit someone else (sans any horrible attack). Or else, as Karl noted in the blog comments, I will have to be very careful about what shows I watch:
Amen to that! Enough with the coincidence vortex. As I said to Biella in IRC later: Do us a favor don t watch any shows about nuclear attacks on New York, okay

John Goerzen: Game Suggestions?

I m not an avid gamer, but I do occasionally enjoy playing video games. I sometimes have time to do so over the holidays, so I m looking for suggestions. I have a PS3 and a PC available. Thinking about what I like, most recently it seems to be immersive world games: Oblivion, Dragon Age, Mass Effect 1 & 2, and GTA. I ve also enjoyed simulation games, such as Civ, SimCity, FreeCiv, and Railroad Tycoon in the past and could again. Some of the Star Wars games (Knights of the Old Republic, Jedi Academy, Force Unleashed) I ve enjoyed, though the ones that have essentially no plot I didn t really. What suggestions do you have?

Dominique Dumont: How about a configfs with Config::Model ?

Hello During the Config::Model presentation at Debian mini-conf, I was asked whether Config::Model could be used from other languages than Perl. Of course, config-edit command line can be launched from any program with any language, but we can hardly call it an API. There s also the possibility to use Config::Model::SimpleUI to fork a process and send commands on its STDIN and get results on STDOUT. But using this from another program is awkward. On kernel side, /proc and /sys are widely used to get information from the kernel and set kernel configuration. How about using a similar approach with system configuration data ? Configuration data from config files is already mapped into a tree within Config::Model. This tree can also be mapped to a file system structure. This file system structure could have the following layout:
/conf/
system/
sshd/
PermitRootLogin # contain 0 or 1
ssh/

popcon/
As a bonus, this file system would provide a unified access to all system configuration data available through Config::Model. In any case, people would still be able to tinker configuration with their favorite text editor on a file in /etc. The modification will be propagated to the corresponding entry in the /conf virtual file system. The reverse will also be done. Anyone interested ? All the best PS: Further technical discussion will be held on Config::Model mailing list: config-model-users at lists.sourceforge.net 2010.11.25 edit: specified that config data can still be written in usual config file.

Russell Coker: A First Digital Camera

I ve just been asked for advice on buying a digital camera. I m not an expert on cameras but I have a good general knowledge of technology and I m sure that the readers of my blog will correct me rapidly if I make any serious mistakes. ;)Types of CameraThe Wikipedia Page about Digital Cameras is worth reading [1].Here are the types of camera that are useful as a stand-alone camera (IE not camera phones or industrial cameras):I suggest that people not start out a hobby of digital photography with a DSLR or other interchangeable lens camera. I think that it s best to start out with simple gear that s cheap if you decide that digital photography is not your thing then you have wasted less money, and if you really get into it then you ll be able to make a more informed choice about an expensive camera after getting some experience.A spare cheap compact camera can be useful even if you own a more expensive camera. There are times when you don t want the bulk of a DSLR or Bridge Camera and when you have a risk of theft or accidental damage such that you don t want to take an expensive camera. People who are really serious about photography apparently take a camera everywhere, you could have a compact camera in your front pocket for fast pictures and a bulky camera in your backpack for when you have time to prepare a quality shot. So buying a cheap camera and then buying an expensive one a few months later would not be wasting money!As the person who asked for advice has never owned a digital camera before I ll focus on cheap compact cameras for the rest of this post.Pixels and LensesCameras are typically advertised with the resolution in Megapixels described in bold. Presumably most people search for the camera with the highest resolution. The first thing to beware of is cameras that don t have hardware which is capable of taking a picture of the stated resolution, they use interpolation to generate a higher resolution image. There are probably some cameras with interpolation that are OK and provide a decent picture at a low price, but generally I recommend avoiding all cameras that do interpolation.Optical zoom is a very important feature. Often pictures have to be cropped to remove unwanted background, if you zoom in appropriately you can avoid cropping and make better use of the available resolution. Beware of cameras that advertise things such as advanced zoom , anything that doesn t exactly say optical zoom is using digital zoom IE interpolation. I suggest not considering a compact camera unless it can do at least 4* optical zoom, with 5* or better being preferable.The physical size of the lens is important. A bigger lens allows better pictures in adverse lighting and also allows a faster shutter speed to give better photos of moving objects and better photos when you are moving. Generally you can get a rough idea of the potential that a camera has by just glancing at the lens, if it s the size of a lens in a mobile phone then the pictures won t be that great. If it is on a telescopic mount and it s wide then the result will be better. When buying a lens for a DSLR or other detachable lens camera you should be able to read specifications of the lens which indicate it s size. For compact cameras the specifications of the lens are usually available from the vendor and often available from review sites but generally aren t included in adverts by retailers. If you are comparing cameras in the store looking at them seems like the best option.The ratio of the lens area to the number of pixels determines how much light is received by the sensors for each pixel. So when there are two cameras that are essentially identical apart from the number of megapixels the one with the highest number isn t necessarily better in all situations. A 12MP camera might not give a better result than a 10MP camera, a monitor described as Full HD has a resolution of 1920*1080 which is 2MP. A 5MP camera is useful to allow cropping but if the aim is to display pictures on current monitors then anything much bigger than 5MP is probably wasted at this time and 10MP will provide pictures that can use the capabilities of monitors that are developed for a while.PrintingSome printers that are affordable for home use might require something like a 7MP camera to print a picture at A4 or Letter size at the highest quality. Professional printing will probably require something even greater. But if your intended use of a digital camera doesn t involve printing the pictures, or only rarely involves printing them at A4 or Letter size then you don t need a high resolution for printing. I expect that there are some available printers that can use paper at sizes such as B3 which might require a 20MP camera for best quality. But if the aim of the printing is to put a picture on your wall (the most common case) then even if it s not at the ideal resolution then probably no-one will notice the difference you can t see the pixels from a few meters away.If the aim of the camera is to photograph professional artwork for the purpose of selling it on the Internet then a high resolution camera really isn t desired. You want to offer pictures on the Internet which aren t good enough to be usefully printed.VideoThe capabilities for recording video can vary significantly between different cameras in the same range. If you don t care about video then that s fine, but if video matters to you then you have to read the specs. It s also worth considering digital video cameras, I have previously summarised the available digital video cameras although I m sure that there have been some new models since then [3]. A good (expensive) digital camera will have video functionality that compares well to most digital video cameras but it will cost a lot more.Choosing a Compact CameraThere are many compact cameras in the $100 to $150 price range. Ted s has the Samsung Digimax ES65 for $99.95 which has 10MP and 5* optical zoom. This seems like a good deal. Practice with a cheap camera could easily allow you to make a better choice when buying a more expensive camera that saves you more than $100 so it seems unlikely that you will have any great regrets about buying a $100 camera.Buying from the specs is a bad idea, I recommend testing a camera in the store before buying every store that you want to buy from allows this. But don t expect that quality pictures in the store means much, the people who run the camera stores usually set them up with good lighting so that pictures will tend to turn out well. The aim of an in-store test is not to discover what the camera does well, but to discover what (if anything) it does badly. Also it s useful to test the ergonomics of the camera before buying, discover whether you would be happy to hold the camera for an hour.It s a good idea to ask the staff at a camera store for advice, but don t rely on such advice. My experience is that they tend not to ask what the prospective customer plans to do with the camera and this significantly limits the quality of their recommendations.ConclusionMake your first digital camera a cheap compact camera that doesn t cost much more than $100. Make sure it has at least 4* optical zoom with 5* being preferred. Don t worry too much about the number of megapixels, anything more than 5 will do. Test the camera in the store to look for any obvious reasons that make it unsuitable for your use. If you want video then be prepared to pay a little more as the cheapest cameras have a low resolution for video.

22 November 2010

Axel Beckert: Useful but Unknown Unix Tools: convmv

Ogg and MP3 files often contain the interpreter and song title in the file name. Which is (besides quoting blanks, etc.) usually no issue if you have English interpreters or song titles. But it may become a character set issue, if you have songs with e.g. French, German, Greek, or Russian interpreters or song titles: They may not be in your preferred character set and therefore don t display properly on your system. Worst case: You just see questions marks. If you face such problems, convmv (man page, Debian package) is your tool, because convmv converts filenames from one encoding to another:
$ ls -lF
total 4
-rw-rw-r-- 1 abe abe 4 2010-11-21 16:17 ????
$ convmv -f latin1 -t utf-8 *
Your Perl version has fleas #37757 #49830 
Starting a dry run without changes...
mv "./??"       "./ "
No changes to your files done. Use --notest to finally rename the files.
$ convmv --notest -f latin1 -t utf-8 *
Your Perl version has fleas #37757 #49830 
mv "./??"       "./ "
Ready!
$ ls -lF
total 4
-rw-rw-r-- 1 abe abe 4 2010-11-21 16:17  
$ 
Of course it can also recursively rename your whole Ogg collection. And it can do it interactively, too:
$ ls -lF
total 4
-rw-rw-r-- 1 abe abe 4 2010-11-21 16:17 ????
$ convmv -i --notest -f latin1 -t utf-8 *
Your Perl version has fleas #37757 #49830 
mv "./??"       "./ " (y/n) y
Ready!
$ ls -lF
total 4
-rw-rw-r-- 1 abe abe 4 2010-11-21 16:17  
$ 
So convmv takes away at least one UTF-8 migration fear. Update 23:03: Nearly forgot, but Mowgli reminded me: There is also convmvfs (Debian package), a FUSE based filesystem which converts file names on access.

Matthew Garrett: Fusion Garage GPL update

Fusion Garage have put up a website containing the source code for the kernel, bootloader and some miscellaneous tools (including their recovery system). As far as I can tell (by inspection - I haven't tried building binaries) it corresponds to what they were distributing, which is excellent. On the other hand, that's all the source they've provided. The pkgs.tgz binary they're providing is the binary packages shipped with the Joojoo, missing their source code. Many of these appear to simply be Ubuntu packages with the gpg signatures stripped, which is a GPL violation though not a terribly interesting one (GPLv2 only allows you to point at someone else's repositories if (a) you're not distributing commercially, (b) they gave you a written offer for the source code and (c) you pass on that written offer - however the source is out there, so it's not something I'm personally terribly upset about). In some other cases, there do seem to be genuine differences. udev, for instance, has a bunch of customisation. And finally there are packages that don't appear in Ubuntu at all, but which do contain GPLed or LGPLed material (such as webkit).

So, the take-home message is that even when given 6 months to provide source code, Fusion Garage are unable to adhere to the licenses of software they distribute. Don't give them any of your money, since unless they magically get significantly better it'll probably end up being spent on defending lawsuits.

Rapha&#235;l Hertzog: How Ubuntu builds up on Debian

I have been asked how Ubuntu relates to Debian, and how packages flow from one to the other. So here s my attempt at clarifying the whole picture.

Where do the packages come from? Most packages are created by Debian contributors and they are uploaded in Debian unstable (or Debian experimental). New packages are reviewed by the Debian ftpmasters before being accepted in the official archive. The packages are held in the NEW queue until the review is over, and the time spent there varies between a few hours and a few months (usually they are processed within one week or two). Ubuntu imports all the official Debian packages, but they also add some packages of their own. About 7% of the Ubuntu packages are third-party software that have been packaged for Ubuntu but not for Debian. What are the changes made by Ubuntu? From all the source packages coming from Debian, 17% have additional changes made by Ubuntu. Many of them are part of the main repository, which is actively maintained by Canonical and Ubuntu core developers. The universe repository is usually closer to the official Debian packages. Many of the changes made by Ubuntu are the results of the decisions taken during the Ubuntu Developer Summit in order to reach specific goals: provide a better user interface, offer faster boot times, become a better platform for third-party software developers, offer a good integration with their online services (Launchpad, Ubuntu One), etc. Other changes are simply the result of fixing bugs reported by Ubuntu users. Note that even non-modified source packages will result in different binary packages for Ubuntu. That s because Ubuntu has made changes to the build environment. They only support Intel-based computers with a 686-class (or newer) CPU, they enable some compiler options that Debian doesn t, etc. And all binary packages are modified by a program called pkgbinarymangler. Ubuntu s release cycle and the relation with Debian Ubuntu releases every 6 months (that s what time based releases is about). Debian has a very different schedule. How does Ubuntu manage to reuse Debian s work? Ubuntu imports packages from Debian unstable (even experimental sometimes) to get the newest packages. If the Ubuntu package already has Ubuntu-specific changes, they merge their changes in the updated Debian package. Otherwise the Debian package is simply grabbed and rebuilt in Ubuntu. This works well because Debian unstable is much more usable than the name suggests. And this process only goes on during the first 2 months of the cycle (until the Debian Import Freeze), so there s plenty of time afterward to fix the biggest problems. In the third and fourth month, it s still possible to pick updated packages from Debian but it must be requested by a developer, it won t be done automatically. At the end of the fourth month, the feature freeze is put in place. The 2 months left are dedicated to bug fixing and polishing the distribution. There are various sub-freezes that happen in this period, you can check the Natty release schedule as an example. Picking updated packages from Debian is now the exception, it will only be allowed if the update on the Debian side is a bug-fix only release. Credits: some figures taken from a talk of Lucas Nussbaum, they were collected based on the packages available in the Lucid Lynx release of Ubuntu. Click here to subscribe to my newsletter and get my monthly update on what s going on in Debian and Ubuntu.

15 comments Liked this article? Click here. My blog is Flattr-enabled.

21 November 2010

Russell Coker: Ruxcon 2010

Yesterday and today I attended Ruxcon the leading technical security conference in Australia [1]. The first lecture I attended was Breaking Linux Security Protections by Andrew Griffiths. This included a good overview of many current issues with Linux security. One thing that was particularly noteworthy was his mention of SE Linux policy, he cited the policy for the FTP server as an example of policy that can be regarded as too lax but also noted the fact that to get SE Linux used the policies had to be more liberal than we might desire. There is probably scope for someone to give a good lecture about how we are forced to make uncomfortable choices between making security features stronger and making them more usable.The next lecture I attended was Breaking Virtualisation by Endrazine. It makes me wonder how long it will be before someone cracks one of the major cloud hosting services such as EC2 it s not an appealing thought.Billy Rios gave a really interesting lecture titled Will it Blend? about blended exploits. The idea is to try and find a few programs which do things that are slightly undesired (arguably not even bugs) but which when combined can result in totally cracking a system. One example was a way of tricking IE into loading a DLL from the desktop and a way of tricking Safari into saving arbitrary files to the desktop, combine them and you can push a DLL to a victim and make them load it. Learning about these things can really change the way you think about misbehaving programs!Ben Nagy gave an interesting lecture about Prospecting for Rootite . His systematic way of finding test cases that cover a large portion of the code of a large application such as MS-Word seems quite effective. Once you have test cases that cover a lot of code then you can use fuzzing to find flaws.Edward Farrell gave an informative lecture about RFID Security , I didn t really learn that much though, he confirmed my suspicions that RFID implementations generally suck.Mark Goudie gave a very informative lecture titled We ve been Hacked! What Went Wrong and Why . Mark works for Verizon and often with the US Secret Service in investigating security breaches. He presented a lot of information that I have not seen before and made some good arguments in support of companies being more proactive in protecting their systems from attack.Stephen Glass and Mark Robert gave a lecture titled Security in Public Safety Radio Systems which mainly focussed on digital radios used by the Australian police. It would be good if the police got people like them to test out new kit before ordering it in bulk, it seems that they will be using defective radios for a long time (it s not easy or cheap to replace them once they are deployed).Edward Farrell gave an interesting lecture titled Hooray for Reading: The Kindle & You about hacking the Kindle. Unfortunately they haven t worked out how to get GUI code going on a hacked Kindle yet so there are some limitations as to what can be done.I think that the most interesting lecture of the conference was This Job Makes you Paranoid by Alex Tilley of the Australian Federal Police. He gave some interesting anecdotes about real cases to illustrate his points and he advocated the police position really well. I ve attended several lectures by employees of law enforcement agencies, but none of them demonstrated anywhere near the understanding of their audience that Alex did.The last lecture I attended was Virtualisation Security State of the Union by David Jorn of Red Hat. He gave an interesting summary of some of the issues including mentioning how SE Linux is being used for confining KVM virtual machines.Ruxcon was a great conference and I definitely recommend attending it. I have to note that even though there are police attending and lecturing it s not entirely a white-hat affair. One thing that I hope they do next year is to get a bigger venue. The foyer was rather crowded and because it had a hard floor was really noisy between lectures. Space and carpet are two really important things when you have lots of people in one room!

20 November 2010

Jon Dowland: scm

Can anyone recommend some videos to me which explain the ins-and-outs of the chef and puppet configuration management tools? I have some familiarity with configuration management, having worked on cfengine (version 2) for a few years. However I haven't managed to evaluate the newer tools effectively. The barrier to entry (setting up at least a master and a slave VM...) has been too high (or I haven't given it enough time!) If there are any good screencasts/videos that cover not just how they work but their individual advantages, that would be excellent: I have some upcoming time in which I can absorb material like that (but not the kind of time in which I could get hands-on).

18 November 2010

Rapha&#235;l Hertzog: 4 tips to maintain a 3.0 (quilt) Debian source package in a VCS

Most Debian packages are managed with a version control system (VCS) like git, subversion, bazaar or mercurial. The particularities of the 3.0 (quilt) source format are not without consequences in terms of integration with the VCS. I ll give you some tips to have a smoother experience. All the samples given in the article assume that you use git as version control system. 1. Add .pc to the VCS ignore list .pc is the directory used by quilt to store its internal data (list of applied patches, backup of modified files). It s also created by dpkg-source so that quilt knows that the patches are in debian/patches (and not in patches which is the default directory used by quilt). For that reason, the directory is kept even if you unapply all the patches. However you don t want to store this directory in your repository, so it s best to put it in the VCS ignore list. With git you simply do:
$ echo ".pc" >>.gitignore
$ git add .gitignore
$ git commit -m "Ignore quilt dir"
The .gitignore file is ignored by dpkg-source, so you re not adding any noise to the generated source package. 2. Unapply patches after the build If you store upstream sources with non-applied patches (most people do), and if you don t build packages in a temporary build directory, then you probably want to unapply the patches after the build so that your repository is again in a clean status. You can do this by adding unapply-patches to debian/source/local-options:
$ echo "unapply-patches" >>debian/source/local-options
$ git add debian/source/local-options
$ git commit -m "Unapply patches after build"
svn-buildpackage always builds in a temporary directory so the repository is left exactly like it was before the build, this option is thus useless. git-buildpackage can also be told to build in a temporary directory with --git-export-dir=../build-area/ (the directory ../build-area/ is the one used by svn-buildpackage, so this option makes git-buildpackage behave like svn-buildpackage in that respect). 3. Manage your quilt patches as a git branch Instead of using quilt to manage the Debian-specific patches, it s possible to use git itself. git-buildpackage comes with gbp-pq ( Git-BuildPackage Patch Queue ): it can export the quilt serie in a git branch that you can manipulate like you want. Each commit represents a patch, so you want to rebase that branch to edit intermediary commits. Check out the upstream documentation of this tool to learn how to work with it. There s an alternative tool as well: git-dpm. Its website explains the principle very well. It s a more complicated than gbp-pq but it has the advantage of keeping the history of all branches used to generate the quilt series of all Debian releases. You might want to read a review made by Sam Hartman, it explains the limits of this tool. 4. Document how to review the changes One of the main benefit of this new source format is that it s easy to review changes because upstream changes are kept as separate patches properly documented (ideally using the DEP-3 format). With the tools above, the commit message becomes the patch header. Thus it s important to write meaningful commit messages. This works well as long as your workflow considers the Debian patches as a branch that you rebase on top of the upstream sources at each release. Some maintainers don t like this workflow and prefer to have the Debian changes applied directly in the packaging branch. They switch to a new upstream version by merging it in their packaging branch. In that case, it s difficult to generate a quilt serie out of the VCS. Instead, you should instruct dpkg-source to store all the changes in a single patch (which is then similar to the good old .diff.gz) and document in the header of that patch how the changes can be better reviewed, for example in the VCS web interface. You do the former with the --single-debian-patch option and the latter by writing the header in debian/source/patch-header:
$ echo "single-debian-patch" >> debian/source/local-options
$ cat >debian/source/patch-header <<END
This patch contains all the Debian-specific
changes mixed together. To review them
separately, please inspect the VCS history
at http://git.debian.org/?=collab-maint/foo.git
<put details="details" here="here" more="more">
END
Subscribe to this blog by RSS, by email or on Facebook.

11 comments Liked this article? Click here. My blog is Flattr-enabled.

Next.

Previous.