Search Results: "tach"

28 May 2007

Andrew Pollock: [tech] LVM, you've done it again

The good thing about having kept a blog these last few years, is I have a searchable record of hardware changes. Recently, I noticed a few disk errors on caesar, and I was wondering how old that disk was. I disk some searching, and found via this post that the disk in it was a hand-me-down from when I decommissioned daedalus Mk I. One of the reasons I decommissioned it when I did, was the RAID-1 was exhibiting some strange errors during resynchronisation, and I didn't want to leave the country leaving behind an ageing problematic server with my stuff on it. I'd previously been unable to fault either 120 Gb disk under some light testing with badblocks, so I just reused them, and so around October 2005, I put the larger disk in caesar. So this disk has seen a fair bit of use, originally in daedalus, and then in caesar for another 20 months. It's allowed to fail, it's served me well. Anyway, so I bought a 750 Gb drive a couple of weeks ago, because one thing that I've wanted to do with caesar was do remote backups of daedalus, and there just wasn't enough space to do that, so I went for as big as I could find, and essentially repeated the same trick as last time, to upsize:
  1. Power down, attach new disk as a slave
  2. Boot into single user mode
  3. Unmount everything, remount root read-only
  4. sfdisk -d /dev/hda sfdisk /dev/hdb to copy the partition table (I use a root, swap, LVM, three partition layout)
  5. dd if=/dev/hda1 of=/dev/hdb1 bs=1M to copy the root filesystem to the new disk
  6. mkswap /dev/hdb2 to put the swap signature on what will become the new swap device
  7. cfdisk /dev/hdb and blow away the third partition and recreate it using all of the available space (there's probably a programmatic way of doing this, but hey, it's not exactly hard to do in cfdisk either)
  8. pvcreate /dev/hdb3 to put an LVM signature on the new LVM physical volume
  9. vgextend base /dev/hdb3 to tell LVM there's two disks in the volume group for the time being
  10. Remount the root filesystem read-write
  11. rm /boot/grub/device.map and run /usr/sbin/grub-install /dev/hdb to install GRUB in the MBR of what will become the new boot disk
  12. Power down, swap the disks around so that the new disk is now primary and the old disk is now the slave
  13. Boot into single user mode again, unmount everything except root
  14. pvmove /dev/hdb3 /dev/hda3 to relocate all of the allocated physical extents off the old disk onto the new one
  15. Twiddle thumbs for a couple of hours. Admire artwork on computer's motherboard (did you know Compaq EVO's have a picture of a car on their motherboards? A map of Texas?)
  16. vgreduce base /dev/hdb3 to take the old disk out of the volume group
  17. pvremove /dev/hdb3 to remove the LVM signature from the old disk
  18. Power down and remove the old disk
  19. Reboot into multi-user mode and profit from all the additional free physical extents
I absolutely love how I can do this with LVM, with a minimum of fuss. Last time I did this, I had a kernel panic during the pvmove, but that didn't even stop it, I just rebooted and reran the pvmove and it carried on from the last checkpoint. No such excitement this time. I'm sure Solaris' ZFS does all of this with substantially less manual steps, but hey, I like my Linux :-)

27 May 2007

Bastian Venthur: Please help to localize reportbug-ng

I’ve just uploaded a new version of reportbug-ng. The biggest change in this release is the new reportbug-ng.pot file which contains some work for our brave localization teams. I’ve already translated rng into German, so rng is now available in German and English. If you want your mother language to appear in this list, please grab the .pot, translate it and file a l10n+patch bug against reportbug-ng with the translation attached. Thanks!

Andrew Pollock: [tech] Finding out just how hot the linen cupboard is...

I decided to move the old 1-RU Pentium III server (the thing providing all the storage for my MythTV box via ATAoE) from under the bed in the spare room to the linen cupboard. It had a brief stop in the wardrobe in the spare room, but it didn't really help with the noise. Sarah was a concerned about the heat in the linen cupboard, as this is where the patch panel is, so caesar is already in here, along with an Ethernet switch, an ADSL modem, a wireless access point, and the Vonage ATA. There's a lot of DC plug packs generating heat, so it was a reasonable concern. I figured in this day and age, someone must make some sort of USB temperature sensor, and after some searching around, I discovered the DLP-TEMP-G, which seemed to be about the right price, doing what I wanted. I'm going to say the web page was a bit ambiguous, but it was probably just late at night, because I read the bottom as having the option to buy it from Mouser, or via PayPal directly with DLP Design. So I went down the latter path, because I generally prefer to deal directly with the manufacturer. Turns out what I was actually ordering was just a "Test Application", so that email I'd received the day after I placed my order for two units was all I was going to get. I figured this out after a week or so of wondering when it was going to arrive. They were really good about it, and refunded me my $40, even though I'd received said software, and I placed a new order with Mouser for what I really wanted. Now this time, I just didn't read things thoroughly enough, although I'll still say that things were a little ambiguously worded. The page I've linked to above does say "DLP-TEMP-G and 1 DS18B20 sensor $25.00", but when reading datasheet, it goes on about three sensors, and coming with one that isn't soldered on so that you can optionally run a cable between it and the board. I somehow interpreted this as meaning there were two sensors on the board, and one loose. Not the case. The board supports having up to three DS18B20 sensors attached to it, however you please. It comes with one unattached. In hindsight, why would you want two temperature sensors directly on the board? So the moral of this story is I just can't read. Anyway, I got home from Santa Monica last night, and the goods had finally turned up, so I had a play. The DS18B20 just looks like a transistor. I initially ignored it, and just shoved the USB board in caesar, and it happily recognised it
usb 1-1: new full speed USB device using uhci_hcd and address 8
usb 1-1: configuration #1 chosen from 1 choice
drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: Detected FT232BM
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new driver ftdi_sio
drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver
I then fooled around with minicom, and discovered that the little transistor thing I'd been ignoring was indeed the temperature sensor, as I got a reading of zero back (when using this program I found on the 'net). So I went to bed, and this morning did a bit of messing around with the sensor, and with a bit of creative bending, I've got it sitting in the S1 holes without requiring any soldering. It tells me the linen cupboard is about 44 degrees Celsius. Warm, but I don't think it's in any immediate danger of bursting into flames. Wouldn't surprise me if some of the gear in there isn't too keen about the temperature though. At least we won't have to worry about mold. Next step is to convince cacti to graph it, and nagios to monitor it, and we're in business. Here's a little Python program I knocked up to grab the temperature. pyserial is nice. Read on, Macduff!

24 May 2007

Nico Golde: creating (dynamic) function call graphs

I am currently writing a general purpose shared library for acpi (more on that soon).
I was interested in having a function call graph especially to see if the interface looks somehow clean and to include it in the documentation of the library. Of course I wanted to do it with open source tools. There are several tools for static call graphs but if you want dynamic call graphs you have to use additional features of your compiler to generate a graph based on code during runtime.

The first variant I tried was using egypt a small perl script to generate a dot file. Dot (today included into graphviz? is a tool originally developed at AT&T to generate hierarchical or layered drawings of directed graphs.

So what is needed?
First install software (here on a Debian systen, egypt is not included in Debian):
$ aptitude install graphviz graphicsmagick (+ download egypt from the homepage)

Compile your software using gcc with the option -dr to dump an RTL file of the source.
Most of gcc's work is done in an intermediate representation of your code, called register transfer language (RTL). This pretty much describes the instructions in plain text and is inspired by LISP lists.
Ok, here we go:
$ gcc -dr list.c libacpi.c test.c
This generates three RTL files, for every source file one. Depending on the gcc version the names may vary, here the names are libacpi.c.00.expand list.c.00.expand and test.c.00.expand.

Now use egypt to create a dot file (I don't want one for test.c now):
$ egypt libacpi.c.00.expand list.c.00.expand dot -Gsize=100,100 -Grankdir=LR -Tps -o graph.ps
Egypt will create dot-output and by piping it to dot with -Tps -o graph.ps you get the resulting graph as a ps file. -Grankdir is used to generate a graph which runs from the left to the right, default is up-down which looks a bit strange.

Now convert the ps file into a png:
$ gm convert graph.ps graph.png
The result looks like this (looks cool huh? :-)):



The second variant I tested is a bit different and in my opinion the resulting graph looks a bit better.
The gcc commandline switch -finstrument-functions allows easy creations of call-graphs for C/C++ (script languages used but I haven't tried).
You need to compile every file with the -finstrument-functions switch. Then gcc places a call to the functions __cyg_profile_func_enter upon entering a function and __cyg_profile_func_exit on leaving a function.

Compile your sources with -g and -finstrumental-functions:
$ gcc -g -finstrumental-functions list.c libacpi.c test.c -o test
Now you need to get some source code by Sebastian Krahmer (SuSE):
$ wget http://www.suse.de/~krahmer/instrumental/instrumental.tgz && tar xvfz instrumental.tgz && cd instrumental
Compile a shared object file:
$ cc -fPIC -c instrumental.c && ld -Bshareable instrumental.o -o inst.so
This generates a shared object file you can preload with LD_PRELOAD
$ LD_PRELOAD=./inst.so test
.....

Now you will find a log.inst.dot.<pid> and log.inst.ascii.<pid> in /tmp (path can be modified in instrumental.c).
The first file is a dot file you can now create a ps and a png file with but you need to attach a closing bracket at the end of the file since the package is not
able to intercept exit() or aborts. echo ' ' >> log.inst.dot.<pid>
$ dot -Gsize=15,20 -Grankdir=LR -Tps -o graph.ps log.inst.dot.<pid> && gm convert graph.ps graph.png
The result looks like:


PDF file which scales a bit better

The other file represents the call graph in ascii:
~ [1000 1000 1000] -- main (0x8049ea4)
~ [1000 1000 1000] -- check_acpi_support (0x8048984)
~ [1000 1000 1000] -- get_acpi_version (0x8048782)
~ [1000 1000 1000] -- get_acpi_content (0x80486b4)
~ [1000 1000 1000] -- scan_acpi_value (0x8048837)
~ [1000 1000 1000] -- init_acpi_batt (0x80489d6)
~ [1000 1000 1000] -- dir_list (0x804a447)
~ [1000 1000 1000] -- new_list (0x804a23c)
~ [1000 1000 1000] -- append_node (0x804a309)
~ [1000 1000 1000] -- append_node (0x804a309)
~ [1000 1000 1000] -- read_acpi_battinfo (0x80497d3)
~ [1000 1000 1000] -- get_acpi_content (0x80486b4)
....

So both methods work but the first seems to be more useful if you want a graph for a specific file, not a specific program since you get an RTL file for each source file and you don't need all to create the dot file. The second method however looks better but has the limitation that you actually need to run the program (but that's dynamic and not static) and you can't (correct me if I miss something) create graphs for single files.

Have fun creating graphs for your favorite software and have a look into Sebastian Krahmers paper http://www.suse.de/~krahmer/instrumental/instrumental.pdf and http://www.ibm.com/developerworks/library/l-graphvis/. He also created a graph for openssh http://www.suse.de/~krahmer/ossh4.6.pdf.

22 May 2007

Alastair McKinstry: Election 2007: Choices in Galway West ?

Has anyone seen a recent poll for Galway West? (In the Irish General Election, that is). The last poll was March 26th, which is way out-of-date : long prior to the election being called, before the Cryptosporidium Crisis, etc. The result is, I'm in the unusual position of having to make a decision. Ordinarily I'd vote Number 1 for Niall O'Brolch in (Green) and 2. Micheal D. Higgins (Labour). Ireland uses the unusual Single Transferable Vote system, with multi-member constituencies. Galway West is a 5-seat constituency, and Micheal D. is a long-sitting TD, who most would have expected to be automatically returned. Niall O'Brolch in is fairly new; he's a member of the City Council and current Mayor of Galway (thats a relatively powerless post in the Irish local council scheme of things, though). Unfortunately news from the Labour camp appears that too many people assume he will be automatically returned; the word they are getting on the street is "Yes, you'll be getting my no.2 ". But in the STV system, this could mean he wouldn't be in the running. Those votes for the Greens and others will perhaps stay with the Greens and won't transfer to him. So the choice, Vote 1. Greens, which is my natural preference, or 1. Labour, in the hope of getting both Micheal D. and Niall elected? a poll of the current situation would help. BTW, for voting geeks, following the link and reading about STV is worth it. It makes Irish election counts the most fun election counts in the World. One of the main arguments against electronic voting in Ireland has been that it would take all the fun out of the count, which would be over too soon ... Tags ,

Alastair McKinstry: Irish, Schools and the Election

Well, theres a General Election here in Ireland on the 24 May, and the politicans are well and truly on the last lap of the campaign trail. We're a bit rural to see them all, for those who don't make it to the door, here's something to think about. In Moycullen we are on the edge of the Gaeltacht. Various institutions, such as the main primary school, have been struggling to retain that status with the encroachment of the B arla 'burbs (suburbs of the Gaeltacht where English dominates). Our children go to Baile Nua, the villages' gaelscoil. To hold standards, the school has a policy of capping its current enrollment (to 84, I think), to keep class sizes small, until the potential intake is large enough to justify another teacher. Fair enough. However this has the side-effect that, in an area supposedly set aside to protect the Irish language, students are necessarily turned away from the only Irish-language school in the Village. Any comments? Tags , , ,

18 May 2007

MJ Ray: Server setup: Samba

What I learnt this morning while installing Samba so that an out-of-ink Microsoft PC could print on a toner-full laser attached to a GNU/Linux workstation: Firstly, the manual authors seem to prefer to document CUPS. I don't understand why. Surely if one has CUPS installed already, a Microsoft PC can print to it as a network printer without Samba? I installed Samba because I want to print without replacing lpr and breaking things that print from the workstation already. Secondly, if you ytpo smb.conf badly enough, then smbd will sulk. Particularly passwd-related options. To persuade it to give useful error messages, smbd -F -S -i seems the magic combination. If you don't put -i, it decides that you really meant it to daemonise, despite the other options. Thirdly, it doesn't break it if Microsoft Windows puts "unable to connect" or another strange message on its Printers window. I'm not sure what that message really means. Finally and most importantly, if the nobody user is not allowed to print, make sure Samba is sending the print job as a different user that is allowed to print. That's the "guest account" option in the printer config.

17 May 2007

Ross Burton: GTK+ Tip of the Day, Sound Juicer news

First, a tip of the day. Thanks to Matthew Garrett for pointing out that GLib 2.14 will have API for creating timers with second granularity (instead of millisecond): g_timeout_add_seconds(). This means that multiple timers scheduled to go off at roughly the same time will be fired at once, resulting in power savings. I'm pleased to see this land in GLib, and can't wait for GLib 2.14 now as it is looking really good: GRegex and GSequence in particular are interesting new additions. In Sound Juicer news, Luca Cavalli has ported the gedit/Epiphany plugin code to SJ. It's definitely work in progress at the moment, but it is coming together nicely. Follow #311688 if you want to keep up with the changes. The first two plugins I'd like to see from both feature and proof of concept angles are more complete CD playback controls (repeat and random), and downloading of album cover art. NP: Delay, Dub Tractor

14 May 2007

Uwe Hermann: Playing audio on the NSLU2

3D Sound USB Audio Device I'm a happy NSLU2 user since a few months now, and I'm using it for all kinds of things, e.g. as a 24/7 remote ssh server at home (using DynDNS and the ddclient Debian package), as IRC logger (screen + irssi), etc. etc. I was considering multiple options as to where/how to install the slug (USB thumb drive, Compact Flash, disk drive, ...) but I settled with a full Debian install on an 1 GB USB thumb drive for now. I implemented some measures to maximize the life time of the USB thumb drive, maybe I'll post some info on that later... One new thing I've been trying lately is to use the slug as an audio player. As it doesn't come with an integrated sound card, you have to use an external USB audio device. I've got mine (see photo) from eBay for ca. 5 Euro (+ shipping) and it works out of the box with Linux 2.6.18 using the snd_usb_audio kernel module. You simply attach it via USB (the module is automatically loaded) and then attach external speakers to it. Here's an lsusb of the device:
Bus 001 Device 011: ID 1130:f211 Tenx Technology, Inc.
One problem with playing audio on the slug is the slow CPU. At 266 MHz (and without FPU!) playing audio with "normal" audio players such as mplayer or mpg321 is not possible. But there are several ways to make the slug play your favorite music. Here's a list of players I tested and a status report of whether they work at all. If yes, I listed a rough percentage of CPU load resulting from playing the music.
  • Ogg vorbis:
    • mplayer, aplay, playsound, and ogg123 don't work.
    • $ apt-get install libvorbisidec-dev
      $ cd /usr/share/doc/libvorbisidec-dev/examples
      $ make
      $ cat foo.ogg   ./ivorbisfile_example   aplay -f cd
      
      Result: 40% CPU load
  • MOD, XM, S3M, IT, etc.:
    • $ mikmod foo.mod: 10% CPU load (even with compressed MOD files)
  • WAV:
  • FLAC:
  • SPEEX:
    • $ speexdec foo.spx: doesn't work, 100% CPU load. Any known alternatives?
  • AU:
    • $ cat foo.au > /dev/dsp: 3% CPU load (but sounds crappy)
    • $ cat foo.au > /dev/audio: 3% CPU load (sounds better)
    • $ mplayer foo.au: 5% CPU load
    • $ aplay foo.au: 5% CPU load
    • $ playsound foo.au: 5% CPU load
  • AIFF:
    • $ sox foo.aiff -t wav - aplay: 50% CPU load (a bit stupid, but it works)
  • Streaming MP3:
    • $ mplayer http://www.example.com/foo.mp3: doesn't work, 100% CPU load.
    • $ wget http://www.example.com/foo.mp3 -O - madplay - : 17% CPU load
  • Streaming Ogg Vorbis:
    • $ cd /usr/share/doc/libvorbisidec-dev/examples
      $ wget http://www.example.com/foo.ogg -O - ./ivorbisfile_example aplay -f cd
      : 40% CPU load
  • The SlugAsAudioPlayer page in the NSLU2-Linux wiki might have further information on this topic. Feel free to add comments if you know of other audio types which can be played on an NSLU2.

    2 May 2007

    Anthony Towns: A conversation with jdub

    A couple of months ago I was sitting in a north Sydney pub cradling a beer with the ineluctable jdub, the decidedly unparsimonious rusty and (if I’m accurately remembering who’d left and who hadn’t by this point) the irremediable mrd. As you might imagine, these sort of conditions are a perfect breeding ground for a particular type of discussion, and with Jeff’s departure from Canonical not that long beforehand accompanied by the then ongoing DPL elections, talk turned to the future of Debian, and in particular Jeff’s views on that future. Obviously more than a few weeks have passed since then, so please imagine this as a dream sequence with a stylish TV fade-in accompanied by appropriate fine print caveats about paraphrasing and the perfidy of memory. I think it’s fair to sum Jeff’s main point about the future of distros as one of “disintermediation” – that is removing, or at least minimising, the barriers between the authors and users of a piece of software, and in general getting closer and quicker collaboration between everyone involved and interested in developing and maintaining that software. Which means things like trying to remove the line between the Debian bug tracker and upstream bug trackers entirely, so that Debian users end up talking directly with the upstream maintainers, rather than having a Debian maintainer relaying information between the two. It also means making the path for updated packages to get to users quicker and smoother – so that as soon as a developer commits a new version of the software to version control, the next time users of that software “apt-get update” they see it, download it, and start using it. Or at least, they do if they’ve chosen to follow the bleeding edge. Jeff had a bunch more ideas in that vein – like not bothering with a central archive, but having users collect the packages they’re interested in from upstream sites all over the place, standardising, reducing or removing the “control” information for packages so that creating the correct packages for 80% of free software (that uses ./configure in the usual way, eg) was a complete no-brainer, and perhaps viewing distributions not so much as the gatekeepers and central players of the open source world, but perhaps more as systems of providing resources, assistance and opportunities to software authors who deal with their users directly – and in so doing have more of an opportunity for their users to actively participate in the project’s development, and have more feedback (and control) of how their project is perceived by its users. I’m not sure if I’m doing it justice – it’s a pretty radical notion, and as an upstream-type hacker, Rusty was pretty enthralled by it. As a distro-type hacker, on the other hand, I’d have to say I was daunted: getting rid of the middleman here means getting rid of Debian, which I must admit I have something of an attachment for… and yet, in principle at least, I can’t see anything but good sense in the idea – getting users and developers interacting more closely is important to improving the free software community, and while distros have historically been a force for making free software more accessible to people, it’s entirely possible we can now make it even more accessible now by, in some sense, doing away with distros. And if that’s the case, then we definitely should, because it’ll benefit both users and developers of free software, which is what we’re all about. On the other hand, distributions (at least currently) aren’t just about collecting and compiling software which could be automated; it’s also about integrating it, standardising interactions between software, and in some cases acting as a buffer between users who want to use a bit of software and developers who for one reason or another don’t actually want to deal with those users (perhaps due to lack of a shared language or political or philosophical disagreements). I think it’s also pretty interesting to view Gentoo through this light; that is, not so much as a distro that makes you compile everything from source, but rather as a distro that gives its users a system based on exactly what the developers produce, with the addition of only a comparably tiny amount of Gentoo-derived content. Maybe it’s just me, but Gentoo sounds a lot more interesting to me in that light. So is that a foretaste of the future of binary free software distributions too? There’s a lot of things that would stand in the way of Debian managing that, but so far all I can think of is a thousand problems that should probably be solved anyway, and not even one that can’t. I think, btw, that jdub had been reading Accelerando (also available as a Creative Commons licensed ebook) somewhat concurrently with thinking about this stuff, so perhaps it should be called “Distributions 2.0” or something. Accelerando’s a crazy-awesome near-future/singularity book by Charles Stross, who happens to live in the city that will host the forthcoming DebConf 7…

    30 April 2007

    Kai Hendry: Etrex plotting

    Etrex via a USB interface This morning I thought I couldn’t get my GPS tracklog from my bike ride through London off my Etrex GPS device as I didn’t have:
    1. A serial port on my X40
    2. Google plus (20USD for getting data off my GPS!) on my Windows desktop at work
    As I left work, a colleague suggested I try an USB serial adaptor that was lying around. He also gave me a CD with the drivers. I said I don’t need drivers! I run Debian, much to my colleague’s bemusement. Anyhoo, the USB/Serial interface works well, it comes up like so:
    Apr 30 22:56:53 monty kernel: usbcore: registered new driver usbserial
    Apr 30 22:56:53 monty kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
    Apr 30 22:56:53 monty kernel: usbcore: registered new driver usbserial_generic
    Apr 30 22:56:53 monty kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core
    Apr 30 22:56:53 monty kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
    Apr 30 22:56:53 monty kernel: pl2303 2-1:1.0: pl2303 converter detected
    Apr 30 22:56:53 monty kernel: usb 2-1: pl2303 converter now attached to ttyUSB0
    
    Then I ran: gpsbabel -t -i garmin -f /dev/ttyUSB0 -o gpx -F tracklog.gpx To download the track log from the Garmin. Then I converted the GPX into KML with this Gpsvisualizer Web application. Then I load up the KML with Google Earth to see where and when I have been cycling London. Google Earth really needs the package libgl1-mesa-dri installed to get DRI working on my X40 machine. Google earth showing my track log Though I prefer not to use Google Earth. I wish I could load the data with this Google maps animator, though the service doesn’t seem to accepting new accounts. Grrr… Update: Just a couple of comments about riding in London:

    27 April 2007

    Martin F. Krafft: Moving in pieces, with and without morphine

    As readers of my blog know, I moved to a new flat just after Easter. Unfortunately, on that Monday afternoon, just after we finished hauling most of the furniture (the heavy stuff at least) over to the new place, I slipped as I was leaping off the transporter vehicle, lost an argument against gravity and hit the asphalt more or less horizontally after a 1.5 metre fall. I landed on both wrists and my left knee, and while my consciousness never left, reality sort of blurred away, as I rolled over on the ground and waves of pain began rippling through my body. People started assembling around me and the adrenaline faded away, then I realised that this move of mine was not going to end as smoothly as it had begun. My body refused to bend my left wrist and knee and I knew I was injured, but it did not hurt so much for me to conclude anything serious. I remembered the ice packs in my freezer and had my cousin fetch them, then let two colleagues carry me to bed to regain my bearing, but the pain got worse and I started to accept that I would have to go to the hospital. Still optimistic ("it's just a contusion, it's just a sprain"), I crawled from my cousins car to the wheel chair, into the hospital and onto a bed to await the verdict. Still thinking about returning home tomorrow, I spent hours on the bed, being pushed between the x-ray, casting, and diagnostic rooms until finally I was told of my fate: multiple fractures of my left knee cap, broken ulna and radius on my left arm with splinters in the joints, and a fractured metacarpal bone on the right my pinky's tendon was supposed to snap, but it proved too strong and rather caused the part of the bone to which it was attached to rip off. They deciced to perform surgery on the two left limbs but to leave the metacarpal bone alone because of the complexity of the fracture and the proximity of all my hand's and fingers' nerves. Because everything was swollen like a balloon ready to burst, I had to wait three days for the surgery with casts and a splint on my leg. The surgery was scheduled for Thursday morning and even though I was actually looking forward to it all (especially the administration of the anesthetic), I was simply too tired in the early morning hours, and the Dormicum tablet they fed me did the rest: I was asleep when we entered the surgery room and woke up at noon with new casts and a morphine injection pumping a comparatively large dose of the drug into my veins every eight minutes apparently, my body was going through a lot of pain during the surgery, so the "pain management service" (in German, they're just called "Schmerzdienst" "pain service", actually) opted to pump it up. Here's what I looked liked shortly after the surgery: madduck post-surgery Meanwhile, Gian-marco, my future flat mate, had spent the day packing up everything that was left in my old flat, where I had left an utter mess. A colleague of mine was to sublet the place starting that Saturday, so there were roughly 48 hours left to empty and clean it, and to hand it over. There are more pleasant things in heaven and earth than to have someone else empty your flat for you. Morphine is a really crazy drug. Most people think of it as fuzzy and often joke about taking it if only they could get their hands on it. Having made the experience, I'd rather not take it again unless I have to. Watching television turned out to be impossible, even the weather report went too fast for me. Visitors appeared sort of blurry, I would often not follow the things they said, and it was definitely impossible to entertain thoughts for prolonged periods of time, or to engage in any sort of productive thinking. Organising a cleaning lady for my old flat and giving instructions to my cousin, who would hand over the flat took all my energy On Friday, I was to have an important business meeting with three people, so I organised a room in the hospital and asked the nurses to put me on optional morphine so I could be a bit more present during the meeting. As a consequence, I could press a button once every ten minutes for a dose of morphine, and with this new level of control, I began to reduce the drug amount in my blood gradually. The meeting did not take place in the end but I came to regret my choice to reduce the morphine at around midnight, when the pain in my knee became unbearable. I kept pressing the button for more morphine like a madman, but the device would only deliver a new shot every 10 minutes. The nurse was not authorised to change that and instead gave me other pain and sleep medication, but not even the combination of morphine, Tramal (an opiod), Novalgin, Mefenacid, and Paracetamol could dampen the level of pain, and so I spent almost three hours in real agony, biting the pillow with tears running down my cheeks, until finally the medication won, I became indifferent (thanks to Temesta) and drifted off into sleep. After breakfast the next morning, the morphine applicator suddenly had a fit, started beeping, and pumped more drug into my body than it should have. It took me about 20 minutes or maybe an hour (who knows ) to put my brain together, realise what had happened, and come up with a way to lift my finger to the button to call the nurse. Despite the horrible night, I told them to remove the morphine because I'd rather stand the pain than have my brain mushed like that, plus there are always plain morphine injections delivered by humans instead of machines. In fact, the next night I could feel the pain approaching and since it's easier to suppress pain than it is to remove it, I asked for a sleeping pill and a morphine injection. The injection did three things: first, it hurt so much that my knee immediately became pain-free while nerve central was occupied trying to figure out what the heck had just happened in my right thigh. Second, it did not take three minutes to kick in, and it kicked in so strongly that I just barely realised that my head was suboptimally positioned on the pillow and the lights still on, but failed to do anything about it. I did not wake once until breakfast. And third, I am glad to know that morphine does actually (still) work. Pain is complex, fascinating, useful, sometimes even pleasurable to some, but when you know the cause and you'd rather make it stop, it's comforting to know that there are ways the previous night had instilled some doubt in me. From then it was all downhill and I left the hospital after eleven days on Thursday, got by without pain medication the same day and off the sleeping pills the next night. Two days later I was already racing around town in my wheel chair: madduck racing in a wheel chair By now I can actually walk again, albeit slowly, and even though I still cannot lift heavy stuff or get my hands wet, my hands are a lot better; on 21 May, the casts shall be removed and I'll be able to bend my knee again, but it may take up to a year to return to sports, such as running, to which I had just become addicted. In fact, I can comfortably claim that I had just reached an acceptable level of fitness just before the injury. Tough luck. My mother has come to Zurich twice already to help unpack and with her invaluable help, as well as the help of Gian-marco and several others, we are actually almost done moving in. Ironically, it's actually quite annoying to sit and watch others do your work; I would have helped as well, had the roles been inverted, and yet I am still greatly indebted. Human relations tend to be funny like that. Let me end with two points: first, Zurich's university hospital probably ranks among the best hospitals in the world, and that makes Zurich even more attractive to me (even though I certainly don't plan my next hospital stay). I felt very comfortable throughout my stay, had the impression of being in very capable hands, and had most of my countless questions answered. In addition, the hospital is very nicely surrounded by a park and could not be more central, which makes it easier for visitors. And that brings me to my final thought: thanks to everyone who stopped by or called in to make my stay a lot more pleasant. I spent eleven days in the hospital and I got bored and annoyed for the first time on Wednesday, the day before my release. Most of the credit for those ten days of lack of boredom goes to everyone who supported me. It did help that I had Internet access via a convenient 2 /day GPRS flatrate (even though I could not really type), but it became crystal clear to me that visiting someone in the hospital, whether you're close to the patient or not, is one of the most beautiful gifts you can give. In the past I have neglected this opportunity occasionally; now I would want to make a special effort (even though I hope there won't be any need). And I would not be a geek if I did not end this post with a reference to Debian: I know of a case when one of our developers ended up in hospital and two others (or was it more?) drove hours to visit and check in on him/her. Now even more than before can I say that I am proud to be a member of a project in which such things happen. PS: this post took me about 4 hours to compose. Sucks to be typing one-handed.

    Enrico Zini: tg-file-download

    File downloads with TurboGears In TurboGears, I had to implement a file download method, but the file required access controls so it was put in a directory not exported by Apache. In #turbogears I've been pointed at: http://cherrypy.org/wiki/FileDownload and this is everything put together:
    from cherrypy.lib.cptools import serveFile
    # In cherrypy 3 it should be:
    #from cherrypy.lib.static import serve_file
    @expose()
    def get(self, *args, **kw):
        """Access the file pointed by the given path"""
        pathname = check_auth_and_compute_pathname()
        return serveFile(pathname)
    
    Then I needed to export some CSV:
    @expose()
    def getcsv(self, *args, **kw):
        """Get the data in CSV format"""
        rows = compute_data_rows()
        headers = compute_headers(rows)
        filename = compute_file_name()
        cherrypy.response.headers['Content-Type'] = "application/x-download"
        cherrypy.response.headers['Content-Disposition'] = 'attachment; filename="'+filename+'"'
        csvdata = StringIO.StringIO()
        writer = csv.writer(csvdata)
        writer.writerow(headers)
        writer.writerows(rows)
        return csvdata.getvalue()
    
    In my case it's not an issue as I can only compute the headers after I computed all the data, but I still have to find out how to serve the CSV file while I'm generating it, instead of storing it all into a big string and returning the big string.

    21 April 2007

    Erich Schubert: More AppArmor FUD^W PR:

    I didn't intend to write (ok, rant...) on this topic again, but a few days ago, this "AppArmor FAQ", was posted to the Linux Kernel Mailing list. Again, this is a lot of 'marketing stuff', and doesn't have the facts quite right...Some quotes:
    In the traditional UNIX model, files do have names but not labels, and applications only operate in terms of those names.
    No. In the traditional UNIX model, filenames point to inodes, and the inodes contain data such as file modification dates and permissions. This is where SELinux stores the labels it uses for access control. In fact, the "unix owner" and "unix group" are pretty much the same thing as SELinux labels. And also work pretty much the same way.
    Contrary to popular belief, AppArmor is *not* "Pathnames R Us", but rather "Use native abstractions to mediate stuff": when you mediate something, you should use the native syntax that users normally use to access the object.
    Maybe the appropriate term would have been "naive abstractions"?And, no, security systems shouldn't be designed around what a user can easily grasp, because that might just not work... it should be designed around the way resources are handled and how you can successfully restrict access."Contrary to popular belief", SELinux *does* use path names. Actually in a very convenient way for the users. So I wouldn't claim SELinux is really harder to use than AppArmor because of its use of path names.The difference is that SELinux doesn't rely on the path names, but it still gives the user the possibility to use them. In fact, the only way I know to get a proplerly labeled filesystem is based on path names.If I'd for example keep my web stuff in /home/www, I can tell SELinux that the appropriate label is httpd_sys_content_t by doing
    semanage fcontext -a -t httpd_sys_content_t /home/www
    restorecon -R /home/www
    
    In AppArmor, I'd need to modify the policy for several applications to achieve this, because of it's dependency on path names. SELinux also uses an abstraction. One that is very convenient for users actually. SELinux does access control on object classes. What I'm doing in above example is to put these files into the "Web site data files" class. So please stop scaring people of "labels". That is just the technical term for what is an "object class", a concept every developer will be familiar with. (SELinux policy development has a couple of OOP-like features, btw., for example it is possible to give an application access to 'all log files'.)There are, however, some true statements hidden in there:
    We also acknowledge that pathname based access control requires a way to perform pathname matching in the kernel, and this comes at a cost higher than comparing object labels [...]
    So by providing string matching in the kernel, AppArmor trades run-time performance to grant reduced administrative work. It is however not obvious how large the difference in "reduced administrative work" is between AppArmor testing the filename "run-time" compared to SELinux using filenames to relabel files "on demand" (or, with restorecond, even on creation by using inotify).What I still seriously dislike is the FUD spread by AppArmor people such as
    Label-based security (exemplified by SELinux, and its predecessors in MLS systems) attaches security policy to the data. As the data flows through the system, the label sticks to the data, and so security policy with respect to this data stays intact. This is a good approach for ensuring secrecy, the kind of problem that intelligence agencies have.
    Why should this only be useful to "intelligence agencies"? Some people live in countries with very strict privacy requirements, and we might want to use these techniques to lessen the risk of leaking data. In AppArmor, I can copy a file with private customer data to the web server directory, and it becomes readable by the web server. In SELinux, the file will still be unreadable by the web server. Does that really sound like "only useful to intelligence agencies" to you?Dear AppArmor people, please stop trying to invoke fear of the NSA, just to make people use AppArmor. That makes you look very untrustworthy, you know...The SELinux kernel code is part of the Linux kernel, AppArmor is not. So in theory, that code has been reviewed much better than yours, and is maybe even less likely to contain a "NSA backdoor" than yours. Changes to SELinux are openly discussed on a mailing list, and go through peer review there. They foolow a very strict coding style, which makes review easier; obfuscated code doesn't have a place there. It's not like we were running a binary blob from the NSA we can't have a look at.

    18 April 2007

    Biella Coleman: The Importance of Celebration

    Recently a Debian user left a really nice note letting me know “It makes
    me happy and proud to learn that boricuas are Debian developers! (Hopefully you are not the only one). This is for me the best Debian News since Etch released. Proud and happy for you.” Here I have to confess, however that I am neither a DD nor really a true Boriqua. I have studied Debian for many years, but have never officially joined. In terms of PR, none of my family is originally from there as my father is Jewish American and my mom was born in Russian, wandered as war refugee for many years in Europe and eventually landed in Venezuela, where I was born. But I have made my home in PR for many years and do consider it one of my many homes. Speaking of many homes, I also feel, even though I am not a DD, that Debian is an important touchstone in my life. It reminded me of a conversation I had with Manoj recently related to this topic, who almost mistook me for a DD: [biella] who is that DD that wrote an anthro thesis on debian? [08:55]
    [biella] he is brazilian [manoj] I was gonna say that the dd who did an anthro thesis on debian
    was you, then it struck me that you are not a dd, but I still
    think of you as one now, and then it struck me further that
    making you a dd might compromise your postiion as an observer After many years following the project, I have grown quite attached to it, and every year, a few months before Debconf I am reminded of this attachment. I have managed to make Debconf only every other year, and usually when I face this fact, a sense of melancholia and slight sadness sets in, especially when I hear of everyone making plans to go. I always start to question my decision to stay back, then hit all sorts of websites for cheap tickets, and start to wonder if I can perhaps manage to complete some work there, which is the main reason this year I am staying away. I then make myself confront REALITY and remind myself that the whole reason I love attending Debconf is because of its extreme vitality, which after a week, leaves you wrung out and tired, because you put so much of your attention and mind, soul and heart in the events. So even if I go for a week, or longer, you usually need a week ore more to recover. I am not sure I can spare such time this year, especially since less than a month after Debconf, I am packing my bags and moving back to the east coast of the United States. And as I learned last year and the year before and two years before, these sorts of long-distance moves take a lot of your time. My longing reminds me of how important it is to celebrate those things in life you love. And while there is more to Debconf than a celebration, much of it is just that, a chance, a space, a place by which and where you celebrate. And since I sit only in the shadows of Debian, I imagine the pleasure and joy runs deeper and wider for those who sit at its heart. So if you are on the fence on whether to go, this is your friendly public service announcement that it is, indeed, so worth your while.

    16 April 2007

    Holger Levsen: Singing not whining

    Even though the network at dudesconf worked flawlessly even for me after whining here about my laptop on saturday, I have now resolved to concentrate on positive aspects here, as I believe Debian as much as everybody else needs positive thinking rather than negative thoughts.

    Dudesconf/DebConf.es3 rocked, though two days is a bit too short :) Caring organizers, almost 24h food supply, vegetarian food for the needy, meeting "old faces" again, being able to attach new faces to old nicks/names and meeting new people. And doing some juggling once again for more than two minutes.

    On another positive aspect, the new server for debian-community.org is now up and running etch with a 2.4.27 kernel from sarge (because of 317258), the content will be migrated either tonite after work (I doubt it) or ma ana. Seperate post still pending...

    Bastian, I completly agree. Is any artist reading this and able to dedicate some time and effort to create (a) proposal(s) for a better design for wiki.debian.org? I believe the proper place to propose designs and discuss them is the debian-www list, though any place is fine for posting proposals.

    12 April 2007

    Biella Coleman: On My Aunt Enid, Cars, and History

    Those who know me even moderately well (as well as every doctor I have ever seen), knows that my real first name as “Enid.” That is the mysterious E. that sometimes precedes the Gabriella. My mom’s intention was to call me Gabriella, the first name of some famous Italian Cabaret singer, Gabriella Ferranti. But when Enid, my aunt on my fathers side, passed away a few months before I was born, I was given the name Enid Gabriella. We have always used Biella or Gabriella but I like that I have Enid in there and have fancied from time to time to start using the name Enid. By all accounts, Enid was an amazing and energetic woman, who reared her four kids with passion, was very open to friends and family, and who, despite living a solidly upper middle class Jewish life, was also involved in interesting political work(like helping Americans doge the draft by escaping to Canada). My mom held a special fondness for her because, well, honestly I think she was one of the only members of my dad’s family who she deeply loved. And Enid always went out of her way to show her care and concern, as when she immediately went to Caracas after my mothers first child unexpectedly died of a high fever at the age of five months. Today as I was writing away, I received an email from my father that he sent to me and a bunch of cousins and other siblings where he attached a 9 page document of remembrances and memories of Enid. My dad, though in no way as bad off as my mother (health wise), is no spring chicken. And I think as he fast approaches 80 years old, he is committing a lot to writing and thus, keeping his memory alive for us. In fact, this reminded me of a really beautiful quote I recently came across on memory:
    “You have to begin to lose your memory, if only in bits and pieces, to realize that memory is what makes our lives. Life without memory is no life at all, just as an intelligence without the possibility of expression is not really an intelligence. Our memory is our coherence, our reason, our feeling, even our action. Without it, we are nothing.” Luis Bu uel
    But what was a little odd (but nonetheless very endearing) about most of the account is that it was not organized by stories, or date, but by car models. Yes, by technology. My dad organized the stories about Enid by virtue of the cars they had, which struck me a little strange because it is not like he was a car buff or anything (growing up we always had the most unsexy cars, like Ford Tauruses). The cars he covers are the following: The Model A Ford Convertible
    The 1941 Oldsmobile
    The 1948 Buick Convertible
    A Chevy Convertible Once you read his little tribute, it becomes immediately clear that his choice of talking about cars is also way for him to talk about history which is my dad’s great love (he can talk to you straight for 5 hours about some odd event in WW II and why he should have become a historian) as it is about Enid. Case in point here:
    This was the first General Motors car with automatic drive. It was called Hydromatic and even though this car had a powerful 8-cylinder engine, this first automatic drive was very sluggish. Forget about 0 to 60 miles an hour in 7 seconds. This was in minutes. It was the car that Abe used to teach both Enid and I to drive. We both had to have additional lessons with a stick shift car, because the driving test was only given on stick shift cars. I learned to drive in 1944, when I was 16. Enid took lessons from Abe and learned to drive in 1945 when she was fifteen. This was against the law, but the law in the name of Tom, the policeman that covered our neighborhood, liked Enid and looked the other way.
    For those who care to read more (it may only be amusing to me and those few people that are into American car history), I have included all the cars and here are the main cast of characters. Ruth = My Grandmother
    Abe = Grandfather
    David = Dad
    Enid = My Aunt, David’s sister (more…)

    7 April 2007

    Arnaud Vandyck: Menuiserie!

    Je ne sais pas pourquoi mais hier soir j'ai dessin une chaise! Je n'ai absolument pas une formation de menuisier mais j'ai essay ... J'ai commenc par des proportions pour un enfant, pour Adrien, mon fieul, et neveu. Appelez-moi Monsieur Zig-Zag! Les images sont dans la suite de l'article (et en attachement). Sur la chaise, il y a la maquette en carton. read more

    5 April 2007

    Lars Wirzenius: Random hacks: Lap tray

    For a few years now, I've used a lap tray under my laptop when sitting in an armchair or sofa at home. It is basically a tray with a pillow below. It's been very nice: not only does it protect me from burns, it's just plain more comfortable than balancing the thing on my thighs and knees. Unfortunately, it's been slowly disintegrating for the past couple of years. I decided to hire my cousin Johan Wirzenius the carpenter to make me a new one. Since I was ordering a custom one, I got to specify three new fancy features: the pillow is detachable (via velcro), and the tray is foldable, resulting in a more transportable whole. Also, the edges of the tray have grooves to hold cables in place, and the surface has grooves to allow better ventilation. Below are four pictures of the tray, courtesy of my cousin.
    lap tray lap tray lap tray lap tray Four pictures of the new tray. The person is my cousin's assistant.

    3 April 2007

    Evan Prodromou: 13 Germinal CCXV

    Gar. I had to go downtown today to sign some legal papers with our lawyer. He's taken a gig as the interim chief of staff for the president of Concordia University, but he's kept a few of his older clients, including us. Maj and I stopped at the bank beforehand to sign some mortgage papers, and then we went to the SAQ across the street to buy some wine. We then piled back in the car, drove downtown, and with a little time to spare we stopped at Zyng for lunch, walked around St. Catherine a little bit, did some furniture shopping, and then met our lawyer near his office. We had a good coffee together and saw the new engineering building there -- it's quite nice. When Maj and I got back to the car, I realized that I didn't have my remote starter for the car -- which also disables the car alarm. This little gadget has been a real pain for me since we got the car -- the thing that attaches it to the keychain almost instantly broke, so I've had to carry it around separate from my keys. And now it was gone, and I had no idea where it was. So we retraced steps -- another 45 minutes walking around to the noodle joint, the furniture store, the Concordia caf . Nothing. We looked around on the street for a while, then jumped in a cab and came home. Maj had her keys here, so I borrowed them, cabbed back to where the car was parked, and as I was getting into the car I saw this: clicker on the dashboard That's the clicker, right under that SAQ brochure about Italian wines. DOH! Moral of the story: attach your car-alarm clicker very carefully to your keychain. Sure, not much of a moral, but it's what I learned today. tags:

    RSS validated So, after starting an RSS 1.0 feed for my blog, I was having some problems using it in different readers. A few Google searches later landed me at the [$$vote for http://validator.w3.org/feed/, which is totally cool. Why didn't I know about this before? It turned out that my Tag URI format was invalid. I was using tag URIs for RSS item identifiers, and I'd left off the all-important validity date. So I had to update those. It seems to be working pretty nice, now; the validator gives the all-good sign for both my RSS 2.0 and RSS 1.0 feeds. tags:

    Greek Wikitravel Expedition So, I'm going to be interviewed this week for Hellas Spectrum, a Greek-language television show here in Montreal focusing on the local Greek community and culture. (I know - wow!) Apparently the interview will be "mostly" in English, with "a little bit" of Greek. Uh-oh. I studied some Greek in college, and I spent a summer in Crete and made my way pretty nicely, but I definitely haven't used the language in years. So this should be fun. I'm pretty embarrassed that I'm so inept in my ancestral tongue, and I hope that Amita June learns more than I have. The whole thing has reminded me that we don't have a Wikitravel language version for Greek -- yet. So I started a Greek Wikitravel Expedition to try to collect a group of users to make the wiki work. I've asked already on Greek Wikipedia, and I hope to find some more centres of Greek Open Source/Open Content culture on the Web. Greek people are disproportionately represented in science, engineering, and technology, so I think there will be a lot of interest. So, question for the LazyWeb: where are the good Greek Open Source/Open Content community Web sites? Influential Greek bloggers? What's the Greek Barrapunto? How can I get more interest in this project in the Greek Internet community? Contact me and let me know. tags:

    Next.

    Previous.