Instantly share code, notes, and snippets.




backdoor-image can be used to easily add user with passwordless sudo access to a image or a root filesystem.

Operating on an image requires the 'mount-image-callback' tool from cloud-utils. That can be installed on ubuntu via apt-get install -qy cloud-image-utils.


Fix LXD error when cannot destroy filesystem dataset busy

Sometimes lxd with zfs gets hosed in a way that:

$ lxc delete --force golden-piranha
Error: Failed to destroy ZFS filesystem: cannot destroy 'default/containers/golden-piranha': dataset is busy

The script lxcl-fix-filesystem-busy below helps to fix that.


test gzip encoding of url

This is a simple PASS / FAIL test indicating if a url is providing gzip encoded content.

View 00.cast
{"version": 2, "width": 80, "height": 28, "timestamp": 1540250091, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
[0.020481, "o", "\u001b[3J\u001b[H\u001b[2J"]
[0.026851, "o", "\u001b]0;ubuntu@b1 \u0007\u001b[01;32mubuntu@b1\u001b[00m\u001b[01;34m\u001b[00m$ "]
[0.820281, "o", "c"]
[0.973717, "o", "a"]
[1.061033, "o", "t"]
[1.146492, "o", " "]
[1.265701, "o", "i"]
[1.316542, "o", "n"]
[1.445377, "o", "t"]

Oracle cloud ssh config for using console access.

Oracle cloud provides serial console access to both bare metal and virtual machines. This is very helpful. Access is provided over ssh, and looks something like:

ssh \
    -o ProxyCommand='ssh -W %h:%p -p 443' \

If you looked away and left the console inactive for a while you might try to

View open-iscsi package test

open-iscsi package test debug

This is how you can run the open-iscsi tests more piecemeal

Much of this is taken from the 'testing manually' section in debian/tests/

Start a uvt-kvm guest to do your test in

View 91smoser-schroot-setup
# This is /etc/schroot/setup.d/91smoser
# I use it to apply local updates to schroots.
# make sure it is executable (chmod +x).
# Things it does:
# a.) uses rather than
# my systems just use this, and then the proxy has that.
# b.) sets proxy inside. If apt proxy is configured outside, it will
# apply that inside.
# c.) uses a portion of 'apt-go-fast'

Rackspace CLI wrapper

Figuring out how to use the openstack CLI tools ('nova', 'oscli' or 'openstack') with rackspace was quite non-obvious. Perhaps I was missing some documentation.

This is just a simple wrapper to set my creds for interaction with the openstack cli tools to interact with rackspace. I have similar wrappers for other clouds (vexxhost, server-stack, runabove, dreamcompute).

The values here have worked for me with on Rackspace public cloud with 18.04 versions of 'swift', 'openstack, and 'nova' as of 2018-04-20. In a fresh lxd container:


Softlayer / IBM Cloud notes and tools

These are primarily useful for developing the IBM Cloud datasource.

See also cloud-init's qa-scripts/bin/launch-softlayer which can launch softlayer instances in either 'template' mode or 'os_code'.