Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
πŸ€Έβ€β™‚οΈ
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

πŸ€Έβ€β™‚οΈ
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
@scarolan
scarolan / .kitchen.yml
Created June 23, 2017 00:31
Test Kitchen Config file for Chef Workshop
---
driver:
name: ec2
aws_ssh_key_id: chef_demo_2x
region: us-west-2
subnet_id: subnet-da4bd3bf
security_group_ids: sg-1cea9178
associate_public_ip: true
instance_type: t2.micro
tags:
@scarolan
scarolan / aws_inspec_sample.rb
Created September 5, 2017 17:25
Sample code for demonstrating inspec-aws
# encoding: utf-8
# copyright: 2015, The Authors
title 'AWS Inspec Demo Profile'
control 'aws-production-instances' do
impact 1.0
title 'Check Production Instances'
desc 'Make sure the status of production AWS instances is set to running.'
@scarolan
scarolan / hpe_oneview_synergy.rb
Created November 10, 2017 17:30
Chef recipe to stand up Synergy infrastructure
chef_gem 'oneview-sdk' do
compile_time true
end
require 'oneview-sdk'
my_client = { url: 'https://192.168.20.20', user: 'Administrator', password: '*******', api_version: 500 }
# Create a new fiber channel network
oneview_fc_network 'FCNetwork1' do
@scarolan
scarolan / screenrc config
Created December 29, 2017 21:57
screenrc config
#shelltitle ''
vbell on
autodetach on
startup_message off
defscrollback 2048
#termcapinfo xterm* ti@:te@
termcapinfo xterm* 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %=%D %M %d %c"
#hardstatus string '%{= kK}%-Lw%{= KW}%50>%n%f %t%{= kK}%+Lw%< %{=kG}%-= %d%M %c:%s%{-}'
@scarolan
scarolan / show_all_instances.sh
Created January 29, 2018 16:04
List all AWS instances in all regions
#!/bin/sh
getRegions() {
aws ec2 describe-regions --output text --query 'Regions[*].RegionName'
}
getInstances() {
REGION=$1
if [ "$#" -ne 1 ]; then
echo "USAGE: getInstances us-west-2"
@scarolan
scarolan / emojis.json
Created April 3, 2018 15:37 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
@scarolan
scarolan / rotate.sh
Created April 12, 2018 17:43
Rotate a local Linux password, store the new password in HashiCorp Vault
#!/bin/sh
# Script for rotating passwords on the local machine.
# Make sure and store VAULT_TOKEN as an environment variable before running this.
USERNAME=$1
PASSLENGTH=$2
VAULTURL=$3
NEWPASS=$(openssl rand -base64 $PASSLENGTH)
JSON="{ \"data\": { \"root\": \"$NEWPASS\" } }"
# My first Terraform
variable "access_key" {}
variable "secret_key" {}
variable "ami" {}
variable "subnet_id" {}
variable "instance_type" {}
variable "vpc_security_group_id" {}
variable "identity" {}
variable "access_key" {}
variable "secret_key" {}
variable "region" {}
variable ami {}
variable subnet_id {}
variable instance_type {
default = "t2.micro"
}
variable vpc_security_group_id {}
variable identity {}
# First enable the userpass auth engine
#
# vault auth enable userpass
# vault write auth/userpass/users/alice password=alice policies="default,dev"
# vault write auth/userpass/users/bob password=bob policies="default,prod"
# Then create these policies
# dev
path "sys/mounts" {