Skip to content

Instantly share code, notes, and snippets.

@sgtoj
sgtoj / atmos-example.md
Last active August 3, 2021 14:54
atmos example
# use1-prod.yaml

import:
    - catalog/component/data 
    - catalog/app-stack/example-app
    - catalog/app-stack/foobar-app
    - globals
  
components:

Keybase proof

I hereby claim:

  • I am sgtoj on github.
  • I am sgtoj (https://keybase.io/sgtoj) on keybase.
  • I have a public key ASB_Va_bmMS89pI1oQuxOPhmPh2ywg8bZwFJ2G8Jv54bEgo

To claim this, I am signing this object:

@sgtoj
sgtoj / aws_sso.py
Last active October 2, 2024 14:22
AWS SSO Credentials File Updater for AWS SDKs
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@sgtoj
sgtoj / copy_sm_secrets.py
Last active May 17, 2024 12:03
Python script to copy AWS SecretsManager Secrets
#!/usr/bin/env python3
import os
import sys
import boto3
from botocore.exceptions import ClientError
# -------------------------------------------------------------------- main ---
@sgtoj
sgtoj / review_sns_topics.py
Last active December 17, 2019 15:03
Python script to query and save all SNS topics and their attributes in a given region.
#!/usr/bin/env python3
import json
import re
import sys
import os
import boto3
# -------------------------------------------------------------------- main ---
@sgtoj
sgtoj / aws_mfa_login.py
Last active January 27, 2020 12:52
Simple Script to Create MFA Login Sessions for AWS CLI and SDK
#!/usr/bin/env python3
import sys
from configparser import SafeConfigParser
from pathlib import Path
import boto3
import botocore
AWS_PROFILE_PATH = f"{Path.home()}/.aws/credentials"
@sgtoj
sgtoj / transfer_ddb.py
Created August 6, 2019 12:13
Copy DynamoDB Table to Another Table
#!/usr/bin/env python3
import boto3
# parameters for source account
SRC_ACCOUNT_PROFILE = 'aws_profile_name'
SRC_ACCOUNT_REGION = 'us-east-1'
SRC_TABLE = 'your-source-table-name'
# parameters for destination account
DST_ACCOUNT_PROFILE = 'aws_profile_name'
@sgtoj
sgtoj / config_aws_raid.sh
Last active September 10, 2024 18:55
Configure Raid for AWS Instance (NVME Supported)
#!/usr/bin/env bash
# ========================================================== configurations ===
RAID_NAME=ephemeral_raid
RAID_DEVICE=/dev/md0
RAID_MOUNT_PATH=/mnt/ephemeral
# =============================================================== functions ===
@sgtoj
sgtoj / wsl_py3.md
Created March 6, 2018 12:17
Install Python 3.6 from Source for Windows for Ubuntu

Python 3.6 is not avaliable via apt-get using a trusted source for the WSL's current version of Ubuntu (v16.04). Therefore, it is recommended to install Python 3.6 from source using the steps below. Be warned, installing Python from source takes several minutes to complete.

sudo apt-get install -y build-essential checkinstall
sudo apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd /usr/src

Change Product Name in Registry

  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
    • Set EditionID Key to Professional
    • Set ProductName Key to Windows 10 Professional
  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion
    • Set EditionID Key to Professional
    • Set ProductName Key to Windows 10 Professional

Update Windows