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
#!/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 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 | |
# | |
# 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 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 | |
# 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 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
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 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 | |
PROFILE=${AWS_PROFILE:-default} | |
TAG=${TAG:-Name} | |
STATE=${STATE:-running} | |
aws ec2 --profile ${PROFILE} describe-instances \ | |
--filters Name=instance-state-name,Values=${STATE} | \ | |
jq .Reservations[].Instances[].Tags | \ | |
jq -c ".[] | select(.Key | contains(\"${TAG}\"))" | \ |