Skip to content

Instantly share code, notes, and snippets.

View mijndert's full-sized avatar
💻
Remote

Mijndert mijndert

💻
Remote
View GitHub Profile
@benkoller
benkoller / s3-static-hosting.tf
Created March 27, 2021 08:19
A terraform script to create all resources one might need to self-host a static page on S3. Includes a SSL cert, DNS records, Bucket, and a Cloudfront distribution.
terraform {
required_providers {
aws = {
version = "3.11"
}
}
}
provider "aws" {
shared_credentials_file = "$HOME/.aws/creds"
@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active April 19, 2024 11:40
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:

@DaisukeMiyamoto
DaisukeMiyamoto / assume_role.py
Created September 12, 2018 05:00
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@jairamc
jairamc / set-aws-credentials.py
Last active December 21, 2021 02:45
Simple python script to set AWS Credentials in your environment variables
#! /usr/bin/env python
###############################################################
# In your .bashrc/.zshrc add `eval $(python <path to script>)`
# Or simply run `eval $(python <path to script>)`
# This avoids adding your aws credentials to bash/zsh history
###############################################################
import os, sys
from ConfigParser import ConfigParser
from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.