Skip to content

Instantly share code, notes, and snippets.


Gene Wood gene1wood

View GitHub Profile
gene1wood /
Last active Oct 26, 2020
How to get BitWarden to differentiate between consumer retail logins, AWS root logins and AWS IAM user logins

Here's how to get BitWarden to treat these three different types of Amazon logins as separate

  • consumer retail business login
  • AWS root user login (AWS logins that use an email address)
  • AWS IAM user login (AWS logins that use a username) consumer retail

  • Set URI 1 to Exact with a value of

gene1wood /
Last active Oct 24, 2020
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

gene1wood / all_aws_managed_policies.json
Last active Oct 19, 2020
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
View all_aws_managed_policies.json
This file has been truncated, but you can view the full file.
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
gene1wood /
Last active Oct 13, 2020
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
gene1wood /
Created Jan 8, 2018
How to install Duplicati on CentOS 6
# Install mono
rpm --import ""
yum-config-manager --add-repo
yum install mono-complete
# Install duplicati, ignoring dependencies
rpm -ivh --nodeps duplicati-
# Create init script and enable the service
gene1wood /
Last active Oct 8, 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 /
Created Dec 29, 2016
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(
client = session.client('sqs')
gene1wood / batch-delete-gmail-emails.js
Last active Oct 3, 2020
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
View batch-delete-gmail-emails.js
This script, when used with Google Apps Scripts will delete 500 emails and
can be triggered to run every minute without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Configure the search query in the code below to match the type of emails
you want to delete
Browser to
Start a script and paste in the code below.
After you past it in, save it and click the little clock looking button.
gene1wood / hide-boing-boing-ads.user.js
Last active Sep 27, 2020
Greasemonkey User Script to hide sponsored posts on
View hide-boing-boing-ads.user.js
// ==UserScript==
// @name Block Boing Boing Ads
// @namespace
// @description Block Boing Boing Ads
// @include*
// @include*
// @require
// @version 5
// @grant none
// ==/UserScript==
gene1wood /
Last active Sep 17, 2020
Explanation of the relationship between python logging root logger and other loggers

Explanation of the relationship between python logging root logger and other loggers

You can’t perform that action at this time.