Skip to content

Instantly share code, notes, and snippets.

View dandye's full-sized avatar

DanDye dandye

View GitHub Profile
@dandye
dandye / aws_reports.py
Created February 6, 2018 01:32 — 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']
@dandye
dandye / bootstrap_salt_cloudinit.rst
Created December 30, 2016 12:41 — forked from abhishekctn/bootstrap_salt_cloudinit.rst
Bootstrapping Salt on Linux EC2 with CloudInit

Boostrapping Salt on Linux EC2 with Cloud-Init

Salt is a great tool for remote execution and configuration management, however you will still need to bootstrap the daemon when spinning up a new node. One option is to create and save a custom AMI, but this creates another resource to maintain and document.

A better method for Linux machines uses Canonical's CloudInit to run a bootstrap script during an EC2 Instance initialization. Cloud-init takes the user_data string passed into a new AWS instance and runs it in a manner similar to rc.local. The bootstrap script needs to:

  1. Install Salt with dependencies
  2. Point the minion to the master
@dandye
dandye / ubuntu-cloud-virtualbox.sh
Created December 28, 2016 10:21 — forked from smoser/ubuntu-cloud-virtualbox.sh
example of using Ubuntu cloud images with virtualbox
## Install necessary packages
$ sudo apt-get install virtualbox-ose qemu-utils genisoimage cloud-utils
## get kvm unloaded so virtualbox can load
$ sudo modprobe -r kvm_amd kvm_intel
$ sudo service virtualbox stop
$ sudo service virtualbox start
## URL to most recent cloud image of 12.04
$ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release"
@dandye
dandye / TAXII-1.1.postman_collection.json
Created October 27, 2016 02:45 — forked from jtschichold/TAXII-1.1.postman_collection.json
Simple Postman Collection for TAXII 1.1 Requests
{
"variables": [],
"info": {
"name": "TAXII-1.1 (0.1)",
"_postman_id": "f355c2a2-5d3e-6f5b-f957-afe4d5646d7a",
"description": "Simple collection of TAXII 1.1 requests.\nYou need an environment with the following keys to run this:\n- hostname: hostname of the TAXII server\n- collection: name of the collection to poll (needed only for Poll Request)\n\nDiscovery request points to {{hostname}}/taxii-discovery-service\n\nCollection Information Request points to {{hostname}}/taxii-collection-management-service\n\nPoll Request to {{hostname}}/taxii-poll-service",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@dandye
dandye / countyFIPS.js
Created August 22, 2012 18:04 — forked from myersjustinc/countyFIPS.js
Mappings between five-digit county FIPS codes and their corresponding counties
// Source: http://www.census.gov/geo/www/ansi/countylookup.html
var countyToFIPS = {
'Alabama': {
'Autauga County': '01001',
'Baldwin County': '01003',
'Barbour County': '01005',
'Bibb County': '01007',
'Blount County': '01009',
'Bullock County': '01011',
@dandye
dandye / fipsToState.json
Created August 22, 2012 18:04 — forked from wavded/fipsToState.json
State FIPS JSON
{
"01": "Alabama",
"02": "Alaska",
"04": "Arizona",
"05": "Arkansas",
"06": "California",
"08": "Colorado",
"09": "Connecticut",
"10": "Delaware",
"11": "District of Columbia",