Skip to content

Instantly share code, notes, and snippets.

@Dude4Linux
Dude4Linux / test-dnsmasq
Last active July 21, 2016 03:51
Test dnsmasq with LXC containers
#!/bin/bash
#
# test-dnsmasq
#
app="wordpress"
container="${app}-container"
domain="${app}.local.lxc"
LEASES="/var/lib/misc/dnsmasq.leases"
release_lease() {
@Dude4Linux
Dude4Linux / test-lxc-destroy
Created December 15, 2015 16:29
Testing the effects of releasing the dhcp lease when a container is destroyed
#!/bin/bash
#
# test-dnsmasq
#
app="wordpress"
container="${app}-container"
domain="${app}.local.lxc"
LEASES="/var/lib/misc/dnsmasq.leases"
release_lease() {
@Dude4Linux
Dude4Linux / turnkey-test-app.yml
Created January 6, 2016 14:45
turnkey-test-app
---
- name: Test a TurnKey appliance
hosts: lxc
gather_facts: false
vars:
host_key_checking: false
ssh_user: '{{lookup("env", "USER")}}'
ssh_key: '{{lookup("file", "~/.ssh/id_rsa.pub")}}'
@Dude4Linux
Dude4Linux / turnkey-setup
Created April 28, 2016 19:44
Apply my personal customizations to a freshly install TurnKey appliance
#! /bin/bash
# ---------------------------------------------------------------------------
# turnkey-setup - Setup and configure a freshly installed TurnKey appliance
# Install ssh key for automated remote login
# Install vim-nox
# Setup additional bash aliases
# Copyright 2013, John Carver <dude4linux@gmail.com>
##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Results from version 2.0.1.0 (passed)
```
TASK [Test appliance webmin] ***************************************************
task path: /home/ansible/playbooks/webmin-test.yml:139
<lxc> ESTABLISH SSH CONNECTION FOR USER: root
<lxc> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r -tt lxc '/bin/sh -c '"'"'mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122 `" && echo "` echo ~/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122 `"'"'"''
<lxc> PUT /tmp/tmpJw5Mg0 TO /root/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122/uri
#!/bin/bash
# lxc-turnkey - Template for TurnKey GNU/Linux appliances
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# Modified for TurnKey GNU/Linux: