Skip to content

Instantly share code, notes, and snippets.

@airtonGit
airtonGit / MySQL optimizações
Last active May 11, 2020 20:30
Exemplos de optimizar mysql database
How to Optimize MySQL Queries for Speed and Performance
original url: https://dzone.com/articles/how-to-optimize-mysql-queries-for-speed-and-perfor
In this guide, we will take you through the steps of optimizing SQL queries and databases on your Alibaba Cloud Elastic Compute Service (ECS) instance. This will guarantee stability, scalability, reliability and speed of applications and websites running on your Alibaba Cloud instance.
Prerequisites
A valid Alibaba cloud account. If you don't have one already, you can sign up for an Alibaba Cloud and enjoy $300 worth in Free Trial.
A server running your favorite operating system that can support MySQL (e.g. Ubuntu, Centos, Debian).
MySQL database server.
@airtonGit
airtonGit / Developers Developers Developers!.md
Created May 11, 2020 20:41
Seleção de frases e citações

"Weeks of programming can save you hours of planning." - A Harckernews pt-BR "Semanas de programação podem te economizar horas de planejamento" - Hackernews

Como Instalar e Usar o Docker no Ubuntu 18.04 PostedNovember 16, 2018 113.3k views DockerUbuntu 18.04

By Brian Hogan

Become an author

Uma versão anterior deste tutorial foi escrita por finid.

Introdução

@airtonGit
airtonGit / Kubernetes.md
Last active May 18, 2020 18:08
Migrando do Docker Swarm para Kubernetes, comandos lado a lado e identificando problemas

Kubernetes vs Docker

swarm kubernetes
docker service list kubectl get pods
docker service logs service-name kubectl logs deployment-name container-name
docker exec -it container-id command kubectl exec -it pod-name [-c container-name] -- command
kubectl describe pod/srv pod-name/srv-name

Container Image Auto Update

apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
@airtonGit
airtonGit / drone-pipeline.yaml
Created May 16, 2020 18:34
Exemplo de drone.io CI/CD pipeline
name: default
kind: pipeline
type: docker
steps:
- name: backend
image: golang
commands:
- go get
@airtonGit
airtonGit / nginx-reverse-proxy.conf
Created May 16, 2020 21:37
Exemplo simples nginx reverse proxy
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
proxy_pass http://localhost:5000/;
}
@airtonGit
airtonGit / Dockerfile
Created May 18, 2020 19:39
Exemplo de Dockerfile para gerar imagem de microserviço em GO
FROM golang as build-env
WORKDIR /app
ADD ./vendor/* /go/src/github.com/
ADD . /app
ENV GOOS=linux
ENV GOARCH=amd64
ENV CGO_ENABLED=0
RUN cd /app && go build -o app
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"sync"