Skip to content

Instantly share code, notes, and snippets.

View marcopaganini's full-sized avatar
💭
"Now" is the envy of all the dead.

Marco Paganini marcopaganini

💭
"Now" is the envy of all the dead.
View GitHub Profile
@marcopaganini
marcopaganini / nginx_reverse_proxy_with_ssl_cert_authentication.md
Last active December 8, 2023 19:38
NGINX reverse proxy with SSL cert authentication

NGINX reverse proxy with SSL cert authentication

This is a short guide for those who want to set up a NGINX reverse proxy with SSL cert authentication. The basic idea is to create a private CA and emit certificates signed by it. Only browsers and/or devices with the certs signed by this CA will be granted access to resources behind the proxy.

There are a few examples of similar configurations on the web, but most use openssl directly. This gist uses Easy-RSA to simplify the task of creating and maintaining a private CA and certs to be distributed to clients.

Install and configure Easy-RSA

Clone Easy-RSA 3:

/*
* Example DriverPg Go
* @package main
* @author @jeffotoni
* @size 10/09/2018
*/
package main
import (
/*
* Example DriverPg C++
* @package main
* @author @jeffotoni
* @size 10/09/2018
*/
#include <iostream>
// ex: c++

Keybase proof

I hereby claim:

  • I am marcopaganini on github.
  • I am paganini (https://keybase.io/paganini) on keybase.
  • I have a public key whose fingerprint is 437E 0C7E E028 A481 FE4E 2210 AA32 3DF2 B40C D0A9

To claim this, I am signing this object:

@marcopaganini
marcopaganini / gitreset.md
Created September 13, 2020 02:24
Git reset and squash only upstreams

Nota: explicação longa a frente...

O problema não é usar o mesmo branch. O problema é que você não está resetando o branch antes (pra ficar igual ao upstream/master) antes de começar um novo desafio.

Vamos a um exemplo prático: imagine que você faça o clone do osprogramadores/op-desafios (upstream), e que existam apenas dois commits lá:

002 Desafio de outro alguém
001 Desafio de alguém
# Useful configuration for your ~/.inputrc.
# Just drop this file into your home directory.
# Author: [email protected] (http://github.com/marcopaganini)
# vi mode FTW. Use <ESC> to enter.
set editing-mode vi
# Show mode in prompt when in command mode.
set show-mode-in-prompt on
set vi-ins-mode-string ""
@marcopaganini
marcopaganini / .tmux.conf
Created July 4, 2021 03:47
My tmux.conf file supporting truecolor terminals and many other hacks.
# tmux configuration file.
# Save as $HOME/.tmux.conf
# Marco Paganini <[email protected]>
#
# Useful command:
# tmux new -D -A -s session_name
#
# This will create a new session if the specified session does not
# exist. If it does, it will detach that session and attach to it.
@marcopaganini
marcopaganini / lottery.md
Created January 12, 2023 20:26
# You won the lottery, now what?

You won the lottery, now what?

Congratulations! You just won millions of dollars in the lottery! That's great.

Now you're fucked.

No really.

You are.

@marcopaganini
marcopaganini / como_perder_tempo_e_dinheiro.md
Last active February 5, 2023 04:23
Como perder tempo e dinheiro

Como perder tempo e dinheiro

Esse é um guia rápido para aqueles interessados em uma carreira na área de programação, que ensina como perder bastante tempo e ganhar pouco ou nenhum dinheiro. Se aplicado corretamente, também resultará em dificuldades ao tentar conseguir emprego.

Apresente-se e comunique-se da pior forma possível

Escolha o pior username, email ou avatar que conseguir encontrar. "Hacker names" (ainda melhor se forem de séries de TV) ou com tons agressivos rendem bons resultados. Como avatar, use figuras infantis ou sugestivas. Bônus pra quem escrever o nome usando apenas caracteres unicode obscuros, ou qualquer outro username impronunciável. Ao se comunicar, não procure ouvir e sempre fale antes. Evite ler, pois isso irá melhorar o seu português! Quanto mais erros crassos de português, melhor. Abrevie tudo, especialmente quando não houver necessidade. Ao pedir ajuda, não explique o problema e assuma que os outros conseguem ler a sua mente. Se possível, desista da ajuda imediatamente *depoi

@marcopaganini
marcopaganini / zfsroot.md
Created September 1, 2023 20:15
Debian (bookworm) ZFS on root.