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
import boto3 | |
import json | |
# --- CONFIGURATION --- | |
SAML_PROVIDER_NAME = "IAMIdentityCenterProvider" # must already exist | |
ROLE_NAME = "SAMLAdminAccessRole" | |
POLICY_NAME = "SAMLAdministratorAccessPolicy" | |
POLICY_DESCRIPTION = "Full admin access for SAML federated users" | |
USE_MANAGED_ADMIN_POLICY = True # set False to use a custom inline policy |
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
#!/bin/bash | |
# Usage: | |
# ./clone_deleted_stack.sh <stack-id-or-name> [new-stack-name] [optional-role-arn] | |
set -euo pipefail | |
INPUT_ID="${1:-}" | |
NEW_STACK_NAME="${2:-}" | |
ROLE_ARN="${3:-}" |
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
import boto3 | |
import tempfile | |
import os | |
import sys | |
from urllib.parse import urlparse | |
import openpyxl | |
def parse_s3_uri(s3_uri): | |
parsed = urlparse(s3_uri) | |
bucket = parsed.netloc |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Test substitution logic for IP construction with dummy resource. | |
Resources: | |
DummyResource: | |
Type: AWS::CloudFormation::WaitConditionHandle | |
Outputs: | |
FabricComponentsStaticIP: | |
Value: !Sub |
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
const redis = require('redis'); | |
const readline = require('readline'); | |
async function connectRedis(host, port, db, password) { | |
const client = redis.createClient({ | |
socket: { host, port }, | |
database: db, | |
password | |
}); | |
await client.connect(); |
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
# define functions to run the ocr, | |
# annotate the images with the bounding boxes | |
# consolidate the results to a dataframe | |
# and iterate over a folder of images | |
from PIL import Image, ImageDraw | |
import pandas as pd | |
from paddleocr import PaddleOCR | |
import os | |
import traceback |
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
while true; do | |
curl -o /dev/null -s -w "%{http_code}, %{time_total}s\n" \ | |
http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | |
sleep 5 | |
done |
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
#!/bin/bash | |
echo "Updating package lists..." | |
dnf update -y | |
echo "Installing required dependencies..." | |
dnf install -y perl perl-core perl-FindBin perl-Time-HiRes perl-JSON \ | |
perl-Digest-MD5 perl-Text-CSV perl-LWP-Protocol-https \ | |
perl-DBI perl-DBD-Pg tar gzip make |
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
#!/bin/bash | |
set -euo pipefail | |
# Check for required commands: aws and jq. | |
command -v aws >/dev/null 2>&1 || { echo "aws CLI is required but not installed. Exiting." >&2; exit 1; } | |
command -v jq >/dev/null 2>&1 || { echo "jq is required but not installed. Exiting." >&2; exit 1; } | |
usage() { | |
cat <<EOF | |
Usage: $0 [secret_name] |
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
# install pipx | |
python -m pip install --user pipx | |
python -m pipx ensurepath | |
sudo pipx ensurepath --global | |
# install jupyterlab | |
pipx install jupyterlab --include-deps | |
pipx ensurepath | |
# add common dependencies |
NewerOlder