Skip to content

Instantly share code, notes, and snippets.

View tickbox-smc's full-sized avatar

Chris Falck tickbox-smc

View GitHub Profile
@tickbox-smc
tickbox-smc / .bash_profile
Created September 23, 2022 14:31 — forked from atr0s/.bash_profile
AWS Session Manager SSH/SCP helper
# Snippet of code to be put on ~/.bash_profile to help SSH into instances via Session Manager while specifying AWS profiles
# It can be used by saving ~/.ssm_bash_profile and adding the following line to ~/.bash_profile
# source ~/.ssm_bash_profile
function aws-ssm-instance-list {
if [ "$#" -lt 1 ]; then
echo "Usage: aws-ssm-instance-list <profile name>"
else
output=$(aws ssm describe-instance-information --profile $1 --query "InstanceInformationList[*].{Name:ComputerName,Id:InstanceId,IPAddress:IPAddress}" --output text)
echo "$output"
@tickbox-smc
tickbox-smc / aws-credentials.sh
Created April 26, 2022 16:04 — forked from inkblot/aws-credentials.sh
Authenticate to vault using IAM instance profile credentials in bash using curl, openssl, and jq
#!/bin/bash
_SELF="${0##*/}"
_HERE="$(dirname $(realpath ${0}))"
function aws_instance_profile_arn() {
curl -s http://169.254.169.254/2019-10-01/meta-data/iam/info | jq -r .InstanceProfileArn
}
function aws_instance_profile_name() {
@tickbox-smc
tickbox-smc / py_flask_ex.py
Created March 24, 2022 14:16 — forked from postcert/py_flask_ex.py
simple python flask healthcheck toggler
from flask import Flask, jsonify
app = Flask(__name__)
health_status = True
@app.route('/toggle')
def toggle():
global health_status
health_status = not health_status
@tickbox-smc
tickbox-smc / README.md
Created July 27, 2021 08:33 — forked from avoidik/README.md
AWS query examples

Top 10 Examples of AWS CLI Query

List Volumes showing attachment using Dictionary Notation

$ aws ec2 describe-volumes \
  --query 'Volumes[*].{ID:VolumeId,InstanceId:Attachments[0].InstanceId,AZ:AvailabilityZone,Size:Size}'
[
    {
        "InstanceId": "i-a071c394",
@tickbox-smc
tickbox-smc / iterm2-solarized.md
Created March 29, 2019 10:06 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k