Skip to content

Instantly share code, notes, and snippets.

@GusAntoniassi
GusAntoniassi / readme.md
Last active April 21, 2020 02:46
Elastic Stack - Eth0

001 - O que é Elastic Stack

O que dá pra fazer com a stack?

  • Logs centralizados
  • Métricas de serviços e servidores
  • APM
  • Segurança (SIEM)
  • Análise de negócios
  • IoT
  • Monitoramento de redes sociais
  • Buscas inteligentes dentro do site
@GusAntoniassi
GusAntoniassi / README.md
Created April 19, 2020 14:37
[Anotações] Melhores práticas para sua pipeline de infra as code - Gomex

https://www.youtube.com/watch?v=XGSuK8kyGag

Infra imutável

  • Golden image
  • Não recebe modificação depois de criada

Infra como produto

  • Parar de ser um time baseado em atender ticket
  • Entrega um artefato, e não a infra funcionando em algum lugar
@GusAntoniassi
GusAntoniassi / README.md
Last active April 9, 2020 20:30
AWS APN - Containers on AWS

Container on AWS - APN Training

  • Instrutor: André Rosa
  • Curso recomendado antes: Foundational Professional Techincal

Modernização de aplicações

Cloud Native Development

  • Muitos clientes querem rodar container porque é "moda"
  • Tem outros pré-requisitos que devem ser considerados
    • Microserviços
  • DevOps
@GusAntoniassi
GusAntoniassi / inotify.sh
Created March 29, 2020 12:33
Inotifywait Test
#!/usr/bin/env bash
pid=""
function monitor() {
inotifywait --exclude '\.swp|.*~$' --event close_write --recursive . |
while read -r directory events filename; do
if ! echo "$directory" | grep -Eq '^\.\/\.git' &&
! git check-ignore --non-matching --verbose "${directory}/${filename}" >/dev/null 2>&1; then
if [ "${pid}" ]; then
@GusAntoniassi
GusAntoniassi / README.md
Last active November 18, 2019 14:40 — forked from claytonrcarter/README.md
Bash script to check GitLab pipeline status

Forked from claytonrcarter to add a g flag to the regex, to allow support for GitLab grouped projects.


A super simple bash script to check the status of a GitLab CI pipeline.

$ git push
...
$ git pipeline-status
@GusAntoniassi
GusAntoniassi / blockblobstorage.log
Last active November 8, 2019 16:37
Terraform Bug Report
2019/11/08 11:30:26 [INFO] Terraform version: 0.12.13
2019/11/08 11:30:26 [INFO] Go runtime version: go1.12.9
2019/11/08 11:30:26 [INFO] CLI args: []string{"/usr/sbin/terraform", "apply"}
2019/11/08 11:30:26 [DEBUG] Attempting to open CLI config file: /home/gus/.terraformrc
2019/11/08 11:30:26 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/11/08 11:30:26 [INFO] CLI command args: []string{"apply"}
2019/11/08 11:30:27 [DEBUG] checking for provider in "."
2019/11/08 11:30:27 [DEBUG] checking for provider in "/usr/sbin"
2019/11/08 11:30:27 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/11/08 11:30:27 [DEBUG] found provider "terraform-provider-azurerm_v1.36.1_x4"
@GusAntoniassi
GusAntoniassi / lambda_function.py
Created October 17, 2019 13:38
[SECOMP 2019 Mandic] Exemplo de lambda function
import boto3
def lambda_handler(event, context):
region = 'us-east-2'
volumeId = 'vol-ALTERE-AQUI'
# Conectar-se à região
ec2 = boto3.client('ec2', region_name=region)
# Pegar o ID do volume
@GusAntoniassi
GusAntoniassi / README.md
Last active December 18, 2019 04:27
Anotações Solutions Architect AWS
@GusAntoniassi
GusAntoniassi / README.md
Created September 13, 2019 17:49
JSONB Postgres

JSONB Postgres

Snippets para auxiliar a criação de queries com JSONB no Postgres

Select

Pegar o JSON de uma imagem:

SELECT dados->'imagens' 
FROM produto p 
CROSS JOIN jsonb_array_elements(p.dados->'imagens') WITH ORDINALITY i