This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Without threadpool | |
for repo in repos: | |
update_repo_data(repo) | |
# ----------------------------------------------------------------------------------- # | |
# With threadpool | |
with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_EXECUTORS) as executor: | |
executor.map(update_repo_data, repos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.poetry] | |
name = "***" | |
version = "0.1.0" | |
description = "" | |
authors = ["mijdavis2 <***>"] | |
[tool.poetry.dependencies] | |
python = "3.8.10" | |
selenium = "3.141.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws route53 list-resource-record-sets --hosted-zone-id SOME_ZONE_ID --output json | jq '.ResourceRecordSets[] | select(.Name | startswith("some.example.com"))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Helpful for finding lambdas that are using an old runtime, etc. | |
RUNTIME=node | |
ARN_SUFFIX=etl | |
aws lambda list-functions --region us-west-2 | \ | |
jq '.Functions[] | select(.Runtime | startswith("${RUNTIME}")) | select (.FunctionArn | endswith("${ARN_SUFFIX}")) | .FunctionName' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Not actually sure when this would be a good idea, | |
but had the idea when porting some js/node to python. | |
Inspired by https://stackoverflow.com/questions/6578986/how-to-convert-json-data-into-a-python-object | |
""" | |
import json | |
from types import SimpleNamespace | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# hook to enforce that current branch is up-to-date with latest | |
# changes from master before committing | |
# put me in .git/hooks and make me executable | |
# the output of rev-list in the following test will be empty if there | |
# are no commits in master that aren't in the current branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# inputs: AWS_PROFILE, IP, PATH_TO_PRIV_KEY | |
function get-aws-windows-password | |
set instance_id (aws --profile $argv[1] ec2 describe-instances --filter Name=private-ip-address,Values=$argv[2] --query 'Reservations[].Instances[].InstanceId' --output text) | |
echo "Instance ID: $instance_id" | |
set passwd (aws --profile $argv[1] ec2 get-password-data --instance-id $instance_id --priv-launch-key $argv[3] --query 'PasswordData' --output text) | |
echo "Password: $passwd" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Requires `gh` --> https://cli.github.com/ | |
# | |
# Ensure you setup gh cli via `gh auth login` | |
# and select the `ssh` option if you are cloning private repos - much easier. | |
# | |
# Usage: | |
# $ ./clone-repos.sh some_org target_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# inputs: AWS_PROFILE, IP, PATH_TO_PRIV_KEY | |
instance_id="$(aws --profile $1 ec2 describe-instances --filter Name=private-ip-address,Values=$2 --query 'Reservations[].Instances[].InstanceId' --output text)" | |
echo "Instance ID: $instance_id" | |
passwd="$(aws --profile $1 ec2 get-password-data --instance-id ${instance_id} --priv-launch-key $3 --query 'PasswordData' --output text)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_prompt --description 'Write out the prompt' | |
set -l last_status $status | |
if not set -q __fish_git_prompt_show_informative_status | |
set -g __fish_git_prompt_show_informative_status 1 | |
end | |
if not set -q __fish_git_prompt_hide_untrackedfiles | |
set -g __fish_git_prompt_hide_untrackedfiles 1 | |
end | |
if not set -q __fish_git_prompt_color_branch | |
set -g __fish_git_prompt_color_branch magenta --bold |
NewerOlder