Skip to content

Instantly share code, notes, and snippets.

View ph33nx's full-sized avatar
🥷
Cooking

Abhi ph33nx

🥷
Cooking
  • 10:38 (UTC +05:30)
View GitHub Profile
@ph33nx
ph33nx / postgres-daily-backup.sh
Last active April 3, 2023 13:59
Postgres Daily Backup Bash Script + Get Credentials from .env
# This script is used to backup postgresql database to a file
# 1. Keep the backup file for 30 days
# 2. Intended to be run from cron
# 3. Read DB credentials from .env file next to the script
# 4. Restore the backup with the following command in psql
# PGPASSWORD=$DB_SECRET pg_restore -Fc --no-owner -h localhost -p 5432 -U $DB_USERNAME -d $DB_NAME < $BACKUP_FILE_NAME
# cd to the script directory
cd "$(dirname "$0")"
@ph33nx
ph33nx / php.conf
Last active April 26, 2024 12:32
Wordpress/PHP DDOS Protection + Harden PHP on Nginx (2024)
# PHP DDOS Protection + Harden PHP on Nginx (2022)
# Created as per latest security standards
# includes protection against DDOS, SQL injections, Comment spam, Php code injection and more
# 444 is returned in most places as it's the most appropriate response code for hackers.
# Some wordpress url's are also blocked as most bots often hit those urls no matter the site is running on wordpress or not
# ** Created by @ph33nx : https://github.com/ph33nx **
# HOW TO USE:
# Include below line (#12) in all your WordPress Sites server block (/etc/nginx/conf.d/wp_site.conf) for this to take effect
# include snippets/wordpress.conf;
@ph33nx
ph33nx / gist:ba29b38c643baf7abbf83f5e74c532c6
Last active August 28, 2020 21:41
Minimal Desktop Enivronment Installation on Arch Linux
#Install minimal Gnome on Arch
pacman -S gnome-shell nautilus gnome-terminal gnome-tweak-tool gnome-control-center gdm networkmanager gnome-keyring xorg-server xorg-xinit
systemctl start gdm
systemctl enable gdm
sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager