Skip to content

Instantly share code, notes, and snippets.

View MGough's full-sized avatar

Merlin Gough MGough

View GitHub Profile
function aws-sso-access-token() {
find "$HOME/.aws/sso/cache" -type f ! -name 'botocore*' -exec jq -r '.accessToken' {} \; | head -n1
}
function aws-sso-list-accounts() {
aws sso list-accounts --access-token "$(aws-sso-access-token)" "$@"
}
function aws-sso-list-account-roles() {
aws sso list-account-roles --access-token "$(aws-sso-access-token)" "$@"
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@gebn
gebn / ctl
Last active March 30, 2016 22:49
Finds and connects to a UG04 lab machine.
#!/bin/bash
# will hold available machine hostnames
alive=()
# iterate through a subset of machines in UG04
for suffix in {10..100}; do
# ping each one
ping -c 1 -t 1 "cca-ug04-130$suffix" > /dev/null 2>&1