Skip to content

Instantly share code, notes, and snippets.

View trinitronx's full-sized avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
.[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

@trinitronx
trinitronx / iterm_open_with
Last active June 26, 2021 01:19 — forked from sos4nt/iterm_open_with
Semantic history command for iTerm2 and Sublime Text 3. Allows iTerm integration of Command+Click to open a file in default app (if non-text), or Sublime Text with optional line number and column. Detects relative paths based on PWD.
#!/bin/sh
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file
# For usage with iTerm2:
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2".
# Usage: iterm_open_with $(pwd) filename [linenumber]
# $(pwd) = current working directory (either use `pwd` or $PWD)
# filename = filename to open
# lineno = line number
pwd=$1
PLAY [test-kitchen] ***********************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [altermn.rvm | include install type vars] *******************************
ok: [localhost] => {"ansible_facts": {"rvm_init_script": "/etc/profile.d/rvm.sh", "rvm_root": "/usr/local/rvm"}}
TASK: [altermn.rvm | ensure necessary yum packages are installed] *************
skipping: [localhost]