Goodby Octopress, Welcome Hugo

Migrated from Octopress to Hugo with the help of octohug. It went quite well, with a couple of problems due to multiline titles, or a literal . written as dot by octopress.

I chose the Hugo Flex theme, since it uses no javascript and is quite tiny. To use more screen space, I changed this:

diff --git a/assets/css/base.css b/assets/css/base.css
index 93ee10c..da5a2d1 100644
--- a/assets/css/base.css
+++ b/assets/css/base.css
@@ -104,7 +104,6 @@ code {
 }

 .u-wrapper {
-  max-width: 42rem;
   margin: auto;
 }

Disabled tags and categories in config.yaml:

disableKinds: ["taxonomy", "taxonomyTerm"]

find jenkins jobs for email address

import hudson.tasks.Mailer
import hudson.plugins.emailext.ExtendedEmailPublisher

def mail = 'foo@bar.com'

Jenkins.instance.getAllItems(AbstractItem.class).collect{ Jenkins.instance.getJob( it.fullName ) }.findAll { job ->
  job?.getPublishersList()?.any {
    (it instanceof Mailer && it.recipients =~ mail) || (it instanceof ExtendedEmailPublisher && it.recipientList =~
mail)
  }
}.collect{ it.fullName }

skype and dbus

Is Skype crashing with

Thread 1 "skypeforlinux" received signal SIGSEGV, Segmentation fault.
0x00007ffff49085d0 in _dbus_header_get_byte_order () from /lib/x86_64-linux-gnu/libdbus-1.so.3

Try stopping dbus:

systemctl stop dbus.socket dbus.service

icinga2

Run a command through sudo:

object CheckCommand "sudo_mailq" {
	import "mailq"

	command = [
		"/usr/bin/sudo",
		"/usr/lib/nagios/plugins/check_mailq"
	]
}

immediate shutdown after boot

Is your linux configured to shut down on power button press and immediately shuts down after the next boot?

Use acpi_listen to check if you are getting two events for each button press:

button/power PBTN 00000080 00000000
button/power LNXPWRBN:00 00000080 0000001c

Hack around it by passing the event information to your script /etc/acpi/events/powerbtn:

...
action=../../etc/acpi/powerbtn.sh %e

And reacting only on one /etc/acpi/powerbtn.sh:

...
[ "$2" == "PBTN" ] || exit 0

bash

Is Bash matching lower- and uppercase files seemingly not caring about shopt -u nocaseglob, e.g.:

$ touch foo FOO
$ echo [a-z]*
foo FOO

then set LC_COLLATE to C, see man bash / Pattern Matching / LC_COLLATE:

The sorting order of characters in range expressions is determined by the current locale and the values of the LC_COLLATE or LC_ALL shell variables, if set. To obtain the traditional interpretation of range expressions, where [a-d] is equivalent to [abcd], set value of the LC_ALL shell variable to C, or […]

apt secure and stretch

Has your own repository stopped working for stretch with something like this:

W: GPG error ... Release: The following signatures were invalid: ...
W: The repository ... Release' is not signed.

Check that your Release.gpg files contain sha256 signatures (Hint: --cert-digest-algo,), not sha1.

ccache and cowbuilder

Install ccache on your host, and setup cache folder to 1GiB maximum size:

sudo apt-get install ccache
sudo mkdir /var/cache/ccache
sudo CCACHE_DIR=/var/cache/ccache ccache -M 1G

Prepare hook to install ccache and fixup permissions:

# cat /tmp/ccache/D01ccache
#!/bin/bash

apt-get install ccache

chown -R pbuilder /var/cache/ccache

Prepare config file

# cat /tmp/ccache/env
export CCACHE_DIR=/var/cache/ccache
export PATH=/usr/lib/ccache:$PATH

Build a source package

sudo cowbuilder --build dtach_0.8-2.1.dsc --basepath
/tmp/jessie.amd64.cow --hookdir /tmp/ccache --buildplace /tmp
--bindmounts /var/cache/ccache --configfile /tmp/ccache/env

The --bindmounts option will provide the host’s ccache to cowbuilder, --hookdir installs ccache inside and --configfile actually enables ccache.

Use CCACHE_DIR=/var/cache/ccache ccache -s to checkout cache usage, e.g.

cache directory                     /var/cache/ccache
primary config                      /var/cache/ccache/ccache.conf
secondary config      (readonly)    /etc/ccache.conf
cache hit (direct)                  3492
cache hit (preprocessed)             227
cache miss                          2483
cache hit rate                     59.96 %
called for link                      466
called for preprocessing             114
compile failed                        23
preprocessor error                    36
bad compiler arguments                 6
autoconf compile/link                 85
no input file                         73
cleanups performed                     0
files in cache                      4835
cache size                         567.8 MB
max cache size                       1.0 GB

cups

The only way I got duplex printing to work from the command line:

lp -o sides=two-sided-long-edge foo.pdf