
Good morning all!
It feels like forever since I last blogged . Which is extremely bad of me
*slaps own wrist*. However, I m been horrendously stupidly busy. As some of you may know, I m very much an Android fan. Recently, I ve gotten myself a shiny Galaxy SII.
Given the fact that alongside my day job of being a Web Developer for an Online Retailer, I m also a
Voluntary Ambulance Person I thought it d be useful to ask my current workplace if they d provide me a
mobile phone cover for my new phone. Of course, work were more than happy to provide me with a shiny
Samsung Galaxy S2 case (I actually went for the
Case-Mate Barely There in brushed aluminium).
Being a voluntary Ambulance Person, I regularly have to go to random places to pick up an ambulance/attend an event. Because of that I rely quite heavily on
Google Maps and it s navigation features (Free Sat Nav in my opinion, the killer feature of Android).
Having only had my phone a week, I started to find that there were a few problems with the GPS. Whereas previously, I d been able to lock on almost instantly, It d now take me about half an hour (literally) to get a lock on anything. I tried Googling, I tried everything I could think of, but to no avail. I downloaded GPS Test, and it was showing that while it was picking up a couple of sattelites, it wasn t picking up enough to get a decent lock

The image above is a screenshot of the GPS test from directly outside my front door, taken after it had settled down.
As you can imagine, I wasn t happy and was ready to send the phone back.
Then, for some reason, a brainwave hit me (It doesn t happen often). What changed from when it was working to now? I know! The Case
*takes case off, tries GPS test again*

It can be amazing what happens when you realise that shiny case you have is mainly made of aluminium. Guess what works well at deflecting radio signals and the like You got it, aluminium.
So now I need to decide whether to get another case or whether to just take the case off when I need to do sensible things.
Other than the case problem, I m finding that the Samsung Galaxy SII is a great phone (as soon as I got rid of Touchwiz). I m not a fan of the OEM Samsung crap that s been bolted onto the phone, and will, as soon as there s a decent release, be putting a copy of CyanogenMod on the phone (I ve already made most of the tweaks I just want rid of SNS)
In other news I ve started more and more gaming again. If you re interested in a couple of rounds of TF2 or some SC2 (or some Portal 2 Co-Op) then give me a shout with your Steam ID / Battle.net ID and I ll see what I can do. I m thinking of starting doing some Let s Play Videos, as my Youtube Channel is looking a bit sparse!
I m going to try and start blogging a bit more aswell so if there s anything you want to see me blog about pop a post in the comments below!
Till next time..

Jean-Yves Lefort s
link-monitor-applet, an applet for the GNOME panel, is a great tool for those with often-changing and possibly unreliable network connection. It allows me to see, at one glance, whether I can reach the router, the internet and/or my VPN. Furthermore, the latency display tells me whether there is a point in working over SSH right now. I often observe other people, e.g. on conferences, to stare for a while at a non-loading web page, then fire up a terminal window and run random ping commands, while I immediately see that the network is down and can relax.
Unfortunately, Jean-Yves seems to have stopped working on link-monitor-applet and does not reply to
bug reports. This was not a big deal as long as I could use the last released version with
minor patches of mine, but now gnome-panel 3 is coming up and all applets need
porting to GTK3. Yesterday and today I worked on that, and got it so far that the applet is fully functional, although the visual styling is not perfect yet, because I m not sure how to do what Jean-Yves did with GtkStyle and GdkGC now with GtkStyleContext and Cairo. The code is in the
gnome3 branch of my git repository.
For this issue, and any further maintenance work, I m looking for someone who is willing to take upstream responsibility for link-monitor-applet, e.g. making sure it works with the latest GNOME (well, GNOME in fallback mode) and that bug reports are handled. The code base is not too big, and both the non-standard build system and the gob-enhanced C code are fine to work with. I ll still be happy to serve as the maintainer of the
Debian package of link-monitor-applet.
Flattr this post
I have recently been working on some code for
NetSurf which builds up an output buffer by repeatedly calling snprintf(); No great shock there, well understood trivial pattern that has been used repeatedly for ages.
Of course I discovered a buffer overflow, which to be fair had already been pointed out to me by another developer and I just failed to see it...Can I blame my old age? no? bah, get off my lawn!
Basically it boils down to me simply not seeing where C helpfully let me subtract one size_t typed value from another for a length and me completely forgetting that a negative result would simply become a large positive value...
I (erroneously) beleived snprintf took a (signed) int as the buffer length, of course it returns one, but it takes a size_t which is, of course unsigned.
Gosh I feel silly now, in fact I was so convinced I was right I wrote a program to "prove" it.
1 /* snprintf.c
2 *
3 * snprintf example
4 *
5 * Public domain (really I do not think its even copyrightable anyway)
6 *
7 * cc -Wall -o snprintf-ex snprintf-ex.c
8 */ 9 10 #include <stdio.h>11 #include <string.h>12 13 #define SHOW printf("%3ld %.*s*%s\n", string_len - slen, (int)slen, string, string + strlen(string) + 1 )14 15 16 int
main(int
argc, char
**argv)17 18 char
string[64];19 size_t string_len = sizeof
(string) /
2;20 int
bloop;21 size_t slen = 0;22 23 /* initialise string */24 for
(bloop = 0; bloop < (sizeof
(string) - 1); bloop++) 25 string[bloop] = '0' + (bloop % 10);26 27 string[bloop] = 0; /* null terminate */28 29 printf("%3ld %s\n",
string_len,
string);30 31 /* try an empty string */32 slen += snprintf(string + slen,
string_len - slen,
"%s",
"");33 34 SHOW;35 36 /* blah blah */37 slen += snprintf(string + slen,
string_len - slen,
"Lorem ipsum dolor");38 39 SHOW;40 41 /* this one should exceed the allowed length */42 slen += snprintf(string + slen,
string_len - slen,
"Lorem ipsum dolor");43 44 SHOW;45 46 /* should not call snprintf up if slen exceeds string_len as the
47 * subtraction results in a negative length and snprintf takes a unisigned
48 * size!
49 */50 51 /* this one starts exceeding the allowed length */52 slen += snprintf(string + slen,
string_len - slen,
"Lorem ipsum dolor");53 54 SHOW;55 56 return
0;57 Of course all this really proved was that I was wrong and I needed to clean up the original code as soon as possible.
A good lesson to learn here is that no matter how experienced you are, you can be mistaken and that, perhaps, some redemption I can take from this is I have matured enough as a programmer to write a test program to prove myself wrong!

