Skip to content

Instantly share code, notes, and snippets.

View airtonGit's full-sized avatar

Airton F Sauer Oliveira airtonGit

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.container{
position: absolute;
display: inline-block;
background-color: green;
@airtonGit
airtonGit / README.md
Created July 17, 2016 15:44 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@airtonGit
airtonGit / arraySortBigToLowe.js
Created May 15, 2019 13:27
Javascript Sort Descrescente
//Array de exemplo desordenado
let listValuesArray = [2010,2009,2015,2011,2019]
//Array chama metodo sort com função para ordenar
listValuesArray.sort( (a, b) => {
if (a > b){
return -1
}else if(a < b){
return 1
}else{
return 0
@airtonGit
airtonGit / insertFromSelect.sql
Created May 15, 2019 13:37
SQL inserir em tabela usando select em outra como origem das linhas
INSERT INTO tabelaDestino
SELECT null, campo1, campo2, CURRENT_TIMESTAMP, alias1.campoA
FROM tabelaOrigem
INNER JOIN tabelaRelacionada1 alias1 ON alias1.id = alias2.fk_id
WHERE
alias1.active = true
;
@airtonGit
airtonGit / reverse-proxy-concept.go
Last active May 15, 2019 13:48
Conceito basico de proxy reverso fornecido pela http lbrary na linguagem Go
func serveReverseProxy(target string, res http.ResponseWriter, req *http.Request) {
//parse the url
url, err := url.Parse(target)
if err != nil {
panic(err.Error())
}
//create de reverse proxy
proxy := httputil.NewSingleHostReverseProxy(url)
//Update the headers to allow for SSL redirection
@airtonGit
airtonGit / requestJson.go
Created May 28, 2019 00:36
Simple GO json request
package main
import (
"fmt"
"bytes"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"time"
@airtonGit
airtonGit / mysql-otimizar-banco.sh
Created May 7, 2020 14:01
MySQL otimizar todas as tabelas do banco de dados, melhora muito consultas com joins rodando em containers
#!/bin/bash
docker exec running-container-id sh -c 'exec mysqlcheck -uroot -p"$MYSQL_ROOT_PASSWORD" nome-banco'
@airtonGit
airtonGit / mysql otimizações.md
Last active May 7, 2020 14:31
MySQL principais paramêtros de otimizações

Tuning MySQLPermalink

When altering the MySQL configuration, be alert to the changes and how they affect your database. Even when following the instructions of programs such as MySQLTuner, it is best to have some understanding of the process.

The MySQL configuration file stored in the following location: /etc/mysql/my.cnf.

Note

Prior to updating your MySQL configuration, create a backup of the my.cnf file:

cp /etc/mysql/my.cnf ~/my.cnf.backup

git credential-manager uninstall
git credential-manager install
You can configure an individual repo to use a specific user / email address
which overrides the global configuration. From the root of the repo, run
git config user.name "Your Name Here"
git config user.email your@email.com
@airtonGit
airtonGit / K8s Arquiteturas
Last active May 11, 2020 12:14
Retirado do site k8s exemplifica arquiteturas de Pods
Monday, June 29, 2015
The Distributed System ToolKit: Patterns for Composite Containers
Having had the privilege of presenting some ideas from Kubernetes at DockerCon 2015, I thought I would make a blog post to share some of these ideas for those of you who couldn’t be there.
Over the past two years containers have become an increasingly popular way to package and deploy code. Container images solve many real-world problems with existing packaging and deployment tools, but in addition to these significant benefits, containers offer us an opportunity to fundamentally re-think the way we build distributed applications. Just as service oriented architectures (SOA) encouraged the decomposition of applications into modular, focused services, containers should encourage the further decomposition of these services into closely cooperating modular containers. By virtue of establishing a boundary, containers enable users to build their services using modular, reusable components, and this in turn leads to services