Skip to content

Instantly share code, notes, and snippets.

View matburt's full-sized avatar
😄

Matthew Jones matburt

😄
View GitHub Profile
// For compilers that support ranges in case statements
// remember, if a case doesn't have a break then it will fall through to the next one.
switch (age) {
case 21:
printf("You are old enough to drink");
case 18 ... 20:
printf("You are old enough to vote");
case 16 ... 17:
printf("You are old enough to drive");
@matburt
matburt / Containerfile.yml
Created June 5, 2023 20:00
An opa policy and Containerfile sidecar definition for use with ansible-runner runtime policy evaluation experiements
version: '3.7'
volumes:
opa_data:
driver: local
networks:
opa:
driver: bridge
@matburt
matburt / mod-list.json
Last active November 3, 2022 00:16
Factorio Space Exploration Mods
{
"mods":
[
{
"name": "base",
"enabled": true
},
{
"name": "space-exploration",
@matburt
matburt / execution-environment.yml
Created May 18, 2022 13:51
EE to add the awx sample collection from ansible/ansible-tower-samples to a basic EE derived from awx-ee:latest
---
version: 1
build_arg_defaults:
EE_BASE_IMAGE: 'quay.io/ansible/awx-ee:latest'
additional_build_steps:
append:
- ADD awx-sample-1.0.0.tar.gz /ansible-tower-sample-1.0.0.tar.gz
- RUN ansible-galaxy collection install /ansible-tower-sample-1.0.0.tar.gz
@matburt
matburt / Dockerfile
Created August 24, 2021 16:15
.devcontainer for ansible runner
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/codespaces-linux/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/universal:1-focal
RUN pip3 install --user ansible
USER root
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install python3-pexpect
USER codespace
FROM registry.access.redhat.com/ubi8/python-36
USER root
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /bin/tini
RUN pip3 install git+https://github.com/ansible/ansible-runner
RUN pip3 install git+https://github.com/ansible/ansible
RUN chmod +xr /bin/tini
@matburt
matburt / test.yml
Last active May 21, 2018 14:05
pausing playbook
---
- name: Test play 1
hosts: all
tasks:
- shell: sleep 60
- shell: sleep 60
- name: Test play 2
hosts: all
tasks:
- shell: sleep 60
@matburt
matburt / gist:446b832f2bc939b50c6180c4b98785fd
Last active December 16, 2017 01:28
valgrind on python's deepcopy
$ valgrind --tool=massif python -c "from copy import deepcopy; deepcopy(dict(foo='bar'))"
==1322== Massif, a heap profiler
==1322== Copyright (C) 2003-2015, and GNU GPL'd, by Nicholas Nethercote
==1322== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==1322== Command: python -c from\ copy\ import\ deepcopy;\ deepcopy(dict(foo='bar'))
==1322==
==1322==
$ ms_print massif.out.1319 > ms.1319
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matburt
matburt / test.ipynb
Created December 6, 2017 03:40
AWX Jupyter Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.