I hereby claim:
- I am jerm on github.
- I am jermops (https://keybase.io/jermops) on keybase.
- I have a public key ASBBbEfmJpMCpL_Nx1V9kTRXmhSR4h3LkJ_yuCiL0_Y0Xwo
To claim this, I am signing this object:
| #!/bin/bash | |
| # | |
| # I got tired of re-enabling this by hand every time there was a MacOS update, | |
| # so now it's a script. | |
| # | |
| # sudo ./touchsudo.sh | |
| # | |
| # REQUIRES iTerm2 unless you remove that part. Why? Well... | |
| # | |
| # This opens a new iTerm sub-window in a root shell so that IF for some reason the new pam file |
| #!/usr/bin/env python | |
| import csv | |
| field_order_fh = open('field_order.txt',"r") | |
| field_order_list = field_order_fh.readlines() | |
| field_order_list_stripped=[] | |
| for f in field_order_list: | |
| field_order_list_stripped.append(f.rstrip('\n')) | |
| with open('my.csv', newline='') as infile: |
| #!/usr/bin/env python | |
| # | |
| # Sync your tailscale hosts to a route53 hosted zone. | |
| # | |
| import json | |
| import platform | |
| import subprocess | |
| import boto3 | |
| import click |
| # Git prompt stuff | |
| echo .profile | |
| __git_ps1(){ | |
| (:) | |
| } | |
| #[ -f ~/.git-completion.bash ] && source ~/.git-completion.bash | |
| #[ -f ~/.git-config.bash ] && source ~/.git-config.bash | |
| # Activate git completion and prompt functions. My Linux has these built-in in | |
| # /etc/bash_completion.d/git | |
| # On OSX I'm using homebrew where they can be found as below. |
| #!/usr/bin/env python | |
| import os | |
| import boto3 | |
| import yaml | |
| import click | |
| from ansible_vault import Vault |
| # This class retrieves /prefix/* parameters from aws parameter store and lets | |
| # you either reference them individually or it will put them all into your os environment | |
| # for fetching in familiar ways | |
| import os | |
| import boto3 | |
| class AWSParameterClass(object): | |
| def __init__(self, prefix): | |
| _project = boto3.client('ssm') |
| ### Ansible vault grepping | |
| export VAULTS_LIST_FILE='.vaults.txt' | |
| vaultscan() | |
| { | |
| echo "Scanning `pwd` for ansible-vault files" | |
| [ -n "$VAULTSCANBASE" ] && pushd "$VAULSCANBASE" | |
| true > $VAULTS_LIST_FILE | |
| IFS=$'\n' | |
| set -f | |
| for i in `find . -type f` |
| # Install autoenv (or similar) | |
| # add an export ITERM_TAB_LABEL='thisproject' line in .env in each project | |
| # add a noproject version in your homedir | |
| # add this to .profile | |
| # profit! | |
| export ITERM_TAB_LABEL="Set Me" | |
| set_tab_label() { echo "$ITERM_TAB_LABEL"; } | |
| PS1="$PS1\[\033k\033\134\033k\h\033\134\]\[\e]0;\`set_tab_label\`\a\]" |
I hereby claim:
To claim this, I am signing this object:
| import boto | |
| import datetime | |
| def lookup_instance_by_id(instance_id): | |
| conn = boto.connect_ec2() | |
| try: | |
| instance = conn.get_all_instances(filters = {'instance_id':instance_id})[0].instances[0] | |
| except IndexError: | |
| return False | |
| if instance.state != 'terminated': |