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

firefox

Firefox’s Web Content using 50% CPU? Close that Google Search Result tab.

kvm

Getting the discard operation is not supported when running fstrim on a kvm guest? Make sure to

  • use virtio-scsi
  • pass discard='unmap' to the disk driver
  • use a machine type >= 2.1, e.g. pc-i440fx-2.3

stretch without systemd

Following http://without-systemd.org/wiki/index.php/Debian_Stretch and adding a pin on *systemd* will lead to libvirt-daemon-system being uninstalled though (dependency chain: libvirt-daemon-system -> polkit -> libpam-systemd).

It is possible to build rebuild polkit without systemd, see https://github.com/bidaian/no-systemd, but that means tracking another package diversion.

An alternative solution is to just not use systemd as init, put keep the other packages installed:

apt-get install sysvinit-core sysvinit-utils
apt-get remove --purge systemd-sysv

windows7 qlx bsod

A recent Windows 7 installation started crashing with a Bluescreen of Death after installing the qlx driver inside the guest. Switching back to the vga model allowed me to boot it again:

<video>
  <model type='vga' vram='16384' heads='1' primary='yes'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>

install terminator on a minimal centos 7

To remotly start terminator on a minimal CentOS install these packages:

yum install terminator xauth dbus-x11.x86_64 dejavu-sans-fonts.noarch dejavu-sans-mono-fonts.noarch

Without the font packages you’ll only see boxes.

ssh x11 forwarding fails on ipv4 only host

If ssh -X fails with X11 forwarding request failed on channel 0 when connecting to an IPv4 only host, check your /etc/ssh/sshd_config for AddressFamily inet:

Specifies which address family should be used by sshd(8). Valid arguments are “any”, “inet” (use IPv4 only), or “inet6” (use IPv6 only). The default is “any”.