For a while now, I have wanted to test
the Signal app, as it is
said to provide end to end encrypted communication and several of my
friends and family are already using it. As I by choice do not own a
mobile phone, this proved to be harder than expected. And I wanted to
have the source of the client and know that it was the code used on my
machine. But yesterday I managed to get it working. I used the
Github source, compared it to the source in
the
Signal Chrome app available from the Chrome web store, applied
patches to use the production Signal servers, started the app and
asked for the hidden "register without a smart phone" form. Here is
the recipe how I did it.
First, I fetched the Signal desktop source from Github, using
The first part is changing the servers, and the second is updating
an expiration timestamp. This timestamp need to be updated regularly.
It is set 90 days in the future by the build process (Gruntfile.js).
The value is seconds since 1970 times 1000, as far as I can tell.
Based on a tip and good help from the #nuug IRC channel, I wrote a
script to launch Signal in Chromium.
The script start the app and configure Chromium to use the Tor
SOCKS5 proxy to make sure those controlling the Signal servers (today
Amazon and Whisper Systems) as well as those listening on the lines
will have a harder time location my laptop based on the Signal
connections if they use source IP address.
When the script starts, one need to follow the instructions under
"Standalone Registration" in the CONTRIBUTING.md file in the git
repository. I right clicked on the Signal window to get up the
Chromium debugging tool, visited the 'Console' tab and wrote
'extension.install("standalone")' on the console prompt to get the
registration form. Then I entered by land line phone number and
pressed 'Call'. 5 seconds later the phone rang and a robot voice
repeated the verification code three times. After entering the number
into the verification code field in the form, I could start using
Signal from my laptop.
As far as I can tell, The Signal app will leak who is talking to
whom and thus who know who to those controlling the central server,
but such leakage is hard to avoid with a centrally controlled server
setup. It is something to keep in mind when using Signal - the
content of your chats are harder to intercept, but the meta data
exposing your contact network is available to people you do not know.
So better than many options, but not great. And sadly the usage is
connected to my land line, thus allowing those controlling the server
to associate it to my home and person. I would prefer it if only
those I knew could tell who I was on Signal. There are options
avoiding such information leakage, but most of my friends are not
using them, so I am stuck with Signal for now.
Support appending arbitrary text in the Compose textarea to the subject via a context menu. (#4)
Avoid brittle parsing of the page and use the Javascript API instead. (diff)
Updated my Strava Enhancement Suite, a Chrome extension that improves and fixes annoyances in the web interface of the Strava cycling and running tracker:
Merge support from Jeff Schuler to support "Flyby" activity defaults. (#50)
Correctly fallback to the default value after introducing a new value. (diff)
Started work on packaging lute-tab, but upstream was unwilling to relicense to a DFSG-friendly license so the enterprise was aborted.
Updated the SSL certificate for try.diffoscope.org, a hosted version of the diffoscope in-depth and content-aware diff utility. Thanks to Bytemark for sponsoring the hardware.
Started on the slides for the Reproducible Builds talk at DebConf16.
DebConf16 will be held this and next week in Cape Town, South Africa, and we're happy to announce that the schedule is already available. Of course, it is still possible for some minor changes to happen!
The DebCamp Sprints already started on 23 June 2016.
DebConf will open on Saturday, 2 July 2016 with the Open Festival, where events of interest to a wider audience are offered, ranging from topics specific to Debian to a wider appreciation of the open and maker movements (and not just IT-related). Hackers, makers, hobbyists and other interested parties are invited to share their activities with DebConf attendees and the public at the University of Cape Town, whether in form of workshops, lightning talks, install parties, art exhibition or posters. Additionally, a Job Fair will take place on Saturday, and its job wall will be available throughout DebConf.
The full schedule of the Debian Conference thorough the week is published. After the Open Festival, the conference will continue with more than 85 talks and BoFs (informal gatherings and discussions within Debian teams), including not only software development and packaging but also areas like translation, documentation, artwork, testing, specialized derivatives, maintenance of the community infrastructure, and other.
There will also be also a plethora of social events, such as our traditional cheese and wine party, our group photo and our day trip.
DebConf talks will be broadcast live on the Internet when possible, and videos of the talks will be published on the web along with the presentation slides.
DebConf is committed to a safe and welcome environment for all participants. See the DebConf Code of Conduct and the Debian Code of Conduct for more details on this.
Debian thanks the commitment of numerous sponsors to support DebConf16, particularly our Platinum Sponsor Hewlett Packard Enterprise.
About Hewlett Packard Enterprise
Hewlett Packard Enterprise actively participates in open source.
Thousands of developers across the company are focused on open source projects, and HPE sponsors and supports the open source community in a number of ways, including: contributing code, sponsoring foundations and projects, providing active leadership, and participating in various committees.
As some of the world knows full well by now, I've been noodling with Go
for a few years, working through its pros, its cons, and thinking a lot
about how humans use code to express thoughts and ideas. Go's got a lot of
neat use cases, suited to particular problems, and used in the right place,
you can see some clear massive wins.
I've started writing Debian tooling in Go, because it's a pretty natural fit.
Go's fairly tight, and overhead shouldn't be taken up by your operating system.
After a while, I wound up hitting the usual blockers, and started to build up
abstractions. They became pretty darn useful, so, this blog post is announcing
(a still incomplete, year old and perhaps API changing) Debian package for Go.
The Go importable name is pault.ag/go/debian. This contains a lot of utilities
for dealing with Debian packages, and will become an edited down "toolbelt"
for working with or on Debian packages.
Module Overview
Currently, the package contains 4 major sub packages. They're a changelog
parser, a control file parser, deb file format parser, dependency parser
and a version parser. Together, these are a set of powerful building blocks
which can be used together to create higher order systems with reliable
understandings of the world.
changelog
The first (and perhaps most incomplete and least tested) is a changelog file
parser.. This provides the
programmer with the ability to pull out the suite being targeted in the
changelog, when each upload was, and the version for each. For example, let's
look at how we can pull when all the uploads of Docker to sid took place:
funcmain()resp,err:=http.Get("http://metadata.ftp-master.debian.org/changelogs/main/d/docker.io/unstable_changelog")iferr!=nilpanic(err)allEntries,err:=changelog.Parse(resp.Body)iferr!=nilpanic(err)for_,entry:=rangeallEntriesfmt.Printf("Version %s was uploaded on %s\n",entry.Version,entry.When)
The output of which looks like:
Version 1.8.3~ds1-2 was uploaded on 2015-11-04 00:09:02 -0800 -0800
Version 1.8.3~ds1-1 was uploaded on 2015-10-29 19:40:51 -0700 -0700
Version 1.8.2~ds1-2 was uploaded on 2015-10-29 07:23:10 -0700 -0700
Version 1.8.2~ds1-1 was uploaded on 2015-10-28 14:21:00 -0700 -0700
Version 1.7.1~dfsg1-1 was uploaded on 2015-08-26 10:13:48 -0700 -0700
Version 1.6.2~dfsg1-2 was uploaded on 2015-07-01 07:45:19 -0600 -0600
Version 1.6.2~dfsg1-1 was uploaded on 2015-05-21 00:47:43 -0600 -0600
Version 1.6.1+dfsg1-2 was uploaded on 2015-05-10 13:02:54 -0400 EDT
Version 1.6.1+dfsg1-1 was uploaded on 2015-05-08 17:57:10 -0600 -0600
Version 1.6.0+dfsg1-1 was uploaded on 2015-05-05 15:10:49 -0600 -0600
Version 1.6.0+dfsg1-1~exp1 was uploaded on 2015-04-16 18:00:21 -0600 -0600
Version 1.6.0~rc7~dfsg1-1~exp1 was uploaded on 2015-04-15 19:35:46 -0600 -0600
Version 1.6.0~rc4~dfsg1-1 was uploaded on 2015-04-06 17:11:33 -0600 -0600
Version 1.5.0~dfsg1-1 was uploaded on 2015-03-10 22:58:49 -0600 -0600
Version 1.3.3~dfsg1-2 was uploaded on 2015-01-03 00:11:47 -0700 -0700
Version 1.3.3~dfsg1-1 was uploaded on 2014-12-18 21:54:12 -0700 -0700
Version 1.3.2~dfsg1-1 was uploaded on 2014-11-24 19:14:28 -0500 EST
Version 1.3.1~dfsg1-2 was uploaded on 2014-11-07 13:11:34 -0700 -0700
Version 1.3.1~dfsg1-1 was uploaded on 2014-11-03 08:26:29 -0700 -0700
Version 1.3.0~dfsg1-1 was uploaded on 2014-10-17 00:56:07 -0600 -0600
Version 1.2.0~dfsg1-2 was uploaded on 2014-10-09 00:08:11 +0000 +0000
Version 1.2.0~dfsg1-1 was uploaded on 2014-09-13 11:43:17 -0600 -0600
Version 1.0.0~dfsg1-1 was uploaded on 2014-06-13 21:04:53 -0400 EDT
Version 0.11.1~dfsg1-1 was uploaded on 2014-05-09 17:30:45 -0400 EDT
Version 0.9.1~dfsg1-2 was uploaded on 2014-04-08 23:19:08 -0400 EDT
Version 0.9.1~dfsg1-1 was uploaded on 2014-04-03 21:38:30 -0400 EDT
Version 0.9.0+dfsg1-1 was uploaded on 2014-03-11 22:24:31 -0400 EDT
Version 0.8.1+dfsg1-1 was uploaded on 2014-02-25 20:56:31 -0500 EST
Version 0.8.0+dfsg1-2 was uploaded on 2014-02-15 17:51:58 -0500 EST
Version 0.8.0+dfsg1-1 was uploaded on 2014-02-10 20:41:10 -0500 EST
Version 0.7.6+dfsg1-1 was uploaded on 2014-01-22 22:50:47 -0500 EST
Version 0.7.1+dfsg1-1 was uploaded on 2014-01-15 20:22:34 -0500 EST
Version 0.6.7+dfsg1-3 was uploaded on 2014-01-09 20:10:20 -0500 EST
Version 0.6.7+dfsg1-2 was uploaded on 2014-01-08 19:14:02 -0500 EST
Version 0.6.7+dfsg1-1 was uploaded on 2014-01-07 21:06:10 -0500 EST
control
Next is one of the most complex, and one of the oldest parts of go-debian,
which is the control file parser
(otherwise sometimes known as deb822). This module was inspired by the way
that the json module works in Go, allowing for files to be defined in code
with a struct. This tends to be a bit more declarative, but also winds up
putting logic into struct tags, which can be a nasty anti-pattern if used too
much.
The first primitive in this module is the concept of a Paragraph, a struct
containing two values, the order of keys seen, and a map of string to string.
All higher order functions dealing with control files will go through this
type, which is a helpful interchange format to be aware of. All parsing of
meaning from the Control file happens when the Paragraph is unpacked into
a struct using reflection.
The idea behind this strategy that you define your struct, and let the Control
parser handle unpacking the data from the IO into your container, letting you
maintain type safety, since you never have to read and cast, the conversion
will handle this, and return an Unmarshaling error in the event of failure.
Additionally, Structs that define an anonymous member of control.Paragraph
will have the raw Paragraph struct of the underlying file, allowing the
programmer to handle dynamic tags (such as X-Foo), or at least, letting
them survive the round-trip through go.
The default decoder
contains an argument, the ability to verify the input control file using an
OpenPGP keyring, which is exposed to the programmer through the
(*Decoder).Signer() function. If the passed argument is nil, it will not
check the input file signature (at all!), and if it has been passed, any
signed data must be found or an error will fall out of the NewDecoder call.
On the way out, the opposite happens, where the struct is introspected,
turned into a control.Paragraph, and then written out to the io.Writer.
Here's a quick (and VERY dirty) example showing the basics of reading and
writing Debian Control files with go-debian.
packagemainimport("fmt""io""net/http""strings""pault.ag/go/debian/control")typeAllowedPackagestructPackagestringFingerprintstringfunc(a*AllowedPackage)UnmarshalControl(instring)errorin=strings.TrimSpace(in)chunks:=strings.SplitN(in," ",2)iflen(chunks)!=2returnfmt.Errorf("Syntax sucks: '%s'",in)a.Package=chunks[0]a.Fingerprint=chunks[1][1:len(chunks[1])-1]returnniltypeDMUAstructFingerprintstringUidstringAllowedPackages[]AllowedPackage control:"Allow" delim:"," funcmain()resp,err:=http.Get("http://metadata.ftp-master.debian.org/dm.txt")iferr!=nilpanic(err)decoder,err:=control.NewDecoder(resp.Body,nil)iferr!=nilpanic(err)fordmua:=DMUAiferr:=decoder.Decode(&dmua);err!=niliferr==io.EOFbreakpanic(err)fmt.Printf("The DM %s is allowed to upload:\n",dmua.Uid)for_,allowedPackage:=rangedmua.AllowedPackagesfmt.Printf(" %s [granted by %s]\n",allowedPackage.Package,allowedPackage.Fingerprint)
Output (truncated!) looks a bit like:
...
The DM Allison Randal <allison@lohutok.net> is allowed to upload:
parrot [granted by A4F455C3414B10563FCC9244AFA51BD6CDE573CB]
...
The DM Benjamin Barenblat <bbaren@mit.edu> is allowed to upload:
boogie [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B]
dafny [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B]
transmission-remote-gtk [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B]
urweb [granted by 3224C4469D7DF8F3D6F41A02BBC756DDBE595F6B]
...
The DM <aelmahmoudy@sabily.org> is allowed to upload:
covered [granted by 41352A3B4726ACC590940097F0A98A4C4CD6E3D2]
dico [granted by 6ADD5093AC6D1072C9129000B1CCD97290267086]
drawtiming [granted by 41352A3B4726ACC590940097F0A98A4C4CD6E3D2]
fonts-hosny-amiri [granted by BD838A2BAAF9E3408BD9646833BE1A0A8C2ED8FF]
...
...
deb
Next up, we've got the deb module. This contains code to handle reading
Debian 2.0 .deb files. It contains a wrapper that will parse the control
member, and provide the data member through the
archive/tar interface.
Here's an example of how to read a .deb file, access some metadata, and
iterate over the tar archive, and print the filenames of each of the
entries.
dependency
The dependency package provides an interface to parse and compute
dependencies. This package is a bit odd in that, well, there's no other
library that does this. The issue is that there are actually two different
parsers that compute our Dependency lines, one in Perl (as part of dpkg-dev)
and another in C (in dpkg).
To date, this has resulted in me filing
threedifferentbugs.
I also found a broken package in the
archive,
which actually resulted in another bug being (totally accidentally)
already fixed.
I hope to continue to run the archive through my parser in hopes of finding
more bugs! This package is a bit complex, but it basically just returns what
amounts to be an AST
for our Dependency lines. I'm positive there are bugs, so file them!
funcmain()dep,err:=dependency.Parse("foo bar, baz, foobar [amd64] bazfoo [!sparc], fnord:armhf [gnu-linux-sparc]")iferr!=nilpanic(err)anySparc,err:=dependency.ParseArch("sparc")iferr!=nilpanic(err)for_,possi:=rangedep.GetPossibilities(*anySparc)fmt.Printf("%s (%s)\n",possi.Name,possi.Arch)
Gives the output:
foo (<nil>)
baz (<nil>)
fnord (armhf)
version
Right off the bat, I'd like to thank
Michael Stapelberg for letting me graft this
out of dcs and into the go-debian package.
This was nearly entirely his work (with a one or two line function I added
later), and was amazingly helpful to have. Thank you!
This module implements Debian version comparisons and parsing, allowing for
sorting in lists, checking to see if it's native or not, and letting the
programmer to implement smart(er!) logic based on upstream (or Debian)
version numbers.
This module is extremely easy to use and very straightforward, and not worth
writing an example for.
Final thoughts
This is more of a "Yeah, OK, this has been useful enough to me at this point
that I'm going to support this" rather than a "It's stable!" or even
"It's alive!" post. Hopefully folks can report bugs and help iterate on
this module until we have some really clean building blocks to build
solid higher level systems on top of. Being able to have multiple libraries
interoperate by relying on go-debian will be a massive ease.
I'm in need of more documentation, and to finalize some parts of the older
sub package APIs, but I'm hoping to be at a "1.0" real soon now.
Moxie, the lead developer of the Signal secure communication application, recently blogged on the tradeoffs between providing a supportable federated service and providing a compelling application that gains significant adoption. There's a set of perfectly reasonable arguments around that that I don't want to rehash - regardless of feelings on the benefits of federation in general, there's certainly an increase in engineering cost in providing a stable intra-server protocol that still allows for addition of new features, and the person leading a project gets to make the decision about whether that's a valid tradeoff.
One voiced complaint about Signal on Android is the fact that it depends on the Google Play Services. These are a collection of proprietary functions for integrating with Google-provided services, and Signal depends on them to provide a good out of band notification protocol to allow Signal to be notified when new messages arrive, even if the phone is otherwise in a power saving state. At the time this decision was made, there were no terribly good alternatives for Android. Even now, nobody's really demonstrated a free implementation that supports several million clients and has no negative impact on battery life, so if your aim is to write a secure messaging client that will be adopted by as many people is possible, keeping this dependency is entirely rational.
On the other hand, there are users for whom the decision not to install a Google root of trust on their phone is also entirely rational. I have no especially good reason to believe that Google will ever want to do something inappropriate with my phone or data, but it's certainly possible that they'll be compelled to do so against their will. The set of people who will ever actually face this problem is probably small, but it's probably also the set of people who benefit most from Signal in the first place.
(Even ignoring the dependency on Play Services, people may not find the official client sufficient - it's very difficult to write a single piece of software that satisfies all users, whether that be down to accessibility requirements, OS support or whatever. Slack may be great, but there's still people who choose to use Hipchat)
This shouldn't be a problem. Signal is free software and anybody is free to modify it in any way they want to fit their needs, and as long as they don't break the protocol code in the process it'll carry on working with the existing Signal servers and allow communication with people who run the official client. Unfortunately, Moxie has indicated that he is not happy with forked versions of Signal using the official servers. Since Signal doesn't support federation, that means that users of forked versions will be unable to communicate with users of the official client.
This is awkward. Signal is deservedly popular. It provides strong security without being significantly more complicated than a traditional SMS client. In my social circle there's massively more users of Signal than any other security app. If I transition to a fork of Signal, I'm no longer able to securely communicate with them unless they also install the fork. If the aim is to make secure communication ubiquitous, that's kind of a problem.
Right now the choices I have for communicating with people I know are either convenient and secure but require non-free code (Signal), convenient and free but insecure (SMS) or secure and free but horribly inconvenient (gpg). Is there really no way for us to work as a community to develop something that's all three?
Since mid-2015 we were using the dep11-generator in Debian to build AppStream metadata about available software components in the distribution.
Getting rid of dep11-generator
Unfortunately, the old Python-based dep11-generator was hitting some hard limits pretty soon. For example, using multiprocessing with Python was a pain, since it resulted in some very hard-to-track bugs. Also, the multiprocessing approach (as opposed to multithreading) made it impossible to use the underlying LMDB database properly (it was basically closed and reopened in each forked off process, since pickling the Python LMDB object caused some really funny bugs, which usually manifested themselves in the application hanging forever without any information on what was going on). Additionally to that, the Python-based generator forced me to maintain two implementations of the AppStream YAML spec, one in C and one in Python, which consumes quite some time. There were also some other issues (e.g. no unit-tests) in the implementation, which made me think about rewriting the generator.
Adventures in Go / Rust / D
Since I didn t want to write this new piece of software in C (or basically, writing it in C was my last option ), I explored Go and Rust for this purpose and also did a small prototype in the D programming language, when I was starting to feel really adventurous. And while I never intended to write the new generator in D (I was pretty fixated on Go ), this is what happened. The strong points for D for this particular project were its close relation to C (and ease of using existing C code), its super-flat learning curve for someone who knows and likes C and C++ and its pretty powerful implementations of the concurrent and parallel programming paradigms. That being said, not all is great in D and there are some pretty dark spots too, mainly when it comes to the standard library and compilers. I will dive into my experiences with D in a separate blogpost.
What good to expect from appstream-generator?
So, what can the new appstream-generator do for you? Basically, the same as the old dep11-generator: It will extract metadata from a distribution s package archive, download and resize screenshots, search for icons and size them properly and generate reports in JSON and HTML of found metadata and issues.
LibAppStream-based parsing, generation of YAML or XML, multi-distro support,
As opposed to the old generator, the new generator utilizes the metadata parsers and writers of libappstream. This allows it to return the extracted metadata as AppStream YAML (for Debian) or XML (everyone else) It is also written in a distribution-agnostic way, so if someone wants to use it in a different distribution than Debian, this is possible now. It just requires a very small distribution-specific backend to be written, all of the details of the metadata extraction are abstracted away (just two interfaces need to be implemented). While I do not expect anyone except Debian to use this in the near future (most distros have found a solution to generate metadata already), the frontend-backend split is a much cleaner design than what was available in the previous code. It also allows to unit-test the code properly, without providing a Debian archive in the testsuite.
Feature Flags, Optipng,
The new generator also allows to enable and disable certain sets of features in a standardized way. E.g. Ubuntu uses a language-pack system for translations, which Debian doesn t use. Features like this can be implemented as disableable separate modules in the generator. We use this at time to e.g. allow descriptions from packages to be used as AppStream descriptions, or for running optipng on the generated PNG images and icons.
No more Contents file dependency
Another issue the old generator had was that it used the Contents file from the Debian archive to find matching icons for an application. We could never be sure whether the contents in the Contents file actually matched the contents of the package we were currently dealing with. What made things worse is that at Ubuntu, the archive software is only updating the Contents file weekly daily (while the generator might run multiple times a day), which has lead to software being ignored in the metadata, because icons could not yet be found. Even on Debian, with its quickly-updated Contents file, we could immediately see the effects of an out-of-date Contents file when updating it failed once. In the new generator, we read the contents of each package ourselves now and store them in a LMDB database, bypassing the Contents file and removing the whole class of problems resulting from missing or wrong contents-data.
It can t all be good, right?
That is true, there are also some known issues the new generator has:
Large amounts of RAM required
The better speed of the new generator comes at the cost of holding more stuff in RAM. Much more. When processing data from 5 architectures initially on Debian, the amount of required RAM might lie above 4GB, with the OOM killer sometimes being quicker than the garbage collector That being said, on subsequent runs the amount of required memory is much lower. Still, this is something I am working on to improve.
What are symbolic links?
To be faster, the appstream-generator will read the md5sum file in .deb packages instead of extracting the payload archive and reading its contents. Since the md5sums file does not list symbolic links, symlinks basically don t exist for the new generator. This is a problem for software symlinking icons or even .desktop files around, like e.g. LibreOffice does.
I am still investigating how widespread the use of symlinks for icons and .desktop files is, but it looks like fixing packages (making them not-symlink stuff and rather move the files) might be the better approach than investing additional computing power to find symlinks or even switch back to parsing the Contents file. Input on this is welcome!
Deploying asgen
I finished the last pieces of the appstream-generator (together with doing lots of other cool things and talking to great people) at the GNOME Software Hackfest in London last week (detailed blogposts about things that happened there will follow many thanks once again for the Ubuntu community for sponsoring my attendance!).
Since today, the new generator is running on the Debian infrastructure. If bigger issues are found, we can still roll back to the old code. I decided to deploy this faster, so we can get some good testing done before the Stretch release. Please report any issues you may find!
Dad-o, I m so glad you re a pilot!
My 9-year-old son Jacob has been saying that, always with a big hug and his fond nickname for me ( dad-o ). It has now been a year since the first time I sat in the pilot s seat of a plane, taking my first step towards exploring the world from the sky. And now, one year after I first sat in the pilot s seat of an airborne plane, it s prompted me to think back to my own memories.
Flying over the airport at Moundridge, KS
Memories
Back when I was a child, maybe about the age my children are now, I d be outside in the evening and see this orange plane flying overhead. Our neighbor Don had a small ultralight plane and a grass landing strip next to his house. I remember longing to be up in the sky with Don, exploring the world from up there. At that age, I didn t know all the details of why that wouldn t work I just knew I wanted to ride in it.
It wasn t until I was about 11 that I flew for the first time. I still remember that TWA flight with my grandma, taking off early in the morning and flying just a little ways above the puffy clouds lit up all yellow and orange by the sunrise. Even 25 years later, that memory still holds as one of the most beautiful scenes I have ever seen.
Exploring
I have always been an explorer.
When I go past something interesting, I love to go see what it looks like inside. I enjoy driving around Kansas with Laura, finding hidden waterfalls, old county courthouses, ghost towns, beautiful old churches, even small-town restaurants. I explore things around me, too once taking apart a lawnmower engine as a child, nowadays building HF antennas in my treetops or writing code for Linux. If there is little to learn about something, it becomes less interesting to me.
I see this starting to build in my children, too. Since before they could walk, if we were waiting for something in a large building, we d go exploring.
A patch of rain over Hillsboro, KS
The New World
A pilot once told me, Nobody can become a pilot without it changing the way they see the world and then, changing their life.
I doubted that. But it was true. One of the most poetic sights I know is flying a couple thousand feet above an interstate highway at night, following it to my destination. All those red and white lights, those metal capsules of thousands of lives and thousands of stories, stretching out as far as the eye can see in either direction.
Kansas sunset from the plane
When you re in a plane, that small town nowhere near a freeway that always seemed so far away suddenly is only a 15-minute flight away, not even enough time to climb up to a high cruise altitude. Two minutes after takeoff, any number of cities that are an hour s drive away are visible simultaneously, their unique features already recognizable: a grain elevator, oil refinery, college campus, lake, whatever.
And all the houses you fly over each with people in them. Some pretty similar to you, some apparently not. But pretty soon you realize that we all are humans, and we aren t all that different. You can t tell a liberal from a conservative from the sky, nor a person s race or religion, nor even see the border between states. Towns and cities are often nameless from the sky, unless you re really low; only your navigation will tell you where you are.
I ve had the privilege to fly to small out-of-the-way airports, the kind that have a car that pilots can use for free to go into town and get lunch, and leave the key out for them. There I ve met many friendly people. I ve also landed my little Cessna at a big commercial airport where I probably used only 1/10th of the runway, on a grass runway that was barely maintained at all. I ve flown to towns I d driven to or through many times, discovering the friendly folks at the small airport out of town. I ve flown to parts of Kansas I ve never been to before, discovered charming old downtowns and rolling hills, little bursts of rain and beautiful sunsets that seem to turn into a sea.
Parked at the Smith Center, KS airport terminal, about to meet some wonderful people
For a guy that loves exploring the nooks and crannies of the world that everyone else drives by on their way to a major destination, being a pilot has meant many soul-filling moments.
Hard Work
I knew becoming a pilot would be a lot of hard work, and thankfully I remembered stories like that when I finally concluded it would be worth it. I found that I had an aptitude for a lot of things that many find difficult about being a pilot: my experience with amateur radio made me a natural at talking to ATC, my fascination with maps and navigation meant I already knew how to read aviation sectional maps before I even started my training and knew how to process that information in the cockpit, my years as a system administrator and programmer trained me with a careful and methodical decision-making process. And, much to the surprise of my flight instructor, I couldn t wait to begin the part of training about navigating using VORs (VHF radio beacons). I guess he, like many student pilots, had struggled with that, but I was fascinated by this pre-GPS technology (which I still routinely use in my flight planning, as a backup in case the GPS constellation or a GPS receiver fails). So that left the reflexes of flight, the art of it, as the parts I had to work on the hardest.
The exam with the FAA is not like getting your driver s license. It s a multi-stage and difficult process. So when the FAA Designated Pilot Examiner said congratulations, pilot! and later told my flight instructor that you did a really good job with this one, I felt a true sense of accomplishment.
Some of my prep materials
Worth It
Passengers in a small plane can usually hear all the radio conversations going on. My family has heard me talking to air traffic control, to small and big planes. My 6-year-old son Oliver was playing yesterday, and I saw him pick up a plane and say this:
Two-four-niner-golf requesting to land on runway one-seven . Two-four-niner-golf back-taxi on one-seven Two-four-niner-golf ready to takeoff on runway one-seven!
That was a surprisingly accurate representation of some communication a pilot might have (right down to the made-up tailnumber with the spelling alphabet!)
It just got more involved from there!
Jacob and Oliver love model train shows. I couldn t take them to one near us, but there was one in Joplin, MO. So the day before Easter, while Laura was working on her Easter sermon, two excited boys and I (frankly also excited) climbed into a plane and flew to Joplin.
We had a great time at the train show, discovered a restaurant specializing in various kinds of hot dogs (of course they both wanted to eat there), played in a park, explored the city, and they enjoyed the free cookies at the general aviation terminal building while I traded tips on fun places to fly with other pilots.
When it comes right down to it, the smiles of the people I fly with are the most beautiful thing in the air.
There's a piece of software called XScreenSaver. It attempts to fill two somewhat disparate roles:
Provide a functioning screen lock on systems using the X11 windowing system, a job made incredibly difficult due to a variety of design misfeatures in said windowing system[1]
Provide cute graphical output while the screen is locked
XScreenSaver does an excellent job of the second of these[2] and is pretty good at the first, which is to say that it only suffers from a disastrous security flaw once very few years and as such is certainly not appreciably worse than any other piece of software.
Debian ships an operating system that prides itself on stability. The Debian definition of stability is a very specific one - rather than referring to how often the software crashes or misbehaves, it refers to how often the software changes behaviour. Debian is very reluctant to upgrade software that is part of a stable release, to the extent that developers will attempt to backport individual security fixes to the version they shipped rather than upgrading to a release that contains all those security fixes but also adds a new feature. The argument here is that the new release may also introduce new bugs, and Debian's users desire stability (in the "things don't change" sense) more than new features. Backporting security fixes keeps them safe without compromising the reason they're running Debian in the first place.
This all makes plenty of sense at a theoretical level, but reality is sometimes less convenient. The first problem is that security bugs are typically also, well, bugs. They may make your software crash or misbehave in annoying but apparently harmless ways. And when you fix that bug you've also fixed a security bug, but the ability to determine whether a bug is a security bug or not is one that involves deep magic and a fanatical devotion to the cause so given the choice between maybe asking for a CVE and dealing with embargoes and all that crap when perhaps you've actually only fixed a bug that makes the letter "E" appear in places it shouldn't and not one that allows the complete destruction of your intergalactic invasion fleet means people will tend to err on the side of "Eh fuckit" and go drinking instead. So new versions of software will often fix security vulnerabilities without there being any indication that they do so[3], and running old versions probably means you have a bunch of security issues that nobody will ever do anything about.
But that's broadly a technical problem and one we can apply various metrics to, and if somebody wanted to spend enough time performing careful analysis of software we could have actual numbers to figure out whether the better security approach is to upgrade or to backport fixes. Conversations become boring once we introduce too many numbers, so let's ignore that problem and go onto the second, which is far more handwavy and social and so significantly more interesting.
The second problem is that upstream developers remain associated with the software shipped by Debian. Even though Debian includes a tool for reporting bugs against packages included in Debian, some users will ignore that and go straight to the upstream developers. Those upstream developers then have to spend at least 15 or so seconds telling the user that the bug they're seeing has been fixed for some time, and then figure out how to explain that no sorry they can't make Debian include a fixed version because that's not how things work. Worst case, the stable release of Debian ends up including a bug that makes software just basically not work at all and everybody who uses it assumes that the upstream author is brutally incompetent, and they end up quitting the software industry and I don't know running a nightclub or something.
From the Debian side of things, the straightforward solution is to make it more obvious that users should file bugs with Debian and not bother the upstream authors. This doesn't solve the problem of damaged reputation, and nor does it entirely solve the problem of users contacting upstream developers. If a bug is filed with Debian and doesn't get fixed in a timely manner, it's hardly surprising that users will end up going upstream. The Debian bugs list for XScreenSaver does not make terribly attractive reading.
So, coming back to the title for this entry. The most obvious failure of the commons is where a basically malicious actor consumes while giving nothing back, but if an actor with good intentions ends up consuming more than they contribute that may still be a problem. An upstream author releases a piece of software under a free license. Debian distributes this to users. Debian's policies result in the upstream author having to do more work. What does the upstream author get out of this exchange? In an ideal world, plenty. The author's software is made available to more people. A larger set of developers is willing to work on making improvements to the software. In a less ideal world, rather less. The author has to deal with bug mail about already fixed bugs. The author's reputation may be harmed by user exposure to said fixed bugs. The author may get less in the way of useful bug fixes or features because people are running old versions rather than fixing new ones. If the balance tips towards the latter, the author's decision to release their software under a free license has made their life more difficult.
Most discussions about Debian's policies entirely ignore the latter scenario, focusing more on the fact that the author chose to release their software under a free license to begin with. If the author is unwilling to handle the consequences of that, goes the argument, why did they do it in the first place? The unfortunate logical conclusion to that argument is that the author realises that they made a huge mistake and never does so again, and woo uh oops.
The irony here is that one of Debian's foundational documents, the Debian Free Software Guidelines, makes allowances for this. Section 4 allows for distribution of software in Debian even if the author insists that modified versions[4] are renamed. This allows for an author to make a choice - allow themselves to be associated with the Debian version of their work and increase (a) their userbase and (b) their support load, or try to distinguish what Debian ship from their identity. But that document was ratified in 1997 and people haven't really spent much time since then thinking about why it says what it does, and so this tradeoff is rarely considered.
Free software doesn't benefit from distributions antagonising their upstreams, even if said upstream is a cranky nightclub owner. Debian's users are Debian's highest priority, but those users are going to suffer if developers decide that not using free licenses improves their quality of life. Kneejerk reactions around specific instances aren't helpful, but now is probably a good time to start thinking about what value Debian bring to its upstream authors and how that can be increased. Failing to do so doesn't serve users, Debian itself or the free software community as a whole.
[1] The X server has no fundamental concept of a screen lock. This is implemented by an application asking that the X server send all keyboard and mouse input to it rather than to any other application, and then that application creating a window that fills the screen. Due to some hilarious design decisions, opening a pop-up menu in an application prevents any other application from being able to grab input and so it is impossible for the screensaver to activate if you open a menu and then walk away from your computer. This is merely the most obvious problem - there are others that are more subtle and more infuriating. The only fix in this case is to nuke the site from orbit.
[2] There's screenshots here. My favourites are the one that emulate the electrical characteristics of an old CRT in order to present a more realistic depiction of the output of an Apple 2 and the one that includes a complete 6502 emulator.
[3] And obviously new versions of software will often also introduce new security vulnerabilities without there being any indication that they do so, because who would ever put that in their changelog. But the less ethically challenged members of the security community are more likely to be looking at new versions of software than ones released three years ago, so you're probably still tending towards winning overall
[4] There's a perfectly reasonable argument that all packages distributed by Debian are modified in some way
Two years ago, I had
a
look at trusted timestamping options available, and among
other things noted a still open
bug in the tsget script
included in openssl that made it harder than necessary to use openssl
as a trusted timestamping client. A few days ago I was told
the Norwegian government office DIFI is
close to releasing their own trusted timestamp service, and in the
process I was happy to learn about a replacement for the tsget script
using only curl:
This produces a binary timestamp file (etc-shells.tsr) which can be
used to verify that the content of the file /etc/shell with the
calculated sha256 hash existed at the point in time when the request
was made. The last command extract the content of the etc-shells.tsr
in human readable form. The idea behind such timestamp is to be able
to prove using cryptography that the content of a file have not
changed since the file was stamped.
To verify that the file on disk match the public key signature in
the timestamp file, run the following commands. It make sure you have
the required certificate for the trusted timestamp service available
and use it to compare the file content with the timestamp. In
production, one should of course use a better method to verify the
service certificate.
Wikipedia have a lot more information about
trusted
Timestamping and
linked
timestamping, and there are several trusted timestamping services
around, both as commercial services and as free and public services.
Among the latter is
the
zeitstempel.dfn.de service mentioned above and
freetsa.org service linked to from the
wikipedia web site. I believe the DIFI service should show up on
https://tsa.difi.no, but it is not available to the public at the
moment. I hope this will change when it is into production. The
RFC 3161 trusted
timestamping protocol standard is even implemented in LibreOffice,
Microsoft Office and Adobe Acrobat, making it possible to verify when
a document was created.
I would find it useful to be able to use such trusted timestamp
service to make it possible to verify that my stored syslog files have
not been tampered with. This is not a new idea. I found one example
implemented on the Endian network appliances where
the
configuration of such feature was described in 2012.
But I could not find any free implementation of such feature when I
searched, so I decided to try to
build
a prototype named syslog-trusted-timestamp. My idea is to
generate a timestamp of the old log files after they are rotated, and
store the timestamp in the new log file just after rotation. This
will form a chain that would make it possible to see if any old log
files are tampered with. But syslog is bad at handling kilobytes of
binary data, so I decided to base64 encode the timestamp and add an ID
and line sequence numbers to the base64 data to make it possible to
reassemble the timestamp file again. To use it, simply run it like
this:
This will send a timestamp from one or more timestamp services (not
yet decided nor implemented) for each listed file to the syslog using
logger(1). To verify the timestamp, the same program is used with the
--verify option:
The verification step is not yet well designed. The current
implementation depend on the file path being unique and unchanging,
and this is not a solid assumption. It also uses process number as
timestamp ID, and this is bound to create ID collisions. I hope to
have time to come up with a better way to handle timestamp IDs and
verification later.
Please check out
the
prototype for syslog-trusted-timestamp on github and send
suggestions and improvement, or let me know if there already exist a
similar system for timestamping logs already to allow me to join
forces with others with the same interest.
As usual, if you use Bitcoin and want to show your support of my
activities, please send Bitcoin donations to my address
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.
Propellor was recently ported to FreeBSD, by Evan Cofsky. This new feature
led me down a two week long rabbit hole to make it type safe. In particular,
Propellor needed to be taught that some properties work on Debian, others on
FreeBSD, and others on both.
The user shouldn't need to worry about making a mistake like this;
the type checker should tell them they're asking for something that can't
fly.
-- Is this a Debian or a FreeBSD host? I can't remember, let's use both package managers!
host "example.com"$ props
& aptUpgraded
& pkgUpgraded
As of propellor 3.0.0 (in git now;
to be released soon), the type checker will catch such mistakes.
Also, it's really easy to combine two OS-specific properties into a
property that supports both OS's:
upgraded = aptUpgraded pickOS pkgUpgraded
type level lists and functions
The magick making this work is type-level lists. A property has a
metatypes list as part of its type. (So called because it's additional
types describing the type, and I couldn't find a better name.) This list
can contain one or more OS's targeted by the property:
In Haskell type-level lists and other DataKinds are indicated by the
' if you have not seen that before. There are some convenience
aliases and type operators, which let the same types be expressed
more cleanly:
Whenever two properties are combined, their metatypes are combined
using a type-level function. Combining aptUpgraded and pkgUpgraded
will yield a metatypes that targets no OS's, since they have none in
common. So will fail to type check.
My implementation of the metatypes lists is hundreds of lines of
code, consisting entirely of types and type families. It includes a basic
implementation of singletons, and is portable back to ghc 7.6 to support
Debian stable. While it takes some contortions to support such an old
version of ghc, it's pretty awesome that the ghc in Debian stable supports
this stuff.
extending beyond targeted OS's
Before this change, Propellor's Property type had already been slightly
refined, tagging them with HasInfo or NoInfo, as described
in making propellor safer with GADTs and type families. I needed to
keep that HasInfo in the type of properties.
But, it seemed unnecessary verbose to have types like Property NoInfo Debian.
Especially if I want to add even more information to Property
types later. Property NoInfo Debian NoPortsOpen would be a real mouthful to
need to write for every property.
Luckily I now have this handy type-level list. So, I can shove more
types into it, so Property (HasInfo + Debian) is used where necessary,
and Property Debian can be used everywhere else.
Since I can add more types to the type-level list, without affecting
other properties, I expect to be able to implement type-level port
conflict detection next. Should be fairly easy to do without changing
the API except for properties that use ports.
singletons
As shown here, pickOS makes a property that
decides which of two properties to use based on the host's OS.
Any number of OS's can be chained this way, to build a property that
is super-portable out of simple little non-portable properties.
This is a sweet combinator!
Singletons are types that are inhabited by a single value.
This lets the value be inferred from the type, which came in handy
in building the pickOS property combinator.
Its implementation needs to be able to look at each of the properties at
runtime, to compare the OS's they target with the actial OS of the host.
That's done by stashing a target list value inside a property. The target
list value is inferred from the type of the property, thanks to singletons,
and so does not need to be passed in to property. That saves
keyboard time and avoids mistakes.
is it worth it?
It's important to consider whether more complicated types are a net
benefit. Of course, opinions vary widely on that question in general!
But let's consider it in light of my main goals for Propellor:
Help save the user from pushing a broken configuration to their machines
at a time when they're down in the trenches dealing with some urgent
problem at 3 am.
Advance the state of the art in configuration management by
taking advantage of the state of the art in strongly typed haskell.
This change definitely meets both criteria. But there is a tradeoff;
it got a little bit harder to write new propellor properties. Not only do
new properties need to have their type set to target appropriate systems,
but the more polymorphic code is, the more likely the type checker can't
figure out all the types without some help.
A simple example of this problem is as follows.
foo :: Property UnixLike
foo = p requires bar
where
p = property "foo"$do...
The type checker will complain that "The type variable metatypes1 is
ambiguous". Problem is that it can't infer the type of p because many
different types could be combined with the bar property and all would
yield a Property UnixLike. The solution is simply to add a type signature
like p :: Property UnixLike
Since this only affects creating new properties, and not combining existing
properties (which have known types), it seems like a reasonable tradeoff.
things to improve later
There are a few warts that I'm willing to live with for now...
Currently, Property (HasInfo + Debian) is different than Property (Debian +
HasInfo), but they should really be considered to be the same type. That is, I
need type-level sets, not lists. While there's a type level sets library for
hackage, it still seems to
require a specific order of the set items when writing down a type signature.
Also, using ensureProperty, which runs one property inside the action
of another property, got complicated by the need to pass it a type witness.
That witness is used to type check that the inner property targets
every OS that the outer property targets. I think it might be possible
to store the witness in the monad, and have ensureProperty read it, but
it might complicate the type of the monad too much, since it would
have to be parameterized on the type of the witness.
Oh no, I mentioned monads. While type level lists and type functions and
generally bending the type checker to my will is all well and good,
I know most readers stop reading at "monad". So, I'll stop writing. ;)
thanks
Thanks to David Miani who answered my first tentative question with
a big hunk of example code that got me on the right track.
Also to many other people who answered increasingly esoteric Haskell type
system questions.
Also thanks to the Shuttleworth foundation, which funded this work
by way of a Flash Grant.
The requirement
I have been following the development of fascinating tools from the
Development seed people, now seemingly all focused on the
Mapbox brand. They created what seemed to me a revolutionary
desktop tool called Tilemill. Tilemill allowed you to create
custom map stylesheets on your desktop to outline specific areas or
patterns or "things". My interest was to create outdoor maps - OSM has
pretty good biking maps, but no generic outdoor tiles out there (I
need stuff for skiing, canoeing, biking)...
Mapbox has Mapbox outdoors but that's a paid plan
as well. Oh and there's a place to
download Garmin data files especially made for outdoors as well,
and that could be loaded in Qmapshack, but they don't have
coverage in Canada at all. Besides, I would like to print maps, I
know, crazy...
So I have been looking forward to seeing Tilemill packaged in Debian
given how annoying it is to maintain Node apps
(period). Unfortunately, by the time Debian people figured out all the
Node dependencies, the Tilemill project stopped and has been stalled
since 2012. It seems the Mapbox people have now been working on other
products, and in the meantime, the community, scratching their heads,
just switched to other projects.
Overview of alternatives
I wrote this long post to the Debian bugtrackers to try to
untangle all of this, but figured this would be interesting to a wider
community than the narrow group of people working on Javascript
packages, so I figured I would send this on Debian planet.
So Here's a summary of what happened so far, after Tilemill
development stopped. Hang on to your tiles boys and girls, there's a
lot going on!
Mapbox Studio classic
Mapbox people have released a new product in September 2014 named
Mapbox studio classic. The code is still freely available and
seems to be a fork of tilemill. Mapbox classic still has releases
on github, last one is from November 2015. It looks like Mapbox studio
classic has some sort of Mapbox.com lock-in, and there are
certainly new copyright issues, if only with the bundled fonts,
but it could probably be packaged after addressing those issues.
There is an ITP for Mapbox Studio classic as well.
Mapbox Studio
Then there's Mapbox Studio, which is a
full rewrite of Mapbox Studio classic. You need to "signup"
somehow to get access, even though parts of the code are free, namely
the Mapbox GL studio project. It is an interesting project because
it aims to make all this stuff happen in a web browser, which means it
"should" work everywhere. Unfortunately for us, it means it doesn't
work anywhere without a signup form, so that's out for me at least.
There is an [ITP for Mapbox-studio][] yet it is unclear to me what
that one means because the source code to Mapbox-studio doesn't seem
to be available, as far as i can tell (and the ITP doesn't say
either).
That is actually the ITP for Mapbox studio classic.
Kosmtik
The Openstreetmap-carto developers have mostly switched to
kosmtik instead of Mapbox. Kosmtik is another Node desktop app
that seems fairly lightweight and mostly based on plugins. Ross has an
ITP for kosmtik. The package is waiting on other node dependencies
to be uploaded (yes, again).
The future of Tilemill
And there's still this RFP for tilemill, which should probably be
closed now because the project seems dead and plenty of alternatives
exist. I wonder if node some dependencies that were packaged for
Tilemill actually now need to be removed from Debian, because they
have become useless leaf packages... I am leaving the Tilemill RFP
open for someone to clean that up.
CartoCSS
Oh, and finally one could mention another Mapbox project, Carto, a
command line CSS tools that implements some sort of standard CSS
language that all those tools end up using to talk to Mapnik, more or
less. There are no RFPs for that.
As a follow up to calendar synchronisation with calypso,
syncevolution and the N900 running maemo I finally added contacts to
the mix:
on the phone
When you have the calendar sync already running it's as simple as:
First start ssh on the n900 to ease typing:
From there on you can sync contacts and calendars in one go with:
syncevoluton webdav
Looking at the calypso logs on the server it seems that syncevoluton
does not always generate an FN entry and so the card gets
skipped. This doesn't harm the overall sync, but I need to have a look
how to fix this.
on the laptop
In order to use the contacts im mutt there's pycarddav
packaged in Debian. This is basically following upstreams documentation.
To use the entries in mutt add the just extend your .muttrc:
cat <<EOF >>~/.muttrc
set query_command="pc_query -m %s"
macro index,pager B "<pipe-message>pycard-import<enter>" "add sender address to pycardsyncer"
EOF
This allows you to query contacts using Q and add new conatcs with
CTRL-B in mutt's index and pager.
Calypso Changes
We recently moved calypso's git repository to alioth and started
to merge several out of tree patches. More will happen during this
years Debian Groupware Meeting including a new upload to Debian.
As most distributions have switched to systemd as default "init", some
people have asked why we actually keep sysvinit around, as it's old and
crusty, and systemd can do so much more.
My answer is: systemd and sysvinit solve entirely different problems, and
neither can ever replace the other fully.
The big argument in favour of systemd is integration: when you keep
everything in one process, it is easy to make sure that components talk to
each other. That is nice, but kind of misses the point: integration could
be done via IPC as well, and systemd uses a lot of it to separate
privileges anyway.
The tighter integration comes from something else: the configuration
format. Where sysvinit uses a lot of shell scripts ("imperative" format),
systemd uses explicit keywords ("descriptive" format), and this is the
important design decision here: descriptive formats cannot do anything
unanticipated, neither good nor bad.
This is important for UI programmers: if there is a button that says "if I
close the lid switch, suspend the laptop", then this needs to be connected
to functionality that behaves this way, and this connection needs to work
in both directions, so the user will find the active setting there when
opening the dialog. So, we need to limit ourselves to a closed set of
choices, so the UI people can prepare translations.
This is the design tradeoff systemd makes: better integration in exchange
for less flexibility.
Of course, it is simple to allow "custom" actions everywhere, but that
starts to break the "well-integrated" behaviour. There is an old blog
post
from Joey Hess about how to implement a simple alarm clock, using systemd,
and this shows both how powerful and how limited the system is.
On one hand, the single line WakeSystem=true takes care of the entire
dependency chain attached to making sure the system is actually on -- when
the system is going to suspend mode, some program needs to determine that
there are scheduled jobs that should wake up the system, determined which
of these is the next one, program the wakeup time into the hardware and
only then allow the suspend to continue.
On the other hand, the descriptive framework already breaks down in this
simple example, because the default behaviour of the system is to go to
sleep if the lid switch is closed, and the easiest way to fix this is to
tell systemd to ignore the lid switch while the program is running. The IPC
permissions disallow scheduled user jobs from setting this, so a "custom"
action is taken that sets up the "ignore the lid switch" policy, changes to
an unprivileged user, and runs the actual job.
So, it is possible to get back flexibility, but this is traded for
integration: while the job is running, any functionality that the "suspend
laptop when the lid is closed" button had, is broken.
For something simple as a switch on a personal laptop that breaks if the
user configures something that is non-standard, that is acceptable.
However, the keywords in the service unit files, the timer files, etc.
are also part of a descriptive framework, and the services using them
expect that the things they promise are kept by the framework, so there is
a limit to how many exceptions you can grant.
SystemV init really comes from the other direction here. Nothing is
promised to init scripts but a vague notion that they will be run with
sufficient privileges. There is no dependency tracking that ensures that
certain services will always start before others, just priorities. You can
add a dependency system like insserv if you like and make sure that all
the requirements for it to work (i.e. services declaring their
dependencies) are given, and there is a safe fallback of not parallelizing
so we can always play it safe.
Because there is so little promised to scripts, writing them becomes a bit
tedious -- all of them have a large case statement where they parse the
command line, all of them need to reimplement dropping privileges and
finding the PID of a running process. There are lots of helpers for the
more common things, like the LSB standard functions for colorful and
matching console output, and Debian's start-stop-daemon for privilege and
PID file handling, but in the end it remains each script's responsibility.
Systemd will never be able to provide the same flexibility to admins while
at the same time keeping the promises made in the descriptive language, and
sysvinit will never reach the same amount of easy integration. I think it
is fairly safe to predict both of these things, and I'd even go a step
further: if any one of them tried, I'd ask the project managers what they
were thinking.
The only way to keep systems as complex as these running is to limit the
scope of the project.
With systemd, the complexity is kept in the internals, and it is important
for manageability that all possible interactions are well-defined. That is
a huge issue when writing adventure games, where you need to define
interaction rules for each player action in combination with each object,
and each pair of objects that can be combined with the "Use" action. Where
adventure games would default to "This doesn't seem to work." or "I cannot
use this.", this would not be a helpful error message when we're trying to
boot, so we really need to cut down on actions and object types here.
Sysvinit, on the other hand, is both more extreme in limiting the scope to
very few actions (restart, wait, once) and only one object type
(process that can be started and may occasionally terminate) in the main
program, and a lot more open in what scripts outside the main program are
allowed to do. The prime example for this is that the majority of
configuration takes place outside the inittab even -- a script is
responsible for the interface that services are registered by dropping init
scripts into specific directories, and scripts can also create additional
interfaces, but none of this is intrinsic to the init system itself.
Which system is the right choice for your system is just that: your choice.
You would choose a starting point, and customize what is necessary for your
computer to do what you want it to do.
Here's the thing: most users will be entirely happy with fully uncustomized
systemd. It will suspend your laptop if you close the lid, and even give
your download manager veto power. I fully support Debian's decision to use
systemd as the default init for new installs, because it makes sense to use
the default that is good for the vast majority of users.
However, my opening statement still stands: systemd can never support all
use cases, because it is constrained by its design. Trying to change that
would turn it into an unmaintainable mess, and the authors are right in
rejecting this. There are use cases that define the project, and use cases
that are out of scope.
This is what we need sysvinit for: the bits that the systemd project
managers rightfully reject, but that are someone's use case. Telling these
users to get lost would be extremely bad style for the "universal operating
system."
For example, if someone needs a service that asks a database server for a
list of virtual machines to start, runs each in its private network
namespace that is named after replacing part of the virtual machine name
with the last two octets of the host machine's IP address, then binds a
virtual Ethernet device into the network namespace and sets up a NAT rule
that allows devices to talk to the public Internet and a firewall rule to
stop VMs from talking to each other.
Such a beast would live outside of systemd's world view. You can easily
start it, but systemd would not know how to monitor it (as long as there is
some process still running, is that a good sign), not know how to shut down
one instance, not know how to map processes to instances and so on. SystemV
init has the advantage here that none of these things are defined by the
system, and as long as my init script has some code to handle "status", I
can easily check up on my processes with the same interface I'd use for
everything else.
This requires me to have more knowledge of how the init system works, that
is true, however I'd also venture that the learning curve for sysvinit is
shallower. If you know shell scripting, you can understand what init
scripts do, without memorizing special rules that govern how certain
keywords interact, and keeping track of changes to these rules as the
feature set is expanded.
That said, I'm looking at becoming the new maintainer of the sysvinit
package so we can continue to ship it and give our users a choice, but I'd
definitely need help, as I only have a few systems left that won't run
properly with systemd because of its nasty habit to keep lots of code in
memory where sysvinit would unload it after use (by letting the shell
process end), and these don't make good test systems.
The overall plan is to set up a CI system that
tests sysvinit -> systemd transition
tests systemd -> sysvinit transition
tests debootstrap with systemd
tests debootstrap with sysvinit
tests whether service start works for a list of services, so we can
catch regressions
scans packages that have systemd unit files for init scripts, and vice
versa
Ideally, I'd like to reach a state where we can actually ensure that the
default configuration is somewhat similar regardless of which init system
we use, and that it is possible to install with either (this is a nasty
regression in jessie: bootstrapping a foreign-architecture system broke).
This will take time, and step one is probably looking at bugs first -- I'm
grateful for any help I can get here, primarily I'd like to hear about
regressions via bug reports.
tl;dr: as a distribution, we need both systemd and sysvinit. If you
suggest that systemd can replace sysvinit, I will probably understand that
you think that the systemd maintainers don't know project management. I'm
reluctantly looking at becoming the official maintainer because I think it
is important to keep around.
I know, all the Scala fanboys are going to hate me now. But:
Stop overusing lambda expressions.
Most of the time when you are using lambdas, you are not even doing
functional programming, because you often are violating one key rule of
functional
programming: no side effects.
For example:
collection.forEach(System.out::println);
is of course very cute to use, and is (wow) 10 characters shorter than:
for (Object o : collection) System.out.println(o);
but this is not functional programming because it has side effects.
What you are doing are anonymous methods/objects, using a
shorthand notion. It's sometimes convenient, it is usually short, and
unfortunately often unreadable, once you start cramming complex problems into
this framework.
It does not offer efficiency improvements, unless you have the
propery of side-effect freeness (and a language compiler that can exploit
this, or parallelism that can then call the function concurrently in arbitrary
order and still yield the same result).
Here is an examples of how to not use lambdas: DZone Java 8
Factorial (with boilerplate such as the Pair class omitted):
Stream<Pair> allFactorials = Stream.iterate(
new Pair(BigInteger.ONE, BigInteger.ONE),
x -> new Pair(
x.num.add(BigInteger.ONE),
x.value.multiply(x.num.add(BigInteger.ONE))));
return allFactorials.filter(
(x) -> x.num.equals(num)).findAny().get().value;
When you are fresh out of the functional programming class, this may seem
like a good idea to you... (and in contrast to the examples mentioned above,
this is really a functional program).
But such code is a pain to read, and will not scale well either.
Rewriting this to classic Java yields:
BigInteger cur = BigInteger.ONE, acc = BigInteger.ONE;
while(cur.compareTo(num) <= 0)
cur = cur.add(BigInteger.ONE); // Unfortunately, BigInteger is immutable!
acc = acc.multiply(cur);
return acc;
Sorry, but the traditional loop is much more readable. It will still
not perform very well (because of BigInteger not being designed for efficiency
- it does not even make sense to allow BigInteger for num - the
factorial of 2**63-1, the maximum of a Java long, needs
1020 bytes to store, i.e. about 500 exabyte.
For some, I did some benchmarking. One hundred random values
num (of course the same for all methods) from the range 1 to 1000.
I also included this even more traditional version:
BigInteger acc = BigInteger.ONE;
for(long i = 2; i <=x; i++)
acc = acc.multiply(BigInteger.valueOf(i));
return acc;
Here are the results (Microbenchmark, using JMH, 10 warum iterations,
20 measurement iterations of 1 second each):
As you can see, this "functional" approach above is about 50% slower than the
classic for-loop. This will be mostly due to the Pair and additional
BigInteger objects created and garbage collected.
Apart from being substantially faster, the iterative approach is also
much simpler to follow. (To some extend it is faster because it is also
easier for the compiler!)
There was a recent blog post by Robert Br utigam that
discussed exception throwing in Java
lambdas and the pitfalls associated with this. The discussed approach
involves abusing generics for throwing unknown checked exceptions in the
lambdas, ouch.
Don't get me wrong. There are cases where the use of lambdas is
perfectly reasonable. There are also cases where it adheres to the
"functional programming" principle. For example, a
stream.filter(x -> x.name.equals("John Doe")) can be a readable
shorthand when selecting or preprocessing data. If it is really functional
(side-effect free), then it can safely be run in parallel and give you some
speedup.
Also, Java lambdas were carefully designed, and the hotspot VM tries hard
to optimize them. That is why Java lambdas are not closures - that would be
much less performant. Also, the stack traces of Java lambdas remain
somewhat readable (although still much worse than those of traditional code).
This blog post by Takipi showcases how bad the stacktraces become (in the
Java example, the stream function is more to blame than the
actual lambda - nevertheless, the actual lambda application shows up as
the cryptic LmbdaMain$$Lambda$1/821270929.apply(Unknown Source)
without line number information). Java 8 added new bytecodes to be able to
optimize Lambdas better - earlier JVM-based languages may not yet make good
use of this.
But you really should use lambdas only for one-liners. If it is a more
complex method, you should give it a name to encourage reuse and
improve debugging.
Beware of the cost of .boxed() streams!
And do not overuse lambdas. Most often, non-Lambda code is
just as compact, and much more readable. Similar to foreach-loops, you do
lose some flexibility compared to the "raw" APIs such as Iterators:
for(Iterator<Something>> it = collection.iterator(); it.hasNext(); )
Something s = it.next();
if (someTest(s)) continue; // Skip
if (otherTest(s)) it.remove(); // Remove
if (thirdTest(s)) process(s); // Call-out to a complex function
if (fourthTest(s)) break; // Stop early
In many cases, this code is preferrable to the lambda hacks we see pop up
everywhere these days. Above code is efficient, and readable.
If you can solve it with a for loop, use a for loop!
Code quality is not measured by how much functionality you can do
without typing a semicolon or a newline!
On the contrary: the key ingredient to writing high-performance code
is the memory layout (usually) - something you need to do low-level.
Instead of going crazy about Lambdas, I'm more looking forward to real
value types
(similar to a struct in C, reference-free objects) maybe in Java 9
(Project Valhalla),
as they will allow reducing the memory impact for many scenarios considerably.
I'd prefer a mutable design, however - I understand why this is proposed,
but the uses cases I have in mind become much less elegant when having to
overwrite instead of modify all the time.
In trying to improve the WiFi service in my house, I recently dug out my old Linksys WRT54G Router. It is a 802.11 bg router, which can do 54 MBPS. Currently, I use a TPLink based router, with a DD-WRT community firmware, which claims is 802.11 bgn and can do 300 MBPS. The overall wifi signal isn't adequate, so I thought of using the old router as a repeater.
The default Linksys VXWorks firmware does not have the bridging capabilities, so it was time to flashback, again, the dd-wrt image onto it (The last time I did, I eventually had to revert back to the stock firmware because my ISP claimed that the router was giving too many packet drops). Being an old device, and me being lazy, I did not pay much attention to the exact steps; and ended up bricking my router, wherein it wouldn't give me the Management Console to flash a new firmware; nor would it give me the old VXWorks firmware interface. All it gave was a White Screen of Death and an active IP connection.
Turns out I'm not the only one bricking routers, so some good soul documented the process on unbricking the router. I was in a slightly more better position than the author, cause I did have the network available. My initial hope was to just push the firmware image over tftp, and that it would work. But that didn't happen.
So, I was forced to follow the steps in the article, i.e. to use the Windows Tool mentioned in it (Infact that is what triggered me to write the article). Not having Windows available, my choice was to try it out over Crossover/Wine. It got the job done; so Thank You.
BTW, does anyone know what goodie does the Windows Tool do that plain tftp did not ? The Windows Tool too pushed the image over tftp, so it must be doing something within the tftp spec to trigger the firmware upload and flash.
That done, getting the Repeater Bridge wasn't that painful. If you build a Repeater Bridge setup, just follow dd-wrt instructions. The only extra I'd add is that You should keep your Virtual AP's credentials the same as that of your Primary Router's AP's. I'm not sure why that is needed but that ate my good 2-3 hrs.
One of the difficulties of being a kernel maintainer for a busy subsystem is that you will often end up getting a lot of mail that requires reading and handling which in turn requires sending a lot of mail out in reply. Some of that requires thought and careful consideration but a lot of it is quite routine and (perhaps surprisingly) there is often more challenge in doing a good job of handling these routine messages.
For a long time I used to hand write every reply I sent but the problem with doing that is that sending the same message a lot of times tends to result in the messages getting more and more brief as the message becomes routine and practised. Your words become more optimised and if you ve stopped thinking about the message before you ve finished typing it then there s a desire to finish the typing and get on to the next thing. This is I think a lot of the reputation that kernel maintainers have for being terse and unhelpful comes from messages that are very practised for someone sending them all the time aren t always going to be obvious or helpful for someone who s not so intimately familiar with what s going on. The good part of it is that everyone is getting a personalised response and it s easy to insert a comment about that specific situation when you re already replying but it s not clear that the tradeoff is a good one.
What I ve started doing instead for most things is keeping a set of pre-written paragraphs for common cases that I can just insert into a mail and edit as needed. Hopefully it s working well for people, it means the replies are that bit more verbose than they might otherwise be (mainly adding an explanation of why a given thing is being asked for) but can easily be adapted as needed. The one exception is the Applied, thanks mails I used to send when I apply a patch (literally just saying that). Those are now automatically generated by the script I use to sync my local git repository with kernel.org and very much more verbose:
From: Mark Brown <broonie@kernel.org>
To: $ CCS
Cc: $ LIST
Subject: $ SUBJECT
In-Reply-To: $ MSGID
The patch
$ TITLE
has been applied to the $ REPO tree at
$ URL $ BRANCH
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
(unfortunately this bit seems to be something that it s worth pointing out)
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
(the script does try to CC relevant lists). As well as giving people more information this also means that the mails only get sent out when things actually get published to my public repositories which avoids some confusion that used to happen sometimes with people getting my replies before I d pushed, especially when I d been working with poor connectivity as often happens when travelling. On the down side it s very much an obvious form letter which some people don t like and which can make people glaze over.
My hope with this is to make things easier on average for patch submitters and easier for me, feedback on the scripted e-mails appears to be good thus far and the goal with the pasted in content is that it should be less obvious that it s happening so I d expect less feedback there.
It's that time of the year where I go to FOSDEM (Free and Open Source
Software Developers' European Meeting). The keynotes and the maintracks are
very good, with good presentations and contents.
It's very dificult to choose what talks to see, what talks to see later in
video and what talks to loose. What I leave here is my selection of talks. This
selection is representative of my tastes, not of the quality of the
presentations. I will give links for material that is available now. I will do
periodic updates when the new material is available: video or slides.
About 7 months ago, I wrote about we had improved Lintian sperformance. In 2.5.41, we are doing another memory reduction, where we primarily reduce the memory consumption of data about ELF binaries. Like previously, memory reductions follows the less is more pattern.
My initial test subject was linux-image-4.4.0-trunk-rt-686-pae_4.4-1~exp1_i386.deb. It had a somewhat unique property that the ELF data made up a little over half the cache.
We do away with a lot of unnecessary default values [f4c57bb, 470875f]
That removed about ~3MB (out of 10.56MB) of that ELF data cache
Discard section information we do not use [3fd98d9]
This reduced the ELF data cache to 2MB (down from the 7MB).
Then we stop caching the output of file(1) twice [7c2bee4]
While a fairly modest reduction (only 0.80MB out of 16MB total), it also affects packages without ELF binaries.
At this point, we had reduced the total memory usage from 18.35MB to 8.92MB (the ELF data going from 10.56MB to 1.98MB)[1]. At this point, I figured that I was happy with the improvement and discarded my test subject.
While impressive, the test subject was unsurprisingly a special case. The improvement in regular packages[2] (with ELF binaries) were closer to 8% in total. Not being satisfied with that, I pulled one more trick.
This brought coreutils (just the lone deb) another 10% memory reduction in total.
In the grand total, coreutils 8.24-1 amd64 went from 4.09MB to 3.48MB. The ELF data cache went from 3.38MB to 2.84MB. Similarly, libreoffice/4.2.5-1 (including its ~170 binaries) has also seen a 8.5% reduction in total cache size[3] and is now down to 260.48MB (from 284.83MB).
[1] If you are wondering why I in 3fd98d9 wrote The total cache memory usage is approaching 1/3 of the original for that package , then you are not alone. I am not sure myself any more, but it seems obviously wrong.
[2] FTR: The sample size of regular packages is 2 in this case. Of which one of them being coreutils
[3] Admittedly, since take 2 and not since 2.5.40.2 like the rest. Filed under: Debian, Lintian
The Netgear ReadyNAS 104 comes shipped with U-Boot. To access its "shell"
remove the small quadratic sticker at the backside to reveal the UART pins
(3V3, pinout available at Arnaud's NAS page[1] and
connect a matching adapter. Also connect a network cable to the lower jack.
Then on a different machine in the same network setup a tftp server (e.g.
apt-get install tftpd-hpa). As of today the latest beta netboot installer
(Beta 2) doesn't work any more because the kernel in jessie was updated since
the installer was released. So pick up the armhf netboot installer from the
daily snapshots. You
need
initrd.gz
and vmlinuz.
Furthermore
armada-370-netgear-rn104.dtb.
Update: As jessie is released now, download the following images:
With 192.168.1.17 being the IPv4 of the machine you set up the tftp server
above, adapt accordingly to your setup.
While in U-Boot the default ethernet device is the lower jack, the installer is
only able to use the upper, so replug the ethernet cable to the upper
receptacle.
Go through the installation, and before rebooting do the following:
Select "Change debconf priority" and set it to "low". Then "Download installer components" and check "mtd-modules-3.16.0-4-armmp-di". After that "Execute a shell" and do:
You then need to adapt the u-boot environment to pass the right root parameter
to Linux. Alternatively add Bootloader-Sets-Incorrect-Root: yes to
/etc/flash-kernel/db.
[1] Note this page is about a ReadyNAS 102, the pinout is identical though.
Siri and I are on a journey through India and Nepal,
with the aim of learning about needs of Debian derivatives,
to improve Debian and encourage closer integration.
C-DAC and BOSS
Centre for Development of Advanced Computing (C-DAC) is a large organization
serving country- and state-level institutions in India,
with offices and training facilities several major cities.
In Chennai, C-DAC has a staff of 25 developers
working full time on Barath Operating System Solutions (BOSS).
BOSS is a Debian derivative with several flavors
- a desktop for use at primary schools (EduBOSS),
a desktop for governmental offices (BOSS),
and a range of server-oriented use cases using same core as the desktops
with various (non-packaged) code and configuration on top.
The core common to all BOSS flavors is a derivative of Debian.
Major work has been in strengthening localization and related code
- including the development of a font
covering all officially supported indic scripts,
tuning input methods configuration,
and bugfixing LibreOffice handling of complex scripts.
All that work is all passed directly to upstream code projects
(some still show as derived work until sifting down again into Debian).
Besides locale derivations,
BOSS currently includes 11 packages not yet in Debian
- a mixture of package dependencies, branding data and configuration tweaks.
Seems most if not all can fit into Debian with a bit of restructuring work.
small computers
As some of you know,
I always had a special interest in low-resource (yet general purpose) computers
(partly driven by my lack of money to spend on shinier hardware),
and since ~2009 particularly in ARM-based computers.
After 4 days of meetings and discussion with C-DAC,
- literally few minutes before departure -
I casually mentioned my interest in small computers,
and much to my surprise it turned out that C-DAC also works on that,
just didn't get around to mention it yet at the Debian wiki page.
C-DAC have worked for a year on tuning BOSS to work on the Vidyut laptop
(successor to the Aakash tablet).
All except builtin camera is allegedly working.
C-DAC is also looking into Olimex boards
- my favorites -
possibly for use with small server setups
but our time was up, we had to leave for our train to Pune,
so details on that we will have to figure out through mail.
collaboration
In the past, C-DAC have kept in touch with their users
through BOSS-specific places like a dedicated IRC channel.
Recent changes in management style at the development office
have caused less attention available to that communication, however.
C-DAC have politely offered their code changes upstram for years,
but maybe "too polite":
Maybe they have offered only polished fixes,
being less loud about "interesting problems".
I suggested, as way to improve while limiting (ideally avoiding) extra work,
is to mentally take a step up the stream:
Treat BOSS not as a derivative but a subset of Debian itself,
hang out and discuss issues and ideas at debian irc channels,
and maintain your packages directly in Debian.
Only parts unfit for Debian
- secret stuff done for India military,
and dirty configuration hacks not yet possible within Debian Policy -
really need to be kept away from Debian.
C-DAC agreed, and Debian now has a BOSS team!
Anyone interested to follow BOSS as a Debian blend,
and perhaps even contribute with opinions and/or code,
is quite welcome to join the newly created mailinglist
on Debian Alioth:
https://lists.alioth.debian.org/mailman/listinfo/boss-devel.
Our meetings with BOSS developers have been very pleasant.
Even those working at the top of cloud or big data stacks
- furthest away from our mindset of tightly "locking down" all parts as packages -
were patient with us.
Thanks in particular to Prema S and Prathibha B,
working on packaging of BOSS for the past 5+ years,
and both likely to enter the Debian New Maintainer Queue before long