Skip to content

Instantly share code, notes, and snippets.

Avatar

Gene Wood gene1wood

View GitHub Profile
@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active Sep 21, 2021
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`
View aws-lambda-relative-import-no-known-parent-package.md

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

.
├── lambda_file.py
└── example.py
@gene1wood
gene1wood / .GitHub-Webhook-Ngrok-Test-Endpoint.md
Last active Sep 18, 2021
Simple ngrok + flask app to show a JSON payload. Intended as a GitHub webhook web endpoint for testing.
View .GitHub-Webhook-Ngrok-Test-Endpoint.md

Simple ngrok + flask app to show a JSON payload. Intended as a GitHub webhook web endpoint for testing.

@gene1wood
gene1wood / thread-on-how-maintainers-assert-their-role.md
Created Sep 17, 2021
Here's a thread I've started with the Mozilla GitHub owners to try to agree on a standard for how maintainers assert their role
View thread-on-how-maintainers-assert-their-role.md

With the recent Travis CI security issue, it's again become necessary for Mozilla security folks to need to be able to contact maintainers of our GitHub repos (in this case to coordinate rotation of leaked credentials). I wanted to see if we (GitHub owners) could come up with a standard (either an existing one or make one) for how people can assert and communicate their role as a maintainer of a given GitHub repo. I don't know if an email thread is the best channel, but I thought I'd start this and we could switch to a zoom call if folks want. Here are some potential solutions that have come to mind

SECURITY.md

This standard ( https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository ) is so repo maintainers can assert how to report security vulnerabilities.

  • It's public so maintainers might be reluctant to put email addresses in there
@gene1wood
gene1wood / duplicacy_github_issues_disabled_earlier_this_year.md
Last active Sep 12, 2021
Duplicacy GitHub issues disabled earlier this year
View duplicacy_github_issues_disabled_earlier_this_year.md

It looks like GitHub issues were disabled on the Duplicacy GitHub repo sometime between April and July this year (2021). I noticed this while checking back on a bug to see if I still needed to continue to use a workaround or if it had been fixed.

I searched through the repo README, on the duplicacy.com website and here in the forums but don't see any mention of the disabling of issues, or where one is meant to report or track bugs now.

Gilbert, if the intent is to prevent opening new issues (I'm guessing here, but as a maintainer of open source software I'm familiar with the challenges of getting low quality issues), would it be possible to, instead of disabling GitHub issues, re-enable GitHub issues and instead create a [6 month interac

@gene1wood
gene1wood / batch-delete-gmail-emails.js
Last active Sep 11, 2021
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 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 threads. This limits to 400 threads in case 500
threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete
@gene1wood
gene1wood / how_to_create_a_new_python_package.md
Last active Sep 9, 2021
My process for creating a new python package
View how_to_create_a_new_python_package.md
my-package-name
├── my_module_name
│   └── __init__.py
├── LICENSE.txt
├── README.rst
├── requirements.txt
└── setup.py
  • Create a Python package name which is ideally all lower case with no dashes but may contain dashes (but not underscores)
@gene1wood
gene1wood / parse_arn.py
Last active Sep 7, 2021
Parse an AWS ARN (Amazon Resource Name) into it's constituent elements
View parse_arn.py
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:
@gene1wood
gene1wood / launch.jnlp
Created Feb 6, 2015
How to modify the SuperMicro IPMI Remote Console java applet to use a port other than 443
View launch.jnlp
<jnlp spec="1.0+" codebase="https://localhost:8443/">
<information>
<title>ATEN Java iKVM Viewer</title>
<vendor>ATEN</vendor>
<description>Java Web Start Application</description>
</information>
<security>
<all-permissions/>
</security>
@gene1wood
gene1wood / 01-explanation-of-python-logging-and-the-root-logger.md
Last active Aug 31, 2021
Explanation of the relationship between python logging root logger and other loggers
View 01-explanation-of-python-logging-and-the-root-logger.md

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