Skip to content

Instantly share code, notes, and snippets.

@faermanj
faermanj / test-all.yml
Last active February 21, 2023 16:06
Test matrix with github actions
name: Test all versions
on:
workflow_dispatch: {}
jobs:
iterate_and_call:
runs-on: ubuntu-latest
strategy:
matrix:
@faermanj
faermanj / script.sh
Created November 29, 2022 13:45
Install fedora image to raspi card
arm-image-installer --image=/home/faermanj/Downloads/Fedora-Workstation-37-1.7.aarch64.raw.xz --target=rpi4 --media=/dev/sda --resizefs
@faermanj
faermanj / README.md
Created July 23, 2022 14:11
Mentoria Coletiva - Algoritmos e Programação - 23/07/2022
@faermanj
faermanj / aws-nuke.yml
Last active May 8, 2023 15:59
Limpando sua conta da AWS com aws-nuke
accounts:
"192912639870": {} # ccsandbox
account-blocklist:
- "192912699999"
resource-types:
excludes:
- IAMGroup
- IAMGroupPolicy
@faermanj
faermanj / pre-req.js
Created May 3, 2022 13:05
Postman OIDC
var auth_username = pm.variables.get("auth_username")
var auth_password = pm.variables.get("auth_password")
var client_id = pm.variables.get("client_id")
var client_secret = pm.variables.get("client_secret")
var authBody = `username=${auth_username}&password=${auth_password}&grant_type=password&client_id=${client_id}&client_secret=${client_secret}`;
console.log(authBody)
var force_refresh = true
var token_expires_in = pm.environment.get("token_expires_in");
var token_created = pm.environment.get("token_created");
@faermanj
faermanj / README.md
Last active July 12, 2023 14:12
TDC 2022 - Aplicacoes Seguras com Quarkus

Aplicações Seguras com Quarkus e Keycloak

Julio @faermanj
https://faermanj.me
https://caravana.cluoud
https://gist.github.com/faermanj/270a8a8ab817f95fc2e350ec2d481bd2

Agenda

Aplicação estilo "microserviços" ("PetCare")

@faermanj
faermanj / note.sh
Created September 1, 2021 13:54
Delete a versioned bucket
aws s3api put-bucket-versioning --bucket "{{bucket}}" --versioning-configuration "Status=Suspended";
aws s3api delete-objects --bucket "{{bucket}}" --delete "$(aws s3api list-object-versions --bucket "{{bucket}}" --output=json --query='{Objects: *[].{Key:Key,VersionId:VersionId}}')";
aws s3api delete-bucket-policy --bucket "{{bucket}}";
aws s3 rm "s3://{{bucket}}" --recursive;
aws s3 rb "s3://{{bucket}}"
@faermanj
faermanj / delete.sh
Last active February 11, 2021 12:34
Terraform + Cloudformation Working Sample
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DEFAULT_ENVNAME="BCX$(whoami | awk '{ print toupper($0) }')"
BC_ENVNAME=${BC_ENVNAME:-$DEFAULT_ENVNAME}
BC_DISTBKT=$(aws cloudformation list-exports --query "Exports[?Name=='BC::${BC_ENVNAME}::DISTBKT'].Value" --output=text)
BC_DISTBKT_URL="s3://${BC_DISTBKT}/"
@faermanj
faermanj / queensII.py
Last active December 8, 2020 15:09
Hacker Rank: Queens II
#!/bin/python3
#WARNING: Spoiler of https://www.hackerrank.com/challenges/queens-attack-2/problem
import math
import os
import random
import re
import sys
@faermanj
faermanj / Bechmarking Storage
Created October 27, 2020 07:14
Architecting on AWS - Notes
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/raid-config.html
mdadm --create --verbose /dev/md0 \
--level=0 \
--name=riverraid \
--raid-devices=2 /dev/nvme1n1 /dev/nvme2n1
mkfs.ext4 -L riverraid /dev/md0
mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)