Discover Snippets

leon / test Created at Sat Oct 24 06:37:37 WIB 2020
https://baas.biznetgiocloud.com/bc/api/ams/links/agents/redirect?language=multi&system=linux&architecture=64&productType=enterprise&login=96f6e017-0979-49cf-89a1-30a2dab1f23d
leon / archives.txt Created at Sat Oct 10 14:40:17 WIB 2020
---
title: Archives
type: archives
# The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
leon / cpanel-port.md Created at Tue Jun 30 11:40:32 WIB 2020
Daftar dari semua standar port yang terbuka di Server cPanel.

List Port Standar cPanel

Ini adalah daftar dari semua standar port yang terbuka di Server cPanel. Anda harus membuka semua port ini di firewall server untuk menjalankan cPanel agar sempurna. Port default ini dikonfigurasi sebagai dibuka di firewall seperti CSF untuk server cPanel.

  • 20 FTP
  • 21 FTP
  • 22 SSH
  • 37 rdate
  • 25 SMTP
leon / Compute.sh Created at Wed Jun 17 10:29:07 WIB 2020
Create Compute
#Function deploy

create_vm() {
virt-clone -o template-centos7.7 -n $VM_NAME -f /data/vms/$VM_NAME.qcow2
virsh start $VM_NAME

sleep 60

ssh root@192.168.100.253 /bin/bash << EOF
leon / controller.sh Created at Wed Jun 17 10:16:17 WIB 2020
Create Controller
#eth0
VM_NAME=alora-controller
ADDRESS1=10.30.30.60
GATEWAY1=10.30.30.1
NETWORK_NAME1=net-10.30.30

#eth1
ADDRESS2=10.40.40.60
GATEWAY2=10.40.40.1
NETWORK_NAME2=net-10.40.40
leon / ssl-haproxy.md 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 / Install-script.sh Created at Sun Mar 22 20:38:24 WIB 2020
Installation Script
#!/bin/bash
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
#!/bin/bash
echo "MEMULAI INSTALASI !!"
echo ""
echo "======================================="
sudo yum -y install "epel-release"
sudo yum -y install "yum-utils"
sudo yum -y install "nginx"
sudo yum -y install "http://rpms.remirepo.net/enterprise/remi-release-7.rpm"
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
#!/bin/bash
echo "=========================";
echo "Welcome to Auto Bash !";
echo "=========================";
echo "";

echo "Hanya bisa 1 User saja !"

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

/etc/php-fpm.conf

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