Skip to content

Instantly share code, notes, and snippets.

⌨️
tappity tap.

Tristan tristanmorgan

⌨️
tappity tap.
Block or report user

Report or block tristanmorgan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tristanmorgan
tristanmorgan / .terraformrc
Created Jul 24, 2019
Terraform Enterprise Token Helper (save into macOS keychain)
View .terraformrc
disable_checkpoint = true
credentials_helper helper {
args = []
}
# save this in home.
@tristanmorgan
tristanmorgan / basic.rb
Created Dec 19, 2018
lib/thor/line_editor/basic.rb - print stars for no-echo input
View basic.rb
class Thor
module LineEditor
class Basic
attr_reader :prompt, :options
def self.available?
true
end
def initialize(prompt, options)
@tristanmorgan
tristanmorgan / ssh-config
Last active Mar 14, 2019
ssh/config with proxy environment switch.
View ssh-config
Host *
StrictHostKeyChecking no
ServerAliveInterval 60
FingerprintHash md5
VisualHostKey yes
ControlPath /tmp/%r@%h:%p
IdentityFile ~/.ssh/id_rsa
Host github.com
ControlMaster auto
@tristanmorgan
tristanmorgan / vault-token-helper.sh
Last active May 1, 2019
HashiCorp Vault token-helper script using the Mac keychain.
View vault-token-helper.sh
#!/bin/sh
set -e
[ -z "$VAULT_ADDR" ] && VAULT_ADDR="https://127.0.0.1:8200"
case $1 in
store)
security add-generic-password -U -a "VAULT-$USER" -c "hvlt" -C "hvlt" -D "Hashicorp Vault" -s "$VAULT_ADDR" -w "$(cat)"
;;
get)
View awscli-Dockerfile
FROM alpine:latest
LABEL maintainer="Tristan Morgan <tristan@vibrato.com.au>"
LABEL Description="AWS-CLI in a minimal container"
ARG AWS_CLI_VERSION=1.14.42
RUN apk add --no-cache python3 groff \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install awscli==$AWS_CLI_VERSION awsprocesscreds
@tristanmorgan
tristanmorgan / lib-vault-api-auth.rb
Created Aug 10, 2017
An attempt at calling Hashicorp Vault IAM Auth backend in Ruby
View lib-vault-api-auth.rb
# Authenticate via the AWS EC2 authentication method (IAM method). If authentication is
# successful, the resulting token will be stored on the client and used
# for future requests.
#
# @example
# Vault.auth.aws_ec2_iam("dev-role-iam", "vault.example.com") #=> #<Vault::Secret lease_id="">
#
# @param [String] role
# @param [String] iam_auth_header_value
#
View keybase.md

Keybase proof

I hereby claim:

  • I am tristanmorgan on github.
  • I am tristanmorgan (https://keybase.io/tristanmorgan) on keybase.
  • I have a public key ASDtv9LpwPydVjuqv7_D-FGUp14BUQ9rchfq59DpOGSm1go

To claim this, I am signing this object:

View com.oho.cntlm.daemon.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/com.oho.cntlm.daemon.err 644 5 1000 * NJ /var/run/com.oho.cntlm.daemon.pid
/var/log/com.oho.cntlm.daemon.out 644 5 1000 * NJ /var/run/com.oho.cntlm.daemon.pid
# /etc/newsyslog.d/com.oho.cntlm.daemon.conf
View com.oho.cntlm.daemon.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Thanks to OHO's Blog -->
<!-- /Library/LaunchDaemons/com.oho.cntlm.daemon.plist -->
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<true/>
@tristanmorgan
tristanmorgan / Vagrantfile
Last active Aug 29, 2015
Vagrantfile with network controller and chipset set
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
You can’t perform that action at this time.