Instantly share code, notes, and snippets.

Scott Moser smoser

  • Cisco
  • US
View GitHub Profile
smoser /
Created Jan 25, 2019
NAT setup on ubuntu through vpn

nat setup through vpn

The goal of this excersise was to connect a system to my desktop system and let it share the vpn.


  • desktop: It has the following interfaces

    • wlp3s0: wireless managed by network manager connected to a wireless network.
    • tun0: a vpn device set up and managed by network manager
    • enp0s25: an unconnected wireless nic.
  • laptop: this system needed wanted to be on the vpn. It has the following interfaces:

smoser /
Last active Dec 10, 2018



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.

smoser /
Last active Nov 28, 2018
fix lxc ZFS filesystem cannot destroy error.

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.

smoser /
Created Nov 5, 2018
test a url for gzip encoding

test gzip encoding of url

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

smoser / 00.cast
Last active Oct 23, 2018
Demo of cloud-init 18.4 features query and render.
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"]
smoser /
Last active Sep 4, 2018
ssh config for oracle cloud vnc/ssh connection

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

smoser / open-iscsi package test
Last active Jul 20, 2018
open-iscsi package test debug information
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

smoser /
Created Jun 17, 2018
A snap (snapcraft.yaml) for pdftk
smoser / 91smoser-schroot-setup
Last active Nov 15, 2018
custom sbuild / schroot setup.
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'
smoser /
Last active Oct 9, 2018
rackspace cli shell wrapper

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: