Discover Snippets

leon / Created at Tue Apr 28 23:43:53 WIB 2020
An example for implementation HAProxy with SSL
frontend http
bind *:80
bind *:443 ssl crt /etc/haproxy/cert.pem
redirect scheme https code 301 if !{ ssl_fc }
reqadd X-Forwarded-Proto:\ http
reqadd X-Forwarded-Proto:\ https
mode http
errorfile 503 /etc/haproxy/50x.http
default_backend web-backend
leon / Created at Tue Apr 07 21:20:01 WIB 2020
Berisi tentang daftar notifikasi cron yang perlu dilakukan pengecekan.


  • [CloudKilat] Jatuh Tempo Domain
  • Info : Berisikan informasi list domain yang akan memasuki masa jatuh tempo.
  • Action : Memeriksa domain internal yang akan expired lalu menginformasikannya ke grup Gosip. ( dan )
  • Notification Message
  • Info : Berisikan informasi list layanan yang sudah dilakukan terminasi dikarenakan tidak adanya pembayaran sejak tanggal jatuh tempo, atau sudah melakukan permintaan pembatalan.
  • Action : Memastikan layanan sudah berhasil diterminate dan mengecek partial credit pada inoice UNPAID agar dapat dilakukan pengembalian credit dan perubahan status menjadi cancelled.
  • WHMCS Cron Job Activity
  • Info : Berisikan informasi list layanan yang gagal dilakukan aksi terminate ataupun suspend oleh sistem.
  • Action : Melakukan terminaasi ataupun suspend secara manual dari halaman portal admin.
leon / Created at Sun Mar 22 20:38:24 WIB 2020
Installation Script
echo "========================="
echo "Welcome to Auto Bash !"
echo "========================="
# Opsi
echo ""
echo "Mau install apa gan?"
echo ""
echo "1) Nginx + PHP7.2 + PHP-FPM (For CentOS 7 Only)"
echo "2) Jitsi Meet + Nginx (For Ubuntu 18.04 Only)"
leon / Install-Nginx Created at Sun Mar 22 20:29:52 WIB 2020
Install Nginx
echo ""
echo "======================================="
sudo yum -y install "epel-release"
sudo yum -y install "yum-utils"
sudo yum -y install "nginx"
sudo yum -y install ""
sudo yum -y --enablerepo=remi-php72 install php php-intl php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd php-dom php-curl php-zip php-mbstring hp-xml php-xmlreader php-simplexml php-bcmath php-soap php-amqplib php-fpm
sudo systemctl restart nginx php-fpm;
leon / bash-echo Created at Sun Mar 22 20:09:04 WIB 2020
Sample Bash Scripting
echo "=========================";
echo "Welcome to Auto Bash !";
echo "=========================";
echo "";

echo "Hanya bisa 1 User saja !"

read -p "Masukan User : " user; echo "";
leon / Created at Sun Mar 22 13:51:20 WIB 2020
Perubahan yang udah gw lakuin


Jika 10 proses child php-fpm gagal menangani permintaan dalam 1 menit, makan akan dilakukan restart, lalu child akan menunggu selama 10 detik terlebih dahulu sebelum dapat memproses permintaan lagi.

emergency_restart_threshold 10
emergency_restart_interval 1m
process_control_timeout 10s
root / define-assets-reverse-proxy Created at Sat Mar 21 19:10:12 WIB 2020
Untuk mendeklarasikan asset pada reverse proxy
location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$
add_header 'Access-Control-Allow-Origin' '*';
alias /usr/share/jitsi-meet/$1/$2;
leon / HaProxy-Layer7 Created at Wed Mar 18 01:44:22 WIB 2020
Konfigurasi HAProxy untuk Load Balancing layer 7 Wordpress
frontend www-http
bind *:80
option forwardfor
option http-server-close
reqadd X-Forwarded-Proto:\ http

acl url_admin  path_beg  -i  /wp-admin /wp-login.php
acl url_admin hdr(Cookie) core-backend
use_backend core-backend if url_admin
leon / Pi-Hole-Blocklist Created at Mon Mar 09 23:00:59 WIB 2020
leon / mobile-detected Created at Mon Feb 17 22:49:11 WIB 2020
#----- redirect to mobile check (starts) -----#
set $mobile_rewrite do_not_perform;

# this regex string is actually much longer to match more mobile devices
if ($http_user_agent ~* '(iPhone|iPod|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)') {
set $mobile_rewrite perform;
if ($mobile_rewrite = perform) {
rewrite ^(/wp-admin) last;