Skip to content

Instantly share code, notes, and snippets.

Gene Wood gene1wood

Block or report user

Report or block gene1wood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gene1wood /
Last active Feb 3, 2020
Script to check what AWS IAM users and roles have rights to perform an action
#!/usr/bin/env python
import sys
import boto3
def get_paginated_results(product, action, key, credentials=None, args=None):
args = {} if args is None else args
return [y for sublist in [x[key] for x in boto3.client(product, **({} if credentials is None else credentials)).get_paginator(action).paginate(**args)] for y in sublist]
gene1wood /
Created Jan 22, 2020
How to deal with a Google Pixel with a broken power button
gene1wood /
Created Dec 31, 2019
The sequence of events triggered for a CloudFormation custom resource backed by an AWS Lambda function

Create a stack

    "event": {
        "StackId": "arn:aws:cloudformation:us-west-2:656532927350:stack/genetest2/c6c0c040-c5ee-11e9-9ec7-0ad236afdc80",
        "ResponseURL": "",
        "ResourceProperties": {
            "ServiceToken": "arn:aws:lambda:us-west-2:656532927350:function:genetest2-ExampleFunction-NQLOVV15EHNT",
            "Param": "alpha"
gene1wood /
Created Dec 20, 2019
Some exploration around what would be needed to simplify (through code) the process of releasing python package versions
  • Make sure has all new functionality you want in the release

    • Summarize changes since last release that are missing from Unreleased
  • Pick new version based on semver rules

  • Run unit tests / tox

  • Run flake8

  • Check to ensure

    • There are contents in unreleased
    • The new version number isn't present
  • Verify version is newer than newest version in

Num Tool Name Executable Name
1 AMS (Amazon Mozilla Services) CLI ams
2 Auth0 for AWS aws-auth0
3 AWS login proxy aws-download-keys
4 AWS Single Sign-On aws_sso
5 AWS SSO CLI aws-sso
6 AWS SSO Login aws_sso_login
7 aws_secure aws_secure
8 aws-fed aws-fed
gene1wood /
Last active Mar 27, 2020
How to configure CloudFront using CloudFormation to pass all headers

How to configure CloudFront using CloudFormation to pass all headers

How can you configure a CloudFront distribution to pass all headers to the origin if the CloudFront distribution is deployed using CloudFormation? If you deploy the distribution in the AWS Web Console, you can select between None, Whitelist and All. In CloudFront it appears that you can only assert a whitelist of allowed headers. This is done in this area of a CloudFormation resource describing a CloudFront distribution

    Type: AWS::CloudFront::Distribution
gene1wood /
Last active Mar 15, 2020
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

gene1wood / gist:aa1c7fe0ce68b529bd3196018e7f600b
Created Sep 23, 2019
Greasemonkey userscript to prevent Jira from capturing the Alt+1 Alt+2 Alt+3 keyboard shortcuts
View gist:aa1c7fe0ce68b529bd3196018e7f600b
// ==UserScript==
// @name JIRA: Prevent Alt+[123] hijacking
// @namespace
// @include *RapidBoard.jsp*
// @version 1
// @grant none
// ==/UserScript==
gene1wood /
Last active Dec 18, 2019
Example of the directory structure,, tox.ini and pytest tests for a new python project

Directory structure

projectname/                 [1]
├── projectname              [2]
│   ├──
├── tests
│   └──
You can’t perform that action at this time.