Skip to content

Instantly share code, notes, and snippets.

View proffalken's full-sized avatar

Matthew Macdonald-Wallace proffalken

View GitHub Profile
@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 / 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"
}
/*
RC PulseIn Servos
By: Matthew Macdonald-Wallace
Date: 29/07/2015
HEAVILY BASED ON:
RC PulseIn Joystick
By: Nick Poole
SparkFun Electronics
#!/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
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
@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
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 */;
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")
@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
#
@proffalken
proffalken / gist:5085293
Created March 4, 2013 20:22
Connecting to HPCS and setting hostname via cloud-init
ud = "#cloud-config\nfqdn: " + server_fqdn + "\nhostname: " + hostname + "\nmanage_etc_hosts: true"
# get the image
image_details = self.get_image(image,region)
new_server = self.cx[region].servers.create(hostname,flavor=flavor,image=image_details,key_name=key_name,userdata=ud)