Skip to content

Instantly share code, notes, and snippets.

View proffalken's full-sized avatar

Matthew Macdonald-Wallace proffalken

View GitHub Profile
@proffalken
proffalken / cloud.rb
Created March 6, 2013 08:26
put this in /etc/chef/ohai_plugins
#
# Author:: Cary Penniman (<[email protected]>)
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
import sys
import logging.config
import logging
import os.path
LOGGING_CONF=os.path.join(os.path.dirname(__file__),
"logging.ini")
logging.config.fileConfig(LOGGING_CONF)
fallthrough = logging.getLogger("root")
This file has been truncated, but you can view the full file.
-- MySQL dump 10.13 Distrib 5.5.32, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: rail_tmp
-- ------------------------------------------------------
-- Server version 5.5.32-0ubuntu0.13.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@proffalken
proffalken / logging.conf
Last active August 29, 2015 13:57
Raven Stacktrace
[loggers]
keys = root, iso8601, nova, amqplib, sqlalchemy, suds, eventlet.wsgi, nova.openstack.common.rpc.amqp, nova.scheduler.filters.retry_filter, nova.scheduler.filters.image_props_filter, nova.scheduler.filters.disk_filter, nova.servicegroup.drivers.db, nova.servicegroup.api, nova.scheduler.host_manager, root
[handlers]
keys = sentry, watchedfile
[formatters]
keys = context, default
[logger_root]
qualname = root
level = DEBUG
from flask import Flask, render_template
import pygerrit
app = Flask(__name__)
app.config.from_object('config')
@app.errorhandler(404)
def not_found(error):
return render_template('404.html'), 404
#!/bin/bash
## Thanks to https://gist.github.com/xurizaemon for sorting this version out for me! :)
DEB_OR_UBU=$(lsb_release -ds | cut -d " " -f 1)
INSTALLED_VERSION=$(dpkg -s libc6 | grep Version | awk '{ print $2 }')
FIXED_VERSION=""
if [ "$DEB_OR_UBU" == "Ubuntu" ]; then
UBUNTU_RELEASE=$(lsb_release -sr | cut -d '.' -f 1)
case $UBUNTU_RELEASE in
/*
RC PulseIn Servos
By: Matthew Macdonald-Wallace
Date: 29/07/2015
HEAVILY BASED ON:
RC PulseIn Joystick
By: Nick Poole
SparkFun Electronics
@proffalken
proffalken / HostedServices.tf
Last active May 11, 2018 13:01
Terraforming with Azure
resource "azure_hosted_service" "azure_test_nat" {
name = "azure_test_nat"
location = "North Europe"
ephemeral_contents = false
description = "Nat Gateway Hosted service created by Terraform."
label = "azure_test_nat"
}
@proffalken
proffalken / WebHostedService.tf
Last active April 13, 2016 05:53
Terraforming with Azure Part 2
resource "azure_hosted_service" "azure_test_web" {
name = "azure_test_web"
location = "North Europe"
ephemeral_contents = false
description = "Consul Hosted service created by Terraform."
label = "azure_test_web"
}
@proffalken
proffalken / gist:a0c67a430f75b6548fb5
Created October 14, 2015 15:07
Docker Ansible TestKitchen CI Thoughts
Ansible insists on using SystemD when running on Centos7, Docker and SystemD don't play well together, especially if you start to introduce DBUS into the mix as well (firewalld I'm looking at you!).
This is totally understandable as Docker is effectively a replacement for systemd (I know that's not strictly accurate, but for now it will suffice!)
The primary issue is that Ansible assumes that the process manager (upstart/sysV/SystemD) will be PID 1 and in Docker that's not going to be the case because it's a container meaning that we need to do shitty things like passing "use_docker" as an ansible extra var and then enable/disable in tasks appropriately, working around out testing infrastructure defeating the whole point of having it
I don't doubt that Docker is great for testing standalone applications or containers where you are only running Apache/MySQL/whatever but to test Ansible plays seems to be difficult because Ansible expects to see a system process manager and Docker doesn't have one :simple_smi