Skip to content

Instantly share code, notes, and snippets.

View olivx's full-sized avatar

Thiago Oliveira olivx

  • Tivit
  • Sao Paulo
View GitHub Profile
@olivx
olivx / configurar_pyenv.md
Created September 9, 2021 15:51 — forked from luzfcb/configurar_pyenv.md
instalar pyenv no ubuntu

baseado no meu outro tutorial https://gist.github.com/luzfcb/1a7f64adf5d12c2d357d0b4319fe9dcd

Use o pyenv https://github.com/pyenv/pyenv para baixar, instalar e gerenciar múltiplas versões do INTERPRETADOR Python na sua maquina.

Primeiro instale as dependências:

Linux (Ubuntu):

Abra um terminal, apertando o atalho CRTL + ALT + T ou digite aperte a tecla do windows e digite terminal, ou clique com o botão direito na tela, e escolha a opção "Abrir Terminal" (somente para Ubuntu 15.10 ou superior, para 14.04 é necessário instalar o pacote nautilus-open-terminal e reiniciar)

@olivx
olivx / audit_mixin.py
Created August 31, 2021 19:14 — forked from metaperl/audit_mixin.py
generic audit log for SQLAlchemy models, inspired by https://gist.github.com/ngse/c20058116b8044c65d3fbceda3fdf423
# Inspired by the flask-specific https://gist.github.com/ngse/c20058116b8044c65d3fbceda3fdf423
# This is generic and should work with any web framework and even command-line.
# Implement by using AuditableMixin in your model class declarations
# Usage for the [Reahl web app framework](http://reahl.org) below:
# ---------------------------------------------------------------
# import lib.audit_mixin
#!/bin/bash
echo Intalling linux esentials...
sudo apt-get update -y
sudo apt-get install -y gcc \
gconf2 \
make \
linux-headers-$(uname -r) \
build-essential \
apt-transport-https \
ca-certificates \
@olivx
olivx / kube-registry.yaml
Last active August 5, 2019 03:57 — forked from coco98/kube-registry.yaml
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@olivx
olivx / install.sh
Created February 14, 2019 15:46 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@olivx
olivx / pipeline.py
Last active January 25, 2019 17:14 — forked from cansadadeserfeliz/pipeline.py
Django: python-social-auth configuration and pipeline
def update_user_social_data(strategy, *args, **kwargs):
"""Set the name and avatar for a user only if is new.
"""
print 'update_user_social_data ::', strategy
if not kwargs['is_new']:
return
full_name = ''
backend = kwargs['backend']
@olivx
olivx / escola.xlsx
Created December 5, 2018 21:29 — forked from rg3915/FromDict.ipynb
Annotations of Pandas DataFrame
@olivx
olivx / report-runner.py
Created November 1, 2018 18:30 — forked from chris1610/report-runner.py
Pandas Pivot Table Reporting Example - pbpython.com
# -*- coding: utf-8 -*-
"""
Sample report generation script from pbpython.com
This program takes an input Excel file, reads it and turns it into a
pivot table.
The output is saved in multiple tabs in a new Excel file.
"""
@olivx
olivx / comandos-docker
Created May 20, 2018 02:36 — forked from geiltonxavier/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.