• pkgsrcCon 2007 report

    pkgsrcCon 2007 is over. The conference started around 1:00pm on the 27th and has lasted until today^Wyesterday (the 29th) at around 7:00pm. There have been 10 different talks as planned, although we weren't able to follow the proposed schedule. Most of the presentations were delayed and some were shifted because the speakers could not arrive on time. Not a big deal though.We have been, more or less, around 20-25 people. There were 30 registered, but a couple had to withdraw and some others did not come (for unknown reasons to us). Maybe the conferences were too technical or the schedule did not meet their expectations.The thing is I originally intended to write a short report after each day, but I have had literally no life outside pkgsrcCon since Thursday night. Taking care of the organization has been time consuming (and I have done almost nothing!), not to mention that recording all the presentations was exhausting; more on this below.Anyway, it has been an excellent experience. Meeting other pkgsrc developers in person has been very nice, plus they are all also very nice people too. Of course, their presentations were also interesting, and they showed extremely interesting ideas from their creators. I'm specially looking forward to seeing the preliminary results of one of the detailed projects (won't tell you which ;-).So, what did we do? We started with a pre-pkgsrcCon dinner on Thursday night, which was the first encounter among all developers. The talks started the day afterwards in the afternoon, and when they were over we had some beers and dinner together. Saturday was more of the same, even though it had more talks. We then had dinner on a nicer restaurant; great, great time. The last talks happened on Sunday, after which we had some more beers and the last dinner all together.I now have to compress all the video recordings and we have yet to decide if we will make them public and how. Stay tuned! (And don't hesitate to join for pkgsrcCon 2008; I'm sure you will enjoy it, at the very least as much as I did!) [Continue reading]

  • Monotone's help rewrite

    A couple of weeks ago, I updated Monotone to 0.34 and noticed a small style problem in the help output: the line wrapping was not working properly, so some words got cut on the terminal's boundary. After resolving this minor issue, I realized that I didn't know what most of the commands shown in the main help screen did. Virtually all other command-line utilities that have integrated help show some form of an abstract description for each command which allows the novice to quickly see what they are about. So why wouldn't Monotone?I started extending the internal commands interface to accept a little abstract for each command and command group, to be later shown in the help output. This was rather easy, and I posted some preliminary changes in to the mailing list. But you know what happens when proposing trivial changes...People complained that the new output was too long to be useful, which I agreed on and fixed by only showing commands in a given group at a time. But... there was also an interesting request: allow the documentation of subcommands (e.g. list keys) in a consistent way with how primary commands (e.g. checkout) are defined. There is even a bug (#18281) about this issue.And... that has kept me busy for way longer than I expected. I've ended up rewriting the way commands are defined internally by constructing a tree of commands instead of a plain list. This allows the generic command lookup algorithm to locate commands at any level in the tree, thus being able to standarize the way to define help and options on them.The work is almost done and can be seen in the net.venge.monotone.help-rewrite branch.I've also been messing with Cogito recently and found some of its user interface features to be very convenient. These include automatic paging of long output and colored diffs straight on the console. Something to borrow from them if I ever have the time for it, I guess ;-) [Continue reading]

  • SoC: Selected again!

    Yes, Google Summer of Code (SoC) 2007 is back and I'm in once again! This means I'll be able to spend another summer working on free software and deliver some useful contributions by the end of it.This time I sent just one proposal, choosing NetBSD as the mentoring organization. The project is entitled Automated testing framework and is mentored by Martin Husemann. This framework is something I've had in mind for a long time already; in fact, I also applied for this in SoC 2006 and attempted to develop this project as my undergraduate thesis.For more details on what the project is about, check out these notes.At last, take a look at the full list of accepted projects for NetBSD. It is rather short unfortunately, but they all look very promising. It is a pity ext3 support is not in them, but getting ZFS instead will be good too.Edit (April 19th): Fixed a link. [Continue reading]

  • Problems with locales?

    Reviewing photos from my trip to Punta Cana, I found this one taken at Punta Cana's airport:Looks like they had some problems with locales! The text should have read España (or Spain).On a related note, it was also curious to see all other monitors mention the flight's destination city whereas ours showed the whole country. According to the other screens, it should have really said Madrid. [Continue reading]

  • Mounting volumes on Mac OS X's startup

    As I mentioned yesterday, I have a couple of disk images in my Mac OS X machine that hold NetBSD's and pkgsrc's source code. I also have some virtual machines in Parallels that need to use these project's files.In order to keep disk usage to the minimum, I share the project's disk images with the virtual machines by means of NFS. (See Mac OS X as an NFS Server for more details.) But in doing so, a problem appears: the NFS daemon is started as part of the system's boot process, long before I can manually mount the disk images. As a result, the NFS daemon — more specifically, mountd — cannot see the exported directories and assumes that their corresponding export entries are invalid. This effectively means that, after mounting the images, I have to manually send a HUP signal to mountd to refresh its export list.A little research will tell you that it is trivial to mount disk volumes on login by dragging their icon to the Login items section of the Accounts preference panel:But... that doesn't solve the problem. If you do that, the images will be mounted when you log in, and that happens long after the system has spawned the NFS daemons.Ideally, one should be able to list the disk images in /etc/fstab, just as is done with any other file system, but that does not work (or I don't know the appropriate syntax). So how do you resolve the problem? Or better said, how did I resolve it (because I doubt it's the only solution)?It turns out it was not trivial: you need to manually write a new startup script that mounts the images for you on system startup. In order to do that, start by creating the /Library/StartupItems/DiskImages directory; this will hold the startup script as well as the necessary meta-data to tell the system what to do with it.Then create the real script within that directory and name it DiskImages:#! /bin/sh## DiskImages startup script#. /etc/rc.commonbasePath="/Library/StartupItems/DiskImages"StartService() { hdiutil attach -nobrowse /Users/jmmv/Projects/NetBSD.dmg hdiutil attach -nobrowse /Users/jmmv/Projects/pkgsrc.dmg}StopService() { true}RestartService() { true}RunService "$1"Don't forget to grant the executable permission to that script with chmod +x DiskImages.At last, create the StartupParameters.plist file, also in that directory, and put the following in it:{ Description = "Automatic attachment of disk images"; OrderPreference = "First"; Uses = ("Disks");}And that's it! Reboot and those exported directories contained within images will be properly recognized by the NFS daemon.I'm wondering if there is a better way to resolve the issue, but so far this seems to work. Now... mmm... a UI to create and manage this script could be sweet. [Continue reading]

  • How to disable journaling on a HFS+ volume

    Mac OS X's native file system (HFS+) supports journaling, a feature that is enabled by default on all new volumes. Journaling is a very nice feature as it allows a quick recovery of the file system's status should anything bad happen to the machine — e.g. a power failure or a crash. With a journaled file system, the operating system can easily undo or redo the last operations executed on the disk without losing meta-data, effectively avoiding a full file system check.However, journaling introduces a performance penalty for write operations. Every time the operating system has to modify the file system, it must first update the journal, then execute the real operation and at last mark the operation as completed in the journal. In most situations, this penalty is worth it for the reasons stated above. (Note: I haven't benchmarked this penalty; it may be unnoticeable!)There are some scenarios in which it can be avoided though. For example: I keep several disk images in my machine that hold the source code of some projects — NetBSD, pkgsrc — because these need to be placed in case-sensitive file systems. Up until now I had these configured as journaled HFS+ file systems, but I just figured out that I could gain some performance points by disabling this feature at the risk of losing the robustness introduced by journaling. After all, crashes are rare and power failures are non-existant in a laptop; plus the data stored in the images can be easily refetched at will in case of a disaster.It turns out that the Disk Utility allows you to easily enable journaling for a volume (just check out the big icon in the toolbar), but the interface provides no way to disable it. Or at least I haven't found that option. According to multiple articles I found, it was possible in older OS X versions. So I realized that the feature had to be available somewhere in recent versions.And that's right: the command-line diskutil program is able to disable journaling for a given mounted volume. Just run it as:# diskutil disableJournal /Volumes/TheVolumeNameAnd voila! Journaling disabled.For more details, check out the #107248 Knowledge Base Article. [Continue reading]

  • Games: Doom 3: Resurrection of evil

    As I told you a couple of weeks ago, I bought Doom 3: Resurrection of evil, which I have just finished it. As other reviewers have mentioned, this is more of the same Doom 3: dark and scary scenarios, lots of monsters and the same game-play.However, I find it more balanced than the original Doom 3. Overall, the game is shorter as well as each of its chapters. I started playing a chapter a day, then stopped for several days while I was busy with other stuff and today I played the last four chapters in two runs. This makes it more fun to play, because as you notice you are reaching the end you want to see it as soon as possible (as happened to me).Then there are some annoying new monsters, but they are not strong ones. There are also some new guns, such as the double shotgun from the original Doom, a Half Life 2's gravity-gun-like thing and The Artifact, which replaces the Soul's Cube; mmm, I think I preferred the latter.At last, the storyline is so thin that you don't get involved, but it doesn't matter because the game is very linear and thus you can't get stalled nor lost. Just keep going and killing everything in your way.Summarizing, you'll certainly enjoy it if you liked the original Doom 3. I'm wondering which game I can get now given that Half Life 2: Episode 2 is delayed! [Continue reading]

  • Fixing EXIF date information

    Back in February, some friends and I spent a week visiting Punta Cana. We made a lot of photos there but, when we came back, we realized that most of us (not all!) forgot to adjust our camera's date to the foreign timezone, which was 5 hours behind of ours.I imported all our photos in iPhoto but the difference in their timestamps made all images appear unsorted in the main view; this was very annoying. So I wondered if the EXIF information embedded in them could be easily fixed. It turns out it is possible, but the tools to do so — or at least the one I used — leave a lot to be desired: it was not exactly trivial to resolve the problem.In order to modify the EXIF information, I installed the free libexif library alongside a very simple frontend to it named exif, distributed from the same page. To painlessly get this in Mac OS X, just use the graphics/exif package in pkgsrc.Then I had to see which fields I wanted to modify in each photo. This can be accomplished with the exif --tag <photo-name.jpg> command, which shows all tags currently attached to the photo and their corresponding values. Skimming through the resulting list, it is easy to spot which fields correspond to date information. I specifically picked up 0x0132, 0x9003 and 0x9004, but some of them may not exist in your images.With this information at hand, I wrote a little script that looped over all affected photos and, for each tag, adjusted it to the new value. It goes as follows:#!/bin/shwhile [ $# -gt 0 ]; do file=$1; shift for tag in 0x0132 0x9003 0x9004; do date=$(exif --tag=${tag} $file | grep Value | cut -d ' ' -f 4-) date=$(perl adjust.pl "${date}") exif --tag=${tag} --ifd=0 --set-value="${date}" ${file} mv ${file}.modified.jpeg ${file} donedoneThe magic to subtract five hours to each date is hidden in the adjust.pl script, which looks like this:($date, $time) = split / /, $ARGV[0];($year, $month, $day) = split /:/, $date;($hour, $min, $sec) = split /:/, $time;$amount = 5;if ($hour >= $amount) { $hour -= $amount;} else { $hour = $hour - $amount + 24; if ($day == 1) { $day = 31; $month -= 1; } else { $day -= 1; }}printf "%04d:%02d:%02d %02d:%02d:%02dn", $year, $month, $day, $hour, $min, $sec;I know the code is really crappy but it did the job just fine! [Continue reading]

  • Cross-platform development with Parallels

    These days I'm seizing some of my free time to continue what I did as my SoC 2006 project: the Boost.Process library. There is still a lot of work to be done, but some items are annoying enough to require early attention (well, I can't speak of "early" because I hadn't touched the code for months).Boost.Process aims to be a cross-platform library and currently works under POSIX-based systems (such as Linux, NetBSD or Mac OS X) as well as under Win32 systems. However, developing such a thing is not easy if you don't have concurrent access to both systems to test your code as you go. That is because, past summer, Win32 support was "second class": I first coded everything under NetBSD and, eventually, I fired up my Windows XP installation and fixed any problems that arised due to the new code. This was suboptimal and really slowed down the development of the library.Now, with a MacBook Pro and Parallels Desktop for Mac, these issues have gone away. I can now code under whichever system I want and immediately test my changes on the other system without having to reboot! It's so convenient...And, with Coherence mode, everything is so transparent... just check out the following screenshot:To make things better I could share the project's code over the virtual network to avoid having to commit changes to the public repository before having tested them on the two systems. If you inspect the logs, you'll see many "Add feature X" commits followed by a "Fix previous under Win32". But it is a minor issue right now.Kudos to the Parallels developers, who made this possible and painless. I now understand the "computer as a tool" paradigm rather than a "computer as a hobby". [Continue reading]

  • Cursa Bombers 2007

    The Cursa Bombers is a 10km-long race that takes place in Barcelona city. Today, it has been celebrated for the 9th consecutive year with a record in the number of participants: almost 13,000.As I told you a long time ago, I enjoy running so I decided to take part in this race. The event started at 10:00 in the morning and lasted a maximum of an hour and 20 minutes.It took me 46'39" to finish it and ended up in the 4156 position; not that bad, considering that I haven't trained running for a while. The breakdown is:Absolute time of arrival: 48'49"Real time to completion: 46'39"Absolute position: 4156th (considering the absolute time)Corrected position: 3857th (considering the real time)Category and position within it: Male senior, 1917thAverage time per km: 4'40"Position and time at first checkpoint (2,5km): 5531th, 14'34"Position and time at second checkpoint (5km): 4973th, 27'02"Position and time at third checkpoint (7,5km): 4456th, 34'46" It is the first race I run but it has been very enjoyable and exciting. I'm already looking forward to the next one! [Continue reading]