Skip to content

Instantly share code, notes, and snippets.

Gustavo Henrique gustavohenrique

Block or report user

Report or block gustavohenrique

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile


import boto3
import uuid

from PIL import Image

S3 = boto3.client("s3")

Install psql 11

wget --quiet -O - | sudo apt-key add -
RELEASE=$(lsb_release -cs)
echo "deb ${RELEASE}"-pgdg main | sudo tee  /etc/apt/sources.list.d/postgres.list
sudo apt update
sudo apt -y install postgresql-client-11


sudo killall -HUP mDNSResponder; say dns cleared successfully


sudo /etc/init.d/dnsmasq restart
sudo /etc/init.d/nscd restart
gustavohenrique /
Created Aug 13, 2019
Example using parallel in Python
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import codecs
import pandas as pd
from argparse import ArgumentParser
from urllib import request
from tqdm import trange
from joblib import Parallel, delayed

Generate self signed wildcard certificate

cat <<EOF | tee certificate.cfg
[ req ]
req_extensions     = req_ext
distinguished_name = req_distinguished_name
prompt             = no

gustavohenrique /
Created May 27, 2019
journalctl cheat sheet


journalctl --utc
journalctl /usr/bin/bash
journalctl -k  # kernel messages
journalctl --no-full  # display some information
journalctl -a  # display all information
journalclt --no-pager  # good for scripts
journalctl -b -u nginx -o json-pretty
journalctl -n  # recent logs
package mail

import (
gustavohenrique /
Last active Aug 12, 2019
Generate certificates using certbot + route53 plugin
export AWS_PROFILE=myprofile
mkdir letsencrypt
pip install certbot-dns-route53
certbot certonly -d -d '*' --dns-route53 --logs-dir ./letsencrypt/log/ --config-dir ./letsencrypt/config/ --work-dir ./letsencrypt/work/ -m --agree-tos --non-interactive --server
ls letsencrypt/config/archive/
# renew
certbot renew --cert-name --logs-dir ./letsencrypt/log/ --config-dir ./letsencrypt/config/ --work-dir ./letsencrypt/work/
gustavohenrique /
Last active Sep 26, 2019
Some steps to install Arch Linux

Archlinux Installation

Installation options

  1. Installed with LVM on LUKS encryption, no dual boot.

  2. Using systemd-boot instead of GRUB on UEFI, as it's more lightweight.

Hardware Notes

You can’t perform that action at this time.