planet@commandline:~ $ _

flavours: planet commandline   + microblogging snippets   + emacs   + german

About this page

»Planet Commandline« is a blog aggregator featuring blog feeds giving tips and tricks about commandline and keyboard usage including but not limited to keyboard-focussed window managers under X.

Planet Commandline comes in different flavours: The basic planet with blogs and blog slices containing tips, tricks and news around the commandline. Then there is the microblogging flavour which also contains several small tips and tricks also posted on some microblogging sites. And for those who abstain to use vi, there is also an emacs flavour, containing also emacs tips and tricks. Finally because there's good content also in German, there's also a German (plus English) flavour.

If you think your blog (or a subset of it with its own feed) fits onto the planet, please contact Axel Beckert, either by mail at <[email protected]> or contact XTaran on IRC (LUGS, IRCNet, OFTC or Freenode).

Planet Planet

Powered by PlanetVenus
Last update: 29. January 2026, 21:43 Uhr (UTC)

October 04, 2024

Image

grml development blog

Infrastructure overhaul: web paste blog

We're reworking, updating and migrating our infrastructure. We try to not break too much of it, but if you should notice any problems please let us know.

We no longer host our own paste service (which used to be available at paste.grml.org). This paste.pl service was written and thankfully maintained for a long time by alumni Grml developer Alexander 'formorer' Wirt, and served us well for many years (seems to have be >14 years!). We no longer want to maintain the service ourself though and therefore decided to retire it. If you're looking for a similar web service, paste.debian.net provides the same paste.pl service and API, and is also run by Alexander.

We also migrated our mirror infrastructure, as well as our download and main web presence. All those changes should not really affect nor be visible to anyone in the public though.

Finally, we also migrated our blog system, which is serving what you're reading here. :) Back in 2011 we switched from the hosted supersized.org service to our self hosted Serendipity. Also serendipity (AKA s9y) served us well for the last 13 years, but we don't want to host yet another PHP/MySQL service any longer. We decided to migrate to hugo, being a static blog engine.

IMPORTANT: The RSS feed at https://blog.grml.org/feeds/index.rss2 should work as it used to work. But comments are gone, so also the previous comments feeds (formerly known as blog.grml.org/feeds/comments.rss2) is gone as well. We had troubles with getting the Atom feed working with hugo, but decided to not put further work into that, as most users seem to be using the RSS2 feed anyways. So at least for now our Atom feed is gone! If you are subscribed to our atom feed at blog.grml.org/feeds/atom.xml, please switch to https://blog.grml.org/feeds/index.rss2 instead, to be able to receive further updates from our Grml blog. This also will be the last blog entry that's shipped via Atom feed.

by Michael Prokop at 04. October 2024, 7:05 Uhr

September 07, 2024

Image

grml development blog

Migrated Git and Wiki services

For the last 16 years (since 2008!) we hosted our own Git infrastructure and had a mirror of our Git repositories at GitHub.com.

While running your own infrastructure clearly has its benefits, it also requires maintenance efforts, for which we no longer really have the workforce nor enjoyment we used to have. We also appreciate the social effects you get from platforms like GitHub. We therefor decided to switch to GitHub as our primary Git hosting place. Over the last days, we migrated from git.grml.org to github.com by putting according URL rewrites into place.

We also used to host our own DokuWiki for more than 19(!) years. In the last few years we didn't have any actual wiki changes, so we decided to also migrate this over to GitHub, and also there put according URL rewrites into action.

Now all our Grml Git repositories can be found at github.com/grml, and our Wiki is available at github.com/grml/grml/wiki/.

If you should notice any problems with any of our services, please reach out.

by Michael Prokop at 07. September 2024, 6:45 Uhr

March 02, 2024

Image

grml development blog

Grml - new stable release 2024.02 available

This Grml release provides fresh software packages from Debian trixie. As usual it also incorporates current hardware support and fixes known bugs from previous Grml releases.

More information is available in the release notes of Grml 2024.02.

Grab the latest Grml ISO(s) and spread the word!

Thanks to everyone contributing to Grml and this release, stay healthy and happy Grml-ing!

by Michael Prokop at 02. March 2024, 9:31 Uhr

February 07, 2024

Image

grml development blog

First Release Candidate of Grml version 2024.02 available

We are proud to announce the first release candidate of the upcoming version 2024.02, code-named 'Glumpad'!

