Skip to content

Instantly share code, notes, and snippets.

@dasgoll
dasgoll / secg.json
Last active November 21, 2017 14:47
CloudFormation Security Group All Traffic
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Hadoop Cluster (HDP 2.3)",
"Resources": {
"secg": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "secg",
"VpcId": "vpc-1e1af67b",
"SecurityGroupIngress": [
@gene1wood
gene1wood / 01_get_account_id_for_user_ec2instance_role_or_lambda.py
Last active November 9, 2022 16:40
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
print(boto3.client('sts').get_caller_identity()['Account'])
@kunik
kunik / proxy.js
Created December 25, 2015 01:40 — forked from nakedible-p/proxy.js
AWS ES proxy
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
@jamtur01
jamtur01 / pre-commit
Created October 18, 2016 21:54
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@john-delivuk
john-delivuk / sp_generate_inserts.sql
Last active November 7, 2016 21:02
This is a first attempt at making something we can scrape transactional tables and commit them to our git repo, while dealing with sensitive values in memory
SET NOCOUNT ON
GO
PRINT 'Using Master database'
USE master
GO
PRINT 'Checking for the existence of this procedure'
IF (SELECT OBJECT_ID('sp_generate_inserts','P')) IS NOT NULL --means, the procedure already exists
BEGIN