Search Results: "xam"

19 February 2011

Kees Cook: ptracing siblings

In Ubuntu, the use of ptrace is restricted. The default allowed relationship between the debugger and the debuggee is that parents are allowed to ptrace their descendants. This means that running gdb /some/program and strace /some/program Just Works. Using gdb s attach and strace s -p options need CAP_SYS_PTRACE, care of sudo. The next most common use-case was that of crash handlers needing to do a live ptrace of a crashing program (in the rare case of Apport being insufficient). For example, KDE applications have a segfault handler that calls out to kdeinit and requests that the crash handling process be started on it, and then sits in a loop waiting to be attached to. While kdeinit is the parent of both the crashing program (debuggee) and the crash handling program (debugger), the debugger cannot attach to the debugee since they are siblings, not parent/descendant. To solve this, a prctl() call was added so that the debugee could declare who s descendants were going to attach to it. KDE patched their segfault handler to make the prctl() and everything Just Works again. Breakpad, the crash handler for Firefox and Chromium, was updated to do effectively the same thing, though they had to add code to pass the process id back to the debuggee since they didn t have it handy like KDE. Another use-case was Wine, where for emulation to work correctly, they needed to allow all Wine processes to ptrace each other to correctly emulate Windows. For this, they just declared that all descendants of the wine-server could debug a given Wine process, there-by confining their ptrace festival to just Wine programs. One of the remaining use-cases is that of a debugging IDE that doesn t directly use ptrace itself. For example, qtcreator will launch a program and then later attach to it by launching gdb and using the attach command. This looks a lot like the crash handler use-case, except that the debuggee doesn t have any idea that it is running under an IDE. A simple solution for this is to have the IDE run its programs with the LD_PRELOAD environment variable aimed at a short library that just calls prctl() with the parent process id, and suddenly the IDE and its descendants (i.e. gdb) can debug the program all day long. I ve got an example of this preloadable library written. If it turns out this is generally useful for IDEs, I could package it up like fakeroot and faketime.

18 February 2011

Russell Coker: Sony Ericsson Xperia X10i First Experience

I have just got a new Xperia X10i for my wife. It s with Virgin who use the Optus network. Optus apparently have better coverage than Three (who we have been using for 6.5 years) and Virgin offers the best deals they have good phones on low monthly rates and do nice things like selling most phones unlocked (the Xperia is one that comes unlocked).I chose the phone for use in system administration work. A large screen should be good for reading email and running a ssh client. Hopefully I will be able to use the phone s Wifi to provide mobile net access to a laptop for any problem that can t be solved on a tiny screen. My wife doesn t do much sysadmin work nowadays, but it ll save some effort if we can both use the same model of phone. Also according to Amobil.no the Xperia X10 is the second best phone for camera-phone functionality [1], and my wife would really like to take some good pictures with her phone (she loves the LG U990 Viewty that she has right now).ScreenOne major reason for choosing this phone is that it has the biggest and highest resolution of any phone that doesn t cost a huge amount of money. It does well in this regard, the screen is very good to look at. However it is apparently not particularly sensitive and we still have the protective cover on the screen which makes the swipe to unlock operation quite difficult. My wife generally likes to keep the protective plastic on such screens for a while to prevent damage, but she may take this off sooner than on other devices.Sony FoolishnessOne reason that this phone is cheaper than any other phone with similar specs is that it s made by Sony. Sony won t provide updates to Android 2.2 or better and they have their own stupid applications installed in an intrusive manner. The main screen of the phone has a large icon for the Sony Timescape program. If you choose a background image of a person s face then the Timescape logo is in the ideal location to obscure the person s eyes. Generally it s not desired to have the person in your phone background look like Zorro. Fortunately you can delete icons from the home screen, you just have to press and hold the icon until a trash-can appears at the bottom of the screen and then drag it to the trash.Phone BookThe core phone functionality is fairly important for a mobile phone. But it seems that every modern phone has some serious failings in this regard. The Xperia comes with a phone book that is reasonably good for managing contacts and partially coalesces multiple entries with the same name which is convenient as I somehow managed to import 3 copies of each entry in my wife s phone book. The down-side is that the multiple entries are still stored, so when it comes time to update someone s phone number my wife will have to separate the entries and then delete all but one of them, adding probably a minute of effort for each one. With 60 phone book entries that s probably an hour of wasted time during the course of her phone use.They really should do a time based analysis of phone use and optimise the UI for efficiently performing common tasks. I think that an ideal design would start off by asking the user to rate the importance of phone functionality, camera, facebook, twitter, etc and then give a UI that matches the important tasks. A device that has 384M of RAM, 1G of built-in Flash storage, and an 8G micro-SD card (which Virgin provided with the phone) should be able to offer a selection of UIs.CameraThe configuration for the camera allows some settings to be changed easily and others have to be changed through the advanced settings which requires one more button press and a few extra taps on the screen. One real stupidity is to have the phone light be in the advanced settings, so if the room happens to be a little darker than expected you suddenly need to go to a lot of extra effort to turn on the light.Finally it would be really good to be able to take a quick picture. I would like to be able to be able to press a combination of buttons and have it immediately take a picture regardless of what had been running before. Not press the main menu button, the camera icon (which I made a link from the home screen), wait a second for it to load, and then press the shutter button. Ideally I would like to press a combination of hardware buttons to have it immediately take a picture even when the screen is locked. I don t want to wait for the screen unlock process, sometimes the perfect shot is only available for a second.WifiIt doesn t support ad-hoc networks. This is really annoying for me as I don t own an access point and I don t plan to buy one just for a phone. My laptop (Thinkpad T61 with Intel Corporation PRO/Wireless 3945ABG [Golan]) doesn t seem to support running as an access point, and my EeePC 701 with an Atheros AR5001 has the same problem, here is the error message:# iwconfig wlan0 mode master essid x
Error for wireless request Set Mode (8B06) :
SET failed on device wlan0 ; Invalid argument.I have a cheap Realtec USB Wifi device that claims to support being an access point but just fails when I try it. So presumably it doesn t really support it but the driver is buggy.It seems that I may need to put a custom Android installation on it to get ad-hoc working.Also it s apparently necessary to root the Xperia to get Wifi tethering to work for providing net access to a laptop. So I guess I ll hacking it soon.Internet AccessThe Virgin web site couldn t help me set up the Internet access because I ported a phone number from another Telco. I had to use the phone number supplied by Virgin to login to their web site and the site then wanted to sent (probably SMS) the settings to my phone, but of course it couldn t SMS to that number as I ve got the Three number active. Presumably they were expecting that customers would setup Internet access before porting their old number.I phoned the Virgin tech support and used the settings they suggested, but it didn t work. Then I took the phone to a Virgin store and it started working after they rebooted it with no changes to settings. Just like Windows used to be. :(Email Access Default AppThe email setup defaults to port 143 IMAP access, so even when a mail server provides access on port 993 for IMAPS and on port 995 for POP3S probably most users will not use any encryption because their phone doesn t default to it. Also one annoying feature is that when I gave it the email address test@coker.com.au it decided to use test as the user-name for IMAP by default. It seems that a very large portion of the active email accounts nowadays are on systems that handle multiple domains and thus require the domain name in authentication, and a large portion of the remainder accept domain names even when they aren t required. Besides it s a lot easier to delete a domain name when it s not needed than to type it in when it is.The default hostname for sending and receiving mail is the domain name, if the MUA configuration program had checked the MX record it would have known that smtp.sws.net.au is a better default choice for the mail server. I ve now started the practice of creating a CNAME entry named m in every domain I run, so when someone is setting up a mobile phone they just have to add m. to the start of the default hostname to use for sending and receiving mail. By doing this I can probably save an average user at least 30 seconds of typing, which is particularly important if I happen to be talking them through the process!The MUA uses IMAP commands to load the text of the message without attachments and then loads attachments on demand, this will be handy for when people attach unreasonably large files. With IMAP caching and partial loads the core functionality seems OK, and some quick tests of standard but not commonly used IMAP functions such as noticing that mail has been deleted by another client seemed to work well. The performance of loading a new mailbox with 369 message was quite poor, I m not sure how much of this is due to the network connection and how much is due to the client implementation. This is a real concern for me as I typically have about 7,000 messages in my IMAP account and 3,000 unread messages most of which are in two folders.Another problem is the fact that there seems to be no way of searching in the list of messages, sorting/grouping by subject or sender, or showing unread messages. This makes the Xperia unsuitable for the task of reading mailing lists when on public transport. I would really like to be able to sort through a folder of mailing-list mail, delete messages that I don t need to keep and flag ones that need attention when I have the resources of a desktop system when I m on a tram or in other situations where a laptop can be inconvenient.One undeniable bug I discovered (as opposed to the missing features I listed) is that when a message has a line with a URL followed by many spaces it won t load correctly in the web browser, the spaces will be treated as part of the URL. I ve changed the default signature in my email to have a description followed by a URL to avoid triggering this bug. Presumably other Android phones are bug for bug compatible. :(Moxier MailThere is a complete set of email and calendaring applications preloaded from Moxier.com. The Moxier mail client uses company.com as an example domain name (they should use example.com does no-one read the RFCs?). It s nice that they verify the SSL certificate and display the details when it s not signed.Unfortunately Moxier doesn t support anything other than Exchange, and I can t delete it either as it s part of the base set of applications from Sony.SMSThe SMS application is supposedly conversation based. This doesn t seem like a benefit to me, it s a pity that there is no option to make it act more like every other SMS implementation I ve used over the last 12 years.BatteryThe battery is described as having a capacity of 1500mAh, for comparison a AA rechargeable batteries have capacities ranging from 1800mAh to 2800mAh. My first mobile phone had a rechargeable battery that took the same space as 4*AA batteries and the phone was designed to run on AA batteries if the main battery wasn t charged. I would like to have an Android phone that had a battery pack of similar size to at least 2*AA batteries, and 4*AA would be OK too.The Xperia battery was reported as being half discharged after playing with the phone for less than an hour. Basically when doing anything with the phone that is remotely intensive I need to have it plugged in. Unless of course I m using one of the star-chart applications LightsThere are two white leds in the gaps between the keys for Settings, Main-Menu, and Back on the front. They are quite bright and annoying to look into at night.SSHSSH was one of the reasons for getting an Android phone, but it was one of the last things I worked on because everything else was so much fun. I m currently using ConnectBot, it supports storing ssh host keys, generating a key-pair from random screen touches, locking and unlocking the key-pair (with a pass-phrase) and pasting the public key to an open window. All the basic functions just work although it s rather inconvenient to enter the CTRL keys.The next thing to investigate is a small and light Bluetooth keyboard. Using an external hardware keyboard will save me from the pain of entering CTRL keys (which is even worse than the pain of entering passwords that contain digits and mixed case). It will also allow me to type a lot faster and use the entire screen for the ssh session.Current Bug SummaryWifi doesn t do ad-hoc mode or tethering.MUA doesn t correctly handle URLs in messages if many spaces follow the URL and is also unsuitable for mailing list mail.Sometimes requires a reboot to make Internet access settings take affect.Camera light can t be easily turned on and off.This isn t too bad.ConclusionMost things do what I want. Once I get a MUA working with all my email, Wifi doing what I want, and a Bluetooth keyboard it ll be a fairly ideal mobile sysadmin terminal. I ll probably order one for myself this weekend.

15 February 2011

Lars Wirzenius: Experiences with SD

For a few months now I've been using SD for tracking bugs in many of my personal projects. SD is a distributed bug tracker, and I believe such systems to be the future, just like distributed version control has become the obviously correct choice. Distributed bug tracking is still in its infancy, and the tools are still developing. However, SD, at least, is already usable, at least for the small kinds of projects as mine are. I have no idea, at least yet, how it scales up to large projects with many developers. Life with SD is similar to life with a DVCS. You have your bug repository, and you make changes there as find bugs, fix them, and so on. When it is suitable and convenient, you synchronise your repository with others. I mainly sync to my server, so that others can sync from that if they wish. (I don't know if anyone does that.) There are several distributed bug trackers. I chose SD because it seemed the most mature one, but also because it does not tie the bug repository with the source code version control tree. This is quite important, I think. If there's a bug in the project's website, then that does not need to be committed to the project's source code. If I work on a bug in a separate code branch, I would like to make any necessary notes about it in a central bug repository for all the branches on my laptop. This is helpful, for example, if I have to back out of my code changes, because I did something stupid, but want to keep the notes I took in the bug repository. SD is not without its weirdness. The command line syntax is a bit un-Unixy, and it requires setting an environment variable to specify the location of the bug repository. (I wrote a little wrapper script to set it: all my branches for project foo are in ~/foo, and the bug repository is in ~/foo/bugs.) It could perhaps also be faster, but it's not exactly slow, either: it is a joy to be able to just run sd ticket close 123 rather than open a web browser, navigate to the right bug, and click close there. Also, once you have a bunch of projects, each with its own bug repository, it becomes an effort to synchronise each of them. I'm hoping mr will someday support SD, but until then I'm using a little wrapper that syncs my SD repositories to my server. I also have a third wrapper that allows me to run an SD command on each repository, so that I can, for example, easily get a list of all open bugs in all projects, which is helpful for my GTD weekly review.

Dirk Eddelbuettel: Rcpp 0.9.1

A new release 0.9.1 of Rcpp went to CRAN and Debian yesterday. This version contains mostly bug-fixes and rather few enhancements. The changes are mostly 'internal fixes' and not user-facing; they mostly address some issues in memory management which, while not tripping up the unit tests or common usage, caused trouble for advanced Rcpp modules use and repeated memory allocation / deallocation. This bit Doug Bates repeatedly, and he put his head down and debugged the issue. A number of changes fairly deep-down in Rcpp (as well as in R-devel) later, this looks much better and we owe him a hearfelt Thank You! A big Thanks! also goes to Luke Tierney who out some new memory debugging code into R-devel which the --enable-strict-barrier in R 2.13.0 (due in April) will enable. A related fix is also in R 2.12.2 due on the 25th. The NEWS entry is below; more detail is in the ChangeLog file in the package.
0.9.1   2011-02-14
    o   A number of internal changes to the memory allocation / protection of
        temporary objects were made---with a heartfelt "Thank You!" to both
        Doug Bates for very persistent debugging of Rcpp modules code, and to
        Luke Tierney who added additional memory allocation debugging tools
        to R-devel (which will be in R 2.13.0 and may also be in R 2.12.2)
        
    o   Removed another GNU Make-specific variable from src/Makevars in order
        to make the build more portable; this was noticed on FreeBSD
    o   On *BSD, do not try to compute a stack trace but provide file and
        line number (which is the same behaviour as implemented in Windows)
    o   Fixed an int conversion bug reported by Daniel Sabanes Bove on r-devel,
        added unit test as well
    
    o   Added unit tests for complex-typed vectors (thanks to Christian Gunning)
    
    o   Expanded the Rcpp-quickref vignette (with thanks to Christian Gunning)
    o   Additional examples were added to the Rcpp-FAQ vignette
Thanks to CRANberries, there is also a diff to the previous release 0.9.0. As always, even fuller details are on the Rcpp Changelog page and the Rcpp page which also leads to the downloads, the browseable doxygen docs and zip files of doxygen output for the standard formats. A local directory has source and documentation too. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page

Lucas Nussbaum: Re: please send a patch

It seems that Matthew Palmer misread my blog post as a complaint against developers asking for patches in exchange of pet feature requests. He really should pay more attention, since I gave pet feature requests as an example of case where it would be appropriate to ask for a patch:
Of course, there are cases where it s perfectly reasonable to ask for a patch: when the task is expected to take hours, or when the result is of limited interest to everybody except the demander.
But even then, it s not clear. This morning I got an email from a someone involved in PHP packages maintenance, who said that Bugs Search @ UDD was a great tool, but that he would love to have a way to list all bugs affecting packages with the implemented-in::php debtag.
To produce a working patch for this would probably take him at least an hour. You need to set up a copy of the CGI on alioth, understand the DB structure, dig into the code, etc. If you don t understand SQL and Ruby, it could be a really difficult process. Also, it s probably quite uninteresting for him to do that, since he is unlikely to stick around developing UDD.
Instead, it didn t take me more than 5 minutes to produce a one-liner.
The net result for Debian in that case? 55 minutes saved by a developer. Update:
Torsten Werner wrote an angry reply to my post. It s true that yesterday s episode triggered my blog post, because I felt quite frustrated to have to provide a patch for something that simple, and would have preferred to use the time for a Debian task where I would be more efficient. But I was not particularly angry at that episode, since that s something I ve seen on several occasions. That s also why I did not mention any team in particular.
The feature request I was making was reasonable, and cannot really be considered a pet feature request (though I might be biased with my QA hat on): mentionning in the dak templates used for bug closure that packages removed from Debian can still be found on snapshot.d.o. The fact that he thinks that addressing this himself turns him into a slave raises interesting questions.

14 February 2011

Raphaël Hertzog: Debian Cleanup Tip #3: get rid of third-party packages

Last week, we learned how to get rid of obsolete packages. This time, we re going to learn how to bring back your computer to a state close to a pure Ubuntu/Debian installation. Thanks to the power of APT, it s easy to add new external repositories and install supplementary software. Unfortunately some of those are not very well maintained. They might contain crappy packages or they might simply not be updated. An external package which was initially working well, can become a burden on system maintenance because it will be interfering with regular updates (for example by requiring a package that should be removed in newer versions of the system). So my goal for today is to teach you how to identify the packages on your system that are not coming from Debian or Ubuntu. So that you can go through them from time to time and keep only those that you really need. Obsolete packages are a subset of those, but I ll leave them alone. We took care of them last week. Each (well-formed) APT repository comes with a Release file describing it (example). They provide some values that can be used by APT to identify packages contained in the repository. All official Debian repositories are documented with Origin=Debian (and Origin=Ubuntu for Ubuntu). You can verify the origin value associated to each repository (if any) in the output of apt-cache policy:
[...]
 500 http://ftp.debian.org/debian/ lenny/main i386 Packages
     release v=5.0.8,o=Debian,a=stable,n=lenny,l=Debian,c=main
     origin ftp.debian.org
[...]
From there on, we can simply ask aptitude to compute a list of packages which are both installed and not available in an official Debian repository:
$ aptitude search '?narrow(?installed, !?origin(Debian))!?obsolete'
or
$ aptitude search '~S ~i !~ODebian !~o'
You can replace search with purge or remove if you want to get rid of all the packages listed. But you re more likely to want to remove only a subset of carefully chosen packages you re probably still using some of the software that you installed from external repositories. With synaptic, you can also browse the content of each repository. Click on the Origin button and you have a list of repositories. You can go through the non-Debian repositories and look which packages are installed and up-to-date. But you can do better, you can create a custom view. Click on the menu entry Settings > Filter . Click on New to create a new filter and name it External packages . Unselect everything in the Status tab and keep only Installed . Go in the Properties tab and here add a new entry Origin Excludes ftp.debian.org . In fact you must replace ftp.debian.org with the hostname of your Debian/Ubuntu mirror. The one that appears on the origin line in the output of apt-cache policy (see the excerpt quoted above in this article). Note that the term Origin is used to refer to two different things, a field in the release file but also the name of the host for an APT repository. It s a bit confusing if you don t pay attention. Close the filters window with OK. You now have a new listing of External packages under the Custom Filters screen. You can see which packages are installed and up-to-date and decide whether you really want to keep it. If the package is also provided by Debian/Ubuntu and you want to go back to the version provided by your distribution, you can use the Package > Force version menu entry.
Click here to subscribe to my free newsletter and get my monthly analysis on what s going on in Debian and Ubuntu. Or just follow along via the RSS feed, Identi.ca, Twitter or Facebook.

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

13 February 2011

Wouter Verhelst: PMW uploaded

Earlier today (or, well, last night, since it's fairly late alrady) I uploaded pmw (about which I blogged previously). In preparation for that, I've also uploaded aspic, which is required to build pmw's documentation. While I'm quite fond of pmw already, and intend to maintain it inside Debian for quite some time, my interest in aspic is limited to the fact that I need it for pmw. So if anyone seems interested in adopting it... be my guest. But do talk to me, first. In my previous blog post, I've raved about how I like pmw much more than I do lilypond. I had two reasons for that, at the time: Now, I have a third:
wouter@celtic:~$ grep-available --eregex -FPackage -sInstalled-Size -sPackage '(pmw lilypond)'
Installed-Size: 1916
Package: pmw
Installed-Size: 7048
Package: lilypond-data
Installed-Size: 392344
Package: lilypond-doc
Installed-Size: 896
Package: pmw-doc
Installed-Size: 4184
Package: lilypond
Less than two megs for pmw, versus over ten for lilypond and lilypond-data combined; and less than a megabyte for complete documentation plus examples for pmw, versus several hundred megs for lilypond-doc. And it's not because pmw is less flexible, or has less features, or is less well documented, or anything of the sorts. It does have less output options; but then it's not like it's hard to convert PostScript into something else or anything.

12 February 2011

Joerg Jaspert: Daily comic strips

I ve been using dailystrips since April 2006 to get a daily overview page of all the various daily web comics I (and a few friends) like to see. It makes it much simpler than having to browse dozens of various webpages, with all their useless webbugs integrated, to see stuff. That had some drawbacks: So about two or three weeks ago I took a look at dailystrips code to figure out where I need to stuff some lines in to get the additional information. Yuck. No. I don t like it. Not because it is perl, that alone would be fine. So, instead I went and did a little rewrite of it. In a simple and pure bash script. I duplicated the functionality of the daily mode (fetch images per day and put them into a daily subdirectory, create html files for them) and didn t bother with the fetch a random strip one as I never used that. Turned out at 276 lines of shell script that can even fetch alt/title and not break on funny characters in them, yay. Even better, as the search terms for the additional information is just a regex using bashs capability there run over the html file, one can have anything from it put as alt/title onto the final page. When I had that working I asked a colleague to provide a bit of CSS, so it also looks better now. An example output is available (note that the Previous/Archive links are not available there), and if you want you can take a look at the code too. There is no Debian package and I m not sure there should ever be one. If you want to get me patches feel free to mail me, be it for the CSS or the script, whatever.

Dominique Dumont: FOSDEM video of config-model talks are available

Hello The Cross-Distro video team was very fast this year: All videos of the cross-distro talks are available. Among them, you can find the 2 config-model related talks I gave: If you re interested in the subject of collaboration between distribution, you can also view Vincent Untz s talk: Example of cross-distro collaboration: Application Installer All the best.

10 February 2011

Raphaël Hertzog: Best practices when sponsoring Debian packages

Sponsoring a package means uploading a package for someone else (usually a new contributor starting out as package maintainer). This is an activity reserved to Debian Developer who are supposed to be knowledgeable about packaging. This article tries to document the process to ensure the sponsor is doing a reasonably good job according to Debian s standards. Sponsoring a package in the Debian archive is not a trivial matter. It means that you verified the packaging and that it is of the level of quality that Debian strives to have. Let s have a look to what you can and should do when you re sponsoring a package. Sponsoring the initial upload Sponsoring a brand new package into Debian requires a thorough review of the Debian packaging. Building the package and testing the software is definitely not enough! You should open every file in the debian directory and look out for potential problems. Here s a checklist that you can use to perform the audit: If the audit did not reveal any problem, you can upload the package. But remember that even if you re not the maintainer, the sponsor is still responsible of what he uploaded to Debian. That s why you re encouraged to keep up with the package through the Package Tracking System. Sponsoring an update of an existing package You will usually assume that the package has already gone through a full review. So instead of doing it again, you will carefully analyze the difference between the current version and the new version prepared by the maintainer. If you have not done the initial review yourself, you might still want to have a more deeper look just in case the initial reviewer was sloppy. To be able to analyze the difference you need both versions. Download the current version of the source package (with apt-get source) and rebuild it (or download the current binary packages with aptitude download). Download the source package to sponsor (usually with dget). Read the new changelog entry, it should tell you what to expect during the review. The main tool you will use is debdiff, you can run it with two source packages (.dsc files), or two binary packages, or two .changes files (it will then compare all the binary packages listed in the .changes). If you compare the source packages (excluding upstream files in the case of a new upstream version, for example by filtering the output of debdiff with filterdiff -i '*/debian/*'), you must understand all the changes you see and they should be properly documented in the Debian changelog. If everything is fine, build the package and compare the binary packages to verify that the changes on the source package have no unexpected consequences (like some files dropped by mistake, missing dependencies, etc.). You might want to check out the Package Tracking System to verify if the maintainer has not missed something important. Maybe there are translations updates sitting in the BTS that could have been integrated. Maybe the package has been NMUed and the maintainer forgot to integrate the changes from the NMU in his package. Maybe there s a release critical bug that he has left unhandled and that s blocking migration to testing. Whatever. If you find something that she could have done (better), it s time to tell her so that she can improve for next time. And so that she has a better understanding of her responsibilities. If you have found no problem, upload the new version. Otherwise ask the maintainer to provide you a fixed version.
This article will be repurposed to enhance the Debian Developers Reference, hopefully leading to a fix for the wishlist bug #453313. Click here and help me fix more of those. You re also welcome to suggest improvements in the comments. Are there other checks that you re always doing? Do you have some handy tip to make it easier to review a package?

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

9 February 2011

Matthew Garrett: LCA 2011

I'm both back from LCA 2011 and also over the associated brutal jetlag, so if you sent me mail and I still haven't replied then it's fallen down some sort of cliff and you should probably shout at me until I do something about it. LCA was, as usual, excellent. Especially given that the original venue was the same distance above the river as the now somewhat misleadingly described dry dock on the opposite bank.

I did a bunch of talks this year, and they're now all online, so without further ado:

Enterprise power management - a discussion of power management with a focus on enterprise users, given at the plumbers miniconf. LWN did a writeup here, and every time I say "Tera" you should pretend that I'm saying "Giga". I have no good excuse.

Linux license compliance - about the poor observance of the GPL's conditions by vendors, given at the business miniconf. A useful example presented itself in the form of a GPL-violating Android tablet that I bought in literally the first store I went into in Australia this year. Probably also the last appearance of my Knuth t-shirt, because it appears to have several holes in places where it shouldn't.

Making laptops work in Linux - talking about identifying how laptop-specific functionality is wired up, with an emphasis on reverse-engineering ACPI methods to figure out how to make things work. This one was my presentation at the main conference.

The organisers and volunteers deserve incredible gratitude for the way the conference was managed, especially considering that the CBD was underwater a week and a half earlier.

8 February 2011

Richard Darst: Debian latex-beamer theme

A while ago, I gave a presentation on Debian, and made a latex-beamer color scheme for it. Over time I improved it some. Eventually, I grabbed the colors from the new debian website, since they are much nicer (lighter) than the old colors, and thus fit in a presentation better. Last year, I wanted to write this up so that others could use the scheme.The theme can be found here, and there are examples in this gallery. This is distributed as a few color lines you need to copy and paste into your presentation (it is not much, and I thought that was better than an external dependency). You need to select your own layout theme from those included in beamer, for examples see the gallery. The theme page lists many credits for ideas, in particular zack for the idea of the logo on the background, and some other useful links. I would welcome others to improve this theme and make it more distributable.As a reminder, there is another Debian wiki page for collecting presentations people have given, and it has some other useful links on it.

7 February 2011

Jonathan McDowell: Why Linux? (Part 6: Freedom)

(This is part of a series of posts on Why Linux?) I think of myself as reasonably pragmatic in my approach to Free/Open Source software. I don't get worked up over which set of language people want to use. I use devices that require binary firmware to be downloaded to them (because just because I can't see it doesn't mean it doesn't exist). I have non-free in my sources.list. And yet, talking to other Linux users these days, I realize I'm much more of a Freedom nut job than average. I want the source, be it for a driver, a minor widget, or a full app. I don't buy nVidia. I will sacrifice a degree of functionality in order to get Free. And while I think WINE is an excellent piece of software, I think the best end result is that it's no longer necessary, not that it's a perfect implementation of the ABI. How does any of this help justify my use of Linux in the work place? As previously mentioned, I'm a developer. Most developers don't operate in a vacuum; they have to inter-operate with other ecosystems. And usually somewhere along the line there's a failure to document exactly how something is handled, or an ambiguity about what exact choice might be taken. If I have access to the source then I can check that out for myself. If I don't, I have to guess. As an example, a long time ago I was involved in writing a serial console driver for QNX. There came a point where the behaviour wasn't quite as we'd expect. Although the organisation had a license for the source, I wasn't allowed to look at it. Instead I had to come up with a series of suitable questions that someone who could look at the source could answer without violating any NDAs. If I'd been able to look at the source directly we'd have all saved a lot of time. And that's an example where someone could look at the source, rather than having to make a bunch of guesses and instrument tests to see which was right. Access to the Linux source has helped me in other commercial contexts too. At Black Cat we were able to take advantage of patches like grsecurity in order to tighten up shell account boxes. I wrote the IPv6 support for l2tpns, because we had access to the source and could. I've been able to look at the source to understand exactly what SCSI responses are sent in certain circumstances too (or understand exactly what the error that a user land test program was getting back meant). Also I'm a big believe in Linus' Law. I do think that good Free software is much better than proprietary software (there's some really bad Free software out there though, I'm not disputing that). The fact that smart people can look at it and scratch whatever their itch is means that we get a gradual process of improvement that can't be ignored. Equally as long as someone has an interest in the software, end users can't be left high and dry by organisations abandoning still users applications. I think that should be a powerful driver to business to look towards Free software. (Before my more astute readers point it out; yes, I am employed writing non-free software. See the first sentence. One day I'll find a job working on Free software that ticks enough of the other boxes to be viable.)

6 February 2011

Vincent Fourmond: Doxygen for Ruby, first working draft !

Quite some time ago, I complained about the lack of support of Ruby in doxygen, the ultimate code documentation generator (at least for me). Time has passed, and I had some time and motivation to look into it and write a patch. The code is now reasonably mature to be used, altough it still lacks many features, and, most importantly, testing. That's why I pushed my git-svn private repository to github today, in order to get enough testing to integrate it into mainstream doxygen. It's current features: You can get an opinion of how it looks on the code of ctioga2. The doxygen configuration file can be found there.

Lars Wirzenius: Idea: addsysuser

Debian got squeeze released, and ideas are brewing for what to do during the next release cycle. Here's an idea I had lying around. I'm throwing it out there, since I won't have time to do anything about it for at least a little while, but perhaps someone else thinks it's a good idea? Or, better yet, you can all tell me in comments why this is a bad idea, or at least why it should be designed in a different way.
NAME
       addsysuser, delsysuser - create and remove systems user in Debian pack 
       ages
SYNOPSIS
       addsysuser [options] username
       delsysuser [options] username
DESCRIPTION
       addsysuser creates a system user, and delsysuser removes it.  The  pur 
       puse  of these tools is to make it easier for Debian packages to create
       and remove system users as  the  pacakges  are  installed  and  purged.
       These are wrappers around adduser(8) and deluser(8).
       addsysuser  will  create the system user, unless it already exists.  If
       the user already exists, it does nothing.
       delsysuser removes the user.  However,  the  system  administrator  may
       configure  it  to  never remove the user, or to remove only some users.
       Use the /etc/adduser.conf for the settings:
       DELETESYSTEMUSERS
          Set to true or false  depending  on  whether  delsysuser  should
          remove the system user or not.  Defaults to true.
OPTIONS
       -p, --packagePACKAGE
          Record the user as being used by a specific package.  Many pack 
          ages can use the same user.  delsysuser  will  only  remove  the
          user when no packages are using it anymore.
       --no-act
          Only  pretend  to call adduser or deluser without actually doing
          so.  This allows easier testing of command lines.
FILES
       /etc/adduser.conf
          Configuration file for addsysuser and delsysuser.
EXAMPLE
       In the postinst script:
          addsysuser --package hello hellouser
       In the postrm script:
          delsysuser --package hello hellouser
SEE ALSO
       adduser(8), deluser(8).

5 February 2011

Craig Small: Syntax Highlighting with Mid-Century themes

As a site that discusses a variety of programming languages, I thought it would be good to have syntax highlighting for the code snippets. This blog runs Movable Type so it had to fit in with the setup I have already. So I found the Syntax Highlighter module ok and the initial installation went fine, it was simply:
  1. Download the .zip archive
  2. Unzip the archive into a temporary directory
  3. Copy the plugins/SyntaxHighlighter directory to my plugins directory
  4. Copy the mt-static/plugins/SyntaxHighlighter directory to static/plugins
You then need to edit the HTML Head template and add to the bottom of it the following line:
<$MTSyntaxHighlighterInclude$>
Next, I like to use Markdown as my markup language. But you can only have one type text filter. Another plugin called FormatStack solves this. Create a new stack and put Syntax Highlighter before Markdown. You can then create documents with both sorts of tags and it works quite nicely, well almost. Mid Century Problems This is probably not a Mid-Century specific problem but the modern templates or styles may cause a problem. You ll find you switch styles and suddenly, no more syntax highlighting. The problem is the onLoad functions get overloaded. Some styles have an onload property on their body. You ll see lines similiar to
 <body id="blogbase" class="whatever" onload="mtEntryOnLoad">
This onload event stops other onload events, which means Syntax Highlighter cannot do its thing. The fix is rather simple, you just adjust the templates so they look like the following:
<body id="blogbase" class="mt-entry-archive layout-wtt">
<script type="text/javascript">
 mtAttachEvent("load", mtEntryOnLoad);
</script> 
After doing this and publishing it all worked! You may also see this sort of problem with other plugins that use the mtAttachEvent() Javascript call. Reducing Includes By default, the script includes all syntaxes it knows. If you want to only include some, you do this by specifying what brushes you want. For example if you only will highlight perl and python scripts then you can change the line to:
<$MTSyntaxHighlighterInclude brush="perl,python"$>
Syntax Themes The other attribute the Include line will take is theme. There are several themes but default is alternating white on grey with the rest being variations on light text on a dark background.

Craig Small: JFFNMS and IPv6

ipv6-google-rrt.png One of the many Free Software projects I work on is JFFNMS, which is a network management system written in PHP. In light that the last IPv4 address blocks have now been allocated to APNIC it s probably timely to look at how to manage network devices in a new IPv6 world. First you need to get the basics sorted out and for that it is best to use the net-snmp command line utilities to check all is well. Then its onto what to do in JFFNMS itself. Now fixed with proper markup, I hope.
    strlcpy(hostname, a1, sizeof(hostname));
        if ((pptr = strchr (hostname, ':')))  
            remote_port = strtol (pptr + 1, NULL, 0);
         
