Skip to content

Instantly share code, notes, and snippets.

@ayoneeyee
ayoneeyee / OpenShift Workshop
Created December 13, 2018 17:33 — forked from epe105/OpenShift Workshop
OpenShift Workshop
[Gist Page]
info.redhatgov.io/openshift
[Lab Guide]
http://redhatgov.io/workshops/openshift_101_dcmetromap/
[OpenShift Console]
https://ocp-devsecops.redhatgov.io
[Terminal]
#!/bin/bash
hostname=$1
ipaddress=$2
event=$3
echo $hostname $ipaddress $event
if [ $event == "HostUp" ];
then
#!/bin/bash
apt update
apt install python-pip -y
mkdir -p /var/log/webhook
git clone https://github.com/lcc2207/scalr-command-webhook.git /opt/command-webhook
apt-get update
apt-get install -y --no-install-recommends python python-dev python-pip uwsgi uwsgi-plugin-python
@ayoneeyee
ayoneeyee / rotate-ami-launch-config.sh
Created August 12, 2018 00:59 — forked from MattHealy/rotate-ami-launch-config.sh
Update an existing AWS Launch Configuration to use a new AMI image
#!/bin/bash
oldconfigname="$1"
newconfigname="$2"
ami="$3"
KEYNAME="my_keypair_name"
ASGROUP="my_autoscaling_group_name"
SECURITYGROUP="sg-1234"
INSTANCETYPE="t2.micro"
@ayoneeyee
ayoneeyee / encrypt_all_objects.py
Created August 12, 2018 00:57 — forked from MattHealy/encrypt_all_objects.py
Python script to encrypt all existing objects in an S3 bucket
#!/usr/bin/env python
# set SSE on all existing objects
#usage: encrypt_all_objects.py bucketname
import sys
import boto
from boto import connect_s3
@ayoneeyee
ayoneeyee / snapshots.py
Created August 3, 2018 19:12 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@ayoneeyee
ayoneeyee / install-terraform-packer-os-x.sh
Created July 23, 2018 00:58 — forked from Adron/install-terraform-packer-os-x.sh
Install Terraform & Packer on Linux
#!/usr/bin/env bash
# Script prerequisite > install jq > https://stedolan.github.io
# ********************************************************************************************
# UPDATE: Check out Robert's repo here https://github.com/robertpeteuil/terraform-installer
# Robert's repo is more built out and has more options around the installation process.
# Cheers! -Adron
# ********************************************************************************************
cd ~
@ayoneeyee
ayoneeyee / install_jenkins_plugin.sh
Created September 13, 2017 15:03 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins