Skip to content

Instantly share code, notes, and snippets.

View mtulio's full-sized avatar

Marco Braga mtulio

View GitHub Profile
@mtulio
mtulio / ARM-output-aws-ec2-offering-table.txt
Created August 7, 2023 05:43
AWS EC2 Offerings across zones - focus on ARM
2023-08-06 23:50:25.466977>> Zones by Family
c6g.2xlarge
zone
af-south-1a --
af-south-1b --
af-south-1c --
ap-east-1a X
ap-east-1b X
@mtulio
mtulio / aws-local-zones-ec2-offerings-by-type.txt
Last active March 1, 2023 01:38
EC2 instances offering in AWS Local Zones
>> Instance map
{'c5.12xlarge': ['us-west-2-lax-1b', 'us-west-2-lax-1a'],
'c5.18xlarge': ['us-west-2-lax-1b', 'us-west-2-lax-1a'],
'c5.24xlarge': ['us-west-2-lax-1a', 'us-west-2-lax-1b'],
'c5.2xlarge': ['us-east-1-scl-1a',
'us-east-1-bue-1a',
'us-west-2-lax-1b',
'us-west-2-lax-1a',
'eu-north-1-hel-1a',
'eu-north-1-cph-1a',
@mtulio
mtulio / replace-nlb-ocp-k8s-api.sh
Last active October 20, 2021 12:04
Replace NLB's target group from kube-apiserver to Target Type instance
#/bin/sh
#
# Switch NLB's listeners to target group type 'instnace' on
# kube-apiserver on OpenShift deployment.
#
set -o pipefail
set -o nounset
set -o errexit
@mtulio
mtulio / aws-eks-lab.sh
Created September 14, 2018 04:54
Basic EKS lab to setup an new cluster
#!/bin/bash
# Basic EKS client Setup and management
# Doc: https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html
OS_NAME=linux
OS_ARCH=amd64
OS_DIST=$(cat /etc/os-release |grep ^NAME |awk -F'=' '{print$2}')
KUBECTL_URL=https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/${OS_NAME}/${OS_ARCH}/kubectl
#!/bin/bash
# Benchmark in Linux OS using FIO and IOping
## FIO
# Random read performance
time fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 \
--name=test --filename=./test-r \
--bs=4k --iodepth=64 --size=40G --readwrite=randrw --rwmixread=75
@mtulio
mtulio / aws-cli-spot-get-cheaper-by-region
Created August 24, 2018 06:23
AWS CLI - Check the cheaper spot on an given Region and Instance Type and return the AZ name
#!/bin/bash
# Return cheapper AZ for an given instance type and region
# Eg: $0 us-east-1 r3.8xlarge [all]
# AWS Region [Eg. us-east-1 ]
R=$1
# AWS Instance Type [Eg. r3.8xlarge ]
I=$2
#!/bin/bash
#
# generate_ramdom_password.sh - Generate random passwords
#
# author: Marco Tulio R Braga (https://github.com/mtulio)
# created: Aug 18, 2015
# modified: Aug 18, 2015
#
#######################################