Skip to content

Instantly share code, notes, and snippets.

View mda590's full-sized avatar
☁️
Feeling cloudy

Matt Adorjan mda590

☁️
Feeling cloudy
View GitHub Profile
@tomvachon
tomvachon / stack.yml
Created August 16, 2017 11:16
AWS IAM Policy for Tag Restricted EBS & EC2
Type: AWS::IAM::ManagedPolicy
Properties:
Description: AWS Policy for EC2 Instance, EBS Creation with Tagging required
PolicyDocument:
Version: "2012-10-17"
Statement:
# This allows the untaggable calls to work when RunInstances is the actor
-
Effect: Allow
Action:
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active June 5, 2024 09:59
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@joelthompson
joelthompson / README.md
Last active May 21, 2024 17:19
Vault Auth
@sybeck2k
sybeck2k / nomad
Last active June 30, 2017 13:46
nomad init script
#nomad !/bin/bash
#
# nomad Manage the nomad agent
#
# chkconfig: 2345 95 95
# description: Consul is a tool for service discovery and configuration
# processname: nomad
# config: /etc/nomad.conf
# pidfile: /var/run/nomad.pid
@singledigit
singledigit / cognito.yaml
Last active June 4, 2024 05:19
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@wrwrwr
wrwrwr / lambda.sh
Created February 15, 2017 23:32
Package a Python module with NumPy and SciPy for AWS Lambda.
#!/usr/bin/env bash
# Path to the project directory (that should include requirements.txt),
# Files and directories within that need to be deployed.
project=../backend
contents=(module lamdba_handler.py)
# Unnecessary parts. Note that there are some inter-dependencies in SciPy,
# for example to use scipy.stats you also need scipy.linalg, scipy.integrate,
# scipy.misc, scipy.sparse, and scipy.special.
@ranieuwe
ranieuwe / grab-azure-docs.sh
Last active March 28, 2020 16:31
Grabs a PDF copy of all Azure docs
for row in $(curl https://api.github.com/repositories/72685026/contents/articles | jq -c -r '.[] | select(.type | contains("dir")) | "\(.name)"'); do wget -O "${row}.pdf" "https://docs.microsoft.com/en-us/azure/opbuildpdf/${row}/toc.pdf?branch=live"; done
@dvirsky
dvirsky / gendocs.py
Last active September 12, 2021 16:12
Generate Markdown documentation from a python package
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"
@gene1wood
gene1wood / role_arn_to_session.py
Created December 29, 2016 17:38
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
"""
Usage :
session = role_arn_to_session(
RoleArn='arn:aws:iam::012345678901:role/example-role',
RoleSessionName='ExampleSessionName')
client = session.client('sqs')
"""
import os
import boto.utils
import boto3
import requests
import datetime
import time
def get_contents(filename):