This Grml release provides fresh software packages from Debian trixie. As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2022.11 and 2024.02(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of February 2024.

by Michael Prokop at 07. February 2024, 7:25 Uhr

February 06, 2024

Image

grml development blog

First Release Candidate of Grml version 2022.11 available

We are proud to announce the first release candidate of the upcoming version 2022.11, code-named 'MalGuckes'!

This Grml release provides fresh software packages from Debian bookworm. As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2021.07 and 2022.11(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of November 2022.

by Michael Prokop at 06. February 2024, 8:48 Uhr

September 20, 2023

Image

grml development blog

20 years of grml.org

Wow, how time flies! 20 years ago grml.org was registered by Mika, and in 2004 we had our first public Grml release. 🄳

We're glad about such a wonderful community and are celebrating this with a small Easter egg in our Grml daily ISOs! 😜

And now for another 20 years? šŸ¤“

*

by Michael Prokop at 20. September 2023, 6:34 Uhr

November 30, 2022

Image

grml development blog

Grml - new stable release 2022.11 available

This Grml release provides fresh software packages from Debian bookworm. As usual it also incorporates current hardware support and fixes known bugs from previous Grml releases.

More information is available in the release notes of Grml 2022.11.

Grab the latest Grml ISO(s) and spread the word!

Thanks to everyone contributing to Grml and this release, stay healthy and happy Grml-ing!

by Michael Prokop at 30. November 2022, 11:08 Uhr

July 31, 2021

Image

grml development blog

Grml - new stable release 2021.07 available

This Grml release provides fresh software packages from Debian bullseye. As usual it also incorporates current hardware support and fixes known bugs from previous Grml releases.

More information is available in the release notes of Grml 2021.07.

Grab the latest Grml ISO(s) and spread the word!

Thanks to everyone contributing to Grml and this release, stay healthy and happy Grml-ing!

by Michael Prokop at 31. July 2021, 11:37 Uhr

July 16, 2021

Image

grml development blog

First Release Candidate of Grml version 2021.07 available

We are proud to announce the first release candidate of the upcoming version 2021.07, code-named 'JauKerl'!

This Grml release provides fresh software packages from Debian bullseye. As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2020.06 and 2021.07(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of July 2021.

by Michael Prokop at 16. July 2021, 15:23 Uhr

May 28, 2021

Image

grml development blog

Grml IRC channel moving to OFTC

You might have heard about the Freenode IRC drama, and after more than 17 years of #grml on Freenode, it's time to say goodbye.

We decided to move our IRC to irc.oftc.net, so please join us at #grml over there.

Thanks for the many years of great service to Freenode, thanks OFTC for hosting us!

by Michael Prokop at 28. May 2021, 11:43 Uhr

February 15, 2021

Image

Axel Beckert: Shell

Starting a GNU Screen session via SSH's ~/.ssh/config

This is more or less a followup to this blog posting of mine about AutoSSH and GNU Screen from nearly ten years ago — which by the way is still valid and still the way, I use SSH and GNU Screen.

Recently a friend asked me how to automatically start or reconnect to a GNU Screen session directly via OpenSSH’s configuration file. Here’s how to do it:

Add an entry to ~/.ssh/config similar to this one:

Host screen_on_server
    Hostname server.example.org
    RequestTTY yes
    RemoteCommand screen -RD

and then just call ssh screen_on_server and you’ll get connected to an existing screen session if present, otherwise you’ll a new new one.

Should work with tmux, too, but might need commandline different options.

by Axel Beckert ([email protected]) at 15. February 2021, 4:50 Uhr

October 12, 2020

Image

Axel Beckert: Shell

Git related shell aliases I commonly use

  • ga="git annex"
  • gap="git add -p"
  • amend="git commit --amend"

Hope this might be an inspiration to use these or similar aliases as well.

by Axel Beckert ([email protected]) at 12. October 2020, 12:28 Uhr

June 28, 2020

Image

grml development blog

Grml - new stable release 2020.06 available

Long time no see, but there we are - we just released Grml 2020.06 - Ausgehfuahangl!

This Grml release provides fresh software packages from Debian testing (AKA bullseye). As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

More information is available in the release notes of Grml 2020.06.

Grab the latest Grml ISO(s) and spread the word!

Thanks everyone, stay healthy and happy Grml-ing!

by Michael Prokop at 28. June 2020, 3:36 Uhr

June 09, 2020

Image

grml development blog

First Release Candidate of Grml version 2020.06 available

We are proud to announce the first release candidate of the upcoming version 2020.06, code-named 'Ausgehfuahangl'!

This Grml release provides fresh software packages from Debian testing (AKA bullseye). As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2018.12 and 2020.06(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of June 2020.

by Michael Prokop at 09. June 2020, 7:10 Uhr

January 11, 2019

Image

grml development blog

Grml/Debian Bug Squashing Party in Salzburg, 2019

The Debian project hosts a Bug Squashing Party in Salzburg/Austria, taking place from April 5th to April 7th 2019. A Bug Squashing Party is a come-together of developers, contributors and enthusiasts who try to fix as many bugs as possible.

We’ve been invited to join the Bug Squashing Party and since Grml is an official derivative of Debian we’re more than happy to take this opportunity. This is the perfect time and place to meet with fellow Grml and Debian developers, contributors and friends, to make the next Debian- and Grml-Release the best ever! :)

The key facts:

  • Location: conova communications GmbH, Karolingerstr. 36A, 5020 Salzburg, Austria
  • Date: 2019-04-05 (Friday) until 2019-04-07 (Sunday)

If you want to join us please visit wiki.debian.org/BSP/2019/04/Salzburg for further information. If you’ve any questions feel free to reach out to us.

PS: For the ones of you who can’t join us in Salzburg, feel free to join us during the Bug Squashing Party on IRC (#grml on irc.freenode.org)!

by Michael Prokop at 11. January 2019, 9:52 Uhr

January 04, 2019

Image

grml development blog

Grml - new stable release 2018.12 available

So we did it again - we just released Grml 2018.12 - Gnackwatschn!

This Grml release provides fresh software packages from Debian testing, what's going to be released as stable release Debian/buster in 2019. As usual it also incorporates current hardware support and fixes known bugs from previous Grml releases.

More information is available in the release notes of Grml 2018.12.

Grab the latest Grml ISO(s) and spread the word!

Thanks everyone, happy new year and happy Grml-ing!

by Michael Prokop at 04. January 2019, 9:39 Uhr

December 20, 2018

Image

grml development blog

First Release Candidate of Grml version 2018.12 available

We are proud to announce the first release candidate of the upcoming version 2018.12, code-named 'Gnackwatschn'!

This Grml release provides fresh software packages from Debian testing (AKA buster). As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2017.05 and 2018.12(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of December 2018.

by Michael Prokop at 20. December 2018, 16:07 Uhr

March 09, 2018

Image

Christoph Berg: Unix

Cool Unix Features: paste

paste is one of those tools nobody uses [1]. It puts two file side by side, line by line.

One application for this came up today where some tool was called for several files at once and would spit out one line by file, but unfortunately not including the filename.

$ paste <(ls *.rpm) <(ls *.rpm | xargs -r rpm -q --queryformat '%{name} \n' -p)

[1] See "J" in The ABCs of Unix

[PS: I meant to blog this in 2011, but apparently never committed the file...]

09. March 2018, 9:06 Uhr

January 16, 2018

Image

Axel Beckert: Shell

Tex Yoda II Mechanical Keyboard with Trackpoint

Here’s a short review of the Tex Yoda II Mechanical Keyboard with Trackpoint, a pointer to the next Swiss Mechanical Keyboard Meetup and why I ordered a $300 keyboard with less keys than a normal one.

Short Review of the Tex Yoda II

Image
Pro
  • Trackpoint
  • Cherry MX Switches
  • Compact but heavy alumium case
  • Backlight (optional)
  • USB C connector and USB A to C cable with angled USB C plug
  • All three types of Thinkpad Trackpoint caps included
  • Configurable layout with nice web-based configurator (might be opensourced in the future)
  • Fn+Trackpoint = scrolling (not further configurable, though)
  • Case not clipped, but screwed
  • Backlight brightness and Trackpoint speed configurable via key bindings (usually Fn and some other key)
  • Default Fn keybindings as side printed and backlit labels
  • Nice packaging
Contra
  • It’s only a 60% Keyboard (I prefer TKL) and the two common top rows are merged into one, switched with the Fn key.
  • Cursor keys by default (and labeled) on the right side (mapped to Fn + WASD) — maybe good for games, but not for me.
  • ~ on Fn-Shift-Esc
  • Occassionally backlight flickering (low frequency)
  • Pulsed LED light effect (i.e. high frequency flickering) on all but the lowest brightness level
  • Trackpoint is very sensitive even in the slowest setting — use Fn+Q and Fn+E to adjust the trackpoint speed (ā€œtpsā€)
  • No manual included or (obviously) downloadable.
  • Only the DIP switches 1-3 and 6 are documented, 4 and 5 are not. (Thanks gismo for the question about them!)
  • No more included USB hub like the Tex Yoda I had or the HHKB Lite 2 (USB 1.1 only) has.
My Modifications So Far
Layout Modifications Via The Web-Based Yoda 2 Configurator
  • Right Control and Menu key are Right and Left cursors keys
  • Fn+Enter and Fn+Shift are Up and Down cursor keys
  • Right Windows key is the Compose key (done in software via xmodmap)
  • Middle mouse button is of course a middle click (not Fn as with the default layout).
Other Modifications
  • Clear dampening o-rings (clear, 50A) under each key cap for a more silent typing experience
  • Braided USB cable

Next Swiss Mechanical Keyboard Meetup

On Sunday, the 18th of February 2018, the 4th Swiss Mechanical Keyboard Meetup will happen, this time at ETH Zurich, building CAB, room H52. I’ll be there with at least my Tex Yoda II and my vintage Cherry G80-2100.

Why I ordered a $300 keyboard

(JFTR: It was actually USD $299 plus shipping from the US to Europe and customs fee in Switzerland. Can’t exactly find out how much of shipping and customs fee were actually for that one keyboard, because I ordered several items at once. It’s complicated…)

I always was and still are a big fan of Trackpoints as common on IBM and Lenovo Thinkapds as well as a few other laptop manufactures.

For a while I just used Thinkpads as my private everyday computer, first a Thinkpad T61, later a Thinkpad X240. At some point I also wanted a keyboard with Trackpoint on my workstation at work. So I ordered a Lenovo Thinkpad USB Keyboard with Trackpoint. Then I decided that I want a permanent workstation at home again and ordered two more such keyboards: One for the workstation at home, one for my Debian GNU/kFreeBSD running ASUS EeeBox (not affected by Meltdown or Spectre, yay! :-) which I often took with me to staff Debian booths at events. There, a compact keyboard with a built-in pointing device was perfect.

Then I met the guys from the Swiss Mechanical Keyboard Meetup at their 3rd meetup (pictures) and knew: I need a mechanical keyboard with Trackpoint.

IBM built one Model M with Trackpoint, the M13, but they’re hard to get. For example, ClickyKeyboards sells them, but doesn’t publish the price tag. :-/ Additionally, back then there were only two mouse buttons usual and I really need the third mouse button for unix-style pasting.

Then there’s the Unicomp Endura Pro, the legit successor of the IBM Model M13, but it’s only available with an IMHO very ugly color combination: light grey key caps in a black case. And they want approximately 50% of the price as shipping costs (to Europe). Additionally it didn’t have some other nice keyboard features I started to love: Narrow bezels are nice and keyboards with backlight (like the Thinkpad X240 ff. has) have their advantages, too. So … no.

Soon I found, what I was looking for: The Tex Yoda, a nice, modern and quite compact mechanical keyboard with Trackpoint. Unfortunately it is sold out since quite some years ago and more then 5000 people on Massdrop were waiting for its reintroduction.

And then the unexpected happened: The Tex Yoda II has been announced. I knew, I had to get one. From then on the main question was when and where will it be available. To my surprise it was not on Massdrop but at a rather normal dealer, at MechanicalKeyboards.com.

At that time a friend heard me talking of mechanical keyboards and of being unsure about which keyboard switches I should order. He offered to lend me his KBTalking ONI TKL (Ten Key Less) keyboard with Cherry MX Brown switches for a while. Which was great, because from theory, MX Brown switches were likely the most fitting ones for me. He also gave me two other non-functional keyboards with other Cherry MX switch colors (variants) for comparision. As a another keyboard to compare I had my programmable Cherry G80-2100 from the early ’90s with vintage Cherry MX Black switches. Another keyboard to compare with is my Happy Hacking Keyboard (HHKB) Lite 2 (PD-KB200B/U) which I got as a gift a few years ago. While the HHKB once was a status symbol amongst hackers and system administrators, the old models (like this one) only had membrane type keyboard switches. (They nevertheless still seem to get built, but only sold in Japan.)

I noticed that I was quickly able to type faster with the Cherry MX Brown switches and the TKL layout than with the classic Thinkpad layout and its rubber dome switches or with the HHKB. So two things became clear:

  • At least for now I want Cherry MX Brown switches.
  • I want a TKL (ten key less) layout, i.e. one without the number block but with the cursor block. As with the Lenovo Thinkpad USB Keyboards and the HHKB, I really like the cursor keys being in the easy to reach lower right corner. The number pad is just in the way to have that.

Unfortunately the Tex Yoda II was without that cursor block. But since it otherwise fitted perfectly into my wishlist (Trackpoint, Cherry MX Brown switches available, Backlight, narrow bezels, heavy weight), I had to buy one once available.

So in early December 2017, I ordered a Tex Yoda II White Backlit Mechanical Keyboard (Brown Cherry MX) at MechanicalKeyboards.com.

Because I was nevertheless keen on a TKL-sized keyboard I also ordered a Deck Francium Pro White LED Backlit PBT Mechanical Keyboard (Brown Cherry MX) which has an ugly font on the key caps, but was available for a reduced price at that time, and the controller got quite good reviews. And there was that very nice Tai-Hao 104 Key PBT Double Shot Keycap Set - Orange and Black, so the font issue was quickly solved with keycaps in my favourite colour: orange. :-)

The package arrived in early January. The aluminum case of the Tex Yoda II was even nicer than I thought. Unfortunately they’ve sent me a Deck Hassium full-size keyboard instead of the wanted TKL-sized Deck Francium. But the support of MechanicalKeyboards.com was very helpful and I assume I can get the keyboard exchanged at no cost.

by Axel Beckert ([email protected]) at 16. January 2018, 20:36 Uhr

June 23, 2017

Image

grml development blog

New Grml developer: Darshaka Pathirana

We're proud to be able to announce that Darshaka "dpat" Pathirana just joined the team as official Grml developer. Welcome in the team, Darshaka!

by Michael Prokop at 23. June 2017, 11:18 Uhr

June 02, 2017

Image

grml development blog

Grml - new stable release 2017.05 available

So we did it again - we just released Grml 2017.05 - Freedatensuppe!

This Grml release provides fresh software packages from Debian testing, what's going to be released as stable release Debian/stretch in just a few more days. As usual it also incorporates current hardware support and fixes known bugs from previous Grml releases.

More information is available in the release notes of Grml 2017.05.

Grab the latest Grml ISO(s) and spread the word!

Thanks everyone and happy grml-ing!

by Michael Prokop at 02. June 2017, 8:50 Uhr

May 09, 2017

Image

grml development blog

First Release Candidate of Grml version 2017.05 available

We are proud to announce the first release candidate of the upcoming version 2017.05, code-named 'Freedatensuppe'!

This Grml release provides fresh software packages from Debian testing (AKA stretch). As usual it also incorporates current hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2014.11 and 2017.05(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and rely on, and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of May (2017 :)).

by Michael Prokop at 09. May 2017, 13:31 Uhr

March 21, 2017

Image

Tanguy Ortolo: Command Line

Bad support of ZIP archives with extra fields

For sharing multiple files, it is often convenient to pack them into an archive, and the most widely supported format to do so is probably ZIP. Under *nix, you can archive a directory with Info-ZIP:

% zip -r something.zip something/

(When you have several files, it is recommended to archive them in a directory, to avoid cluttering the directory where people will extract them.)

Unsupported ZIP archive

Unfortunately, while we would expect ZIP files to be widely supported, I found out that this is not always the case, and I had many recipients failing to open them under operating systems such as iOS.

Avoid extra fields

That issue seems to be linked to the usage of extra file attributes, that are enabled by default, in order to store Unix file metadata. The field designed to store such extra attributes was designed from the beginning so each implementation can take into account attributes it supports and ignore any other ones, but some buggy ZIP implementation appear not to function at all with them.

Therefore, unless you actually need to preserve Unix file metadata, you should avoid using extra fields. With Info-ZIP, you would have to add the option -X:

% zip -rX something.zip something/

by Tanguy at 21. March 2017, 19:33 Uhr

January 04, 2017

Image

grml development blog

State of Grml in 2017

A new stable release of Grml is long overdue and sadly we didn't manage to release a new stable release in 2016 either.

But in Q4 of 2016 we made actual progress with the systemd integration and the according branches should be ready soon for merging to master. A new kernel based on v4.8.15 has been uploaded to grml-testing a few days ago and is included in our daily ISOs already.

We don't want to promise anything we can't hold, but we should have (at least) an RC version available within Q1/2017.

by Michael Prokop at 04. January 2017, 10:45 Uhr

November 23, 2016

Image

Tanguy Ortolo: Command Line

Generate man pages for awscli

No man pages, but almost

The AWS Command Line Interface, which is available in Debian, provides no man page. Instead, that tool has an integrated help system, which allows you to run commands such as aws rds help, that, for what I have seen, generates some reStructuredText, then converts it to a man page in troff format, then calls troff to convert it to text with basic formatting, and eventually passes it to a pager. Since this is close to what man does, the result looks like a degraded man page, with some features missing such as the adaptation to the terminal width.

Well, this is better than nothing, and better than what many under-documented tools can offer, but for several reasons, it still sucks: most importantly, it does not respect administrators' habits and it does not integrate with the system man database. You it does not allow you to use commands such as apropos, and you will get no man page name auto-completion from your shell since there is no man page.

Generate the man pages

Now, since the integrated help system does generate a man page internally, we can hack it to output it, and save it to a file:

Description: Enable a mode to generate troff man pages
 The awscli help system internally uses man pages, but only to convert
 them to text and show them with the pager. This patch enables a mode
 that prints the troff code so the user can save the man page.
 .
 To use that mode, run the help commands with an environment variable
 OUTPUT set to 'troff', for instance:
     OUTPUT='troff' aws rds help
Forwarded: no
Author: Tanguy Ortolo <[email protected]>
Last-Update: 2016-11-22

Index: /usr/lib/python3/dist-packages/awscli/help.py
===================================================================
--- /usr/lib/python3/dist-packages/awscli/help.py       2016-11-21 12:14:22.236254730 +0100
+++ /usr/lib/python3/dist-packages/awscli/help.py       2016-11-21 12:14:22.236254730 +0100
@@ -49,6 +49,8 @@
     Return the appropriate HelpRenderer implementation for the
     current platform.
     """
+    if 'OUTPUT' in os.environ and os.environ['OUTPUT'] == 'troff':
+        return TroffHelpRenderer()
     if platform.system() == 'Windows':
         return WindowsHelpRenderer()
     else:
@@ -97,6 +99,15 @@
         return contents


+class TroffHelpRenderer(object):
+    """
+    Render help content as troff code.
+    """
+
+    def render(self, contents):
+        sys.stdout.buffer.write(publish_string(contents, writer=manpage.Writer()))
+
+
 class PosixHelpRenderer(PagingHelpRenderer):
     """
     Render help content on a Posix-like system.  This includes

This patch must be applied from the root directory with patch -p0, otherwise GNU patch will not accept to work on files with absolute names.

With that patch, you can run help commands with an environment variable OUTPUT='troff' to get the man page to use it as you like, for instance:

% OUTPUT='troff' aws rds help > aws_rds.1
% man -lt aws_rds.1 | lp

Generate all the man pages

Now that we are able to generate the man page of any aws command, all we need to generate all of them is a list of all the available commands. This is not that easy, because the commands are somehow derived from functions provided by a Python library named botocore, which are derived from a bunch of configuration files, and some of them are added, removed or renamed. Anyway, I have been able to write a Python script that does that, but it includes a static list of these modifications:

#! /usr/bin/python3

import subprocess
import awscli.clidriver


def write_manpage(command):
    manpage = open('%s.1' % '_'.join(command), 'w')
    command.append('help')
    process = subprocess.Popen(command,
            env={'OUTPUT': 'troff'},
            stdout=manpage)
    process.wait()
    manpage.close()


driver = awscli.clidriver.CLIDriver()
command_table = driver._get_command_table()

renamed_commands = \
    {
        'config': 'configservice',
        'codedeploy': 'deploy',
        's3': 's3api'
    }
added_commands = \
    {
        's3': ['cp', 'ls', 'mb', 'mv', 'presign', 'rb', 'rm', 'sync',
               'website']
    }
removed_subcommands = \
    {
        'ses': ['delete-verified-email-address',
                'list-verified-email-addresses',
                'verify-email-address'],
        'ec2': ['import-instance', 'import-volume'],
        'emr': ['run-job-flow', 'describe-job-flows',
                'add-job-flow-steps', 'terminate-job-flows',
                'list-bootstrap-actions', 'list-instance-groups',
                'set-termination-protection',
                'set-visible-to-all-users'],
        'rds': ['modify-option-group']
    }
added_subcommands = \
    {
        'rds': ['add-option-to-option-group',
                'remove-option-from-option-group']
    }

# Build a dictionary of real commands, including renames, additions and
# removals.
real_commands = {}
for command in command_table:
    subcommands = []
    subcommand_table = command_table[command]._get_command_table()
    for subcommand in subcommand_table:
        # Skip removed subcommands
        if command in removed_subcommands \
                and subcommand in removed_subcommands[command]:
            continue
        subcommands.append(subcommand)
    # Add added subcommands
    if command in added_subcommands:
        for subcommand in added_subcommands[command]:
            subcommands.append(subcommand)
    # Directly add non-renamed commands
    if command not in renamed_commands:
        real_commands[command] = subcommands
    # Add renamed commands
    else:
        real_commands[renamed_commands[command]] = subcommands
# Add added commands
for command in added_commands:
    real_commands[command] = added_commands[command]

# For each real command and subcommand, generate a manpage
write_manpage(['aws'])
for command in real_commands:
    write_manpage(['aws', command])
    for subcommand in real_commands[command]:
        write_manpage(['aws', command, subcommand])
                         'sync', 'website']}

This script will generate more than 2,000 man page files in the current directory; you will then be able to move them to /usr/local/share/man/man1.

Since this is a lot of man pages, it may be appropriate to concatenate them by major command, for instance all the aws rds together…

by Tanguy at 23. November 2016, 17:25 Uhr

June 08, 2016

Image

Tanguy Ortolo: Command Line

Process command line arguments in shell

When writing a wrapper script, one often has to process the command line arguments to transform them according to his needs, to change some arguments, to remove or insert some, or perhaps to reorder them.

Naive approach

The naive approach to do that is¹:

# Process arguments, building a new argument list
new_args=""
for arg in "$@"
do
    case "$arg"
    in
        --foobar)
            # Convert --foobar to the new syntax --foo=bar
            new_args="$args --foo=bar"
        ;;
        *)
            # Take other options as they are
            new_args="$args $arg"
        ;;
    esac
