Skip to content

Instantly share code, notes, and snippets.

View mateusnava's full-sized avatar

Mateus Nava mateusnava

View GitHub Profile
@mateusnava
mateusnava / docker-compose.yml
Created August 21, 2019 18:06
Mongo Cluster
# Add these lines in /etc/hosts
# 127.0.0.1 mongo0
# 127.0.0.1 mongo1
# 127.0.0.1 mongo2
# Running these commands to configure cluster:
# rs.initiate({
# "_id" : "rs0",
# "members" : [
# {
@mateusnava
mateusnava / memory_leak_analyzer.rb
Last active August 16, 2019 13:42
Memory Leak Analyzer
#########################################################################################################
# Dependencies: rbtrace (https://github.com/tmm1/rbtrace) in the ruby process that will be analyzed #
# Reference: https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby #
#########################################################################################################
require 'json'
class MemoryLeakAnalyzer
attr_reader :filename
def initialize
@mateusnava
mateusnava / docker-compose-zero-downtime.sh
Last active March 24, 2021 14:09
Script for docker-compose deploy with zero downtime
#!/bin/bash
DOCKER_COMPOSE_NAME='web'
DOCKER_COMPOSE_FOLDER='/home/mateus/Projetos/api-agro1'
cd $DOCKER_COMPOSE_FOLDER
echo '==> Pulling...'
docker-compose pull