Search Results: "sten"

5 June 2007

Martin-Éric Racine: How about a Gaim of talking Pigeon?

Today, getting increasingly tired of the incoherent User Interface in Gaim 2.0 release candidates, I fetched the recently uploaded release 2.0.1 of Pidgin (same software, different name; the result of a trademark dispute) from Debian/unstable and built it against Stable dependencies. First impressions: excellent harmonization of the behavior between supported protocols, thanks to a new user status handling that is common to all protocols, coupled with unified a icon theme. Overall, this feels much more consistent in everyday use and it serves to blur the distinction between protocols to maintain the focus on the conversation taking place. However, two major annoyances:
  1. The old behavior of stealing focus, every time a tab pops open, is still there. AAAAAAAAAAAAAAAAAAAAAAAAARRRRRRRGH!
  2. Extremely tiny fonts in the conversation window and trying to make them inherit the default system font size via Pidgin's built-in GTK plug-in simply fails.
Conclusion: libpurple may be technically amazing, but Pidgin really is in desperate need of a complete UI overhaul.

David Pashley: Biffy Clyro - Puzzle

Currently listening to Biffy Clyro's new album, Puzzle, and I have to say it is definitely their best album yet. It's up there with 65daysofstatic for best album of the year so far. It's made a change from all the recent albums where it's taken repeated listenings to like the album. With the first listen I love this album. I am definitely going to have to see them live more often. I've only seen them twice and the gig a fortnight ago was possibly one of my best gigs ever.
Read Comments (0)

3 June 2007

Matthew Palmer: Project Honeypot

Recently I stumbled across Project Honeypot, an interesting anti-spam system to identify and flag Internet abusers, through the use of honey pots -- systems that look innocent and attractive enough to the passing network abuser, but which actually log and flag the abuser's activity and record it for future reference. It seems cool enough -- anything that aims to stop random assholes from abusing the Internet and making life unpleasant for the rest of us is to be commended -- but I'm wondering if anyone has had any experience with the project, and has any comments? I'm considering joining up and contributing a few resources, but prior experience is always worth listening to. E-mail me at mpalmer@hezmatt.org, and I'll summarise in a future post (possibly with my own experiences, if I do actually join up).

Bernd Zeimetz: hi, planet && iso8859-15 to utf8 with netatalk magic

hi, planet && iso8859-15 to utf8 with netatalk magic Hi, Planet!
Welcome to my blog, and thanks to Martin for subscribing me. I m not going to bother you with any details about me, if you have any questions feel free to ask me on freenode or oftc (in case you re wondering: my nick is bzed).


