Skip to content

Instantly share code, notes, and snippets.

⚛️
Microservices

Afonso Rodrigues afonsoaugusto

⚛️
Microservices
Block or report user

Report or block afonsoaugusto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 clear_docker.sh
#!/bin/bash
docker container rm $(docker container ls -q)
docker image rm $(docker image ls -q)
docker volume rm $(docker volume ls -q)
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
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)
View app1.yml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: giropops-v1
spec:
replicas: 10
template:
metadata:
labels:
app: giropops
You can’t perform that action at this time.