Skip to content

Instantly share code, notes, and snippets.

@budiantoip
budiantoip / Debug Linux Process.md
Last active May 9, 2025 07:29
Debug Linux Process

Show a list of all running nginx processes, along with their PIDs and full command lines

ps -C nginx -o pid,cmd
  • ps -C nginx: select processes with the command name nginx.
  • -o pid,cmd: show only the PID and COMMAND columns.

List the PIDs of all processes with the command name nginx, sorted by start time (oldest first).

@budiantoip
budiantoip / Email Transfer with doveadm and imapsync.md
Last active April 30, 2025 23:16
Email Transfer with doveadm and imapsync
@budiantoip
budiantoip / How to compile php 8.3.20 on CentOS 7.md
Last active May 8, 2025 05:33
How to compile php 8.3.20 on CentOS 7

Compile PHP 8.3.20 along with all required extensions

#!/bin/bash

sudo su

yum groupinstall -y "Development Tools"
yum install -y epel-release
yum install -y gcc gcc-c++ make autoconf bison re2c libxml2-devel bzip2-devel curl-devel \
    libpng-devel libjpeg-devel libXpm-devel freetype-devel gmp-devel mariadb-devel \
@budiantoip
budiantoip / How to Setup SFTP.md
Last active April 16, 2025 07:50
How to Setup SFTP

1. How to Setup SFTP

Let's assume the ssh username is dev

Open sshd_config

vim /etc/ssh/sshd_config

Then add

@budiantoip
budiantoip / How to install Cloudflare WARP to an Ubuntu server.md
Last active March 28, 2025 09:23
How to install Cloudflare WARP to an Ubuntu server

Installation

curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ jammy main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list
sudo apt-get update && sudo apt-get install -y cloudflare-warp

Configuration

  1. Run this command:
@budiantoip
budiantoip / Nginx Security Headers.md
Last active March 9, 2025 15:33
Nginx Security Headers

# Prevent MIME-type sniffing
add_header X-Content-Type-Options nosniff always;

# Enforce HTTPS for 1 year + subdomains
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

# Protect against clickjacking attacks
add_header X-Frame-Options SAMEORIGIN always;

# Prevent Cross-site scripting (XSS)

@budiantoip
budiantoip / Upgrade OpenSSH Server on Ubuntu.md
Last active March 7, 2025 09:54
Upgrade OpenSSH Server on Ubuntu
@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