Skip to content

Instantly share code, notes, and snippets.

View raflymln's full-sized avatar
I'm Winning This Year!

Rafly Maulana raflymln

I'm Winning This Year!
View GitHub Profile
raflymln / nginx.service
Last active November 25, 2022 17:57
Automatically create .conf files symlink from sites-available folder to sites-enabled folder on Nginx restart/start
# Stop dance for nginx
# =======================
# ExecStop sends SIGSTOP (graceful stop) to the nginx process.
# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
# nginx signals reference doc:
raflymln /
Last active September 22, 2022 10:33
MySQL Backup Script
# Usage: ./ <username> <password> <host> <port> <target-folder (optional)>
# Example: ./ admin admin 3306 /var/backups/mysql
# Default dump folder is /var/backups/mysql
if [ -z "$1" ]; then
echo "The usage is: <username> <password> <host> <port> <target-folder (optional)>";
elif [ -z "$2" ]; then