done

# Call the actual program
exec program $new_args

This naive approach is simple, but fragile, as it will break on arguments that contain a space. For instance, calling wrapper --foobar "some file" (where some file is a single argument) will result in the call program --foo=bar some file (where some and file are two distinct arguments).

Correct approach

To handle spaces in arguments, we need either:

  • to quote them in the new argument list, but that requires escaping possible quotes they contain, which would be error-prone, and implies using external programs such as sed;
  • to use an actual list or array, which is a feature of advanced shells such as Bash or Zsh, not standard shell…

… except standard shell does support arrays, or rather, it does support one specific array: the positional parameter list "$@"². This leads to one solution to process arguments in a reliable way, which consists in rebuilding the positional parameter list with the built-in command set --:

# Process arguments, building a new argument list in "$@"
# "$@" will need to be cleared, not right now but on first iteration only
first_iter=1
for arg in "$@"
do
    if [ "$first_iter" -eq 1 ]
    then
        # Clear the argument list
        set --
        first_iter=0
    fi
    case "$arg"
    in
        --foobar) set -- "$@" --foo=bar ;;
        *) set -- "$@" "$arg" ;;
    esac
done

# Call the actual program
exec program "$@"

Notes

  1. I you prefer, for arg in "$@" can be simplified to just for arg.↑
  2. As a reminder, and contrary to what it looks like, quoted "$@" does not expand to a single field, but to one field per positional parameter. ↑

by Tanguy at 08. June 2016, 13:29 Uhr

April 22, 2016

Image

grml development blog

Booting Grml via iPXE

Jimmy blogged about booting Grml via iPXE, since we've fixed the memdisk feature recently and netboot.xyz also includes support for Grml. :)

by Michael Prokop at 22. April 2016, 7:47 Uhr

April 15, 2016

Image

Tanguy Ortolo: Command Line

Let's Encrypt: threat or opportunity to other certificate authorities?

Let's Encrypt is a certificate authority (CA) that just left beta stage, that provides domain name-validated (DV) X.509 certificates for free and in an automated way: users just have to run a piece of software on their server to get and install a certificate, resulting in a valid TLS setup.

A threat to other certificate authorities

By providing certificates for free and automatically, Let's Encrypt is probably a threat a other CAs, a least for part of their activity. Indeed, for people that are satisfied with DV certificates, there are not many reasons to pay a commercial CA to get certificates in a non-automated way. For the CAcert non-commercial CA, that may mean a slow death, as this is their main activity¹.

For people that want organization-validated (OV) or extended validation (EV) certificates, Let's Encrypt is not suitable, so it will not change anything regarding that.

An opportunity for the most reactive

The entrance of Let's Encrypt is also a significant opportunity for the certificate authorities that will be reactive enough to take advantage of their innovation. Indeed, they introduced automation in both domain name validation and certificate issuance (and revocation), by defining an open protocol that is meant to become an Internet standard. That protocol, named ACME, is not tied to Let's Encrypt and has several free software implementations, so it could be used for the same purpose by commercial CAs.

