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
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
raflymln / mysql_backup.sh
Last active September 22, 2022 10:33
MySQL Backup Script
#!/bin/bash
# Usage: ./script.sh <username> <password> <host> <port> <target-folder (optional)>
# Example: ./script.sh admin admin 127.0.0.1 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)>";
exit;
elif [ -z "$2" ]; then