Skip to content

Instantly share code, notes, and snippets.

Avatar
⚛️
Microservices

Afonso Rodrigues afonsoaugusto

⚛️
Microservices
View GitHub Profile
@afonsoaugusto
afonsoaugusto / 01_execute_mongodb_with_database_files.sh
Last active Aug 26, 2020
Up mongodb with docker and files from backup.
View 01_execute_mongodb_with_database_files.sh
tar -xvf archive.tar.gz
#Subir o banco no docker com bacup do Atlas:
docker run --rm -it -v $PWD:/data/db -p 27017:27017 mongo:3.6
docker run --rm -it -v $PWD:/data/db --memory="5g" --memory-swap="2g" --cpus="2.0" -p 27017:27017 mongo:3.6
@afonsoaugusto
afonsoaugusto / zsh-elapsed-time.md
Created Aug 2, 2020 — forked from knadh/zsh-elapsed-time.md
Elapsed and execution time for commands in ZSH
View zsh-elapsed-time.md

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
  timer=$(($(date +%s%0N)/1000000))
View 12factor_notes.txt
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
III. Configurações
Armazene as configurações no ambiente
IV. Serviços de Apoio
View Springer Text books.txt
S.No. Book Title Author Edition OpenURL
1
Fundamentals of Power Electronics
Robert W. Erickson, Dragan
Maksimovic
2nd ed.
2001 http://link.springer.com/openurl?genre=book&isbn=978-0-306-48048-5
2
Handbook of the Life Course
Jeylan T. Mortimer, Michael J.
View mssql-privileges.sql
# docker run --rm -it -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Q3e3nrZQEBx7VmxbqhQFK7ddwg' -p 1433:1433 mcr.microsoft.com/mssql/server
create database permissions CONTAINMENT = PARTIAL;
use permissions;
CREATE USER Barry WITH PASSWORD = 'sdjklalie8rew8337!$d';
select containment,name from sys.databases;
create schema app_barry;
View Intro_to_mapreduce_udacity.md

https://classroom.udacity.com/courses/ud617

Example code

cd /home/training/udacity_training
[training@localhost udacity_training]$ head -50 data/purchases.txt | ./code/mapper.py | sort | ./code/reducer.py 

[training@localhost udacity_training]$ pwd
/home/training/udacity_training
@afonsoaugusto
afonsoaugusto / gitprint.js
Created Mar 28, 2020 — forked from beevelop/gitprint.js
Print GitHub markdown files
View gitprint.js
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white')
document.querySelector('body').appendChild(document.querySelector('#readme'))
window.print()
@afonsoaugusto
afonsoaugusto / api.py
Created Mar 24, 2020
Example API Flask Python with APM Elastic
View api.py
import logging
from flask import Flask, make_response
from elasticapm.contrib.flask import ElasticAPM
from elasticapm.handlers.logging import LoggingHandler
app = Flask(__name__)
apm = ElasticAPM(app)
@app.route("/")
View convert_escaped_unicode_utf8.txt
sudo apt-get install ascii2uni
file=$(cat log | ascii2uni -a U -q)
echo -e $file
You can’t perform that action at this time.