I hereby claim:
- I am PauloMigAlmeida on github.
- I am paulomigalmeida (https://keybase.io/paulomigalmeida) on keybase.
- I have a public key whose fingerprint is 72C3 8C20 51A2 0BED 8CFF D7C4 AD41 6024 41C7 75EC
To claim this, I am signing this object:
| #!/bin/bash | |
| # Configure machine size | |
| curl --unix-socket /tmp/firecracker.sock -i \ | |
| -X PUT 'http://localhost/machine-config' \ | |
| -H 'Accept: application/json' \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ "vcpu_count": 4, "mem_size_mib": 16384}' | |
| # configure kernel path at firecracker |
| How to compile the linux kernel, launch it as a process and boot into Alpine linux | |
| #Command + Shift + 5 | |
| #Host -> Docker GCC -> UML w/ Alpine | |
| # create and mount the filesystem | |
| sudo rm -rf ~/workspace/root_fs_um | |
| mkdir -p ~/workspace/root_fs_um | |
| cd ~/workspace/root_fs_um | |
| dd if=/dev/zero of=root_fs bs=1M count=1024 |
| # Assuming that you have AWS cli installed and configured. | |
| # To run: | |
| # terraform init | |
| # terraform plan -out terraform.tfplan | |
| # terraform apply terraform.tfplan | |
| provider "aws" { | |
| region = "ap-southeast-2" | |
| } |
| ; Mem definition | |
| PML4.Addr equ 0x00010000 ; PML4 | |
| PDPE.Addr equ 0x00011000 ; 0x10000 + PML4 (512 entries of 64 bits) | |
| PDE.Addr equ 0x00012000 ; 0x11000 + PDPE (512 entries of 64 bits) | |
| PTE.Addr equ 0x00013000 ; 0x12000 + PDE (512 entries of 64 bits) | |
| ; Setup pages structure and flag bits | |
| ; Present (bit 1) and ReadWrite(bit 2) bits are set | |
| .StdBits equ 0x03 |
| # ap-souteast-2 prices only for now | |
| import math | |
| import sys | |
| upload_requests_price_per_thousand = 0.06 | |
| storage_price_per_gb = 0.005 | |
| standard_retrieval_price_per_gb = 0.012 | |
| standard_retrieval_price_per_1000_requests = 0.06 | |
| free_tier_retrieve_per_month = 10 |
| for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output json | jq -r '.[]'); do | |
| echo "$region = $(aws ec2 describe-images --owners amazon --filters 'Name=name,Values=amzn-ami-hvm-????.??.?.x86_64-gp2' --query 'sort_by(Images, &CreationDate) | [-1].ImageId' --region $region)" | |
| done |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Author: Paulo Miguel Almeida <[email protected]> | |
| # | |
| # Desc: Utility script that allows you to find the same ami(name) across multiple regions. | |
| # For instance, let's suppose that you want to find the Ubuntu Server 16.04 LTS HVM SSD | |
| # to build a nice cloudformation template. Note that you can play around with the filters | |
| # that AWSCLI provides. Have fun ;) | |
| # Usage: | |
| # find_ami_in_multiple_regions.sh ami-e93da085 (Obs.: This ami must be at same region your AWS is set) |
| #!/bin/bash | |
| # Usage ./find_class_directory.sh <folder> <class> | |
| # Example: ./find_class_directory.sh WEB-INF/lib SignatureReader | |
| TARGET_DIR=$1 | |
| TARGET_CLASS=$2 | |
| LIST_FILES=$(ls -1 $TARGET_DIR | grep -i -e ".*\.jar") | |
| while read -r line; do |
| #/bin/bash | |
| # Usage ./download.sh <bucket_name> <target_folder> | |
| # Example: ./download.sh test ./files_today | |
| # Note: you must configure your awscli before use this. Execute aws configure | |
| BUCKET_NAME=$1 | |
| TARGET_DIR=$2 | |
| FILES_LIST=$TARGET_DIR/files.txt |