Skip to content

Instantly share code, notes, and snippets.

@spuds51
spuds51 / example.json
Created December 2, 2020 02:24 — forked from sevennineteen/example.json
Example using Jinja2 to populate a JSON payload template
{ "path": "/content/geometrixx/my-first-jinja-page",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:Page" }],
"nodes": [
{ "path": "jcr:content",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:PageContent"},

Set up an IAM Role called (say) SNSEmailForwarder:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
 "Action": [
@spuds51
spuds51 / all_aws_lambda_modules_python.md
Created November 16, 2020 19:15 — forked from gene1wood/all_aws_lambda_modules_python.md
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7

This gist contains lists of modules available in

in AWS Lambda.

It also contains the code to run in Lambda to generate these lists. In addition there is a less_versbose module in the code that you can call to get a list of the top level modules installed and the version of those modules (if they contain a version

@spuds51
spuds51 / getting-going-best-practices.md
Created September 21, 2020 15:26 — forked from jbjonesjr/getting-going-best-practices.md
Getting Going and Best Practices Guide

GitHub Onboarding and Introduction

A guide for getting started and best practices for teams new to, or improving their interactions with, GitHub

image GitHub's features and capabilities

This document is meant to help new teams to GitHub familiarize themselves with the features and platform, as well as start to explore some of the best practices. While not a complete exploration, it's meant as a introduction to the key tenets of using GitHub for your business. For teams and organizations that desire more one on one support, GitHub Professional Services has many different options available to customize tools, training, and process to best meet your needs. The GitHub offerings listed in the diagram above are just a sampling of the various capabilities and we'd love to create a customized offering to meet your specific organizational needs.

Overview and Intr

@spuds51
spuds51 / ec2_info_retriever.py
Created June 29, 2020 00:33 — forked from dastergon/ec2_info_retriever.py
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
"""
A tool for retrieving basic information from the running EC2 instances.
"""
# Connect to EC2
ec2 = boto3.resource('ec2')
@spuds51
spuds51 / parse_arn.py
Created June 28, 2020 23:32 — forked from gene1wood/parse_arn.py
Parse an AWS ARN (Amazon Resource Name) into it's constituent elements
def parse_arn(arn):
# http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
elements = arn.split(':')
result = {'arn': elements[0],
'partition': elements[1],
'service': elements[2],
'region': elements[3],
'account': elements[4]
}
if len(elements) == 7:
@spuds51
spuds51 / user-data.sh
Created June 28, 2020 20:17 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@spuds51
spuds51 / lambdaAMIBackups.py
Created June 18, 2020 23:44 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
# Automated AMI Backups
#
# @author Bobby Kozora
#
# This script will search for all instances having a tag with the name "backup"
# and value "Backup" on it. As soon as we have the instances list, we loop
# through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
# that name, it will use a 7 days default value for each AMI.
@spuds51
spuds51 / README.md
Created May 9, 2020 18:10 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.