Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🍒 🍍 🍓 🍊 🍌

Chaz Reid charlesreid1

💭
🍒 🍍 🍓 🍊 🍌
View GitHub Profile
View zappa_iam_policy.md

By default, zappa has an extremely insecure and hand-wavey approach to permissions, which is to

This gist contains an IAM policy document that can be attached to a role, and/or to an IAM user, that will allow the IAM user to perform all of the ncessary actions required to deploy a zappa function.

Via Cisco: https://github.com/CiscoSecurity/tr-05-serverless-microsoft-defender-for-endpoint/blob/3d9248a06ff287db23a06e88296a5d3fa6713ab4/aws/ZappaLambdaDeploymentPolicy.json

More info: https://github.com/CiscoSecurity/tr-05-serverless-microsoft-defender-for-endpoint/blob/3d9248a06ff287db23a06e88296a5d3fa6713ab4/aws/HOWTO.md#sample-aws-iam-policy-for-deployment-zappalambdadeploymentpolicy

View zappa_deployer.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:GetRole",
"iam:PutRolePolicy"
],
"Resource": [
@charlesreid1
charlesreid1 / blaseball_divisions.json
Created Sep 1, 2020
Blaseball team division and league information in JSON format
View blaseball_divisions.json
{
"Lawful Good": [
"Lovers",
"Tacos",
"Steaks",
"Breath Mints",
"Firefighters"
],
"Chaotic Good": [
"Shoe Thieves",
@charlesreid1
charlesreid1 / allstars.py
Last active May 2, 2022
quick-n-dirty script to get a list of all starred Github repos for a given user using Python and PyGithub
View allstars.py
from github import *
import sys
import json
def usage():
print("")
print("allstars.py: script to print all repos starred by a Github user")
print("Usage: python allstars.py [USERNAME]")
print("")
@charlesreid1
charlesreid1 / get_all_bundles.py
Last active Oct 22, 2019
output from DSSClient.get_bundles_all()
View get_all_bundles.py
import json
from hca.dss import DSSClient
dss = DSSClient()
print(dss.get_all_bundles(replica="gcp"))
print(dss.get_all_bundles(replica="aws"))
@charlesreid1
charlesreid1 / simple_arg.py
Created Jul 23, 2019
A very simple argparse example. Takes one argument, a path to a folder (-d or --dir); prints whether that folder exists.
View simple_arg.py
import os, sys
import argparse
"""
A Simple Argparse Program
That Works Just The Way
We Like It.
Charles Reid
View example_hyperas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charlesreid1
charlesreid1 / poly_circ_undirected.tex
Created Mar 17, 2019
TeX for drawing circles with inscribed polygons and labeled vertices, for the Josephus problem.
View poly_circ_undirected.tex
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw=none, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};
@charlesreid1
charlesreid1 / poly_directed.tex
Last active Mar 17, 2019
TeX for drawing labeled polygons with directed and undirected paths (for illustrating solutions to the Josephus problem).
View poly_directed.tex
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};
@charlesreid1
charlesreid1 / polygon.tex
Last active Mar 17, 2019
TeX for drawing labeled polygons (for illustrating solutions to the Josephus problem).
View polygon.tex
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};