Special Agent 6 All devices that are capable of being managed with SNMP have an agent. It s basically the SNMP server on the router, switch or server. The first step is to make sure it can accept and send traffic using IPv6. Depending on what the device is, it can be real simple. For example, my little Juniper router its a matter of setting the community and access control, just like IPv4 settings:
csmall@juniper1# set snmp community public clients 2001:db8:62:d0::/64
And then run snmpget on the command line to check
csmall@elmo$ snmpget -v 1 -c public udp6:2001:44b8:62:d0::4 system.sysObjectID.0
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2636.1.1.1.2.41
We have success! For Linux systems that use net-snmp you will need to make the snmp daemon listen on UDPv6 ports as well as adjusting the access control. Access control is a matter of adding com2sec6 lines to /etc/snmp/snmpd.conf They are the same format as com2sec lines and are reasonably straight forward. Next, get the daemon to listen to requests on the IPv6 ports as well. The snmpd(8) man page says:
By default, snmpd listens for incoming SNMP requests on UDP port 161 on all IPv4 interfaces. However, it is possible to modify this behaviour by specifying one or more listening addresses as arguments to snmpd.
It wouldn t of killed them to put comma separated list somewhere, now would it? My /etc/default/snmpd file now looks like:
SNMPDOPTS= -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid udp:127.0.0.1,udp6:[::1]:161
The bits in bold are the changes. Then its a quick check:
csmall@elmo$ snmpget -v 1 -c public udp6:[::1] system.sysObjectID.0
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
And we have working agents! JFFNMS Changes OK, we have a working IPv6 network and snmp works across our network so we can query devices. JFFNMS uses PHP so all should be well, shouldn t it? Database Tables This is an almost classic problem with converting IPv4 to IPv6. You have 15 bytes for a IP address string 111.222.333.444 . Ipv6 can be much larger than that. JFFNMS has things like
  CREATE TABLE  hosts (
    [...]
   ip  char(20) NOT NULL default '',
A simple fix to use a char(39) or varchar(39) will do the trick. Fixing the JFFNMS code One of the most troubling problems with the host entries is that the values entered by a user can be a hostname, IP address or IP address and port separated by a colon. There are lots of bits of code that separate out the port or address by just finding the colon or use non-IPv6 aware functions like gethostbyname() that will need to be fixed. I ve got a function to check for an IPv6 address, using the inet_pton() function.
  function is_ipv6($addr)
 
  $net_addr = @inet_pton($addr);
  if ($net_addr === FALSE   strlen($net_addr) < 16)
    return FALSE;
  return TRUE;
 
PHP functions PHP still has the old IPv4 only functions, but unlike libc does not have the Address Family independent functions. The most significant absence is the replacement functions for gethostbyname(). There is dnsgetrecord() but it is quite low-level (it won t recurse lookups if you get alias or CNAME results). It s a little hit and miss in PHP-land with what functions work with IPv6 addresses and what ones do not. fsockopen() and file() do work with IPv6. PHP and SNMP To query remote devices using SNMP, JFFNMS uses the PHP SNMP functions. Unfortunately, while there is some IPv6 support in PHP, it doesn t extend to the SNMP functions. The library does it, as the net-snmp command lines use the same library, it is just that the small shim between the script and net-snmp that is PHP gets in the way. Looking at the PHP code itself you find things like
    strlcpy(hostname, a1, sizeof(hostname));
        if ((pptr = strchr (hostname, ':')))  
            remote_port = strtol (pptr + 1, NULL, 0);
         
which definitely need to be fixed for IPv6. There is also some simple address lookup going on somewhere as well which will also need to fixed. In short, JFFNMS won t be doing SNMP based queries over IPv6 until php5-snmp can do it. Reachability JFFNMS also has a different sort of query called a reachability type. It s essentially a ping from the server running JFFNMS out to the device being managed. It uses fping to do this work, but there is also a program called fping6. It s a simple matter of checking the address type and then selecting fping or fping6 to do the reachability work. The JFFNMS code soon to be pushed into git has this change in it now. Anything Else? The next stage is to find anything else that will work with IPv6. A likely candidate is the TCP and UDP port types as they use nmap to discover the ports and the fsockopen() function call to poll it. fsockopen() does handle IPv6 addresses if you escape them in square brackets.

Craig Small: ncurses into experimental

Sven has been very busy getting a new Debian ncurses packages into order. With the multiple changes made and the fact that so many things depend on the shared libraries, we decided that it is best to put the first cut of these packages into experimental.

We're now using the Quilt 3.0 source format for our packages, which means that we should have a better handle on the patches, especially as they all now have Dep-3 patch tags .

So what has changed, why should you go over and try the experimental packages?

Craig Small: A few minor updates

No real terribly exciting updates lately but all important in their own way. ncurses A new version of ncurses got uploaded into sid. It should hopefully fix the backspace versus delete problem some of the FreeBSD people have been having with some of the terminal emulators. Oh, and if you are pining for the good old days when 8 colours and 64kB of memory was good enough for everyone, checkout ncurses-examples which have a bunch of interesting things you can do with curses, including some games. Anyone remeber the tower of Hanoi? dh-make dh-make, the tool to take a raw tar (or zip) archive and make a Debian package has been updated too. One of the interesting side-effects of maintaining dh-make is you find out (usually through bug reports) the little changes that happen to the Debian package build process. Most people, including myself, though the main big thing between versions 1 and 2 and version 3 of the source formats was the inclusion of quilt patches right inside the source files. And probably for the sake of "main things" this is true. What I didn't realise is that dpkg-source has changed in other ways too. Bug 580804 tripped this one up. For most people, you run dh_make, fix some things up and use debuild. If you didn't have the original tar file (perhaps you got the source from git or svn) you just use --creatorig and it copies the current directory into ../whatever-1.2.3.orig Source format 3 doesn't like this. Previously it would find that there was no orig.tar.gz archive but there was a orig directory and make the archive from that. Now you have to do it yourself and dh_make does it like that too. pidgin-musictracker Now this should of been a pretty simple stock-standard upstream upgrade. Download the file, uupdate, debuild and release. The problem is that upstream didn't fix their po files. These are the translation files that convert the raw english texts in a program into whatever language. This means the first time you run the build process, you have no diff file. However when you run it the second time, part of the install target rebuilds the po files (mainly the line references), you have differences and then a big diff file of these po updates. The real fix is to make sure your po files are up to date before you release! The trick is that they don't automatically and I have been caught myself; though it happens in the release testing phase (because my release testing involves usually building the debian archive so I see my own problem). irc came to the rescue again. Someone there suggested getting dpkg-source to ignore the changes. The way you do that is put parameters into debian/source/options. I wanted to ignore the changes to the po and pot files so my file has:
extend-diff-ignore=po/.*\.pot?
I put that in and it works!

Craig Small: Playing text adventures with mudlet

Mudlet I've been playing text based multi-user games on and off for years, or perhaps that's decades. When I first started playing them, all you had was telnet. Then this program called TinyFugue appeared which is still shipped by Debian. The generic term for these sorts of games are MUDs, or Multi User Dungeons. Anyhow, I recently came across a new MUD client called Mudlet. It's a very slick program and works quite well. The way it does its triggers (reactions to what the mud sends you) and aliases (reactions to what you type) is done well and is fast. For some people you may have 100s of potiential matches on a incoming or outgoing line so you want it to be fast. After trying it out, my next reaction was "ok, so is it packaged in Debian?". To my surprise, it wasn't so the only obvious thing to do was for me to package it. It is now sitting in the NEW queue waiting for our ever-overloaded ftp masters to have a look at it. While the program is done well, as shipped it doesn't play too well with a Linux system. The package carries about 4 different other packages around. I've changed that now so it uses the system libraries and fonts. All of them are shipped in Debian and I'm sure they individually get more attention and love then I would give them being a sub-part of the main package. It of course cuts down on build times and archive sizes too. I still play muds, no matter what client. For me there they're fun on two levels. The first is the puzzles and gameplay of the MUD itself. I play some MUDs run by Iron Realms who continuously update them, giving you new challenges. The second level is the scripting and customisation you can do. Instead of typing "sip health" you can write some scripts to check your health level and get the script to do it. Mudlet (and a lot of other MUD clients) use the Lua langauge to do this scripting. It's a little funny language but is easy to learn and use. You won't be able to build some epic programs with it, but for scripting it is pretty good. Languages in Hunspell Mudlet uses the hunspell library for spell checking. I have, of course, linked it with the Debian library. The difficulty now is what language? I was surprised that when you intialise the library, you specify what language files to use right there. Now for me its simple, the english dictionaries should be used! What I don't undertand is if there is a way of determining the right dictionary globally for a user. I first though it would be one of the locale parameters, those LC_whatever fields. Mine is en_AU.UTF8, which there is no dictionary for as I'd use en_US or en_UK. I could possibly patch Mudlet and find a dialog box somewhere where you can set the language, but to me an environment variable makes more sense. Does anyone use the DICTIONARY variable, for example?

Next.

Previous.