Skip to content

Instantly share code, notes, and snippets.

View donuts-are-good's full-sized avatar
🍩

donuts-are-good donuts-are-good

🍩
View GitHub Profile
@donuts-are-good
donuts-are-good / postgres-to-postgres-migration.sh
Created September 5, 2024 23:41
postgres-to-postgres-migration.sh
#!/usr/bin/env bash
echo "PostgreSQL Migration Script"
echo "============================"
echo "This script will migrate custom tables from the origin database to the destination database."
echo "Make sure you have the following files in the same directory as this script:"
echo "1. origin-creds.txt"
echo "2. destination-creds.txt"
echo ""
echo "These files should contain the database credentials in the following format:"
BEGIN MESSAGE.
EbLVo1Qb1f7I5Dk ry1aeVY6hmxadGN JPne2gqK4Q2altj ITxjRMxufl1ds2T
PjVW5U6Zq3sHpeA s0NXhgj17D2TCKq 6Xr2MZHgg6m5xKY j61Xqd7dqnoItdi
eQDMLCLucR7dNwU CBP0I48qWM3iSIY rnkqdxIz0ewDcu9 6Qwga7MCQ6Y2ZCm
7A4UFT2N1tt0Mh3 o6m6zF0o71JI1G9 YixbW1N5kVsSvb2 JIGj.
END MESSAGE.
@donuts-are-good
donuts-are-good / geoblock.sh
Created January 30, 2022 06:18
block access by country code via IP.
#!/usr/bin/bash
# Remove existing blocklist
rm /tmp/geoblocklist.txt
# Make space for new blocklist
touch /tmp/geoblocklist.txt
# China
curl -k https://www.ipdeny.com/ipblocks/data/countries/cn.zone > /tmp/geoblocklist.txt
@donuts-are-good
donuts-are-good / nginx-port-3000-to-port-80
Created January 29, 2022 08:15
Nginx port 3000 to port 80
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm;
server_name _;