Skip to content

Instantly share code, notes, and snippets.

View hugofer93's full-sized avatar

Hugo Silva hugofer93

View GitHub Profile
@hugofer93
hugofer93 / ngx_waf-module-installation.md
Created May 10, 2021 02:25
Tutorial to compile and install the Nginx firewall module: ngx_waf (https://github.com/ADD-SP/ngx_waf/)

NGX_WAF MODULE INSTALLATION

This is a tutorial for the compilation and installation of the Nginx firewall module: https://github.com/ADD-SP/ngx_waf/

Identify the exact version of Nginx installed:

$ nginx -v
@hugofer93
hugofer93 / chroot-tutorial.md
Last active April 13, 2025 04:40
Tutorial to mount the installation of a GNU/Linux OS and access by terminal to fix it or to modify it.

CHROOT TUTORIAL

Identify partition:

$ fdisk -l

Create a mount point:

@hugofer93
hugofer93 / facebookPost.py
Last active June 6, 2019 17:07
Post to Facebook in Python 3
import requests
def postToFacebook(post):
fb_url = 'https://graph.facebook.com/{}/feed'.format('FANPAGE_ID')
data = {}
data['link'] = post.url
data['message'] = post.texto
data['access_token'] = 'FANPAGE_ACCESS_TOKEN'
@hugofer93
hugofer93 / CiRuc.py
Created June 6, 2019 17:02
Validación de Cédula y RUC para Ecuatorianos en Python
# Validación de Cédula y RUC para Ecuatorianos en Python compatible con 2.7 y 3.4 en adelante.
# Ligeramente modificado para validar las cedulas 23 (Sto Dgo, :D soy de ahí) y 24 (Santa Elena).
# Tomado de aquí: https://fecyman10.wordpress.com/2014/05/01/validar-cedula-y-ruc-ecuatorianos-en-python/
def verificar(nro):
l = len(nro)
if l == 10 or l == 13: # verificar la longitud correcta
cp = int(nro[0:2])
if cp >= 1 and cp <= 24: # verificar codigo de provincia
tercer_dig = int(nro[2])