Skip to content

Instantly share code, notes, and snippets.

🌐
Terraform again

Afonso Rodrigues afonsoaugusto

🌐
Terraform again
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
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
@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
You can’t perform that action at this time.