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 -e | |
sudo apt update | |
sudo apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -y | |
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ |
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 os | |
import traceback | |
from botocore import exceptions, session | |
try: | |
session_obj = session.get_session() | |
credentials = session_obj.get_credentials() |
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 | |
from sys import argv, exit | |
def get_bucket_mpus_size(bucket_name, object_prefix=''): | |
aws_session = boto3.session.Session() # Uses either EC2/ECS metadata, ~/.aws/credentials file, or env vars for auth. | |
s3 = aws_session.resource('s3') | |
bytes_per_gb = 1024 * 1024 * 1024 |