A certification authority could, for instance:

  • ask the customer to provision some pre-paid account;
  • manually validate the customer's identity once;
  • allow the customer to register using ACME, and associate that registration to his validated identity;
  • allow the customer to get organization-validated, or perhaps even extended validation certificates using ACME, and making corresponding debits to his pre-paid account.

Such processes may require or benefit from improvements of the ACME protocol, which is the very reason Internet standards are defined in an open way.

The first certification authority that would implement such a process could gain an advantage over its competitors, as it would greatly simplify getting and renewing certificates. I think even Let's Encrypt people would be happy to see that happen, as it would serve their goal, that is basically to help securing the Internet! Personally, I could buy such a service (assuming it is not restricted to juridical persons, according to a quite common (and detestable) sale discrimination against natural persons²).

Notes

  1. CAcert is an unrecognised certificate authority, that provides an identity validation through a web of trust, and issues DV server certificates that do not include the validated identity. Now that Let's Encrypt can issue valid DV certificates, CAcert is no longer relevant for that activity. It also issues personal certificates, that do include the validated identity, and that can be used for encryption (e.g. S/MIME), signing (e.g. code signing) or authentication, which is an activity Let's Encrypt does not compete with.
  2. Yes, the Organization field of a certificate is probably not relevant to indicate a physical person's name, but the CommonName field is. Yes, that field is usually abused to store the domain name, but a proper use would be to put the owner's name in the CommonName field, and the domain names in the subjectAltName field.↑

