Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tristanmorgan's full-sized avatar
⌨️
tappity tap.

Tristan Morgan tristanmorgan

⌨️
tappity tap.
View GitHub Profile
@tristanmorgan
tristanmorgan / Vagrantfile
Last active August 29, 2015 14:08
Vagrantfile with network controller and chipset set
# -*- 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.
<?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/>
# 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
@tristanmorgan
tristanmorgan / lib-vault-api-auth.rb
Created August 10, 2017 07:08
An attempt at calling Hashicorp Vault IAM Auth backend in Ruby
# 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
#
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 wheel --upgrade pip \
&& python3 -m pip install awscli==$AWS_CLI_VERSION \
&& rm -rf /root/.cache
@tristanmorgan
tristanmorgan / vault-token-helper.sh
Last active February 22, 2021 03:25
HashiCorp Vault Token Helper (save into macOS keychain)
#!/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)
@tristanmorgan
tristanmorgan / ssh-config
Last active October 28, 2022 03:00
ssh/config with proxy environment switch.
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 / basic.rb
Created December 19, 2018 22:21
lib/thor/line_editor/basic.rb - print stars for no-echo input
class Thor
module LineEditor
class Basic
attr_reader :prompt, :options
def self.available?
true
end
def initialize(prompt, options)
@tristanmorgan
tristanmorgan / .terraformrc
Last active March 15, 2024 05:42
Terraform Cloud Token Helper (save into macOS keychain)
disable_checkpoint = true
credentials_helper helper {
args = []
}
# save this in home.
@tristanmorgan
tristanmorgan / story.md
Created February 20, 2020 23:05
macOS signed binary "Killed: 9"

macOS signed binary "Killed: 9"

Not so much of a "file" but a story of finding out how to fix when you download something from the 'net and it won't run because of protextions in the system. Specifically I'm talking about macOS Catalina.

I download a file via Safari and I try to run it and I get some sorta error. solution was to:

xattr -d com.apple.quarantine ~/Downloads/some-binary