Skip to content

Instantly share code, notes, and snippets.

View coleca's full-sized avatar

Cole Calistra coleca

View GitHub Profile
#!/bin/bash
set -e
set -x
# create certs for a kubernetes cluster
usage() {
echo $0 [cluster_name] [service_ip] [additional_names]
echo additional name is generally the dns name
exit -1
}
@viranch
viranch / build-docker.sh
Last active February 4, 2016 18:34
Build dynamic docker 1.7.0
# stop
docker stop `docker ps -q`
sudo service docker stop
# dependencies
sudo apt-get remove -qy lxc-docker && sudo apt-get autoremove -qy
sudo apt-get install -qy libdevmapper-dev golang-gosqlite-dev uuid-dev btrfs-tools git gcc --no-install-recommends
# golang
curl -sSL https://golang.org/dl/go1.4.2.linux-amd64.tar.gz | sudo tar -C /usr/local -xz
@josue
josue / xdebugger.sh
Last active May 12, 2016 13:24
xdebugger - Execute php file and outputs xdebug trace and script logs to file for further analyzing.
#/bin/bash
check_xdebug_installed () {
INSTALLED=`php -m | grep xdebug`
if [ "$INSTALLED" = "" ]; then
echo "PHP extention 'xdebug' must be installed."
exit 1
fi
}
@mikemackintosh
mikemackintosh / git-pre-commit-replace-tabs.sh
Last active May 31, 2016 15:33
R.I.G.B.Y. - Tabs v Spaces
#!/usr/bin/env ruby
files_modified = `git diff-index --cached --name-only HEAD`.split(/\n/)
# expand_tabs from Stack Overflow
# -> http://stackoverflow.com/a/8900610/1431239
# This algorithm by Brian Candler (B.Candler@pobox.com) found on the
# org.ruby-lang.ruby-talk mailing list
# http://markmail.org/message/avdjw34ahxi447qk
# Date: 2003-5-31 13:35:09
# Subject: Re: expandtabs
@wolfeidau
wolfeidau / awssetup.md
Last active February 12, 2019 14:32
Kubernetes Setup Guide

This is a simple guide to getting up and running with kubernetes on AWS.

Install the aws CLI.

brew install awscli

Setup a profile in the aws CLI and enter some credentials, I create an IAM account in my AWS and give it admin, then generate some credentials.

#!/bin/bash
if [ "$(id -u)" = "0" ]; then
echo
echo "Do not run as root. Run as your user"
exit 2
fi
usage() { echo "Usage: $0 -t <time needed> <salt-feature-branch>" 1>&2; exit 1; }
def api_call_account_read(domain, provider_key, account_id)
url = "https://#{domain}/admin/api/accounts/#{account_id}.xml?provider_key=#{provider_key}"
response = RestClient.get url
raise Exception.new("Wrong response code (#{response.code}) in request #{url}") if response.code!=200
document = Nokogiri::XML(response.to_str)
account = Hash.new
account["email"] = document.xpath("//users/user/email").text
@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@0xdabbad00
0xdabbad00 / AWSExposedCredentialPolicy_DO_NOT_REMOVE
Created April 10, 2020 18:34
Copy of AWSExposedCredentialPolicy_DO_NOT_REMOVE sent to me by someone
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"iam:UpdateAccessKey",
"ec2:RequestSpotInstances",
"organizations:InviteAccountToOrganization",
"lightsail:DownloadDefaultKeyPair",
@tuannvm
tuannvm / 0.12.tf
Last active December 3, 2022 18:50
#terraform #hashicorp #cheatsheet #0.12
#### first class expresssion
variable "ami" {}
resource "aws_instance" "example" {
ami = var.ami
}
#### list & map
resource "aws_instance" "example" {
vpc_security_group_ids = var.security_group_id != "" ? [var.security_group_id] : []
}