by Tanguy at 15. April 2016, 13:25 Uhr

January 22, 2016

Image

Tanguy Ortolo: Command Line

Removing sam2p from Debian

Issues with sam2p and removal

I have been maintaining the Debian package of sam2p for some time. Unfortunately, the upstream development of that program is no longer active, and it is using an old custom build chain that no longer works with recent version of GCC.

This package is currently failing to build from source, and while I have been able to patch some issues in the past, and it may still be possible to fix it again, this is not really sustainable.

I am therefore considering to remove sam2p from Debian, unless someone has a very good reason to keep it and is able and willing to maintain it.

Alternative

sam2p is a raster image conversion tool that can convert PNG and JPEG to EPS and PDF while keeping their compression, which is mostly useful to use them in documents compiled with LaTeX. Fortunately, the same can be done with ImageMagick. If you want to convert to EPS, you have to specify that you want EPS 2 or 3, otherwise it would produce EPS level 1 which does not provide native raster compression:

% convert debian-openlogo-raster100.png \
          eps3:debian-openlogo-raster100.eps
% convert debian-openlogo-raster100.png \
          debian-openlogo-raster100.pdf
% ls -lh
1.7K debian-openlogo-raster100.png
6.0K debian-openlogo-raster100.eps
8.8K debian-openlogo-raster100.pdf

% convert photograph.jpg eps3:photograph.eps
% convert photograph.jpg photograph.pdf
% ls -lh
657K photograph.jpg
662K photograph.eps
664K photograph.pdf

% convert scanned-document.png eps3:scanned-document.eps
% convert scanned-document.png scanned-document.pdf
140K scanned-document.png
145K scanned-document.eps
150K scanned-document.pdf

This is a bit less efficient than sam2p, as convert seems to add some fixed overhead, but it does keep the appropriate compression algorithm. See this documentation page from ImageMagick for more information.

Using appropriate formats

As a reminder, when writing LaTeX documents, depending on your build chain, you can use:

photographs
JPEG or EPS (converted from JPEG with ImageMagick);
raster drawings, screenshots…
PNG or EPS (converted from PNG with ImageMagick);
vector graphics
PDF or EPS (convertes from SVG with Inkscape).

by Tanguy at 22. January 2016, 0:52 Uhr

January 12, 2016

Image

grml development blog

Is Grml still alive?

Grml's latest stable release as of today still is 2014.11 and folks are poking us about the current state of Grml and upcoming stable releases. Thanks to our daily ISOs available at daily.grml.org more up2date versions are available, though we understand and agree that a new stable release is overdue.

Sadly since quite some time we're stuck with a release stopper, being a regression in udev which is visible only if you do not use systemd. Grml is using file-rc as its init system and while the migration to systemd was on our agenda no one took care of this so far. Support for systemd is work in progress though now. We hope to have a new stable release of Grml available in Q1 of 2016!

tl;dr: Grml is still alive :)

by Michael Prokop at 12. January 2016, 7:26 Uhr

December 24, 2014

Image

grml development blog

Ten years of Grml

This year we're celebrating 10 years of Grml. I wrote some words about those ten years of Grml in my personal blog.

The Grml team wishes you Merry Christmas to the ones of you who celebrate it and a Happy New Year! We hope to see you in 2015!

by Michael Prokop at 24. December 2014, 13:46 Uhr

December 09, 2014

Image

Tanguy Ortolo: Command Line

Using bsdtar to change an archive format

Streamable archive formats

Package icon

Archive formats such as tar(5) and cpio(5) have the advantage of being streamable, so you can use them for transferring data with pipes and remote shells, without having to store the archive in the middle of the process, for instance:

$ cd public_html/blog
$ rgrep -lF "archive" data/articles \
      | pax -w \
      | ssh newserver "mkdir public_html/blog ;
                       cd public_html/blog ;
                       pax -r"

Turning a ZIP archive into tarball

Unfortunately, many people will send you data in non-streamable archive formats such as ZIP¹. For such cases, bsdtar(1) can be useful, as it is able to convert an archive from one format to another:

$ bsdtar -cf - @archive.zip \
      | COMMAND

These arguments tell bsdtar to:

  • create an archive;
  • write it to stdout (contrary to GNU tar which defaults to stdout, bsdtar defaults to a tape device);
  • put into it the files it will find in the archive archive.zip.

The result is a tape archive, which is easier to manipulate in a stream than a ZIP archive.

Notes

  1. Some will say that although ZIP is based on an file index, it can be stream because that index is placed at the end of the archive. In fact, that characteristic only allows to stream the archive creation, but requires to store the full archive before being able to extract it. ↑.

by Tanguy at 09. December 2014, 16:00 Uhr

Ian Dexter Marquez: CLI

Pull files off Android phone

This assumes you have Android Debug Bridge (ADB) installed. This will pull all files from a directory in an Android phone.


cd /path/to/destination/directory
adb pull /path/to/source .

As Julian says, "Easy-peasy, lemon squeezy."


Image

(I use this, by the way, since the Nexus 5 and OS X Mavericks refuse to work together in USB mode.)

by iandexter ([email protected]) at 09. December 2014, 4:10 Uhr

December 05, 2014

Ian Dexter Marquez: CLI

Open URL in Chrome incognito mode from Terminal

/usr/bin/open -a "Google Chrome Canary" <url> --args --incognito

(Works in 10.10.1, at least.)

by iandexter ([email protected]) at 05. December 2014, 16:24 Uhr

November 17, 2014

Image

grml development blog

Grml - new stable release 2014.11 available

We just released Grml 2014.11 - Gschistigschasti.

This Grml release provides fresh software packages from Debian testing (AKA jessie). As usual it also incorporates up2date hardware support and fixes known bugs from the previous Grml release.

More information is available in the release notes of Grml 2014.11.

Special thanks to Christian Hofstaedtler for helping us in solving a big release stopper caused by udev's net.agent on systems without systemd (AKA #754987).

Grab the latest Grml ISO(s) and spread the word!

Thanks everyone and happy grml-ing!

by Michael Prokop at 17. November 2014, 21:25 Uhr

October 17, 2014

Image

Tanguy Ortolo: Command Line

Trying systemd [ OK ] Switching back to SysV [ OK ]

Since systemd is now the default init system under Debian Jessie, it got installed to my system and I had a chance to test it. The result is disappointing: it does not work well with cryptsetup, so I am switching back to SysV init and RC.

The problem comes from the fact that I am using encrypted drives with cryptsetup, and while this is correctly integrated with SysV, it just sucks with systemd, where the passphrase prompt is mixed up with service start messages, a bit like that (from memory, since I did not take a picture of my system booting):

Enter passphrase for volume foobar-crypt:
[ OK ] Sta*rting serv*ice foo**
[ OK ] ***Starting service bar**
[ OK ] Starting service baz****

The stars correspond to the letters I type, and as you can see, as the passphrase prompt does not wait for my input, they get everywhere in the boot messages, and there is no clear indication that the passphrase was accepted. This looks like some pathological optimization for boot speed, where even interactive steps are run in parallel with services startup: sorry, but this is just insane.

There may exist ways to work around this issue, but I do not care: SysV init works just fine with no setup at all, and I since have no real need for another init system, systemd as a replacement is only acceptable if it works at least as fine for my setup, which is not the case. Goodbye systemd, come back when you are ready.

by Tanguy at 17. October 2014, 16:12 Uhr

Image

Rhonda D'Vine: CLI

New Irssi

After a long time a new irssi upstream release hit the archive. While the most notable change in 0.8.16 was DNSSEC DANE support which is enabled (for linux, src:dnsval has issues to get compiled on kFreeBSD), the most visible change in 0.8.17 was addition of support for both 256 colors and truecolor. While the former can be used directly, for the later you have to explicitly switch the setting colors_ansi_24bit to on. A terminal support it is needed for that though. To test the 256 color support, your terminal has to support it, your TERM environment variable has to be properly set, and you can test it with the newly added /cubes alias. If you have an existing configuration, look at the Testing new Irssi wiki page which helps you get that alias amongst giving other useful tipps, too.

The package currently only lives in unstable, but once it did flow over to testing I will update it in wheezy-backports, too.

Enjoy!

/debian | permanent link | Comments: 0 | Flattr this

by Rhonda at 17. October 2014, 10:39 Uhr

October 09, 2014

Image

grml development blog

First Release Candidate of Grml version 2014.10 available

We are proud to announce the first release candidate of the upcoming version 2014.10, code-named 'Gschistigschasti'!

This Grml release provides fresh software packages from Debian testing (AKA jessie). As usual it also incorporates up2date hardware support and fixes known bugs from the previous Grml release.

For detailed information about the changes between 2014.03 and 2014.03(-rc1) have a look at the official release announcement.

Please test the ISOs and everything you usually use and report back, so we can complete the stable release soon. If no major problems come up, the next iteration will be the stable release, which is scheduled for end of October.

by Michael Prokop at 09. October 2014, 9:36 Uhr