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 | |
# Usage: ./run.sh <ips.csv> | |
set -euo pipefail | |
IP_CSV="$1" | |
OUT_LOG="combined-output.log" | |
# 1) Clear the single output file | |
: > "$OUT_LOG" |
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 | |
import ipaddress, csv | |
# ◼ Adjust these file‐names/paths as needed | |
CIDR_FILE = 'cidrs.tsv' | |
IP_FILE = 'ips.txt' | |
OUTPUT_FILE = 'matched.tsv' | |
# 1) Load and parse your CIDRs | |
networks = [] |
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 | |
# runscript.sh | |
# Usage: ./runscript.sh <ip-address> | |
set -euo pipefail | |
IP_ADDRESS=${1:-} | |
if [[ -z $IP_ADDRESS ]]; then | |
echo "Usage: $0 <ip-address>" | |
exit 1 |
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 | |
# runscript.sh | |
# Usage: ./runscript.sh <ip-address> | |
set -euo pipefail | |
IP_ADDRESS=${1:-} | |
if [[ -z $IP_ADDRESS ]]; then | |
echo "Usage: $0 <ip-address>" | |
exit 1 |
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 | |
# 1) initialize/clear per‑profile logs | |
awk -F, ' | |
NR>1 { logs[$1]=1 } | |
END { for(p in logs) system("> " p "-output.log") } | |
' ips.csv | |
# 2) for each line (skip header) in ips.csv |
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 zsh | |
# aws-multi-role.zsh | |
# Usage: ./aws-multi-role.zsh <env> | |
# Example: ./aws-multi-role.zsh preprod | |
set -euo pipefail | |
# --- 1. prerequisites -------------------------------------------------------- | |
# verify jq is installed (for JSON parsing) | |
if ! command -v jq >/dev/null; then |
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
1. Basic Syntax | |
• Comments: | |
Use # for single-line comments and triple quotes ("""...""" or '''...''') for multi-line strings or docstrings. | |
# This is a single-line comment | |
""" | |
This is a multi-line comment or docstring. | |
Useful for module or function documentation. | |
""" |
NewerOlder