Skip to content

Instantly share code, notes, and snippets.

⚛️
Microservices

Afonso Rodrigues afonsoaugusto

⚛️
Microservices
View GitHub Profile
View ExamReadliness_AWS_SolutionsArchitect-Associate.txt
https://amazon.qwiklabs.com/
Faqs:
https://aws.amazon.com/pt/ec2/faqs/
https://aws.amazon.com/pt/s3/faqs/
https://aws.amazon.com/pt/vpc/faqs/
https://aws.amazon.com/pt/route53/faqs/
https://aws.amazon.com/pt/rds/faqs/
https://aws.amazon.com/pt/sqs/faqs/
@afonsoaugusto
afonsoaugusto / execute_mongodb_with_database_files.sh
Created Nov 8, 2019
Up mongodb with docker and files from backup.
View execute_mongodb_with_database_files.sh
#Subir o banco no docker com bacup do Atlas:
docker run --rm -it -v $PWD:/data/db -p 27017:27017 mongo:3.6
View collect_metrics_sar.sh
#!/bin/bash
#_______________________________________________________________________________
#__
#__ collect.sh
#__
#__ Faz a coleta de network provindo do sar
#__
#__ autor : Afonso Rodrigues
#__ data : 27/08/2019
#__
View dcoker-consul.sh
docker run --rm \
-p "8300:8300" \
-p "8400:8400" \
-p "8500:8500" \
-p "8600:53/udp" \
consul \
agent -dev -client 0.0.0.0
@afonsoaugusto
afonsoaugusto / CleanDockerAWSlogs.cron
Created Jul 11, 2019
Clean Docker and awslogs files cron
View CleanDockerAWSlogs.cron
10 3 * * * root /usr/bin/docker rm $(docker ps -aq)
20 3 * * * root /usr/bin/docker rmi -f $(docker images -qa)
1 1 * * * cat /dev/null > /var/log/awslogs.log >/dev/null 2>&1
1 1 * * * cat /dev/null > /var/log/awslogs.log.1 >/dev/null 2>&1
@afonsoaugusto
afonsoaugusto / collect_information_db.py
Last active Jul 4, 2019
Coleta de informações sobre possiveis deadlocks no mysql 5.6 minuto a minuto
View collect_information_db.py
import pymysql
import os
import json
import logging
from datetime import datetime
def get_connection(secret_dict):
port = int(secret_dict['port']) if 'port' in secret_dict else 3306
dbname = secret_dict['dbname'] if 'dbname' in secret_dict else None
View wordcount2.py
from pyspark.sql import SparkSession
from operator import add
import re
print("Okay Google.")
spark = SparkSession\
.builder\
.appName("CountUniqueWords")\
.getOrCreate()
View curl.sh
rm -rf wordcount.py
curl https://gist.githubusercontent.com/afonsoaugusto/63b1ff49a8418eb1b94e645acdfd3607/raw/9004ff9993a4e2844af782646de58f7d1e8c2300/wordcount.py -o wordcount.py
View 12factor_notes.md

I. Base de Código

Uma base de código com rastreamento utilizando controle de revisão, muitos deploys

II. Dependências

Declare e isole as dependências

  • declaração de dependência (Pip)
  • isolamento de dependência (Virtualenv)

III. Configurações

Armazene as configurações no ambiente

@afonsoaugusto
afonsoaugusto / tooldb.md
Created Apr 17, 2019
Definições projeto tool db
View tooldb.md
  • um repositório de scripts para cada tecnologia (mysql, mongo, oracle)
You can’t perform that action at this time.