Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
Name: monitoring-influxdb-123456789-ab123
Namespace: kube-system
Node: ip-12-34-56-78.ec2.internal/12.34.56.78
Start Time: Thu, 02 Mar 2017 13:07:11 -0700
Labels: k8s-app=influxdb
pod-template-hash=123456789
task=monitoring
Status: Running
Controllers: ReplicaSet/monitoring-influxdb-123456789
@trinitronx
trinitronx / pip_list_available_package_versions.py
Created February 7, 2017 17:50
Pip list all versions of a package that are available
import json
import urllib2
from distutils.version import StrictVersion
from distutils.version import LooseVersion
def versions(package_name):
url = "https://pypi.python.org/pypi/%s/json" % (package_name,)
data = json.load(urllib2.urlopen(urllib2.Request(url)))
versions = data["releases"].keys()
try:
.[2017-01-06T03:21:56-07:00] WARN: Invalid Ableton Live Option detected! Refusing to write this one to Options.txt!
[2017-01-06T03:21:56-07:00] WARN: Invalid Option: FooBarBazInvalid
[2017-01-06T03:21:56-07:00] WARN: Invalid Ableton Live Option detected! Refusing to write this one to Options.txt!
[2017-01-06T03:21:56-07:00] WARN: Invalid Option:
..[2017-01-06T03:21:56-07:00] WARN: AVID CoreAudio is installed! You may encounter problems with Native Instruments hardware and AVID drivers!
[2017-01-06T03:21:56-07:00] WARN: NI knows about this issue, for more information see: http://www.native-instruments.com/en/support/knowledge-base/show/3163/mac-os-x-10.10-yosemite-compatibility-news/
.[2017-01-06T03:21:56-07:00] WARN: AVID CoreAudio is installed! You may encounter problems with Native Instruments hardware and AVID drivers!
[2017-01-06T03:21:56-07:00] WARN: NI knows about this issue, for more information see: http://www.native-instruments.com/en/support/knowledge-base/show/3163/mac-os-x-10.10-yosemite-compatib
#!/usr/bin/python
''' Not my script, found on the Internet, and rediscovered on my hard drive
'''
import sys
def cidr_to_regex(cidr):
ip, prefix = cidr.split('/')
base = 0
for val in map(int, ip.split('.')):
@trinitronx
trinitronx / Dockerfile
Last active October 11, 2017 13:20
test-kitchen SystemD + DBus Dockerfile
FROM debian:8.1
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y sudo openssh-server curl lsb-release
# test-kitchen user setup
@trinitronx
trinitronx / keybase-verify-signing-key-sig.sh
Last active May 25, 2020 00:51
Script to Verify My Software Signing Key & Keybase Identity
#!/bin/bash
KEYBASE_USERID=trinitronx
GPG_PUBKEY_URL="https://keybase.io/trinitronx/key.asc"
SIGCHAIN_LINK="271330c45423cd997dafdc3f355c9575c0e6213aeb464596a457995ba0ae89110f"
THIS_SCRIPT_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh"
THIS_SCRIPT_KEYBASE_SIGNATURE_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh.keybase.sig.asc"
THIS_SCRIPT_GPG_SIGNATURE_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh.gpg.sig.asc"
echo "This script requires that curl, gpg2, and jq are installed"
@trinitronx
trinitronx / gist:8b80f2e2529b9bc32bf70af01b59033a
Created June 10, 2016 19:00 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@trinitronx
trinitronx / gpg-agent.conf
Created May 12, 2016 05:53 — forked from nl5887/gpg-agent.conf
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@trinitronx
trinitronx / keybase.md
Created March 28, 2016 22:43
Keybase identity proof

Keybase proof

I hereby claim:

  • I am trinitronx on github.
  • I am trinitronx (https://keybase.io/trinitronx) on keybase.
  • I have a public key whose fingerprint is 177C AEC0 0C77 B281 2AD2 886F 1ABA 4874 3609 41DA

To claim this, I am signing this object:

Running the a playbook to create an EC2 host, I find that there is a race condition for Ansible to be able to connect to the host.

Both wait_for and shell: echo host_is_up (with retry / do..until loop) tasks are not enough to avoid hitting the race condition where Ansible fails to SSH.

Running the play shows that the "Wait for SSH" task completes successfully, and the initial connect for the "Wait up to 10mins for potential cloud-init sshd race condition" task fails completely without retrying as I had expected:

$ export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST
$ export AWS_ACCESS_KEY=$AWS_ACCESS_KEY_ID
$ export AWS_SECRET_ACCESS_KEY=1234567890abcdefghijklmnopqrstuvwxyzABCD

$ export AWS_SECRET_KEY=$AWS_SECRET_ACCESS_KEY