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 -*- | |
| """Argparse Subcommand Template.""" | |
| import argparse | |
| from pathlib import Path | |
| MAP = { | |
| "dev": { | |
| "arg1": "foo", | |
| }, |
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
| # See https://pre-commit.com for more information | |
| # See https://pre-commit.com/hooks.html for more hooks | |
| repos: | |
| - repo: https://github.com/pre-commit/pre-commit-hooks | |
| rev: v3.2.0 | |
| hooks: | |
| - id: trailing-whitespace | |
| - id: end-of-file-fixer | |
| - id: check-yaml | |
| - id: check-added-large-files |
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 -*- | |
| """ | |
| Gives a very ROUGH estimate for costs of unattached volumes since creation. | |
| This is only an estimate, and meant to shine a light on possible savings. | |
| In my paricular case, I used AWS sso to generate a list of profiles for all | |
| accounts in our organization and iterated over those accounts to find | |
| unattached EBS volumes. |
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 -*- | |
| """Auto generate SSO profiles based on your membership.""" | |
| import argparse | |
| from configparser import ConfigParser | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| import re | |
| import subprocess |
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 -*- | |
| """List all processes, sort by number of open files.""" | |
| from collections import Counter | |
| import psutil | |
| def main(): | |
| """Run main function.""" |
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' | |
| curl -X POST \ | |
| -H 'Content-Type:application/json' \ | |
| -H "Accept:application/json" \ | |
| -d '@temp.json' \ | |
| http://localhost:5000/ |
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 | |
| # import gpg public web-flow signature into your keychain 4AEE18F83AFDEB23 | |
| curl https://github.com/web-flow.gpg | gpg --import |
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 -*- | |
| """Convert JSON to python dataclass.""" | |
| import argparse | |
| import json | |
| import select | |
| from string import Template | |
| import sys | |
| from typing import Any, Tuple |
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 -*- | |
| """Enumerate LDAP nested Group Membership, from list of group names in json file""" | |
| import json | |
| import logging | |
| import os | |
| from pathlib import Path | |
| import ssl | |
| from typing import List |
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
| # add studio javac to path | |
| if [[ ${PATH} != *"${ANDROID_SDK_ROOT}/bin"* ]]; then | |
| export PATH="${ANDROID_SDK_ROOT}/jre/bin:${PATH}" | |
| fi |