Host aws-sshless-basion
Hostname i-xxxxxxxxxxxx
IdentityFile ~/.ssh/ssh_key
ProxyCommand sh -c "aws ssm start-session --profile aws-profile --region us-east-2 --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
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 python3 | |
| # -*- coding: utf-8 -*- | |
| """Find common strings in multiple files.""" | |
| import argparse | |
| from io import BytesIO | |
| from pathlib import Path | |
| import tokenize | |
| def _itertokens(file: Path): |
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
| git log --pretty=format: --name-only --diff-filter=A |
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
| package crypt | |
| import ( | |
| crypto_rand "crypto/rand" | |
| "encoding/hex" | |
| "io" | |
| "golang.org/x/crypto/nacl/box" | |
| ) |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| """Dump AWS logs entries by in timestamp range""" | |
| import argparse | |
| from datetime import datetime | |
| import logging | |
| import json | |
| import boto3 |
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 bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| DIR="$(dirname "$(readlink -f "$0")")" | |
| GENERATED_DEST="${DIR}/frontend/src/lib/generatedapi" | |
| OPENAPI_FILE="${DIR}/openapi.json" | |
| test -d "${GENERATED_DEST}" || rm -rfv "${GENERATED_DEST}" | |
| mkdir -p "${GENERATED_DEST}" |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Recursively search for a file in a directory tree. | |
| """ | |
| import argparse | |
| from pathlib import Path | |
| def iter_parents(path: Path, args): | |
| """Iterate parents.""" |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Generate a list of AWS SSO urls you can open in your browser. | |
| Fzf Usage: | |
| ./aws_sso_url_generator.py | fzf | awk '{print $NF}' | xargs google-chrome | |
| """ | |
| import asyncio |
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 bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| key_alias="alias/github-barracuda-internal" | |
| param_name="supersecret" | |
| secret=$(openssl rand -hex 256 | tr -d '\n' | base64 -w 0) | |
| arg="${1:-}" | |
| test "${arg}" && secret="$(echo "${arg}" | base64 -w 0)" |
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 bash | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| TAG="cf-frontend:latest" | |
| DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| BUCKET="cf-bucket" | |
| CF_DIST_ID="d-xxxxxxxxxxxx" | |
| FRONTEND_DIR="${DIR}/../frontend" | |
| pushd "${FRONTEND_DIR}" |