Skip to content

Instantly share code, notes, and snippets.

View yamalweb's full-sized avatar
💭
RUB++

yamal-web.ru yamalweb

💭
RUB++
View GitHub Profile
@yamalweb
yamalweb / GeoIP Block NGINX Ubuntu 20.04.md
Created July 12, 2023 19:35 — forked from dunderrrrrr/GeoIP Block NGINX Ubuntu 20.04.md
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@yamalweb
yamalweb / mysql-docker.sh
Created October 27, 2021 08:04 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE