Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
@leedm777
leedm777 / AnsibleVaultDiff.md
Last active January 2, 2024 08:50
Ansible vault diff in Git

Normally, when you diff an [Ansible vault][], all you see is gibberish.

$ git diff -- group_vars/all/vault.yml
diff --git a/group_vars/all/vault.yml b/group_vars/all/vault.yml
index 245ccf4..90bf9ee 100644
--- a/group_vars/all/vault.yml
+++ b/group_vars/all/vault.yml
@@ -1,111 +1,111 @@
 $ANSIBLE_VAULT;1.1;AES256
@leedm777
leedm777 / swagger-type-variance.md
Last active December 13, 2021 08:19
Type variance in Swagger models

This document describes how to extend Swagger data models to allow the types of fields to vary.

Given that Swagger models need to map cleanly to a statically typed object model, a subclassing approach seems like it would be a good fit.

Inheritance

Inheritance allows a model (the derived type) to inherit all of the

@leedm777
leedm777 / app_hello.c
Created October 22, 2012 11:53
Asterisk's simplest application
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2012, Digium, Inc.
*
* David M. Lee, II <dlee@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
-----BEGIN CERTIFICATE-----
MIIEqjCCA5KgAwIBAgIJAK6evcd7BmtQMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCQUwxEzARBgNVBAcTCkh1bnRzdmlsbGUxFTATBgNV
BAoTDERpZ2l1bSwgSW5jLjEMMAoGA1UECxMDU1NPMRswGQYDVQQDExJzdGFnaW5n
LmRpZ2l1bS5jb20xITAfBgkqhkiG9w0BCQEWEm1icm9va3NAZGlnaXVtLmNvbTAe
Fw0xMzAyMDEwNDUyNTBaFw0yMzAyMDEwNDUyNTBaMIGUMQswCQYDVQQGEwJVUzEL
MAkGA1UECBMCQUwxEzARBgNVBAcTCkh1bnRzdmlsbGUxFTATBgNVBAoTDERpZ2l1
bSwgSW5jLjEMMAoGA1UECxMDU1NPMRswGQYDVQQDExJzdGFnaW5nLmRpZ2l1bS5j
b20xITAfBgkqhkiG9w0BCQEWEm1icm9va3NAZGlnaXVtLmNvbTCCASIwDQYJKoZI
hvcNAQEBBQADggEPADCCAQoCggEBAMo0mSDdZCgjcF4ntlh207Ncz4QnYD78Wa1Q
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_b33cb8126c3354c8b911aede0cc0233a20ae4c834f" Version="2.0" IssueInstant="2021-10-20T16:10:24Z" Destination="http://localhost:3000/saml/consume" InResponseTo="_8cba835e975fafe849fe"><saml:Issuer>https://idp.staging.digium.com/simplesaml/saml2/idp/metadata.php</saml:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_b33cb8126c3354c8b911aede0cc0233a20ae4c834f"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>RueWveZxD9XficqDjUa17cGQZDU=</ds:DigestValue></ds:Reference
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_5374c53f02acf8540b710c2094de44cdd3c81299e1" Version="2.0" IssueInstant="2021-10-20T16:09:02Z" Destination="http://localhost:3000/saml/consume" InResponseTo="_3fed94d9fcc6cc4e9ff0"><saml:Issuer>https://idp.staging.digium.com/simplesaml/saml2/idp/metadata.php</saml:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_5374c53f02acf8540b710c2094de44cdd3c81299e1"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>pVwks5IkJxMIOkDhA7vzfWia84I=</ds:DigestValue></ds:Reference
@leedm777
leedm777 / docker-run-ssh.sh
Created August 12, 2015 15:29
Run docker, forwarding your SSH agent into the container
#!/bin/sh
#
# Forwards SSH agent into a Docker container running in the active
# docker-machine
#
PROGNAME=$(basename $0)
NAME=$(docker-machine active)
npm info it worked if it ends with ok
npm verb cli [ '/Users/dlee/.nodenv/versions/8.11.3/bin/node',
npm verb cli '/Users/dlee/.nodenv/versions/8/bin/npm',
npm verb cli '-dd',
npm verb cli 'install' ]
npm info using npm@6.1.0
npm info using node@v8.11.3
npm verb npm-session b5d5a20baa7452b8
npm info lifecycle @~preinstall: @
npm timing stage:loadCurrentTree Completed in 11ms
commit 9b78a4bf59d87412ae29a1af918f345182502309
Author: David M. Lee <dlee@respoke.io>
Date: Wed Dec 27 23:47:14 2017 -0600
Various fixes for macOS
* Removed bundle1.o and macosx-version-min. This is unnecessary, and
become dated more quickly than we update macOS support (10.6 has been
EOL for over three years)
* Add some explicit casting to fix clang errors/warnings
@leedm777
leedm777 / git-all.sh
Created November 10, 2017 17:46
Run a git command on lots of repos
#!/bin/bash
#
# Run git commands on all the repos
#
GREEN='\033[0;32m'
NC='\033[0m' # No Color
faketty() {