Skip to content

Instantly share code, notes, and snippets.

View cmcconnell1's full-sized avatar

Chris McConnell cmcconnell1

View GitHub Profile
# http://documentup.com/skwp/git-workflows-book
[user]
name = First Last
email = first.last@myco.org
#token =
[url "git@github.com:"]
insteadOf = https://github.com/
[core]
excludesfile = /Users/youruserid/.gitignore_global
@cmcconnell1
cmcconnell1 / gcp-label-project.sh
Last active December 2, 2020 19:34
enable compute.googleapis.com and label all gcp projects
#!/bin/bash
# gcloud configuration options to reduce output verbosity:
# gcloud config set core/log_http False;
# gcloud config set core/user_output_enabled True;
# debug, info, warning, error, and none
# gcloud config set core/verbosity warning;
function usage() {
printf "\nUsage: $0 [-help ] [-h]\n"
@cmcconnell1
cmcconnell1 / global-awspricing-ec2.py
Last active August 10, 2020 20:45
example using lyfts awspricing module to get global AWS region EC2 on-demand and reserved instance pricing
#!/usr/bin/env python3
import boto3
import awspricing
import os
# example using lyfts awspricing module to get global AWS region EC2 on-demand and reserved instance pricing
# created as answer/response for another user on realypython slack.
# ./simple-awspricing.py
@cmcconnell1
cmcconnell1 / aws-lambda-dev-usw2-scale-up-error
Created July 27, 2020 23:43
terraform-aws-github-runner lambda scale up SQS PEM error
2020-07-27T16:33:53.349-07:00
2020-07-27T23:33:53.349Z fa882d3a-bfeb-579f-b680-7aa3d978a21f INFO {
Records: [
{
messageId: '4ead6fb3-1461-46d2-beb7-29fecf44195a',
receiptHandle: 'AQEB5K0sqP+/kRXkevHdoRCjkj5htZzO+TqfHmBcwbFP8vVgBVzFayhVsLzjUkULTOvLUN2MCHprzLoe4nLLvxDtXPi3j0x83EWpT8V56rttxYNUivcHG4JPpUepHc4G26WrIocNAch5vGU7wMZYvsI5zCoeWJaMQO5rHIYHLsZx1vrCLHuPshPe8RVSDEn/7ni/V5hNsszbgZSLrnFok2LuFPLD6rvIvUWy1jg4TrFcd7yX9+2J/uUgESBfA0Pp8vY+A/nEzZ4oD9zpMWwWdgXF3JV7Pfe7AR5xSKGGsFs8M7Q=',
body: '{"id":916373631,"repositoryName":"cmcc-test-runner","repositoryOwner":"terradatum","eventType":"check_run","installationId":10551986}',
attributes: [Object],
messageAttributes: {},
md5OfBody: 'bc2b7f5c76ad9b37b1e23e97ce2a5519',
@cmcconnell1
cmcconnell1 / k8s-service-account-kubeconfig.sh
Last active August 21, 2019 00:58 — forked from ericchiang/k8s-service-account-kubeconfig.sh
dynamic generation of kubeconfig files for ci and cd macos and linux
#!/usr/bin/env bash
# ref: https://gist.github.com/ericchiang/d2a838ddad3f44436ae001a342e1001e
# thanks to ericchiang for the initial gist, just tweaked for macos or linux and dynamic file naming.
# Creates kubeconfig files using tokens.
# Copy these files to where the ci or cd processes/envs run kubectl commands--i.e.: jenkins, etc.
#
# Usage ./k8s-service-account-kubeconfig.sh ( namespace ) ( service account name )
# i.e.: k8-sevice-account-kubeconfig.sh ci ci
# i.e.: k8-sevice-account-kubeconfig.sh cd cd
# this is for the naming the kubeconfig file naming us "kubeconfig-$KUBE_USER"
@cmcconnell1
cmcconnell1 / kube-aws-v0.10.2-autoscaler-node-pools-kiam-cluster.yaml
Created September 24, 2018 17:00
proposal for kube-aws docs to include working examples of kube-aws cluster.yaml files with working nodepools, autoscaler, kiam, etc.
# this is an example offered as proposal to include in kube-aws docs/examples
# ref: https://github.com/kubernetes-incubator/kube-aws/issues/1050
clusterName: opsinfra
s3URI: s3://my-bucket-kube-aws-us-west-1/
releaseChannel: stable
amiId: "ami-0a86d340ea7fde077"
disableContainerLinuxAutomaticUpdates: true
apiEndpoints:
- # The unique name of this API endpoint used to identify it inside CloudFormation stacks
name: default
@cmcconnell1
cmcconnell1 / cluster.yaml
Created September 14, 2018 18:50
kube-aws new/latest version v0.10.2 cluster.yaml kube2iam CrashLoopBackOff error: level=fatal msg="route ip+net: no such network interface"
clusterName: opsinfra
s3URI: s3://my-bucket-kube-aws-us-west-1/
releaseChannel: stable
amiId: "ami-0a86d340ea7fde077"
disableContainerLinuxAutomaticUpdates: true
apiEndpoints:
- # The unique name of this API endpoint used to identify it inside CloudFormation stacks
name: default
dnsName: opsinfra.myfoo.com
loadBalancer:
@cmcconnell1
cmcconnell1 / virtualbox-driver-vpn-disabled-minishift.out
Created June 26, 2018 19:40
minishift-start-fails-with-virtualbox-driver-but-works-with-xhyve-if-vpn-inactive
-- minishift version: v1.20.0+53c500a
-- Starting profile 'minishift'
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.9.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.9.0' is supported ... OK
-- Checking if requested hypervisor 'virtualbox' is supported on this platform ... OK
-- Checking if VirtualBox is installed ... OK
-- Checking the ISO URL ... OK
-- Downloading OpenShift binary 'oc' version 'v3.9.0'
@cmcconnell1
cmcconnell1 / kubernetes-cluster-autoscaler-pod-logs-pr#1268
Created May 1, 2018 01:06
fresh kube-aws cluster deploy 3rd restart for the AS pod with modified code from https://github.com/kubernetes-incubator/kube-aws/pull/1268
kk logs cluster-autoscaler-59998c8cbf-9hqwq
I0501 01:00:45.176755 1 flags.go:52] FLAG: --address=":8085"
I0501 01:00:45.177259 1 flags.go:52] FLAG: --alsologtostderr="false"
I0501 01:00:45.177275 1 flags.go:52] FLAG: --application-metrics-count-limit="100"
I0501 01:00:45.177280 1 flags.go:52] FLAG: --azure-container-registry-config=""
I0501 01:00:45.177286 1 flags.go:52] FLAG: --balance-similar-node-groups="false"
I0501 01:00:45.177290 1 flags.go:52] FLAG: --boot-id-file="/proc/sys/kernel/random/boot_id"
I0501 01:00:45.177294 1 flags.go:52] FLAG: --cloud-config=""
I0501 01:00:45.177386 1 flags.go:52] FLAG: --cloud-provider="aws"
I0501 01:00:45.177390 1 flags.go:52] FLAG: --cloud-provider-gce-lb-src-cidrs="209.85.204.0/22,130.211.0.0/22,35.191.0.0/16,209.85.152.0/22"
@cmcconnell1
cmcconnell1 / dist-upated-tls-certs-etcd-nodes.sh
Created April 26, 2018 19:30
Distributes updated x509 tls certs to etcd2 kube nodes and resolves outdated cert problems
#!/usr/bin/env bash
#
# Summary:
# Distributes updated x509 tls certs and resolves outdate cert problems which effectively kill your kube cluster
# ref: https://github.com/kubernetes-incubator/kube-aws/issues/1132
# ref: https://github.com/kubernetes-incubator/kube-aws/issues/1057
#
# NOTES: Ensure this is the correct process for your etcd2 kube cluster before using.
# Test on a dev/test cluster first.
# Use at own risk.