Skip to content

Instantly share code, notes, and snippets.

View denniswebb's full-sized avatar

Dennis Webb denniswebb

View GitHub Profile
@denniswebb
denniswebb / k8s-job-from-cron
Created February 17, 2018 20:14
Run Kubernetes CronJob on Demand
#!/usr/bin/env bash
usage () {
echo "Usage: $(basename "$0") <cronjob_name>"
exit 1
}
if [ -z "$1" ]; then usage; fi
kubectl get cronjob "$1" -ojson | jq '{ "apiVersion": "batch/v1", "kind": "Job", "metadata": {"name": .metadata.name }, "spec": .spec.jobTemplate.spec }' | kubectl apply -f -
@denniswebb
denniswebb / aws_cli_install.tf
Last active September 1, 2023 16:47
Terraform module to install aws cli for Terraform Enterprise (Atlas)
data "template_file" "main" {
template = <<EOF
set -e
WORKDIR=/tmp/${uuid()}
mkdir -p "$WORKDIR"
cd "$WORKDIR"
curl -f "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i "$WORKDIR"/aws
@denniswebb
denniswebb / resume.json
Created September 20, 2022 18:50
Resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Dennis Webb",
"label": "Staff Software Engineer at Panther",
"image": "",
"email": "dhwebb@gmail.com",
"phone": "901-209-9322",
"url": "",
"summary": "I am a DevOps Engineer currently helping businesses deploy and manage their infrastructure and applications with Amazon Web Services. 20 years of IT experience has allowed me to continuously increase my knowledge and improve my skills. I am also a member of the AWS \"All 9 Club\" by holding all 9 of the AWS Certifcations.\n\nI believe that DevOps should provide solutions that allow deployments to be almost \"self-service\" to the developer. A good DevOps department provides tools so a developer can simply add a few deployment parameters in their repo, and the system built by DevOps handles the rest for them. My job is to allow developers to do what they do best, and that's to keep coding.\n\nI am convinced in the
@denniswebb
denniswebb / mfaup.sh
Created February 13, 2018 18:22
Creates MFA AWS Profile for base profile
#!/usr/bin/env bash
token=$1
aws_account=132456
base_profile=work
mfa_profile=workmfa
username=denniswebb
creds=$(aws --profile ${base_profile} sts get-session-token --serial-number arn:aws:iam::${aws_account}:mfa/${username} --duration 129600 --token $token --query "Credentials.[AccessKeyId, SecretAccessKey, SessionToken]" --output text)
@denniswebb
denniswebb / swagger-ui.tf
Created October 11, 2016 02:55
Terraform template for deploying Swagger-UI to S3 website.
variable "region" {default = "us-west-2"}
variable "website_dns" {default = "swagger-ui.webblab.info"}
variable "r53_zone_id" {default = "Z1S59LUERGUH56"}
variable "swagger_ui_version" {default = "v2.2.5"}
provider "aws" {
region = "${var.region}"
}
resource "aws_s3_bucket" "main" {
# Prepare cluster
# helm install --name cert-manager --namespace=cert-manager jetstack/cert-manager --version v0.10.1
# kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true
# kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v0.10.1/cert-manager.yaml
# helm install istio.io/istio-init --name istio-init --namespace istio-system
# helm install istio.io/istio --name istio --namespace istio-system --set-string gateways.istio-ingressgateway.sds.enabled=true
# kubectl label ns default istio-injection=enabled
apiVersion: v1
kind: Service
@denniswebb
denniswebb / github.tf
Created October 3, 2017 16:45
Terraform module for creating GitHub repositories.
variable "repository_name" {}
variable "auto_init" {
default = true
}
variable "description" {
default = ""
}
@denniswebb
denniswebb / userdata_i3_8x.sh
Created April 16, 2017 19:04
Userdata for configuring RAID0 on AWS i3.8xlarge
#!/usr/bin/env bash
mkdir -p /data
mdadm --create --verbose --level=0 /dev/md0 --name=DATA --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1
mdadm --wait /dev/md0
mkfs.ext4 /dev/md0
mdadm --detail --scan >> /etc/mdadm.conf
dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
echo /dev/md0 /data ext4 defaults,nofail,noatime,discard 0 2 >> /etc/fstab
mount -a
@denniswebb
denniswebb / keybase.md
Last active August 23, 2018 01:06
keybase.md

Keybase proof

I hereby claim:

  • I am denniswebb on github.
  • I am dhwebb (https://keybase.io/dhwebb) on keybase.
  • I have a public key ASDGWe1yawPF5lcPtJjxamPO7euHSiJiQo2_thZrakxEuQo

To claim this, I am signing this object:

@denniswebb
denniswebb / circleci-api.md
Last active January 29, 2018 20:04
CircleCI API

Get all repos on CircleCI

curl "https://circleci.com/api/v1.1/projects?circle-token=$CIRCLE_TOKEN" | jq -r '.[] | .username + "/" + .reponame'

Set slack_webhook_url for a single repo

curl -XPUT --header "Content-Type: application/json" "https://circleci.com/api/v1.1/project/github/MyOrg/MyRepo/settings?circle-token=$CIRCLE_TOKEN" -d '{"slack_webhook_url":"https://hooks.slack.com/services/FSFDSFDS?DSFHJKHDFKJSDH"}'

Put it all together to setup webhooks for all of your repos