Skip to content

Instantly share code, notes, and snippets.

@dylanratcliffe
dylanratcliffe / task.md
Last active August 28, 2024 16:17
DevOpsDays Antwerp: Change Approval Task

Welcome! Your job is to update an RDS cluster called facial-recognition-terraform-example from 16.3 to 16.4. In order to do this you'll need to raise a change request and get this reviewed by the Chnage Advisory Board (CAB). The template that you must fill in is included below.

Use the Overmind Assistant to help you to fill in the template. When you think you're done, tell us and we'll review to make sure you haven't missed anything.


Change Approval Template (<- Replace this with a description of the change)

Describe your change here, along with why you are making it

Expected Change Duration: How long you expect this to take

@dylanratcliffe
dylanratcliffe / index.html
Created March 25, 2021 13:01
Polar Clock Example
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: #222;
margin: auto;
width: 960px;
}
.field-track,
@dylanratcliffe
dylanratcliffe / sendmail.rb
Created March 11, 2021 09:14
Email sending example
# Puppet::Functions::Sendmail
Puppet::Functions.create_function(:sendmail) do
dispatch :sendmail do
param 'String[1]', :message
param 'String[1]', :sender
param 'String[1]', :recipient
param 'String[1]', :smtp_server
optional_param 'Optional[Integer]', :smtp_port
optional_param 'Optional[String]', :domain_host
optional_param 'Optional[String]', :smtp_user
@dylanratcliffe
dylanratcliffe / passthrough.py
Last active July 14, 2020 20:25
Relay Generic Webhook passthrough
#!/usr/local/bin/python3
from relay_sdk import Interface, WebhookServer
from quart import Quart, request, jsonify, make_response
import logging
relay = Interface()
app = Quart('incident-triggered')
logging.getLogger().setLevel(logging.INFO)
@dylanratcliffe
dylanratcliffe / API.json
Last active July 15, 2019 14:55
Example API
{
"profile::base::linux::extra_packages": [
"dstat",
"lsof",
"httpd"
]
}
@dylanratcliffe
dylanratcliffe / choco_internal.md
Created February 27, 2019 11:32
Chocolatey Internalisation

Internalizing Chocolatey Packages

In order for packages from the public chocolate feed to be used within your environment they must be internalized. This involved packing any binaries that the package may require into the .nupkg file itself to stop Chocolatey form trying to reach out to the internet. This internalizing process can be completed manually using the process below or automatically using the Chocolatey for Business edition.

The process for manually internalizing packages is as follows:

  1. Download the nupkg file from chocolatey.org
  2. Rename the package to .zip and extract
  3. Delete the extra folders and files that are generated as part of packaging: - _rels/
@dylanratcliffe
dylanratcliffe / singapore.md
Last active November 13, 2019 08:49
Singapore places to go

Singapore Places To Go 🦁

Cocktails 🍸

Employees only: cocktails, good

Bitters & Love: Cocktails and good vibes. The bartenders should be wearing badges that say "I ❤️ Dylan".

ATLAS: 8th best bar in the world apparently, definitely the most impressive I've ever seen. Good for date night. Gin and Champagne range is unmatched

@dylanratcliffe
dylanratcliffe / odd.markdown
Created October 29, 2015 00:59
Weird puppet stuff...

While looking at the catalogs generated by including, containment and inheritance, I found that the include statement has some unintended consequences with relation to automatic tags. In puppet resources and classes are tagged with a few things automatically.

  • Its resource type
  • The full name of the class and/or defined type in which the resource was declared
  • Every namespace segment of the resource’s class and/or defined type

In the case of a class/resource which is contained within a class "tags are passed along by containment" which means that "a resource will receive tags from all of its containers", not just the class it is defined within. Although the use of the include statement does not affect containment as can be evidenced by looking at the containment graph in the catalog or enterprise console, it does however affect the automatic tags that are applied to each resource. We can demonstrate this using the puppet master --compile command to generate two catalogs, one using include and a

@dylanratcliffe
dylanratcliffe / composition.json
Created October 28, 2015 05:31
Catalog using inheritance vs composition
{
"tags": ["settings","scope::child","scope","child","scope::parent","parent","class"],
"name": "test",
"version": 1446010032,
"environment": "production",
"resources": [
{
"type": "Stage",
"title": "main",
"tags": ["stage"],
#require 'spec_helper_acceptance'
require 'spec_helper'
#require 'beaker-rspec'
require 'puppet'
provider_class = Puppet::Type.type(:virtual_machine).provider(:virtualbox_vm)
describe provider_class do
let :resource do
Puppet::Type::Virtual_machine.new(
{