I was due for another Google interview mail it seems. I have to say I wasn't expecting it, but this week I had a follow up to my polite mail from 6 months ago that said "No thanks, I'm not looking" asking if it was still the case.
Normally I welcome this little bit of ego stroking; it's always nice to be wanted. Except that's not really the case, is it? It's an invitation to interview for something, not any indication that you've done more than tick some initial boxes. Google mails inevitably ask me if I'd like to work in SRE. It's always SRE. No one ever emails and asks if I want to work on self-replicating nanobots that will roam Mars searching for the perfect spot to build a beach house.
And that's where things fall down. If someone currently has a job, then emailing them out of the blue to ask if they want to come and interview for something vague is hoping that they're either looking, and just haven't come to you yet, or not looking but unhappy enough with their current role that all they needed to start was an email asking them to submit a recent CV.
For the former, if you're Google, do you really think that person doesn't know where to find you? For the latter, you're being quite presumptuous, aren't you? The act of updating my CV my be some effort (actually it's usually not, because the stuff that's not on it is the stuff I can't talk about because it's not released yet, or stuff that's specific and thus wouldn't go on a CV for a vague job spec). Even if it's not the act of interviewing is potentially a waste of time for both of us, if the role isn't clear.
One argument used is that people will be placed according to the skills they show during the interview process. That's fine from the employers point of view, but if you're actively trying to get some interest from people who are gainfully employed you really need to grab their attention somehow. I can't remember the last time I had an unsolicited email interview offer that actually wowed me, or indeed even showed more than a passing sign of tailoring a spec to my profile.
When I was running Black Cat I made a point of always replying to unsolicited CVs. How polite I was depended on how the covering emails were worded (a Word document with nothing else was likely to get short shrift, something well targeted in a Linux friendly format would normally get some comment about how we weren't hiring and were unlikely to be, but if that changed it would be mentioned on the website), but I felt people deserved a reply - I have been disappointed by not receiving responses myself to what I considered well targeted job inquiries.
So far I've so far taken the same approach with mails from corporate recruiters (less so with recruiters that are associated with recruitment firms, rather than directly with the companies they are hiring for), but I'm starting to feel like changing that stance. Candidates are told to tailor CVs to the role being applied for, provide a decent cover letter, and in general make companies want to talk to them. Companies who are sending out recruitment emails should be held to the same standard. Even assuming you do a basic phone screen first, I can probably expect to need to take a day off work assuming that goes well. You need to convince me I can justify that before I'm going to feel like engaging at all.
(And if I'm honest, based on what I've seen so far, it's unlikely to happen. All of the things I've considered have come from conversations with people I know directly about companies they own or work for, never some random contact via email. I try hard not to think of recruitment mail as spam, but I can how that line of thought follows through.)
I should apologize to Google here. They got mentioned as an example, but I don't think they're particularly bad. I did interview with them at one point, and made the decision not to continue that process after deciding a different, more certain, path was better for me. So I've displayed interest. And in response to my reply today of "I know where to find you, so please assume I'll do so if I change my mind." they've said they'll make a note on their records.
Some years ago I came across a really peculiar newsgroup post. It was not about technicalities of any sort. It was about history. A beautifully written history of computers. From the Turing machine to the Free Software world, the original author managed to capture all the important events of the computer revolution with a great deal of humor. Re-posting it here, it is just brilliant.
The Gospel of Tux (v1.0)
In the beginning Turing created the Machine.
And the Machine was crufty and bodacious, existing in theory only. And von Neumann looked upon the Machine, and saw that it was crufty. He divided the Machine into two Abstractions, the Data and the Code, and yet the two were one Architecture. This is a great Mystery, and the beginning of wisdom.
And von Neumann spoke unto the Architecture, and blessed it, saying, Go forth and replicate, freely exchanging data and code, and bring forth all manner of devices unto the earth. And it was so, and it was cool. The Architecture prospered and was implemented in hardware and software. And it brought forth many Systems unto the earth.
The first Systems were mighty giants; many great works of renown did they accomplish. Among them were Colossus, the codebreaker; ENIAC, the targeter; EDSAC and MULTIVAC and all manner of froody creatures ending in AC, the experimenters; and SAGE, the defender of the sky and father of all networks. These were the mighty giants of old, the first children of Turing, and their works are written in the Books of the Ancients. This was the First Age, the age of Lore.
Now the sons of Marketing looked upon the children of Turing, and saw that they were swift of mind and terse of name and had many great and baleful attributes. And they said unto themselves, Let us go now and make us Corporations, to bind the Systems to our own use that they may bring us great fortune. With sweet words did they lure their customers, and with many chains did they bind the Systems, to fashion them after their own image. And the sons of Marketing fashioned themselves Suits to wear, the better to lure their customers, and wrote grave and perilous Licenses, the better to bind the Systems. And the sons of Marketing thus became known as Suits, despising and being despised by the true Engineers, the children of von Neumann.
And the Systems and their Corporations replicated and grew numerous upon the earth. In those days there were IBM and Digital, Burroughs and Honeywell, Unisys and Rand, and many others. And they each kept to their own System, hardware and software, and did not interchange, for their Licences forbade it. This was the Second Age, the age of Mainframes.
Now it came to pass that the spirits of Turing and von Neumann looked upon the earth and were displeased. The Systems and their Corporations had grown large and bulky, and Suits ruled over true Engineers. And the Customers groaned and cried loudly unto heaven, saying, Oh that there would be created a System mighty in power, yet small in size, able to reach into the very home! And the Engineers groaned and cried likewise, saying, Oh, that a deliverer would arise to grant us freedom from these oppressing Suits and their grave and perilous Licences, and send us a System of our own, that we may hack therein! And the spirits of Turing and von Neumann heard the cries and were moved, and said unto each other, Let us go down and fabricate a Breakthrough, that these cries may be stilled.
And that day the spirits of Turing and von Neumann spake unto Moore of Intel, granting him insight and wisdom to understand the future. And Moore was with chip, and he brought forth the chip and named it 4004. And Moore did bless the Chip, saying, Thou art a Breakthrough; with my own Corporation have I fabricated thee. Thou thou art yet as small as a dust mote, yet shall thou grow and replicate unto the size of a mountain, and conquer all before thee. This blessing I give unto thee: every eighteen months shall thou double in capacity, until the end of the age. This is Moore s Law, which endures unto this day.
And the birth of 4004 was the beginning of the Third Age, the age of Microchips. And as the Mainframes and their Systems and Corporations had flourished, so did the Microchips and their Systems and Corporations. And their lineage was on this wise:
Moore begat Intel. Intel begat Mostech, Zilog and Atari. Mostech begat 6502, and Zilog begat Z80. Intel also begat 8800, who begat Altair; and 8086, mother of all PCs. 6502 begat Commodore, who begat PET and 64; and Apple, who begat 2. (Apple is the great Mystery, the Fruit that was devoured, yet bloomed again.) Atari begat 800 and 1200, masters of the game, who were destroyed by Sega and Nintendo. Xerox begat PARC. Commodore and PARC begat Amiga, creator of fine arts; Apple and PARC begat Lisa, who begat Macintosh, who begat iMac. Atari and PARC begat ST, the music maker, who died and was no more. Z80 begat Sinclair the dwarf, TRS-80 and CP/M, who begat many machines, but soon passed from this world. Altair, Apple and Commodore together begat Microsoft, the Great Darkness which is called Abomination, Destroyer of the Earth, the Gates of Hell.
Now it came to pass in the Age of Microchips that IBM, the greatest of the Mainframe Corporations, looked upon the young Microchip Systems and was greatly vexed. And in their vexation and wrath they smote the earth and created the IBM PC. The PC was without sound and colour, crufty and bodacious in great measure, and its likeness was a tramp, yet the Customers were greatly moved and did purchase the PC in great numbers. And IBM sought about for an Operating System Provider, for in their haste they had not created one, nor had they forged a suitably grave and perilous License, saying, First we will build the market, then we will create a new System, one in our own image, and bound by our Licence. But they reasoned thus out of pride and not wisdom, not forseeing the wrath which was to come.
And IBM came unto Microsoft, who licensed unto them QDOS, the child of CP/M and 8086. (8086 was the daughter of Intel, the child of Moore). And QDOS grew, and was named MS-DOS. And MS-DOS and the PC together waxed mighty, and conquered all markets, replicating and taking possession thereof, in accordance with Moore s Law. And Intel grew terrible and devoured all her children, such that no chip could stand before her. And Microsoft grew proud and devoured IBM, and this was a great marvel in the land. All these things are written in the Books of the Deeds of Microsoft.
In the fullness of time MS-DOS begat Windows. And this is the lineage of Windows: CP/M begat QDOS. QDOS begat DOS 1.0. DOS 1.0 begat DOS 2.0 by way of Unix. DOS 2.0 begat Windows 3.11 by way of PARC and Macintosh. IBM and Microsoft begat OS/2, who begat Windows NT and Warp, the lost OS of lore. Windows 3.11 begat Windows 95 after triumphing over Macintosh in a mighty Battle of Licences. Windows NT begat NT 4.0 by way of Windows 95. NT 4.0 begat NT 5.0, the OS also called Windows 2000, The Millenium Bug, Doomsday, Armageddon, The End Of All Things.
Now it came to pass that Microsoft had waxed great and mighty among the Microchip Corporations; mighter than any of the Mainframe Corporations before it had it waxed. And Gates heart was hardened, and he swore unto his Customers and their Engineers the words of this curse:
Children of von Neumann, hear me. IBM and the Mainframe Corporations bound thy forefathers with grave and perilous Licences, such that ye cried unto the spirits of Turing and von Neumann for deliverance. Now I say unto ye: I am greater than any Corporation before me. Will I loosen your Licences? Nay, I will bind thee with Licences twice as grave and ten times more perilous than my forefathers. I will engrave my Licence on thy heart and write my Serial Number upon thy frontal lobes. I will bind thee to the Windows Platform with cunning artifices and with devious schemes. I will bind thee to the Intel Chipset with crufty code and with gnarly APIs. I will capture and enslave thee as no generation has been enslaved before. And wherefore will ye cry then unto the spirits of Turing, and von Neumann, and Moore? They cannot hear ye. I am become a greater Power than they. Ye shall cry only unto me, and shall live by my mercy and my wrath. I am the Gates of Hell; I hold the portal to MSNBC and the keys to the Blue Screen of Death. Be ye afraid; be ye greatly afraid; serve only me, and live.
And the people were cowed in terror and gave homage to Microsoft, and endured the many grave and perilous trials which the Windows platform and its greatly bodacious Licence forced upon them. And once again did they cry to Turing and von Neumann and Moore for a deliverer, but none was found equal to the task until the birth of Linux.
These are the generations of Linux:
SAGE begat ARPA, which begat TCP/IP, and Aloha, which begat Ethernet. Bell begat Multics, which begat C, which begat Unix. Unix and TCP/IP begat Internet, which begat the World Wide Web. Unix begat RMS, father of the great GNU, which begat the Libraries and Emacs, chief of the Utilities. In the days of the Web, Internet and Ethernet begat the Intranet LAN, which rose to renown among all Corporations and prepared the way for the Penguin.
And Linus and the Web begat the Kernel through Unix. The Kernel, the Libraries and the Utilities together are the Distribution, the one Penguin in many forms, forever and ever praised.
Now in those days there was in the land of Helsinki a young scholar named Linus the Torvald. Linus was a devout man, a disciple of RMS and mighty in the spirit of Turing, von Neumann and Moore. One day as he was meditating on the Architecture, Linus fell into a trance and was granted a vision. And in the vision he saw a great Penguin, serene and well-favoured, sitting upon an ice floe eating fish. And at the sight of the Penguin Linus was deeply afraid, and he cried unto the spirits of Turing, von Neumann and Moore for an interpretation of the dream.
And in the dream the spirits of Turing, von Neumann and Moore answered and spoke unto him, saying, Fear not, Linus, most beloved hacker. You are exceedingly cool and froody. The great Penguin which you see is an Operating System which you shall create and deploy unto the earth. The ice-floe is the earth and all the systems thereof, upon which the Penguin shall rest and rejoice at the completion of its task. And the fish on which the Penguin feeds are the crufty Licensed codebases which swim beneath all the earth s systems. The Penguin shall hunt and devour all that is crufty, gnarly and bodacious; all code which wriggles like spaghetti, or is infested with blighting creatures, or is bound by grave and perilous Licences shall it capture. And in capturing shall it replicate, and in replicating shall it document, and in documentation shall it bring freedom, serenity and most cool froodiness to the earth and all who code therein.
Linus rose from meditation and created a tiny Operating System Kernel as the dream had foreshewn him; in the manner of RMS, he released the Kernel unto the World Wide Web for all to take and behold. And in the fulness of Internet Time the Kernel grew and replicated, becoming most cool and exceedingly froody, until at last it was recognised as indeed a great and mighty Penguin, whose name was Tux. And the followers of Linus took refuge in the Kernel, the Libraries and the Utilities; they installed Distribution after Distribution, and made sacrifice unto the GNU and the Penguin, and gave thanks to the spirits of Turing, von Neumann and Moore, for their deliverance from the hand of Microsoft. And this was the beginning of the Fourth Age, the age of Open Source.
Now there is much more to be said about the exceeding strange and wonderful events of those days; how some Suits of Microsoft plotted war upon the Penguin, but were discovered on a Halloween Eve; how Gates fell among lawyers and was betrayed and crucified by his former friends, the apostles of Media; how the mercenary Knights of the Red Hat brought the gospel of the Penguin into the halls of the Corporations; and even of the dispute between the brethren of Gnome and KDE over a trollish Licence. But all these things are recorded elsewhere, in the Books of the Deeds of the Penguin and the Chronicles of the Fourth Age, and I suppose if they were all narrated they would fill a stack of DVDs as deep and perilous as a Usenet Newsgroup.
Now may you code in the power of the Source; may the Kernel, the Libraries and the Utilities be with you, throughout all Distributions, until the end of the Epoch. Amen.

The last month I was supposed to work on a
OpenStack related
project, but for administrative reasons it has been delayed and I've tried to
do small tasks to be able to finish them quickly and start the work on the
main project when the issues get solved.
As the delay has been longer than expected last Wednesday I've realized than
on the last weeks I did a lot of small system administration tasks:
- With a co-worker I started to work on a GNU/Linux version of our firewall
based on Shorewall to handle the rules and
conntrackd and keepalived to make it highly
available (I had to stop my work on the
Debian GNU/kFreeBSD based firewall
a long time ago, and this summer the old firewalls' hardware started to
fail, so a migration from Linux to Linux makes sense now, as it will be
faster and a future migration will be simpler, as we will have a cleaner set
of rules and better documentation),
- I installed and configured an instance of a web based File Exchange server
(F*EX),
- I installed and configured an instance of a pastebin clone,
- I installed and configured an instance of ProFTPD that works only
as a SFTP server using virtual users (without shell access),
- I also installed an instance of a web based event management system called
indico that is being used to manage a conference and probably will
be used for other events in the future,
- I installed and patched some plugins in our Trac servers,
- I tried a groupware system called SOGo that we will probable deploy
in a week or two,
- And updated and fixed configurations of some other services,
With all the changes I did I noticed that I had to do something with our
Intranet server; it is just a reverse proxy for a lot of different web
services and its main page was one static HTML page with links to them,
nothing else.
In the long term maybe we will replace it with something based on
Drupal or
Lifeay, but for now I just wanted something to
be able to organize the links and provide some information about the services
for the new users without having to write HTML (I really like
Agile
Documentation Tools that let me focus on the content and forget about
the markup), and started to look at some of them.
My first idea was to use
ikiwiki, as it has all the features I was
looking for: I can use
Markdown or
reStructuredText to
write the contents, the source pages are easily handled on a
Version Control
System, it supports the use of templates for the HTML, etc., but it
seemed to me that using ikiwiki was like
killing flies with a cannon
(that's a Spanish say, I guess it's easy to understand it in English, no?)
and I decided to review other
tools to build static web sites.
To make a long story short, I selected some tools that met my requirements and
looked nice on their demo sites; after my first review I thought that
Hyde was going to be my bet, as it uses technologies I'm already
familiar with, but after trying it I saw that I was going to have a problem
with documentation (the current Hyde version lacks it) and it was going to
be more complicated that using ikiwiki.
Before giving up I decided to review simpler tools, just in case, and after
looking some of them I ended up using
poole, a simple
python script (the source is just one file and it only requires
python-markdown to work).
Before moving to the content I tried to adapt a couple of free themes to be
used by the tool, but I didn't liked the result, so I went back to the plain
style provided by the tool and added a logo and a background.
With that simple look and feel I started to work with the content, splitting
it into eight markdown files and a python macro to include a file that has all
the links used on the site.
While trying to make the main page look good I noticed how little I know about
CSS, but using search engines I was able to build a two column block into the
main page and publish the contents and with the help of some CSS enabled
co-workers I changed the look and feel of the site in about 30 minutes.
In summary, if you want a really simple website, you know a little bit of
python and don't want to spend much time learning how to use a website
generator then Poole is a good option. If you want something more complex
I still think that ikiwiki is a good option, but YMMV.
Many people in the united states seem to have the opinion, that the
"public is willing to give up most of their privacy" in particular when
dealing with online services such as Facebook. I believe in his
keynote
at ECML-PKDD, Albert-L szl Barab si of Harvard University expessed such
a view, that this data will just become more and more available. I'm not sure
if it was him or someone else (I believe it was someone else) that essentially
claimed "privacy is irrelevant". Another popular opinion is that "it's only
old people caring for privacy".
However, just like politics, these things tend to oscillate from one
extreme to another. For example, the recent years in Europe, conservative
parties were winning one election after another. Now in France, the socialist
parties have just won the senate, the conservative parties in Germany are
losing in one state after the other and so on. And this will change back again,
too. Democracy also lives from changing roles in government, as this drives
both progress and fights corruption.
We might be seeing the one extreme in the united states right now, where
people are readily giving away their location and interests for free access to
a web site. This can swing back any time.
In Germany, one of the government parties - the liberal democrats, FDP -
just dropped out of the Berlin city government, down to 1.8% of voters. Yes,
this is the party the German foreign minister, Guido Westerwelle is from. The
pirate party
[en.wikipedia.org] - much of their program is about privacy, civil rights,
copyright reforms and the internet - which didn't even participate in the
previous elections since they were was founded just 5 years ago jumped to
8.9%, scoring higher than the liberal democrats did in the previous elections.
In 2009 they scored a surprising high 2% in the federal elections - current
polls see them anywhere from 4% to 7% at the federal level, so they
will probably get seats in parliament in 2013. (There are also other reasons
why the liberal democrats have been losing voters so badly, though! Their
current numbers indicate they might drop out of parliament in 2013.)
The Greens in Germany, which are also very much oriented towards privacy
and civil rights, are also on the rise, and in march just became the second
strongest party and senior partner in the governing coalition of
Baden-W rttemberg, which historically was a heartland of the
conservatives.
So don't assume that privacy is irrelevant nowadays. The public opinion
can swing quickly. In particular in democratic systems that have room for
more than two parties - so probably not in the united states - such topics
can actually influence elections a lot. Within 30 years, the Greens now
frequently reach values of 20% in federal polls and up to 30% in some
states. It doesn't look as if they are going to go away soon.
Also don't assume that it's just old people caring about privacy
- in Germany, in particular the pirate party and the Greens are very much
favored by the young people. The typical voter for the pirates is less than
30 years old, male, has a higher education and works in the media or
internet business.
In Germany, much of the protest for more privacy - and against the
too readily data collection by companies such as Facebook and Google - is
driven by the young internet-users and -workers. I believe this will be
similar in other parts of Europe - there are other pirate parties all over
Europe. And this can happen to the united states any time, too.
Electronic freedom - e.g. pushed by the
Electronic Frontier Foundation, but also
the open source movement - does have quite a history in the united states.
But in particular open source has made such a huge progress the last decade,
these movements in the US could just be a bit out of breath right now. I'm
sure they will come back with a strong push against the privacy invasions
we're seeing right now. And that can likely take down a giant like Facebook,
too. So don't bet on people continuing to give up their privacy!
So my first book, Coding Freedom: The Ethics and Aesthetics of Hacking is mostly sort of done. All the arguments are in place and I am doing the final, very annoying, seemingly endless work of adding a few final citations, hunting for permissions, and tweaking about 10 paragraphs that I feel can be slightly improved (down from about 20 last week). The book is based on the dissertation but re-framed significantly with lots of new material and best of all a lot of the cruft has been zapped away, I think.
The book will include two published pieces, although slightly revised. One of them is one of my all time favorite pieces on the
hacker conference (which is the least academic/jargony of the peer reviewed articles). I thought it might be fun to change some of the photos for my book: so if you have some awesome, high quality photos that exude the joy of conferencing from past Debconfs or ANY hacker conference (preferably with computers in the background) please share.
I am open to anything although I am looking for a high quality/sharp photo of people hacking away in the hack lab. The photo I have is
good but I would like one with better lighting/sharper focus.
The book will be published under a CC license (the most restrictive one, but heck as a junior scholar, I took what I could get and it is the first book that Princeton University Press is releasing under such a license). If you hold the copyright, I will need more official permission, otherwise, if it is under a CC or copyleft license, I will be adding the correct attribution/notice in the book.

Using
zsh as default shell is perfect. Using
grml-zsh stuff to configure it, even better. Using
XTaran s config, way better. Using your own config, invaluable. Now, there is one thing that always bothered me: having all hosts I usually deal with in my
~/.ssh/config in order to have tab completion (and short names). I wanted to improve the situation and was kindly pointed in a different direction by
Myon, namely to just use the
~/.ssh/known_hosts for tab completion. How about that?
I started playing around with the config and, as it turns out, Axel already has something ready. Unfortunately, it didn t fulfill all my needs yet. That is because I have multiple
known_hosts files. Martin already filed a
bug to have ssh read
~/.ssh/known_hosts.d/* but that isn t resolved yet either, even though
upstream is aware of it. I thus had to point tab completion and ssh to multiple files by hand. But that s not too bad for now. Let s have a look:
Host *
HashKnownHosts no
Host *.your-work.com
User that-is-what-they-call-me-at-work
UserKnownHostsFile ~/.ssh/known_hosts.work
Host *.debian.org
UserKnownHostsFile ~/.ssh/known_hosts.debian
What am I doing? Well, we need to deactivate the hashing of known hosts. Otherwise your known_hosts files aren t readable as needed. Then you define your
known_hosts files for the domains you care about. Pretty straight forward.
Now, how about tab completion in zsh? Well, easy part actually:
[ -f ~/.ssh/config ] && : $ (A)ssh_config_hosts:=$ $ $ $ (@M)$ (f)"$(<~/.ssh/config)" :#Host * #Host :#*\** :#*\?*
[ -f ~/.ssh/known_hosts ] && : $ (A)ssh_known_hosts:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts)" %%\ * %%,*
[ -f ~/.ssh/known_hosts.work ] && : $ (A)ssh_known_hosts_work:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts.work)" %%\ * %%,*
[ -f ~/.ssh/known_hosts.debian ] && : $ (A)ssh_known_hosts_debian:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts.debian)" %%\ * %%,*
zstyle ':completion:*:hosts' hosts $ssh_config_hosts $ssh_known_hosts $ssh_known_hosts_work $ssh_known_hosts_debian
What's here? We read and parse your
~/.ssh/config for configured hosts, then we parse all your
known_hosts files which are for me:
~/.ssh/known_hosts,
~/.ssh/known_hosts.work, and
~/.ssh/known_hosts.debian. And lastly, all is added to zsh completion for hosts. That actually works. :)
Axel, that makes a diff for you looking like this:
diff --git a/zsh.d/70-completion b/zsh.d/70-completion
index e92e068..5abf5cc 100644
--- a/zsh.d/70-completion
+++ b/zsh.d/70-completion
@@ -8,6 +8,8 @@
[ -f ~/.ssh/config ] && : $ (A)ssh_config_hosts:=$ $ $ $ (@M)$ (f)"$(<~/.ssh/config)" :#Host * #Host :#*\** :#*\?*
[ -f ~/.ssh/known_hosts ] && : $ (A)ssh_known_hosts:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts)" %%\ * %%,*
+[ -f ~/.ssh/known_hosts.work ] && : $ (A)ssh_known_hosts_work:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts.work)" %%\ * %%,*
+[ -f ~/.ssh/known_hosts.debian ] && : $ (A)ssh_known_hosts_debian:=$ $ $ (f)"$(<$HOME/.ssh/known_hosts.debian)" %%\ * %%,*
-zstyle ':completion:*:*:*' hosts $ssh_config_hosts $ssh_known_hosts
+zstyle ':completion:*:hosts' hosts $ssh_config_hosts $ssh_known_hosts $ssh_known_hosts_work $ssh_known_hosts_debian
Care to merge?
Oh, and before I forget... Of course you don't need to check each and every host by yourself. Debian provides ssh keys for all hosts on master. Just do a
scp master.debian.org:/etc/ssh/ssh_known_hosts ~/.ssh/known_hosts.debian
and I'm sure, your security aware employer has such a file for you as well. Doesn't he? ;)

Microsoft have
responded to suggestions that Windows 8 may make it difficult to boot alternative operating systems. What's interesting is that at no point do they contradict anything I've said. As things stand, Windows 8 certified systems will make it either more difficult or impossible to install alternative operating systems. But let's have some more background.
We became aware of this issue in early August. Since then, we at Red Hat have been discussing the problem with other Linux vendors, hardware vendors and BIOS vendors. We've been making sure that we understood the ramifications of the policy in order to avoid saying anything that wasn't backed up by facts. These are the facts:
- Windows 8 certification requires that hardware ship with UEFI secure boot enabled.
- Windows 8 certification does not require that the user be able to disable UEFI secure boot, and we've already been informed by hardware vendors that some hardware will not have this option.
- Windows 8 certification does not require that the system ship with any keys other than Microsoft's.
- A system that ships with UEFI secure boot enabled and only includes Microsoft's signing keys will only securely boot Microsoft operating systems.
Microsoft have a dominant position in the desktop operating system market. Despite Apple's huge comeback over the past decade, their worldwide share of the desktop market is
below 5%. Linux is far below that. Microsoft own well over 90% of the market. Competition in that market is tough, and vendors will take every break they can get. That includes the Windows logo program, in which Microsoft give incentives to vendors to sell hardware that meets their certification requirements. Vendors who choose not to follow the certification requirements will be at a disadvantage in the marketplace. So while it's up to vendors to choose whether or not to follow the certification requirements, Microsoft's dominant position means that they'd be losing sales by doing so.
Why is this a problem? Because there's no central certification authority for UEFI signing keys. Microsoft can require that hardware vendors include their keys. Their competition can't. A system that ships with Microsoft's signing keys and no others will be unable to perform secure boot of any operating system other than Microsoft's. No other vendor has the same position of power over the hardware vendors. Red Hat is unable to ensure that every OEM carries their signing key. Nor is Canonical. Nor is Nvidia, or AMD or any other PC component manufacturer. Microsoft's influence here is greater than even Intel's.
What does this mean for the end user? Microsoft claim that the customer is in control of their PC. That's true, if by "customer" they mean "hardware manufacturer". The end user is not guaranteed the ability to install extra signing keys in order to securely boot the operating system of their choice. The end user is not guaranteed the ability to disable this functionality. The end user is not guaranteed that their system will include the signing keys that would be required for them to swap their graphics card for one from another vendor, or replace their network card and still be able to netboot, or install a newer SATA controller and have it recognise their hard drive in the firmware. The end user is no longer in control of their PC.
If Microsoft were serious about giving the end user control, they'd be mandating that systems ship without any keys installed. The user would then have the ability to make an informed and conscious decision to limit the flexibility of their system and install the keys. The user would be told what they'd be gaining and what they'd be giving up.
The final irony? If the user has no control over the installed keys, the user has no way to indicate that they don't trust Microsoft products. They can prevent their system booting malware. They can prevent their system booting Red Hat, Ubuntu, FreeBSD, OS X or any other operating system. But they can't prevent their system from running Windows 8.
Microsoft's rebuttal is entirely factually accurate. But it's also misleading. The truth is that Microsoft's move removes control from the end user and places it in the hands of Microsoft and the hardware vendors. The truth is that it makes it more difficult to run anything other than Windows. The truth is that UEFI secure boot is a valuable and worthwhile feature that Microsoft are misusing to gain tighter control over the market. And the truth is that Microsoft haven't even attempted to argue otherwise.

comments

vi users have their
. (dot) redo command for repeating
the last command. The article
Repeating Commands in Emacs in Mickey Petersen s
blog Mastering Emacs explained
Emacs equivalent for that, namely the command
repeat, by
default bound to
C-x z.
I though seldomly use it as I mostly have to repeat a chain of
commands. What I use are so called
Keyboard
Macros.
For example for the
CVE-2011-3192 vulnerability in Apache I added a line like
Include /etc/apache2/sites-common/CVE-2011-3192.conf to
all VirtualHosts.
So I started Emacs with all the relevant files:
grep
CVE-2011-3192 -l /etc/apache2/sites-available/*[^~] xargs emacs
&
To remove those Include lines again
M-x flush-lines is
probably the easiest way in Emacs. So for every file I had to call
flush-lines with always the same parameter, save the buffer and then
close the file or in Emacsish kill the buffer.
So while working on the first file I recorded my doing as a keyboard
macro:
C-x (
- Start recording
M-x flush-lines<Enter>CVE-2011-3192<Enter>
- flush all lines which contain the string CVE-2011-3192
C-x C-s
- save the current buffer
C-x C-k<Enter>
- kill the current buffer, i.e. close the file
C-x )
- Stop recording
Then I just had to call the saved macro with
C-x e. It
flushed all lines, saved the changes and switched to the next
remaining file by closing the current file with three key-strokes. And
to make it even easier, from the second occasion on I only had to
press
e to call the macro directly again. So I just
pressed
e for a bunch of time and had all files edited.
(In this case I used
git diff afterwards to check that I
didn t wreck anything by half-automating my editing. :-)
Of course there are other ways to do this, too, e.g. use
sed or so, but I still think it s a neat example for
showing the power of keyboard macros in Emacs. More things you can do
with Emacs Keyboard Macros are described in the EmacsWiki entry
Keyboard Macros.
And if you still miss vi s
. command in Emacs, you can
use the
dot-mode, an Emacs mode currently maintained by Robert Wyrick
which more or less automatically defines keyboard macros and lets you
call them with
C-..
As the administrator for several
MTAs I've received my fair share of
support requests for "unreadable" e-mails. They generally have an
attachment called
winmail.dat. This is what all (for exceptions see the
rest of this blog post) non-Outlook
MUAs can display, when they receive an e-mail
with the
application/ms-tnef (or
application/vnd.ms-tnef)
MIME type.
TNEF is a
propietary format cooked up in Redmond. When chosen, the e-mail in question
isn't sent as
text/plain or at least
text/html, but the entire
e-mail is put into an TNEF-encoded attachment, most often called
winmail.dat, in which you (most commonly) find the content of the
e-mail in
RTF, possible attachments
are also put into the
winmail.dat.
The easieast solution for all involved parties is to convince the sender,
that her Outlook and/or Exchange setup needs fixing (disabling TNEF in
Outlook and
Exchange 2003).
Sadly this won't work all the time. The other solutions are to either filter the
e-mails on your e-mail server and run them through something like
ytnef_smtpd.py (please note, that this
might be legally problematic for you as a service provider, opening an e-mail,
even automatically, is a violation of communication privacy rights in many
jurisdictions). Or, if the legal problem is too big or can't be solved through an
local server installation (e.g. because there is no server running 24/7), you're
left with either using Outlook (probably what Microsoft intended) or you can use
a plug-in/add-on for your client. I've tested the
LookOut add-on for
icedove and it seems to work well.
There are of course plug-ins for many other clients, but I can't honestly tell
whether they work or not.
[UPDATE 2011-09-20]: Fellow Debian Developer
Josselin
Mouette wrote me, that
Evolution is capable of reading
TNEF-encoded e-mails out of the box, but he also said that
[TNEF e-mails
should] be banned by all means
.[/UPDATE 2011-09-20]
Now, before I close, please always try to convince the sender/postmaster to
fix their setup. It has only advantages:
text/plain e-mails are
smaller, they're less likely to contain malicious code (i.e. no parts hidden
away from the virus scanner on the mail server (amavis can read TNEF e-mails,
if
libconvert-tnef-perl
is installed)) and all recipients can open the e-mails with the client of their
choice.

There are certian things haskell is very good at, and I had the pleasure
of using it for one such thing yesterday. I wanted to support
expressions like
find(1) does, in
git-annex.
Something like:
git-annex drop --not --exclude '*.mp3' --and \
-\( --in usbdrive --or --in archive -\) --and \
--not --copies 3
So, parens and booleans and some kind of domain-specific operations.
It's easy to build a data structure in haskell that can contain this
sort of expression.
- A Token can either be a single word, or an Operation of an arbitrary type. -
data Token op = Token String Operation op
deriving (Show, Eq)
data Matcher op = Any
And (Matcher op) (Matcher op)
Or (Matcher op) (Matcher op)
Not (Matcher op)
Op op
deriving (Show, Eq)
(The
op could just be a
String, but is parameterized for reasons we'll
see later.)
As command-line options, the expression is already tokenised, so all I needed
to do to parse it is consume a list of the Tokens. The only mildly tricky
thing is handling the parens right -- I chose to not make it worry if there
were too many, or too few closing parens.
generate :: [Token op] -> Matcher op
generate ts = generate' Any ts
generate' :: Matcher op -> [Token op] -> Matcher op
generate' m [] = m
generate' m ts = uncurry generate' $ consume m ts
consume :: Matcher op -> [Token op] -> (Matcher op, [Token op])
consume m [] = (m, [])
consume m ((Operation o):ts) = (m And Op o, ts)
consume m ((Token t):ts)
t == "and" = cont $ m And next
t == "or" = cont $ m Or next
t == "not" = cont $ m And (Not next)
t == "(" = let (n, r) = consume next rest in (m And n, r)
t == ")" = (m, ts)
otherwise = error $ "unknown token " ++ t
where
(next, rest) = consume Any ts
cont v = (v, rest)
Once a Matcher is built, it can be used to check if things
match the expression the user supplied. This next bit of code almost writes
itself.
- Checks if a Matcher matches, using a supplied function to check
- the value of Operations. -
match :: (op -> v -> Bool) -> Matcher op -> v -> Bool
match a m v = go m
where
go Any = True
go (And m1 m2) = go m1 && go m2
go (Or m1 m2) = go m1 go m2
go (Not m1) = not (go m1)
go (Op o) = a o v
And that's it! This is all nearly completly generic and could be used
for a great many things that need support for this sort of expression,
as long as they can be checked in pure code.
A trivial example:
*Utility.Matcher> let m = generate [Operation True, Token "and", Token "(", Operation False, Token "or", Token, "not", Operation False, Token ")"]
*Utility.Matcher> match (const . id) m undefined
True
For my case though, I needed to run some IO actions to check if expressions
about files were true. This is where I was very pleased to see a monadic
version of
match could easily be built.
- Runs a monadic Matcher, where Operations are actions in the monad. -
matchM :: Monad m => Matcher (v -> m Bool) -> v -> m Bool
matchM m v = go m
where
go Any = return True
go (And m1 m2) = liftM2 (&&) (go m1) (go m2)
go (Or m1 m2) = liftM2 ( ) (go m1) (go m2)
go (Not m1) = liftM not (go m1)
go (Op o) = o v
With this and about 100 lines of code to implement specific tests like
--copies and --in, git-annex now supports the example at the top.
Just for comparison,
find(1) has thousands of lines of C code to
build a similar parse tree from the command line parameters and run it.
Although I was surprised to see that it optimises expressions by eg,
reordering cheaper tests first.
The last time I wrote this kind of thing was in perl, and there the
natural way was to carefully translate
the expression into perl code, which was then evaled. Meaning the code
was susceptible to security holes.
Anyway, this is nothing that has not been done a hundred times in haskell
before, but it's very nice that it makes it so clean, easy, and generic.
A while ago I've been interviewed for a forthcoming article in
the
LinuxUser magazine on
the topic of why there are so many
Debian
derivatives and on the potential impact, on them, of
the (potential) advent of the so called "
Debian Rolling"
experiment.
Below you can find my take on those topics. Questions are by
Ferdinand Thommes, who has been involved in various Debian
derivatives, including the forthcoming
Siduction.
1.) Why do you think people base distributions on Debian?
Looking at how many there is, since Corel and Libranet set sail in
1999, there must be a reason why, for one, people fork Debian in
the first place, and secondly, why they choose Debian to do so and
not some other distribution.
There are always advantages in creating a so called "derivative"
distribution with respect to creating one from scratch. The main
one is the possibility of reusing the packaging work which is
already done in the "upstream" distro, focusing derivatives'
efforts on customization, usually with clear target public in mind.
Debian pushes most of those advantages (for derivatives) at their
extremes.
-
The Debian archive is huge (about 30'000 packages with Squeeze),
meaning that the amount of packaging work that can be reused is
similarly huge.
-
Debian has a long history and a well established community,
which reduces the risk of "betting" the efforts of derivatives on a
distro that might disappear anytime soon.
-
Debian is well known for its obsession with package quality,
meaning that the risk of trusting pre-existing packages is greatly
reduced, and that package behavior is on average very dependable as
well as documented in standard documents such as the Debian
Policy
-
Debian is also well known for its obsession with licensing, at
the point of being considered by many one of the authoritative
sources for deciding what constitutes Free Software and what does
not. For derivatives that implies that they do not need to
worry---as long as they trust Debian, of course---neither about
legal redistribution risks nor about software freedom claims on
their distro.
But there are also a couple of "political" reasons for basing
derivatives on Debian. One is quite subtle and applies mostly to
commercial distributions. If you are designing one such commercial
distro, you have to be based on an independent distro with no
commercial interests, lest risking that petty (technical or
otherwise) choices might be made just to undermine your business.
Among "popular" GNU/Linux distros, Debian is essentially the only
one which is both volunteer-based and not ascribable to any
specific company.
The last reason why I think many derivatives are based on Debian
is our vocation to universality. Since we are not targeting any
specific public, but rather trying to provide an operating system
suitable for several different use cases (e.g. the tasks supported
by the Debian installer or the choice of Debian Pure Blends), we
offer an ideal starting point for those who are going to have
customization as their main business.
2.) What could be the benefits for Debian and for its
Derivates, if the discussions about a second Debian Release based
on the Testing branch really come to be reality?
We are considering the possibility of adding a new Debian suite
which is "rolling" like Testing, in the sense that new software
releases flow in regularly rather than only at periodic bumps
corresponding to major distribution releases. There seem to be user
demand for that and I personally believe that such a scheme could
address the needs of both advanced desktop users and of developers,
which are now strand to mix and match Debian suites ending up using
package combinations which benefit, as a whole, of very little
quality check. The main issues to face to get there is how to make
sure that adding such a suite would not get in the way of preparing
high quality Stable releases, in terms of quality control,
developer focus, etc.
Note that such a hypothetical "rolling" suite needs does not
necessarily need to be based on Debian Testing, although that is a
good starting point. The reason why it's not a good
endpoint is that Testing has been created (circa 2000),
and is still used, as an internal tool to prepare the forthcoming
Debian Stable release. As such, it is not entirely suitable for
final user consumption. For instance, during the Debian "freeze"
period the flow of new software releases that reach Testing is
greatly reduced up to stopping completely just before the release
of a new Debian Stable. I've been told that users of testing-based
(derivative) rolling releases regularly complain about this aspect
during Debian freezes, which is not surprising.
The main advantage for derivatives which are already offering a
Debian-based "rolling" release will then be the possibility of
basing their work on a suite less bound to the life cycle of Debian
Stable than Testing is at present. On the converse side, that would
also mean that derivatives will need to differentiate more from
Debian than by just saying they are "rolling", which is a good
thing: differences among distros are healthy and drive innovation.
With those derivatives, on the other hand, which will recognize
their goals as being aligned with Debian's goals---Debian Stable
today, maybe Debian "rolling" tomorrow---we will be happy to join
efforts.