This file contains hidden or 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 | |
PROVIDERS_DEFAULT="aws,awscc,google,azurerm,azuread" | |
PROVIDERS="" | |
SEARCH_LOC_DEFAULT=$HOME | |
SEARCH_LOC="" | |
TF_BIN="" | |
STATE_FILE_NAME="terraform.tfstate" | |
search_states() { |
This file contains hidden or 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
locals { | |
hashicorp_apt_gpg_key = file("${path.module}/config_files/hashicorp_apt_gpg_key.pub") | |
cloudinit_config_server = { | |
write_files = [ | |
{ | |
content = local.hashicorp_apt_gpg_key | |
owner = "root:root" | |
path = "/root/hashicorp-deb-key.pub" | |
permissions = "0644" | |
}, |
This file contains hidden or 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
# Based on https://github.com/jamesmdavies88/LuxaforMute/blob/main/mute.py | |
# Make sure to do the udev configuration there first | |
# This script also catches a SIGINT and turns off the LEDs, then exits cleanly | |
from array import array | |
import usb.core | |
import usb.util | |
import os | |
import signal | |
import sys |
This file contains hidden or 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
# Based on https://github.com/jamesmdavies88/LuxaforMute/blob/main/mute.py | |
# Make sure to do the udev configuration there first | |
from array import array | |
import usb.core | |
import usb.util | |
import os | |
def main(): |
This file contains hidden or 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 | |
# Dependencies: AWS CLI, GNU sort, bc | |
# Tested on Fedora 35. | |
# Requires valid AWS creds be available to the AWS CLI. | |
# Example usage: | |
# find-free-vpcs.sh |
This file contains hidden or 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
OLDPROMPT="$PS1" | |
prompt_set() { | |
if [ "$KUBECONFIG" != "" ]; then | |
PROMPT_KUBECONTEXT="k8s:$(kubectl config get-contexts --no-headers $(kubectl config current-context 2>/dev/null) 2>/dev/null | awk '{print substr($2,1,13)"..."substr($2,length($2)-19)}')\n" | |
fi | |
GIT_BRANCH=$(git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/{\1}/') | |
PROMPT_BRANCH=$(echo "$OLDPROMPT" | sed -e 's/\\u/\\u'${GIT_BRANCH}'/') | |
PS1="$PROMPT_KUBECONTEXT""$PROMPT_BRANCH" | |
} |
This file contains hidden or 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
if [ -f ~/.ssh-agent ] && [ /dev/console -nt ~/.ssh-agent ]; then | |
rm -f ~/.ssh-agent | |
echo "Deleted old agent environment file." | |
fi | |
if [ ! -f ~/.ssh-agent ]; then | |
echo "Starting agent." | |
ssh-agent > ~/.ssh-agent | |
fi |