After a longer time of planning we ve upgraded our main file server at work: New machine, new storage (7TB - woohoo!), Etch instead of Sarge and UTF-8 for file names instead of ISO8859-15. Everything not a too complicated thing, except for renaming the about 10,000,000 files from ISO8859-15 to UTF-8 in a proper way.
In theory this is easy, as convmv happily takes care of the problem. But this did not work for us unfortunately, as we re not only providing NFS and Samba services, but also AFP (Apple_Filing_Protocol) via netatalk. Years ago you had to choose ISO8859-15 if you wanted to allow your Apple and Windows users to see the same, non-broken file names - not only because AFP didn t support UTF8 before version 3, which came out with OSX1). Normally you d think that a server would not allow a client to write a file with a file name which includes not supported characters - again, OSX and netatalk go their own way here:
Characters which are not supported by the underlying file system are character(!)-wise encoded using the CAP encoding. So we had to find a way to Luckily netatalk ships the uniconv(1) util2) which is able to take care of this problem. It also updates the CNID3) Database at the same time. There s two things you need to take care of in case you re using the dbd CNID backend: Be careful: uniconv assumes that all colons in a file name are part of a CAP encoded character. That s not a problem as long as you have only Mac and Windows clients accessing your server, as both systems do not allow colons in file names. In our case we found a number of cache files from Nautilus (which is running on our sunray/Solaris web-surf terminals as default browser) with colons in the file name. I hope no user will miss them ;-) Including a final synchronisation of all files to the new storage, about two hours it took uniconv to convert the file names and a aunch break, we were finished after about 14 hours of work. Until now it seems that our users didn t notice the change at all, except for those who realized that they have much more free space now. Looks like a successful weekend so far! :-D 1) and uses a NFD variant of Unicode normalization (UTF-8#Mac_OS_X), but netatalk takes care of this and translates it into the NFC form, which is used on most other platforms 2) it s called netatalk-uniconv in Debian and shipped with netatalk 3) Catalog Node ID, another crust from old Mac OS versions

29 May 2007

Joey Hess: on multitasking

I try to avoid doing multiple things at once on the computer, since I know that focusing on one thing is when I do my best work (see fighting computer-induced ADD). But I've noticed that I can do two things at once quite well if they're the right two. Two of them are:
  1. listening to music
  2. reading (but not writing, or much programming, unless the music isn't based on vocals)
That's pretty obvious, but I was suprised by this pair:
  1. listening to podcasts, interviews, etc
  2. command-line drudgery (upgrades, sysadmin work, etc)
This really suprised me, since I consider the unix command line to be another form of speech. This is making me think I don't really process it that way. Perhaps my mind really considers it a wholey visual/manual activity. It gets iffy when the sysadmin spills over into minor programming, and once I get into programming where I have to hold a lot of info in my head, I lose track of the audio.

Adam Rosi-Kessel: This American Life Parody

Via Jamie, this hilarious This American Life parody (direct link to MP3 if the embedding doesn’t work for you). This guy obviously has listened to a lot of episodes of the show. (I expect this parody will be funny only if you have, as well.)

27 May 2007

Jos Parrella: Recent political issues, travelling to DC and emdevs hacking

A few days ago, some people in Venezuela were shocked by Mark Shuttleworth’s claims against Hugo Ch vez Government and supporting Mar a Corina Machado, a minor opposition leader in the Country. Today, at 23:59:59, the nationwide open air TV broadcaster RCTV will cease operations. In Venezuela, as in several other countries in the World, the economically profitable portion of the electromagnetic spectrum is State’s property, thus requiring a concession to make use of it. RCTV concession was granted in 1987 for twenty years, and the Government has decided to deny the renewal, which is quite unusual (right-wing governments in the past simply would have shut up the antennas) Of course, RCTV is not a pro-Government channel, accounting between 90 and 100 percent of the airtime with anti Government news and opinions, which is not bad per se, though in Venezuela there’s a law requiring equilibrium in times devoted to political ads. Both situations (Mark’s comments and the Government’s decision) pose the threats of a now common situation in our Country: people taking very valid decisions with somewhat doubtful consequences. In the first case, Mark is using his right to freely write what he likes in his blog but it seems that it has damaged a little bit Ubuntu’s image in Venezuela (not that it’s Mark’s fault, of course) In the second case, the Government is taking a lawful decision, but it has actually raised an important discomfort in the population (polls, which are not always accountable, point out as much as 80% rejection rate), the journalists of other media and most foreign observers, which state that they’re actually closing a TV channel and destroying freedom of speech in the Country. Expressing political POVs is quite critical nowadays in Venezuela. Some famous etiquette bookwriters, such as the one at Emily Post’s, always tend to promote a be honest, be respectful position while listening or expressing your points of views in order to keep a productive attitude. I do think that politics are important: I just think mixing them with practical daily tasks, including FLOSS development and promotion, is becoming obnoxious and dangerous. Cheeseconf On June 15th., I’ll be departing to DC7 in Edimburgh. I’ll stay a night in Frankfurt, probably in a hostel, and then I’ll stay at one of the hostels in EDI. I plan to carry white cheese to the Cheese and Wine BoF, and I’d love any comments on how to transport them without posing a biological threat for Europe. I’ll be carrying a 65 liters backpack. How long will it take for the cheese to become a lifeform? Any special tips and tricks to avoid that? Copying files to embedded devices I’ve been trying to copy some binary files into an Axesstel D800 EvDO modem which runs Linux over a tiny ARM processor on less than 16 MB. of memory. I’m actually trying to get netcat in so I can get more useful stuff such as snmpd in. The modem has telnetd, but it has no zmodem utilities, particularly rz. Neither it has wget, nor ftpd. It has thttpd to serve the administrative webpages, but it can’t process shell CGI programs so I can’t send the file through a CGI form. Any ideas? I would love to read comments from hackers who have already managed their ways into embedded devices such as 802.11 devices with Linux, and any generic ideas on how to provide new firmware images for devices such as this Axesstel modem.

25 May 2007

Jonathan McDowell: Thoughts on calendars

I keep having what I've started to think of as the "calendar conversation" with various people. I start by outlining what I think are some fairly reasonable requirements. I'd like to have multiple calenders viewable by different sets of people. So Simon would be able to view my work calendar, while Katherine could see my personal calender (and possibly small bits of work calender where I was going to be away from home). I also want to be able to view my calenders from a variety of devices. My desktop, my phone and my laptop, for example. A web interface might be nice too, though less important to me. This doesn't seem like a lot to ask. My general hope is that whoever I'm boring about this will then say "Oh, you need to look at foo and maybe bar". After all, that's the case with most software related things I need - it's already been done, and there's a good solution available. What actually happens is the person I'm talking to nods in agreement and says they'd like the same sort of things but don't know of anything that manages it. I think the problem comes down to syncing. Sharing my calendars with other people is effectively allowing them to sync their calendar(s) with mine, with some sort of filtering so we each see only what the other wants to see. Likewise, multiple devices is all about syncing. Changes made via one method need to be visible on all of them (ideally as soon as possible). Decent syncing also brings another advantage; client independence. If I can reliably sync my information to a variety of devices/clients then I can try a different client with little risk. We have this already for mail - anything that can talk POP3, IMAP and/or mbox is easy to try out and if you don't like it then you can just change back to what you had before or try something else. Calendaring doesn't seem to have that. I don't think that the interface a client exposes needs to be complex. At a basic level what you need is a way to find out what the client thinks has been added, removed or changed. You also need to present this information in a standard format. Unfortunately iCal (RFC2445) appears to be what we've got here. I think it's a bit overly inclusive, which seems to lead to incomplete implementations. Is there a complete iCal parser library out there? The best hope for syncing that I'm aware of is OpenSync. And I haven't been that impressed; while I managed to get it to move the contacts from my SonyEricsson v600i to my Nokia E70 some of the details got mangled on the way. And lack of things like recurring event support in some of the plugins (eg the Google Calendar syncing adaptor) or warnings about data loss in the Sunbird plugin aren't encouraging. Speaking of Sunbird, I'm not impressed. Last time I looked (and it doesn't appear to have moved very far since then) it didn't make any attempt to support syncing. I'm sorry, WebDAV isn't a syncing system. It's a way of storing files remotely. Sure, I found the interface ok, but I need to make my calendaring data accessible for it to be useful. The Windows approach to all of this seems to be ActiveSync and the use of Outlook. I don't believe that it really handles more than the desktop client and a remote device though? And group calendar sharing requires an Exchange server? Not exactly the flexible solution I'm looking for. I think a key point is that all of this needs to be reliable. I didn't spend time debugging my OpenSync contact syncing issues partly because I didn't notice straight away that there was a problem (it was with additional details like email addresses rather than names/numbers IIRC), but also because it was a lot of work to delve into the code and find out just what on earth was going on. A while back I started looking at writing some calendar syncing code (called Pony) and hit a problem with complete inconsistency in handling time zones between clients that put me right off. If it's not reliable it's not useful. If it's not useful people won't test it and fix it. I think a starting point is a reliable iCal implementation that can handle everything in the spec. From there you can write plugins that will take whatever bastardised variant your device/client supports and translate to and from it. The syncing tool will need to keep a master copy of all the data, because there's no guarantee anything else will be able to support all the fields. A local complete copy should enable appropriate frobbing of data to/from any device/client without losing the information if a new device/client that can handle the data is added. Of course almost all the above applies to contacts as well; I have work contacts, personal contacts, boring house contacts (plumber, garage etc). vCard is the appropriate interchange format for that (why did vCalendar become iCalendar, but vCard not change?), but contacts feature similar issues to calendars I believe. Does this seem reasonable? Please tell me someone has already done it. Point me at Debian packages that will let me sync my phone, my Google Calendar and a local client and make me very happy. I have visions of a suite of tools all chatting over DBus; a little client that looks for my phone to appear over bluetooth and then syncs when it does, a little client that monitors Google Calendar for changes. Sunbird reporting when something changes (and accepting notification of changes). Some other client ([Dates http://www.pimlico-project.org/dates.html]?) doing the same. Another sending the data over WebDAV or SFTP so that my laptop can pick up the info when I'm on the move. I don't think I'm the only person looking for this sort of stuff. Where is it?

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.

21 May 2007

Joachim Breitner: Spontanious DHCP-Server

Sometime someone connects his computer to mine using a network cable, to transfer some files or similar. In a perfect world, both computers would run something like zeroconf or avahi-autoip, and IP adresses were taken care of. But in the real world, this is not often the case. Then, this would be easiest:
$ ifconfig eth0 192.168.42.1
$ simpledhcpd eth0
Where simpledhcpd would, without any configuration, start listening for DHCP requests on eth0 and serve IPs from the just configured subnet. No configuration file, no leases, not even a deamon mode. Just Real Simple IPs for your ad-hoc-network. Does that already exists?

Bernd Zeimetz: hi, planet // iso8859-15 to utf8 with netatalk magic

<div xmlns='http://www.w3.org/1999/xhtml'> <h1><a name="hi_planet_iso8859-15_to_utf8_with_netatalk_magic" id="hi_planet_iso8859-15_to_utf8_with_netatalk_magic">hi, planet // iso8859-15 to utf8 with netatalk magic</a></h1> <p> <em><strong>Hi, Planet!</strong> <br/> Welcome to my blog, and thanks to <a href="http://blog.zobel.ftbfs.de/" title="http://blog.zobel.ftbfs.de/" rel="nofollow">Martin</a> for subscribing me. I m not going to bother you with any details about me, if you have any questions feel free to ask me on <a href="http://freenode.net/" title="http://freenode.net/" rel="nofollow">freenode</a> or <a href="http://www.oftc.net/" title="http://www.oftc.net/" rel="nofollow">oftc</a> (in case you re wondering: my nick is bzed).</em> <br/> <br/> After a longer time of planning we ve upgraded our main file server at <a href="http://www.architektur.tu-darmstadt.de" title="http://www.architektur.tu-darmstadt.de" rel="nofollow">work</a>: New machine, new storage (7TB - woohoo!), Etch instead of Sarge and <a href="http://en.wikipedia.org/wiki/UTF-8" title="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> for file names instead of <a href="http://en.wikipedia.org/wiki/ISO8859-15" title="http://en.wikipedia.org/wiki/ISO8859-15">ISO8859-15</a>. Everything not a too complicated thing, except for renaming the about 10,000,000 files from ISO8859-15 to UTF-8 in a proper way. <br/> In theory this is easy, as <a href="http://packages.debian.org/unstable/utils/convmv" title="http://packages.debian.org/unstable/utils/convmv" rel="nofollow">convmv</a> happily takes care of the problem. But this did not work for us unfortunately, as we re not only providing NFS and Samba services, but also AFP (<a href="http://en.wikipedia.org/wiki/Apple_Filing_Protocol" title="http://en.wikipedia.org/wiki/Apple_Filing_Protocol">Apple_Filing_Protocol</a>) via netatalk. Years ago you had to choose ISO8859-15 if you wanted to allow your Apple and Windows users to see the same, non-broken file names - not only because AFP didn t support UTF8 before version 3, which came out with OSX<a href="#fn__1" name="fnt__1" id="fnt__1">1)</a>. Normally you d think that a server would not allow a client to write a file with a file name which includes not supported characters - again, OSX and netatalk go their own way here:<br/> Characters which are not supported by the underlying file system are character(!)-wise encoded using the <a href="http://netatalk.sourceforge.net/2.0/htmldocs/configuration.html#id2898845" title="http://netatalk.sourceforge.net/2.0/htmldocs/configuration.html#id2898845" rel="nofollow">CAP encoding</a>. So we had to find a way to </p> <ul> <li> convert file names from ISO8859-15 to UTF-8 </li> <li> replace CAP encoded characters by the appropriate UTF-8 character </li> </ul> <p> Luckily netatalk ships the <a href="http://netatalk.sourceforge.net/2.0/htmldocs/uniconv.1.html" title="http://netatalk.sourceforge.net/2.0/htmldocs/uniconv.1.html" rel="nofollow">uniconv(1)</a> util<a href="#fn__2" name="fnt__2" id="fnt__2">2)</a> which is able to take care of this problem. It also updates the CNID<a href="#fn__3" name="fnt__3" id="fnt__3">3)</a> Database at the same time. There s two things you need to take care of in case you re using the dbd <a href="http://netatalk.sourceforge.net/2.0/htmldocs/configuration.html#CNID-backends" title="http://netatalk.sourceforge.net/2.0/htmldocs/configuration.html#CNID-backends" rel="nofollow">CNID backend</a>: </p> <ul> <li> uniconv assumes that <em>cnid_metad</em> is listening on port 4700, you need to start it first. Don t run afpd at the same time! </li> <li> If you ve specified external CNID dbpaths in your <em>AppleVolumes.default</em> (normally they re located in the root of each volume, prone to be deleted by users accidentally), you need to move the .AppleDB directory into your volume s root directory, otherwise uniconv will create a new CNID database. Just move it back as soon as uniconv is finished. </li> </ul> <p> Be careful: uniconv assumes that all colons in a file name are part of a CAP encoded character. That s not a problem as long as you have only Mac and Windows clients accessing your server, as both systems do not allow colons in file names. In our case we found a number of cache files from Nautilus (which is running on our sunray/Solaris web-surf terminals as default browser) with colons in the file name. I hope no user will miss them <img src="http://bzed.de/lib/images/smileys/icon_wink.gif" alt=";-)" /> </p> <p> Including a final synchronisation of all files to the new storage, about two hours it took uniconv to convert the file names and a aunch break, we were finished after about 14 hours of work. Until now it seems that our users didn t notice the change at all, except for those who realized that they have much more free space now. Looks like a successful weekend so far! <img src="http://bzed.de/lib/images/smileys/icon_biggrin.gif" alt=":-D" /> </p> <p> <strong>update:</strong> full html in the feed. </p> <div class="tags"><span> <a href="http://bzed.de/tags/debian" class="wikilink1" title="tags:debian" rel="tag">debian</a>, <a href="http://bzed.de/tags/linux" class="wikilink1" title="tags:linux" rel="tag">linux</a> </span></div> <a href="#fnt__1" id="fn__1" name="fn__1">1)</a> and uses a NFD variant of Unicode normalization (<a href="http://en.wikipedia.org/wiki/UTF-8%23Mac_OS_X" title="http://en.wikipedia.org/wiki/UTF-8%23Mac_OS_X">UTF-8#Mac_OS_X</a>), but netatalk takes care of this and translates it into the NFC form, which is used on most other platforms <a href="#fnt__2" id="fn__2" name="fn__2">2)</a> it s called netatalk-uniconv in Debian and shipped with <a href="http://packages.debian.org/stable/net/netatalk" title="http://packages.debian.org/stable/net/netatalk" rel="nofollow">netatalk</a> <a href="#fnt__3" id="fn__3" name="fn__3">3)</a> Catalog Node ID, another crust from old Mac <acronym title="Operating System">OS</acronym> versions </div>

20 May 2007

Benjamin Mako Hill: Free Culture Talk Recording

As I mentioned previously, I was graciously given the opportunity to speak the crowd at the Free Software Foundation's Members Meeting in March about some of my work and activism around Free Culture. In front of what was probably the friendliest audience possible, I compared the free software and free culture movements and explained why I think that free culture movement may be off track -- and, of course, what we as a community might be able to do about it. If you listen to it, please try to forgive my faults as a speaker. The message I tried to convey is what I think is one the most important tactical issues facing free culture. If this talk dwells a little too long on free software and the lessons we might take from that world, please consider my audience. You can listen to the talk here:

17 May 2007

Gunnar Wolf: On magazines without editorial direction

Scott complains on how Linux Format #93's articles comparing Ubuntu and other distributions often contradict each other, and blames it on the lack of any editorial direction or basic research.
I... Have to confirm this. But anyway, I can stand a bit on the different writers' side - Each article is written by a different person and, although the magazine must try to be coherent (of course, within certain limits - if the magazine suggests editor's picks in one article, they should not bash them to death in the next one).
I write the Linux column in the Spanish edition of PC Magazine. No, it's by far not a technical column, nor anything far like it. The magazine is end-user oriented, and clearly sponsorship-driven - In fact, my column was not part of the magazine for quite some time, as they gear it towards end-users, and sponsors (I cannot venture which sponsors, but your imagination will probably go to the same company as mine) do not like what I write about. All in all, I get the general topics which each month's edition will cover, and I just have to write an article about one of them. Of course, I don't know most of the other writers. There is no interaction at all.
And I guess that Linux Format is a typical magazine - If they run like PC Magazine, they just won't have the time to put all the articles together checking for inconsistencies. I think it is enough of a task to chase the contributors month after month (BTW, I'm a week late already :-/ But I cannot finish just today, as there's too much work to do, and I spend my time blogging... Hmh, time to finish this post, as coitus interruptus as it may seem).

Andrew Stribblehill: Timing random disk seeks

I asked an interviewee how long it takes for a disk seek, and he replied that he thought it was between 4 and 8 milliseconds. Speaking with colleagues, the conventional wisdom was that it was around 10 ms. I was unsatisfied so I thought I would try it for myself.

time sudo perl -we '$disk="/dev/sda"; $n=1500; $blocks= blockdev --getsz $disk ; if (!$blocks) print "Enter capacity in manufacturer GB\n: "; $blocks=1953125*(
) ; use Time::HiRes "time"; open DISK, $disk; $start=time; for (0..$n) seek DISK, int(rand($blocks))*512, 0; sysread DISK, $x, 512 die; $now=time; $times[int(($now-$start)*1000)]++; $x=$now-$start; $s2+=$x**2; $s+=$x; $start=$now ; for (0..$#times) if ($t=$times[$_]) $tot+=$t; $median =$_ if $tot>=$n/2; printf "%3d %s\n", $_, "x" x ($t/2) . ($t%2?":":"") ; printf "\nTook %3.4gs for %d seeks of %s (%d GB)\n", $s, $n, $disk, $blocks/2097152; printf "Mean: %2.03gms; Median: %d-%dms; Std dev: %2.03gms\n", 1000*$s/$n, $median-1, $median, 1000*sqrt($s2/$n - ($s/$n)**2);’
It should be obvious that before you run this, you should check for yourself that it doesn’t do anything dangerous. Or at least check that $disk is set appropriately for your hardware and operating system. If you don’t have blockdev, estimate the number of 512-byte blocks and set $blocks to that value. (There are 1953125 blocks in a hard disk manufacturer’s "Gigabyte".) The graph it produces prints an ‘x’ for two seeks of a given number of milliseconds and a trailing ‘:’ if there was one left over. For me, on my one year old Linux 2.6.18 workstation with a 160 "GB" Western Digital (WDC WD1600JS — quoted seek time 8.9 ms) the typical output is:
  0 :
  3 :
  4 :
  5 x:
  6 xxxx:
  7 xxxxxxx
  8 xxxxxxxxxxx:
  9 xxxxxxxxxxxxxxxxx
 10 xxxxxxxxxxxxxxxxxxxxxxx
 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 12 xxxxxxxxxxxxxxxxxxxxxxxxx
 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 23 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 24 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 25 xxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
 26 xxxxxxxxxxxxxxxxxx
 27 xxxxxxxxxxxxxxx
 28 xxxxxx:
 29 xxxxx:
 30 xxxx
 31 :
 32 :
 34 x
 35 :
 57 :
Took 27.69s for 1500 seeks of /dev/sda (149 GB)
Mean: 18.5ms; Median: 17-18ms; Std dev: 5.24ms
real    0m27.859s
user    0m0.116s
sys     0m0.044s
Why might I care? 18 milliseconds is almost a lifetime compared with anything else a modern PC does. It’s slower than my monitors’ refresh period! I can read around 1 MB from disk, 10 MB over a GigE link or 20 MB from RAM in this time. I can ping from Ireland to England, crossing 40 routers there and back, in the time it takes for my disk head to seek. Every time you read something from a previously unread file, it costs on average EIGHTEEN MILLISECONDS even before it starts reading. That’s just 55 in a second. This has obvious implications for I/O program performance, i.e. that of most servers. If anyone has a concern about my method, I’d be interested to hear it. I’d also like to see the timings for different disks. Either post the whole histogram or just the stats, plus the make and model of the disk. On Linux you can get this from dmesg or hdparm -I device. Update: I’ve made the script more robust under non-existence of blockdev.

Matthew Garrett: Runtime power saving on Linux - the CPU

Modern processors have a variety of low power modes that can be entered while idle. These "C states" are numbered, currently ranging from C0 (a running CPU) to C4 (a deep runtime sleep state). The problem with these states is that the deeper the sleep, the longer it takes the CPU to wake up. In order to avoid excessive reductions in performance, the kernel must keep track of the processor usage pattern and avoid putting the CPU into a deep sleep mode when it's likely that it'll be needed for more work in the near future.

Traditionally, the kernel has had a fixed timer tick - that is, a fixed number of times a second, the timer will generate an interrupt, wake the kernel and allow processes to be rescheduled. This limits the maximum amount of time the CPU can remain idle, as this timer will fire even when the system is otherwise idle. A tick rate of 1000Hz is desirable for reducing latency, but will also result in the maximum sleep period being 1ms. This is less than ideal.

2.6.21 introduced dynamic tick functionality. Now, rather than having a fixed tick interval, if the system is idle the kernel looks at all outstanding timers and schedules a wakeup in time to answer the next timer. This allows much longer periods of sleep without compromising latency. However, for this to be useful it's desirable to have as few timer wakeup events as possible. The longer the CPU is going to be asleep, the deeper the sleep state that can be used.

Intel have recently released Powertop, an application that tracks the causes of wakeups. These wakeups can fall into two categories - kernel and userspace. Pure userspace timers will usually be due to an application having a timer to handle some sort of trivial activity, like blinking a cursor or polling for state. There are a couple of ways to improve this:Things in the kernel can be trickier. Kernel interrupts may be appearing because of some kernel code specifying a timer, but an alternative is that a userspace application is poking them. Many of the same considerations as userspace apply here:Fixing these issues can range from the trivial (removing unnecessary timers) to the complicated (teaching gstreamer about alsa notifications, teaching the mixer applet to listen to signals from gstreamer). It's all helpful, though. Ideally you want your processor to be averaging at least 20ms in the deepest C state before it's woken up again. There's a lot of low-hanging fruit out there, and every fix improves battery life.

16 May 2007

Eddy Petri&#537;or: bluetooth fun with my Nokia 6600

I just started poking with my Nokia 6600 and python for S60. From the highlights of the evening (I just started, so I needed to set things up).
Now I would really like to know how to start a serial terminal server that listens on Bluetooth to be able to start the bluetooth console in a manner similar to the Windows or Mac method.

Update: After digging and trying different things I got to a message which put me on the right track. After a while I got the magic formula:

bounty:/home/eddy/usr/lib/linux_and_other_oses/series 60/devel/python# rfcomm listen 0 3
Waiting for connection on channel 3
Connection from 00:60:57:BB:B6:C5 to /dev/rfcomm0
Press CTRL-C for hangup


The 1 means to create a /dev/rfcomm1 device; the 3 is the channel on which the Bluetooth console tries to connect (try once and you will see it).

After that, the hint in the Mac tutorial, so I typed:

bounty:/home/eddy$ screen /dev/rfcomm0
help
Traceback (most recent call last):
File "", line 1, in ?
NameError: name 'help' is not defined
>>>

Victory! Now I can actually start to program.

Update2:
Oh, yes, I remembered I should write something like "How to connect PyS60 Bluetooth console and Linux" so is easier to spot. I tried to add myself a link to the proper page, but I couldn't make an account because of the broken capthca.

15 May 2007

Martin F. Krafft: Death is just the Beginning

I picked up the sampler Death... is just the Beginning Volume IV the other day, practically for free. On it, there are a few songs by bands I've come to like recently, so I expect to find a few more good tunes that way. Opening the case, I notice that it's not the standard jewel case but rather a unique mixture between paper and plastic. But it's not plastic as the case boldly asserts. It's a NaturePac no plastic biodegradable. Well, first off, I am glad that environmental consciousness is spreading. Next, I wonder whether the producers of the sampler expect me to get rid of it soon, or why they chose biodegradable packaging. And last, since we already know that heavy metal is for gifted kids, I can now boldly assert that all listeners of death metal are environmentally conscious. Or was it the other way around? NP: Man on Fire: The Undefined Design

9 May 2007

Lars Wirzenius: Quote: Blinkenlites und cursorblinken

While cleaning up the infinite mess that is my home directory, I found the following:
ACHTUNG! ALLES LOOKENSPEEPERS! Das Internet is nicht fuer gefingerclicken und giffengrabben. Ist easy droppenpacket der routers und overloaden der backbone mit der spammen unt der me-tooen. Ist nicht fuer gewerken bei das dumpkopfen. Das musclicken sichtseeren keepen das bandwit-spewin hans in das pockets muss; relaxen und watchen das cursorblinken.
This is, obviously, a play on the old blinkenlite thing, which I also found:
A C H T U N G ! ! ! --Alles Touristen und Non Technischen Lookens Peepers-- Das maschine control is nicht fur Gefingerpoken und Mittengrabben. Oderwise is easy schnappen der Schpriggenwerk, Blownfuse, und Poppencorken mit Spitzensparken. Der Maschine is Diggen by Experten only. Is nicht fur Geverken by das Dummkopfen. Das Rubbernecken und Sightseeren keepen das Cottonpicken Hands in das Pockets. So Relaxen und Watsch das Blinkenlite.
If I ever have an actual machine room, these will go on the wall.

8 May 2007

David Welton: Permission denied to get property Object.constructor

I struggled a little bit to figure out what was going on with the Prototype javascript library in terms of this error I was getting in my application, rather cryptically reported as:
[Exception... "'Permission denied to get property 
Object.constructor' when calling method:
[nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]
I was setting up an observer to make some async requests when a checkbox is set or unset. Setting the checkbox to true worked just fine, but unsetting it seems to cause the above exception. It turns out the fix is pretty simple. Instead of this:
<%= observe_field('blah_yes', :url =>
                   :action => 'set_blah', :id => @someobj.id ,
                  :update => 'blahmessages') %>
I made sure to use a :with parameter:
<%= observe_field('blah_yes', :url =>
                   :action => 'set_blah', :id => @someobj.id ,
                  :update => 'blahmessages', :with => 'yes') %>
My guess as to what's occuring comes from the parameters passed into my controller. Before the modification:
 "action"=>"set_blah", "id"=>"4", "1"=>"", "controller"=>"xyz" 
That "1" is being passed as the variable name, rather than its value... After adding the with, the parameters come in like so when it's being set:
 "action"=>"set_blah", "id"=>"4", "controller"=>"xyz", "yeah"=>"1" 
And like so when it isn't... aha!
  "action"=>"set_blah", "id"=>"4", "controller"=>"xyz", "yeah"=>"null" 
I bet that null is what was causing problems. I thought I'd publish it so that an answer is available for those searching with google, as I wasn't able to find one. Perhaps the Prototype library should be a little bit more careful with its data somewhere in order to fail more gracefully, but I'm not sure where one would go about looking.

7 May 2007

Sam Hocevar: Bits from the DPL: blog, talks, FTP-master

blog posts I am going to identify all my DPL-related posts with a dpl tag. All such posts will be accessible through http://sam.zoy.org/blog/?cat=dpl. talks On May 5th I attended an Etch Install Party at the Carrefour du Num rique in the Cit des Sciences et de l'Industrie in Paris, organised by the Parinux LUG. Fellow developers Christian Perrier and Julien Cristau as well as not-yet-but-now-almost-really-soon-to-be developer Yves-Alexis Perez were also present. I did a (rather dull, sorry; I didn't prepare it well enough) talk about the Debian project, its organisation and how people, even beginners, can help Debian and its community. My slides (French) are available, and the Carrefour du Num rique people kindly recorded it and made it available for download. interviews Since the DPL elections I have given several interviews, of which a few have already been published. They may be of interest because I share my thoughts about topics that were not covered in my platform, or not very deeply. You can also check whether I am consistent. And it s important that people know what I may say about Debian to the rest of the world. The interviews are: FTP-master and other teams Zobel is frustrated by things not happening in the FTP team which were apparently going better when AJ was DPL. I don t really know how to understand that blog post. A DPL+FTP-master hat is something that cannot happen this year, so if this is what allowed AJ to be efficient we ll have to find something else. For the record, after my first bits from the DPL on debian-devel-announce and its request for candidacy I have received one offer to help the DSA team and one offer (this morning) to help with the NEW-handling part of FTP-master work.

Next.

Previous.