This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -xe | |
release=$(curl --silent https://golang.org/doc/devel/release.html |grep -Eo 'go[0-9]+(\.[0-9]+)+' |sort -V |uniq |tail -1) | |
os=$(uname -s |tr '[:upper:]' '[:lower:]') | |
arch=$(case "$(uname -m)" in i*) echo '386' ;; x*) echo 'amd64' ;; *) echo 'armv61'; esac) | |
curl --silent https://storage.googleapis.com/golang/$release.$os-$arch.tar.gz \ | |
| sudo tar -vxz --strip-components 1 -C $(dirname $(dirname $(which go))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ec2-user@ip-xx-xxx-xxx-xxx ~]$ nslookup production.cloudflare.docker.com 8.8.8.8 | |
;; connection timed out; no servers could be reached | |
[ec2-user@ip-xx-xxx-xxx-xxx ~]$ nslookup production.cloudflare.docker.com 8.8.8.8 | |
;; connection timed out; no servers could be reached | |
[ec2-user@ip-xx-xxx-xxx-xxx ~]$ nslookup production.cloudflare.docker.com 10.128.8.8 | |
;; connection timed out; no servers could be reached | |
[ec2-user@ip-xx-xxx-xxx-xxx ~]$ nslookup production.cloudflare.docker.com 10.128.0.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ehimeken in ~/nomad-orchestrator/examples/root-example | |
○ → nomad job status | |
ID Type Priority Status Submit Date | |
fabio system 50 running 2019-04-25T11:15:22-07:00 | |
ping_service service 50 running 2019-04-25T11:20:09-07:00 | |
ehimeken in ~/nomad-orchestrator/examples/root-example | |
○ → nomad job status ping_service | |
ID = ping_service | |
Name = ping_service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Sid": "PackerSecurityGroupAccess", | |
"Action": [ | |
"ec2:CreateSecurityGroup", | |
"ec2:DeleteSecurityGroup", | |
"ec2:DescribeSecurityGroups", | |
"ec2:AuthorizeSecurityGroupIngress", | |
"ec2:RevokeSecurityGroupIngress" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to clean ECR repos | |
## Usage: | |
## ./clean-old-ecr-images.sh <IMAGE-REPO-NAME> <WEEKS-TO-KEEP> | |
## | |
## Non-interactive, for running in cron or your C.I.: | |
## echo "y" | ./clean-old-ecr-images.sh <IMAGE-REPO-NAME> <WEEKS-TO-KEEP> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Alter your comps fingerprint.. | |
function rollmac() | |
{ | |
# Disassociate yourself from the airport binary | |
# http://osxdaily.com/2007/01/18/airport-the-little-known-command-line-wireless-utility/ | |
! hash airport 2>/dev/null && { | |
[ -f /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport ] && { | |
ln -fs /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport /usr/local/bin | |
} || { | |
# Dave's not here.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible-playbook 2.6.4 | |
config file = /Users/jddaniel/Repositories/Infra/Hashi/Terraform/terraform-jenkins/ansible/ansible.cfg | |
configured module search path = [u'/Users/jddaniel/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] | |
ansible python module location = /usr/local/lib/python2.7/site-packages/ansible | |
executable location = /usr/local/bin/ansible-playbook | |
python version = 2.7.15 (default, Jul 23 2018, 21:27:06) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] | |
Using /Users/jddaniel/Repositories/Infra/Hashi/Terraform/terraform-jenkins/ansible/ansible.cfg as config file | |
setting up inventory plugins | |
Parsed /usr/local/bin/terraform-inventory inventory source with script plugin | |
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TF_VAR_aws_profile TF_VAR_aws_vpc TF_VAR_aws_net | |
# An implicit guard target, used by other targets to ensure | |
# that environment variables are set before beginning tasks | |
assert-%: | |
@ if [ "${${*}}" = "" ] ; then \ | |
echo "Environment variable $* not set" ; \ | |
exit 1 ; \ | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws --profile {aws_profile} --region {aws_region} \ | |
ec2 create-instance-export-task \ | |
--instance-id {instance_id} \ | |
--target-environment {target_environment} \ | |
--export-to-s3-task DiskImageFormat={disk_image_format},ContainerFormat=ova,S3Bucket={s3_bucket},S3Prefix={s3_prefix} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution: sort numbers first, then test the offset(s) | |
// Disclosure: this is not a great idea for 4 billion numbers | |
// and is completely inefficient | |
var numArray = [ 2, 3, 1, 5, 7, 10 ]; | |
var findMissingNumbers = function (numArray) | |
{ | |
var missing = []; | |
numArray.sort( |
NewerOlder