Skip to content

Instantly share code, notes, and snippets.

View andfilipe1's full-sized avatar
🏠
Working from home

Luiz Filipe Brandão andfilipe1

🏠
Working from home
View GitHub Profile
@andfilipe1
andfilipe1 / docker-load-and-push.sh
Created July 21, 2018 23:16 — forked from stefanvangastel/docker-load-and-push.sh
Bash scripts to pull, (optional) retag, save, load and push Docker images. Created to provide easy means to download an image, retag it to use a private registry and then save it to an external disk. In a offline or on-premise environment you can use the load and push script to load images and push them to a private registry.
#!/bin/bash
#### Functions ###
display_usage() {
echo "This script must be run with Docker capable privileges and you should login to your registry before pushing!"
echo -e "\nUsage:\n$0 <saved_image> [--push]\n"
echo -e " <saved_image>\t\t\tThe image file to load and push"
echo -e " [--push]\t\t\tPush to registry"
echo -e "\nExample: $0 /mydir/ubuntu.tar --push "
}
@andfilipe1
andfilipe1 / gist:c64a93bfc6c207ebb7ce12fb46c5646c
Created July 2, 2018 20:39 — forked from waynegraham/gist:5256410
Postgresql 9.2 Replication on CentOS 6

Master Server

In /var/lib/pgsql/9.2/data/postgresql.conf add

wal_level = hot_standby
max_wal_senders = 1
wal_keep_segments
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM buildpack-deps:stretch-scm
# A few reasons for installing distribution-provided OpenJDK:
#
@andfilipe1
andfilipe1 / go_mem_usage.go
Created January 11, 2018 12:01 — forked from hongster/go_mem_usage.go
Go runtime memory usage.
package main
import (
"fmt"
"runtime"
)
func main() {
// https://golang.org/pkg/runtime/#MemStats
var memStats runtime.MemStats
@andfilipe1
andfilipe1 / comandos-docker
Created November 27, 2017 02:19 — forked from morvanabonin/comandos-docker
Comandos do Docker
Segue a lista de comandos docker e sua utilidade:
docker attach – Acessar dentro do container e trabalhar a partir dele.
docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem.
docker commit – Cria uma imagem a partir de um container.
docker cp – Copia arquivos ou diretórios do container para o host.
docker create – Cria um novo container.
docker diff – Exibe as alterações feitas no filesystem do container.
docker events – Exibe os eventos do container em tempo real.
docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele.