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
eval $( ssh-agent ) | |
# Can add as many keys as you want | |
ssh-add /path/to/key | |
ssh -A user@host |
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
# | |
# For security purposes, the output has been obfuscated with '***' in a few places. | |
# | |
Error: Expected to find one security group with ID "", got: []*ec2.SecurityGroup{{ | |
Description: "SG for access to *** layer", | |
GroupId: "sg-*****", | |
GroupName: "*****", | |
IpPermissions: [ | |
{ |
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
[core] | |
editor = vim | |
[alias] | |
reup = !git stash && git fetch && git rebase origin/master && git stash pop | |
au = !git add -u && git fetch >/dev/null && git diff --cached --no-ext-diff origin/master | grep --color=always 'pdb.set_trace()' -B 6 | |
re = reset | |
dc = diff --cached | |
st = status | |
co = checkout |
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 |
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
#!/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
#!/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
#!/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
""" | |
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
#!/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' |