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
# 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\]" |
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
### 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` |
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
# 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') |
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 python | |
import os | |
import boto3 | |
import yaml | |
import click | |
from ansible_vault import Vault |
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
# 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. |
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 python | |
# | |
# Sync your tailscale hosts to a route53 hosted zone. | |
# | |
import json | |
import platform | |
import subprocess | |
import boto3 | |
import click |
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 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: |
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 | |
# | |
# 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 |
OlderNewer