Skip to content

Instantly share code, notes, and snippets.

View fboaventura's full-sized avatar
📚
Always learning

Frederico Freire Boaventura fboaventura

📚
Always learning
View GitHub Profile
@fboaventura
fboaventura / dabblet.css
Created February 25, 2013 14:06
Teste de posicionamento
/**
* Teste de posicionamento
*/
#box1 {
color: white;
background: linear-gradient(45deg, #def, navy);
width: 10em;
height: 5em;
border: 1px black solid;

Keybase proof

I hereby claim:

  • I am fboaventura on github.
  • I am fboaventura (https://keybase.io/fboaventura) on keybase.
  • I have a public key whose fingerprint is 9BE3 AF3E 474E ACAB A98D C461 D43F 8C0E A119 95AA

To claim this, I am signing this object:

@fboaventura
fboaventura / haproxy.cfg
Created May 5, 2017 12:56 — forked from tikenn/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@fboaventura
fboaventura / Postfix: sender-dependent SASL authentication.md
Created May 5, 2017 13:03 — forked from zmwangx/Postfix: sender-dependent SASL authentication.md
Postfix: sender-dependent SASL authentication — relay to multiple SMTP hosts, or relay to the same host but authenticate as different users (e.g., two Gmail accounts)

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

@fboaventura
fboaventura / web-servers.md
Created October 27, 2017 17:12 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@fboaventura
fboaventura / gentoo_qt_update.sh
Created October 31, 2017 17:36
Update dev-qt/* to new version
#!/bin/bash
QTVER="5"
emerge -avu1 $(qlist -IvC dev-qt/ | grep ${QTVER}. | sed s/-${QTVER}.*//)
@fboaventura
fboaventura / le.conf
Last active December 22, 2017 15:39
Apache: Redirect all Let's Encrypt challenges to a single document root
<IfModule mod_proxy.c>
ProxyPass /.well-known/acme-challenge !
</IfModule>
Alias /.well-known/acme-challenge /var/www/html/.well-known/acme-challenge
<Directory "/var/www/html/.well-known/acme-challenge">
Options None
AllowOverride None
AddDefaultCharset off
@fboaventura
fboaventura / argparse_with_custom_action.py
Created April 26, 2018 14:31 — forked from verbalhanglider/argparse_with_custom_action.py
A tutorial example of A CLI module using an argparse.Action class instance to find all files in a directory tree
"""a tutorial example of A CLI module using an argparse.Action class instance to find all files in a directory tree
"""
from argparse import Action, ArgumentParser
from sys import argv, stderr, stdout
from os import _exit, scandir
from os.path import exists, isdir
__VERSION__ = "1.0.0"
@fboaventura
fboaventura / fw_block.sh
Created May 24, 2018 10:29 — forked from toke/fw_block.sh
Simple spamhaus ipset firewall block
#!/usr/bin/bash
## Run every 24h via cron
## Old entries will time out later automatically
(
cd /var/lib/firewall
wget -qN 'http://www.spamhaus.org/drop/drop.txt'
ipset create -exist spamhaus_drop hash:net counters timeout 90000 comment
@fboaventura
fboaventura / py3whois.py
Created May 24, 2018 10:57 — forked from carmaa/py3whois.py
Python 3 whois client
"""
Whois client for python
transliteration of:
http://www.opensource.apple.com/source/adv_cmds/adv_cmds-138.1/whois/whois.c
Copyright (c) 2010 Chris Wolf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal