Skip to content

Instantly share code, notes, and snippets.

View aschmidt75's full-sized avatar

Andreas Schmidt aschmidt75

View GitHub Profile
@aschmidt75
aschmidt75 / testing docker setup with cucumber
Last active December 20, 2015 08:19
ideas for cucumber-defining and -testing vagrant vms and docker containers
Scenario: Vagrant/Docker Setup
Given a host with 'vagrant' installed
When i run vagrant
Then it should have a vm named 'default'
And it should have a vm named 'web'
And it should have a vm named 'app'
Scenario: Docker Images in web server
Given a vm named 'web'
Then it should have docker installed
@aschmidt75
aschmidt75 / vimcoloringpuppet
Last active August 29, 2015 14:00
install vim plugins for puppet, suitable for vagrant shell provisioning
# install vim magic
sudo apt-get -y install vim
mkdir -p /home/vagrant/.vim/bundle
mkdir -p /home/vagrant/.vim/autoload
chown -R vagrant:vagrant /home/vagrant/.vim
cd /home/vagrant/.vim/bundle
git clone git://github.com/scrooloose/syntastic.git
cd /home/vagrant/.vim/autoload
wget https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
# patch in pathogen to vimrc
@aschmidt75
aschmidt75 / specinfra_nsenter_prototype
Created September 6, 2014 20:17
Serverspec/Specinfra backend for nsenter
require 'specinfra/backend/exec'
require 'open3'
module SpecInfra
module Backend
class Nsenter < Exec
def run_command(cmd, opt={})
cmd = build_command(cmd)
cmd = add_pre_command(cmd)
ret = nsenter_exec!(cmd)
@aschmidt75
aschmidt75 / serverspec2_playground_vagrantfile
Created October 10, 2014 09:57
serverspec2_playground_vagrantfile, to test aschmidt75/specinfra/integrate_docker_resource_type and aschmidt75/serverspec/integrate_docker_resource_type
Vagrant.configure("2") do |config|
config.vm.box = "trusty64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.define "serverspec2-playground", primary: true do |s|
s.vm.synced_folder "spec.d/", "/mnt/spec.d"
# install & run serverspec
s.vm.provision 'shell', inline: <<EOS
sudo apt-get update -yqq

Keybase proof

I hereby claim:

  • I am aschmidt75 on github.
  • I am aschmidt75 (https://keybase.io/aschmidt75) on keybase.
  • I have a public key whose fingerprint is 25F0 C870 FECD 702B F177 A46A 95F1 6A5F 4AB3 57AD

To claim this, I am signing this object:

@aschmidt75
aschmidt75 / gs-pastie-example swarm.json
Created December 19, 2014 12:27
gs-pastie-example swarm.json
{
"app_name": "grafana-pastie-example",
"services": [
{
"service_name": "grafana-pastie",
"components": [
{
"component_name": "gs-rdb",
"image": "dockerfile/rethinkdb",
"ports": [ "8080/tcp", "28015/tcp", "29015/tcp" ]
@aschmidt75
aschmidt75 / docker_tls_example_spec.rb
Created January 27, 2015 15:21
#serverspec example for testing a docker TLS-only setup. Checks key, certificates, configuration, runtime
require 'spec_helper.rb'
# The MIT License (MIT) andreas@de-wiring.net
# This serverspec ensures that
# - tls is configured in docker defaults file
# - certs and keys are present and valid (using openssl verify)
# - dockerd is listing on TLS port
# - there is no activity on docker socket (tls only)
# - that a connection is TLS-secure (using openssl s_client)
@aschmidt75
aschmidt75 / serverspec_openvswitch
Created March 3, 2015 16:47
sample serverspec snippet for testing openvswitch bridges
describe ovs_bridge 'port.47' do
it { should exist } # br-exists
it { should be_tagged } # br-to-vlan != 0
its(:tag) { should eq 47 } # br-to-vlan
its(:parent) { should eq 'trunk0' } # br-to-parent
it { should have_interfaces } # list-ifaces
end
@aschmidt75
aschmidt75 / virttest.te
Created March 17, 2015 11:54
cut down selinux module, based off svirt_lxc_net_t
policy_module(virttest, 1.0);
gen_require( type svirt_sandbox_file_t; )
gen_require( type svirt_lxc_mynet_t; )
gen_require( type virt_lxc_var_run_t; )
gen_require( attribute sandbox_net_domain; )
########################################
#
# svirt_lxc_mynet_t local policy
@aschmidt75
aschmidt75 / keybase.md
Created September 20, 2016 13:51
keybase.md Sept 2016

Keybase proof

I hereby claim:

  • I am aschmidt75 on github.
  • I am aschmidt75 (https://keybase.io/aschmidt75) on keybase.
  • I have a public key ASDF26fy0u6wSwNTtR9kgKSUM5nBbGu2z7Lpd80bfNmi1Qo

To claim this, I am signing this object: