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
gene1wood / SEP315.pdf
Last active Jun 13, 2019
SEP315 Slide Deck
View SEP315.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gene1wood
gene1wood / summary-of-J2M-forks.md
Created Jun 6, 2019
Summary of the forks of the J2M "Convert from JIRA text formatting to GitHub Flavored MarkDown and back again" project
View summary-of-J2M-forks.md
@gene1wood
gene1wood / persisted_json_and_yaml_dict.py
Created May 16, 2019
Python dict object which persists its contents to disk with every change, either in JSON or YAML
View persisted_json_and_yaml_dict.py
import collections, json
class PersistedJSONDict(collections.MutableMapping):
def __init__(self, filename, *args, **kwargs):
self.filename = filename
self.store = dict()
self.load()
self.update(dict(*args, **kwargs))
def __setitem__(self, key, value):
self.store[key] = value
@gene1wood
gene1wood / generate-list-of-aws-elb-ciphers.sh
Created May 8, 2019
All supported AWS Elastic Load Balancer (ELB)
View generate-list-of-aws-elb-ciphers.sh
aws elb describe-load-balancer-policies --query "PolicyDescriptions[?PolicyName=='ELBSample-ELBDefaultCipherPolicy'].PolicyAttributeDescriptions[*].AttributeName[]"
View gist:f0f827cd72dde3ec7a83abd16ef51d97
from authlib.flask.client import OAuth
if os.getenv("NO_AUTH", "False") == "False":
AUTH0_CALLBACK_URL = env.get(constants.AUTH0_CALLBACK_URL)
AUTH0_CLIENT_ID = env.get(constants.AUTH0_CLIENT_ID)
AUTH0_CLIENT_SECRET = env.get(constants.AUTH0_CLIENT_SECRET)
AUTH0_DOMAIN = env.get(constants.AUTH0_DOMAIN)
AUTH0_BASE_URL = "https://" + AUTH0_DOMAIN
AUTH0_AUDIENCE = env.get(constants.AUTH0_AUDIENCE)
if AUTH0_AUDIENCE is "":
@gene1wood
gene1wood / Makefile
Last active Apr 8, 2019
make example Makefile showing the order that targets are resolved
View Makefile
foraker: elbert rainier
@echo "foraker"
elbert:
@echo "elbert"
rainier: blanca
@echo "rainier"
blanca:
@gene1wood
gene1wood / bitwarden-amazon-aws-credential-setup.md
Last active Jan 31, 2019
How to get BitWarden to differentiate between amazon.com consumer retail logins, AWS root logins and AWS IAM user logins
View bitwarden-amazon-aws-credential-setup.md

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

  • amazon.com 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)

amazon.com consumer retail

  • Set URI 1 to Exact with a value of

    https://www.amazon.com/ap/signin?_encoding=UTF8&ignoreAuthState=1&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2F%3Fref_%3Dnav_custrec_signin&switch_account=

View git-cheat-sheet.md

How to un-commit the last un-pushed git commit and move those changes to the index

git reset HEAD~1 --soft

or in SmartGit : Shift-Cntrl-K or Local... Undo Last Commit

How to ammend to a previous commit which is not the most recent

  • Stash any uncomitted changes : Cntrl-S... Stash All
  • In SmartGit find the commit you want to ammend to and right click... Modify/Split...
@gene1wood
gene1wood / troubleshooting-dell-new-xps-15-9570-sleep-suspend-problems.md
Last active Jan 16, 2019
Trying to get sleep / suspend to work in Ubuntu 18.04 on my Dell New XPS 15 9570
View troubleshooting-dell-new-xps-15-9570-sleep-suspend-problems.md

Here are some steps I tried which didn't end up working related to nouveau

  1. Install the Nvidia drivers if they're not already
    • sudo ubuntu-drivers autoinstall
  2. Disable the nvidia-fallback service to prevent it from loading nouveau
    • sudo systemctl disable nvidia-fallback.service
  3. Edit /etc/default/grub and added the following line to block nouveau
    • GRUB_CMDLINE_LINUX="nouveau.blacklist=1"
  4. Update grub with the change you just made
    • sudo update-grub
@gene1wood
gene1wood / cloudformation-force-failure-if-mapping-still-set-to-default.yml
Created Jan 11, 2019
AWS CloudFormation template that checks if a mapping value is still set to the default/example value, and if so, forces stack creation to fail
View cloudformation-force-failure-if-mapping-still-set-to-default.yml
AWSTemplateFormatVersion: 2010-09-09
Description: Example ensuring mapping isn't set to it's default
Mappings:
Variables:
AnExampleKey:
# Make sure to set AnExampleVariable before launching this stack
AnExampleVariable: arn:aws:iam::123456789012:root
Conditions:
VariablesNotSet: !Equals [ !FindInMap [ Variables, AnExampleKey, AnExampleVariable ] , 'arn:aws:iam::123456789012:root' ]
Resources:
You can’t perform that action at this time.