Marcus Ramberg <insert something deeply moving and profound>

Too much scifi not enough MCs

Once again, it's the end of the month, and I did not manage to keep my promise to myself, and write my blog posts earlier than last month. So, in order to not lose my bet with @jhthorsen, I will tell you about the last four books I finished. It just so happens they are all scifi, and they are all set in the near future, even if their themes are quite different.


By Neal Stephenson

I've been following Neal Stephenson for a long time, after he hooked me with the magnificent Snow Crash and The Diamond Age. Although he almost lost me with the sometimes long winded Baroque cycle, I feel like he's returning to old form lately, with REAMDE, which I enjoyed very much, and now Seveneves.

A meteorite has hit the moon, and shattered it into pieces. In itself this is a huge event, but earth scientists soon calculate that it will spell the end of most life on earth, and start exploring alternatives for survival. This book follows one of the most promising plans, making the international space station into an Ark where mankind can survive until earth once more is inhabitable.

As you can imagine, life in space is not without peril, and I found myself turning the pages quite quickly as we approached the climax. The somewhat cryptic title of this book is related to the ending, but I won't say more than that. Definitely worth checking out.

The Martian

By Andy Weir

I first heard about this book through the trailer for the blockbuster movie adoption coming out this fall. The concept of a astronaut stranded on Mars seemed very interesting, so both me and the spouse decided to read the book first.

While not as far reaching as Seveneves, the survival story is quite strong, and the writing is witty, and sprinkled with scientific tidbits that keep you interested throughout the book. Some of the drama in the book seemed a little forced, and I didn't enjoy the bits going on at Houston as much as the space survival parts. Still had a good time, and we will be getting a baby sitter to see this one in the cinema.

The Periphial

By William Gibson

Gibson was one of my favorite writers growing up. Books like Neuromancer, The Difference Engine and Mona Lisa overdrive shaped my views on the near future. While I also enjoyed his contemporary works, I have to say that even more than with Neal Stephenson, this book represents an explosive return to old form.

The book is set in two different time lines. One is a bleak near future, with sprawls and cyborg warriors, quite similar to his older books. In the other timeline we are quite a bit further into the future. Humanity has survived near extinction, and have developed quite advanced telemetry and genetic technology which allows them to create remotely controlled "meat puppets". These two timelines start to converge as a mysterious worm hole is formed between them.

I enjoyed all of this book, and I think you will too. It didn't hurt that autonomous quadcopters played an important role either.


By Ernst Cline

This is the second book from Cline, after the very popular Ready a Player One, which tapped into pop culture nostalgia around 80s arcade gaming, together with a pervasive virtual world, to make a very popular and entertaining book.

I have tried very hard not to judge this book based on his debut novel. The story is a bit similar to Orson Scott Card's Ender's Game, with a young boy fighting aliens. however I think the writing is not nearly as good.

I was also bored with a lot of the fpv multiplayer references. I don't really enjoy these kinds of games, so I guess a lot of the pop references was lost on me. Still, it's a decent youth novella, but not in the same class as the previous three.

Porting AnsibleModule to Perl.

“All animals are equal, but some animals are more equal than others.”
― George Orwell, Animal Farm

Ansible is a great orchestration tool, which I've used extensively for the last years to build infrastructure, or even to accomplish routine tasks like restarting a group of web servers one by one or patching a bunch of servers for critical security issues.

Ansible is written in Python, but you can write modules in anything that can generate JSON. In fact, I wrote about making a Perl based cloudflare module earlier. However, to quote the official documentation:

As mentioned, if you are writing a module in Python, there are some very powerful shortcuts you can use. Modules are still transferred as one file, but an arguments file is no longer needed, so these are not only shorter in terms of code, they are actually FASTER in terms of execution time.

Python is a fine language, but I'm more efficient at writing Perl, so I set out to port AnsibleModule to Perl. However, as I started looking at this new style of argument parsing, I got increasingly horrified. Seems that native Ansible modules are pre-processed to insert a lot of boilerplate code, including the passed arguments passed as a Python struct. Parsing this isn't really feasible from any other language than Python, so I decided to use the JSON support for non-native modules instead. Unfortunately, this argument passing still happens by passing a filename on the command line to the module, and the module slurping this in. Ansible also slurps in the entire file into memory to look for the WANT_JSON flag.

In the future I would love to see the module runner checking if the module opens STDIN, and pass the the module arguments directly as a JSON struct. This seems like the most efficient and agnostic way to go. Reliably detecting if stdin is open over ssh might be troublesome, but even an explicit way of setting JSON_MODE (ENV?) would be an improvement over today's situation.

Using my AnsibleModule port still provides quite a bit of convenience though. For instance, you can do complex argument checking easily:

  my $m = AnsibleModule->new(
    argument_spec => {
      name    => {required => 1},
      enabled => {default  => 0, aliases => [qw/turned_on active/]},
      type    => {type => choices => [qw/one two three/]},
      similar => {type => 'dict'}
    required_one_of => [qw/type similar/]

Note that due to the malleability of Perl, we don't really care about typing beyond String/List/Dict and Bool (which supports the same values as the Python AnsibleModule bools). Everything else is treated as a scalar.

AnsibleModule also helps with supporting check mode in your module, just like the original Python module. I also provide Test::AnsibleModule which lets you simply write unit tests for your module. As a convenience, you can test this module directly through the ansible-perl script command like this:

   ansible-perl -p -m <module> -a '{"foo":"bar"}'

Use -h to see all the available options. The -p flag means ansible-perl uses App::Fatpacker to help you pack up your dependencies inside your Ansible module (as long as they are pure Perl). Mojolicious is fat-packable, and provides a great basis for writing HTTP-related Ansible modules. Incidentally I used it to write AnsibleModule as well.

As a bonus, if you fatpack your modules, you will automatically include the WANT_JSON text that Ansible is looking for in your module source code. Note that if you don't want to pack your module, you will have to include it yourself somewhere in your source code.

Once you've packed your module, you can just put it into library/ in your Ansible project, and use it directly. As long as your hosts have Perl installed, everything should just work.

I'm still putting the finishing touches on the module for the cpan 0.1 release, but meanwhile you can get it from GitHub. Please create an issue or make a pull request if you find any bugs or you miss any features. It might also be useful to look at the examples used in the unit tests.

offline decentralized single sign-on in the browser #

Recently, browsers have just begun to implement web cryptography. This means that browsers are now capable of the same kind of passwordless decentralized authentication schemes we've had server-side with ssh and tls asymmetric keys for decades.

I think this is super interesting. I wonder if users are going to be able to understand how to use it tho. I do want to try.

Fixing the Thinkpad Buttonless Touchpad #

The default configuration of the xf86-input-synaptics driver makes the clickpad almost unusable (on the T440s). Clicks/Taps do not register properly, misclicking, no palm detection, no soft buttons where they should be, and so on... The following configuration can be put in /etc/X11/xorg.conf.d/99-synaptics.conf As a result the clickpad will react a lot more 'calm' than before and the middle & right click button areas match with the printed ones on top of the clickpad.

New laptop, new woes

NoOps is an awful word #

What do IT Ops do? We manage IT risk on behalf of the business. Thinking Ops is about servers is like thinking Dev is about code cutting.

If you think devops means eliminating operations, you don't understand development or operations.