Skip to content

Instantly share code, notes, and snippets.

View superseb's full-sized avatar

Sebastiaan van Steenis superseb

  • Qdrant
  • Netherlands
  • 21:14 (UTC +02:00)
View GitHub Profile
#!/usr/bin/ruby
# README
# gem install aws-sdk
# add this to bashrc
# export HT_DEV_AWS_ACCESS_KEY_ID=????
# export HT_DEV_AWS_SECRET_ACCESS_KEY=????
# put your pem file in ~/.ssh and chmod 0400
# for more info see; https://rubygems.org/gems/aws-sdk
@superseb
superseb / getIpAddr.rb
Created October 10, 2014 06:08
Custom function getipaddr
require 'resolv'
module Puppet::Parser::Functions
newfunction(:getIpAddr, :type => :rvalue) do |arguments|
result = Resolv.getaddress arguments[0]
unless result.nil?
result
else
raise(Puppet::ParseError, "No valid A Record found for host #{arguments[0]}")
end
@superseb
superseb / gist:bd656c95013b1c7aff29
Last active November 18, 2015 16:46
Docker version orca
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.2
Git commit: 76d6bc9
Built: Tue Nov 3 17:43:42 UTC 2015
OS/Arch: linux/amd64
Server:
Version: orca/0.4.0
@superseb
superseb / gist:9cec3515ae192eae9882
Created November 24, 2015 16:25
DigitalOcean sysdig coreos user-data cloudinit
#cloud-config
coreos:
units:
- name: "sysdig-agent.service"
command: "start"
content: |
[Unit]
Description=Sysdig Cloud Agent
After=docker.service
@superseb
superseb / dockercsducp.sh
Last active December 21, 2015 18:35
Docker CS Engine DUCP Installer Ubuntu
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty testing" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update && sudo apt-get install -y docker-engine
@superseb
superseb / gist:12e7ffd6fc44e05a5ecb
Last active July 11, 2016 09:20
DigitalOcean datadog coreos user-data cloudinit
#cloud-config
coreos:
units:
- name: "dd-agent.service"
command: "start"
content: |
[Unit]
Description=Datadog agent
#cloud-config
coreos:
units:
- name: docker.service
drop-ins:
- name: "50-insecure-registry.conf"
content: |
[Service]
Environment=DOCKER_OPTS='--insecure-registry="10.0.1.0/24"'
@superseb
superseb / xe-guest-utils.yml
Last active May 12, 2017 11:47
rancher xe-guest-utils 7.4.0
xe-guest-utils:
image: superseb/rancher-xe-guest-utils:7.4.0
privileged: true
labels:
- io.rancher.os.scope=system
- io.rancher.os.after=console,docker,udev,syslog
volumes-from:
- "all-volumes"
volumes:
- "/dev:/dev:ro"
@superseb
superseb / info.txt
Created May 18, 2017 13:03
Docker daemon: unregister_netdevice: waiting for lo to become free. Usage count = 1
Related issues:
https://github.com/coreos/bugs/issues/254
https://github.com/moby/moby/issues/5618
There is a workaround implemented by Kubernetes (https://github.com/kubernetes/kubernetes/blob/release-1.6/pkg/kubelet/network/kubenet/kubenet_linux.go#L345) and other Docker-based solutions (flynn: https://github.com/flynn/flynn/commit/9d94ea8e2ad7a626f74ff03cb82e8d0efe1b42b5). The fix is putting the docker0 bridge in promiscuous mode by executing `ip link set docker0 promisc on`.
@superseb
superseb / debug.md
Last active May 19, 2017 10:24
Rancher metadata error self/service self/container
time="2017-05-11T09:03:39Z" level=info msg="Error: /self/service" client=10.42.96.139 version=2015-12-19 
time="2017-05-11T09:03:41Z" level=info msg="Error: /self/container" client=10.42.17.88 version=2015-12-19 
time="2017-05-11T09:03:41Z" level=info msg="Error: /self/service" client=10.42.66.225 version=2015-12-19 

Showing gateway for Docker bridge network: docker network inspect bridge -f "{{range .IPAM.Config}}{{.Gateway}}{{end}}"

All hosts should return the same gateway.