Skip to content

Instantly share code, notes, and snippets.

View pdrok's full-sized avatar

Pedro López pdrok

View GitHub Profile
@pdrok
pdrok / remove_password_from_git_commit.md
Created May 17, 2022 14:49
The BFG Repo-Cleaner is a tool that's built and maintained by the open source community. It provides a faster, simpler alternative to git filter-branch for removing unwanted data.

Download the latest version from the site: https://rtyley.github.io/bfg-repo-cleaner/

Create a folder:

mkdir clean-repo

Inside the this folder create a txt file with the password o sensitive data you want to revove

cd clean-repo
echo "mySuperPassword" > passsword.txt
@pdrok
pdrok / environment_variable_python.md
Created May 12, 2022 16:56
use environment variables in python
@pdrok
pdrok / unifi-video-ubuntu-18-04.md
Last active November 9, 2022 06:31
Steps to install unifi-video on Ubuntu 18.04

log in as root: sudo su if you don't have MongoDB already installed:

sudo apt-get install mongodb mongodb-server openjdk-8-jre-headless=8u162-b12-1 jsvc

Open terminal (go to your apps and type in terminal, or push the windows key and type in terminal) Type the following commands:

sudo mv /usr/bin/mongod /usr/bin/mongod.bin
@pdrok
pdrok / 413_request_entity_too_large.md
Last active December 4, 2023 22:38
How to fix a "413 request entity too large" error on AWS Elastic Beanstalk

The .conf files directory have to be .platform/nginx/conf.d/elasticbeanstalk

Create a new file called .platform/nginx/conf.d/01_client_size.conf and paste in the following:

client_max_body_size 20M;

You don't need to restart the nginx manually, when you deploy it restart the services.

Thanks

@pdrok
pdrok / error_backup_mikrotik.md
Created November 29, 2019 14:10
Solucionar error al hacer backup Mikrotik

Al hacer el backup si llega a emitir este error la terminal:

Error: backup,critical error creating backup file: could not read all configuration files

ingresar el siguiente comando:

/ip ssh regenerate-host-key
@pdrok
pdrok / port_knocking_simple.md
Last active November 29, 2019 14:08
Configurar port knocking para acceder el router desde un ip no registrado previamente

Reglas para liberar acceso usando port knocking con RouterOS

Crear tres reglas en un chain aparte port_knock en IP -> Firewall copiando y pegando lo siguiente en una terminal:

/ip firewall filter add action=add-src-to-address-list address-list=PORT_KNOCK_J1 address-list-timeout=20s chain=port_knock dst-address-type=local dst-port=666 protocol=tcp src-address-list=!PORT_KNOCK_J1
/ip firewall filter add action=add-src-to-address-list address-list=PORT_KNOCK_J2 address-list-timeout=20s chain=port_knock dst-address-type=local dst-port=888 protocol=tcp src-address-list=PORT_KNOCK_J1
/ip firewall filter add action=add-src-to-address-list address-list=SOPORTE_REMOTO address-list-timeout=8h chain=port_knock dst-address-type=local dst-port=777 protocol=tcp src-address-list=PORT_KNOCK_J2
@pdrok
pdrok / Mikrotik_OpenVPN.md
Last active August 9, 2023 22:39
Configuracion de OpenVPN en Mikrotik

Crear los templates para los certificados:

/certificate add name=ca-template common-name=myCa key-usage=key-cert-sign,crl-sign days-valid=3650 country="PY" state="Alto Parana" organization="Empresa" locality="Ciudad del Este" unit="TI" key-size=4096

/certificate add name=server-template common-name=server days-valid=3650 country="PY" state="Alto Parana" organization="Empresa" locality="Ciudad del Este" unit="TI" key-size=4096

/certificate add name=client-template common-name=client days-valid=3650 country="PY" state="Alto Parana" organization="Empresa" locality="Ciudad del Este" unit="TI" key-size=4096

Crear los certificados:

/certificate sign ca-template name=myCa

Keybase proof

I hereby claim:

  • I am pdrok on github.
  • I am pdrok (https://keybase.io/pdrok) on keybase.
  • I have a public key ASBSFzM2gsD-ii_ZWMp-3kgRYmxSRQR1Y5aQSc6qSlzOzAo

To claim this, I am signing this object: