Skip to content

Instantly share code, notes, and snippets.

@budiantoip
budiantoip / How to install Older PHP Versions on Ubuntu.md
Last active December 23, 2024 06:08
How to install Older PHP Versions on Ubuntu

Add ondrej/php repository

sudo add-apt-repository ppa:ondrej/php

Update apt metadata

sudo apt update
@budiantoip
budiantoip / Ubuntu Package Upgrades via Cron.md
Created December 2, 2024 20:52
Ubuntu Package Upgrades via Cron

Create a bash script to gracefully reboot the Ubuntu server upon package upgrades

  1. Login as root
  2. Create a bash script file
    vim /root/check-reboot.sh
    
  3. And put these:
    #!/bin/bash
    
@budiantoip
budiantoip / Plesk Cheatsheet.md
Last active November 29, 2024 10:09
Plesk Cheatsheet

HTTP2 Support

Enable

plesk bin http2_pref enable

Disable

plesk bin http2_pref disable
@budiantoip
budiantoip / nginx_snippets.md
Created November 25, 2024 03:09
Nginx snippets

Implement rate-limiting rule for non asset-file requests

# Define the rate limit zone
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;

server {
    # Exclude CSS, JS, and image files from rate limiting
    location ~* \.(css|js|jpg|jpeg|png|gif|webp|svg|ico)$ {
        # No rate limiting applied for these file types
 # You can put other configurations here if necessary
@budiantoip
budiantoip / monit.md
Last active December 13, 2024 00:13
Monit

How to set up monit on domain.com

vim /etc/monit/monitrc

set daemon  30

set mailserver smtp.gmail.com port 587              # primary mailserver
username "[email protected]" password "my_password"
using tls
with timeout 30 seconds
@budiantoip
budiantoip / How to update PHP version on CentOS 7.md
Created August 3, 2024 04:42
How to update PHP version on CentOS 7
sudo yum install yum-utils -y
sudo yum-config-manager --disable remi-php74
sudo yum-config-manager --enable remi-php82
sudo yum install php php-cli php-fpm php-json php-common php-mysqlnd php-xml php-gd php-mbstring php-intl php-opcache -y
@budiantoip
budiantoip / Linux compute stress script.md
Created July 17, 2024 01:08
Linux compute stress script
#! /bin/sh
# set -x

stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 360s
@budiantoip
budiantoip / CentOS 7 Archive Repo.md
Last active July 22, 2024 08:18
CentOS 7 Archive Repo

CentOS 7

/etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
@budiantoip
budiantoip / Calculate Processes.md
Last active November 13, 2024 07:33
Calculate Processes

Calculate processes given a specific process name

Let's start with listing the processes of a php-fpm:

ps -C php-fpm

Display the process size:

ps -C php-fpm -o rss=
@budiantoip
budiantoip / Remix Cheatsheet.md
Last active February 1, 2025 04:55
Remix Cheatsheet