Oct 15,
2018

Docker Tip

Greetings Interweb surfers!

I'm using Docker more as a replacement of a virtual machine to compile packages in a clean environment than a containerization tool like it was designed, as for example a bare Docker Debian image is faster to download than the equivalent VirtualBox.

One thing that used to frustrate me was that sometimes, when attached to the console, the shell somewhat stopped and required an extra "enter" to continue. I never really paid close attention at what I was typing in those moments, my habit is to press Ctrl-p to browse the command history instead to reach for the cursor movement keys and that has become second nature to me that I do it without realizing.

It was driving me crazy.

(ノಠ益ಠ)ノ彡┻━┻

At first I thought I was unknowingly sending the flow-control stop signal, i.e. what's usually bound to the Ctrl-s combination1. It turned out I was way off target as Docker uses the Ctrl-p Ctrl-q keys sequence to detach from a running container's console.

So all I need was to put a saner sequence in the ~/.docker/config.json file, like the one I use below:

{
  "detachKeys": "ctrl-@,ctrl-q"
}

or remember to add the --detach-keys options when attaching to a container:

$docker start --detach-keys="ctrl-@,ctrl-q" -ai container_name

I can infer that all Docker developers either use the Vi shell binding or they reach for the cursor keys...


  1. at the time I tought it was some bizzarre interaction between the Bash running in Docker and my Zsh configuration ↩︎

 
 

Sep 25,
2018

Managing Applications Installed From Source Using Stow

Hello random person from the Interweb!

I've started to use GNU Stow to install application from source and decided to post about it. Paraphrasing from the description on its home-page, Stow permits to install distinct applications from sources in the same place using a tangle of symbolic links, so the big software package that want to be installed to /usr/local acts as it's the only one installed.

The gist of it consists to configure the application to be installed under a common path called the Stow dir1, compiling/installing it as usual and finally invoking Stow to create the required links to add binaries, libraries and eventual man pages to the corresponding paths.

To "remove" a previously installed application Stow should be invoked with the -D option followed by the application directory. This will only remove the symbolic links, the application directory is still available with all the binaries, to revert the operation.

$ stow generic-application-2.0
$ stow -D generic-application-2.0

For ease of use, I've added the Stow and target paths to my ~/.stowrc file:

--dir=/usr/local/stow
--target=/usr/local

in this way I can "install" and "remove" applications without cd-ing to the Stow directory before invoking it.

Colophon

The above covers basically the 90% of it's usage, at least for my use case. For details like for example, resolving conflicts or the chstow target dir maintenance tool, the documentation is the usual resource.

I should spend some time pondering if it would be better to stuck stuff in my home dir instead of /usr/local/, for starter my home partition is usually the biggest one and being the only user on my systems I don't have advantages in storing applications under /usr/local.


  1. in my case I've decided to use /usr/local/stow, how original... ↩︎

 
 

Aug 06,
2018

Gnome Header Bars

Greetings Netizens!

Today I've spent a couple of minutes of my busy day to scratch an itch I had regarding Gnome, in particular the CSD or Client Side Decorations. When they were introduced I didn't payed enough attention, well other than noticing how ugly Gtk2 applications look now.

Somewhat I confused CSD with Header Bars, the new windows' title-bar with embedded buttons, so searching on "how to operate those title-bar buttons without a mouse" using only the keyboard1 wasn't an immediate thing to do.

The question above is about enabling Bluetooth when your Bluetooth mouse is paired to your PC but it's not yet connected.

Well, there is a web page that lists all the keybindings and I'm quite sure I've read it in the past; what I probably missed is that F10 is used as default to give focus to the menu bar or header bar menu.

“ヽ(´▽`)ノ”

Next time it happens I'm sure I wouldn't need to find a spare USB wired mouse.

By the way, I noticed the gvfs (Gnome Virtual File System) daemon tends to spam the log with errors if the samba-common package isn't installed2.


  1. my opinion about touchscreens on notebook is very unpolite so it's better to not ask ↩︎

  2. it's included in the suggested packages, but usually I seldom install them if I don't need them actively ↩︎