Skip to content

Instantly share code, notes, and snippets.

View jeanpauldejong's full-sized avatar
😄
Just changing the world, one line of code at a time.

Jean-Paul de Jong jeanpauldejong

😄
Just changing the world, one line of code at a time.
View GitHub Profile
@jeanpauldejong
jeanpauldejong / redis-object-cache-wordpress.md
Created July 27, 2025 20:48
Redis Object Cache for WordPress

Setup Redis Object Cache for WordPress

Install Redis Server

apt update
apt install redis-server -y

Check Redis is running: systemctl status redis

@jeanpauldejong
jeanpauldejong / data-format-cheatsheet.md
Created July 6, 2025 08:09
Date & Time Formatting Cheat Sheet (PHP vs Linux vs Ruby/Rails vs Standards)

Date & Time Formatting Cheat Sheet (PHP vs Linux vs Ruby/Rails vs Standards)

This guide provides equivalent date/time format strings across popular environments (PHP, Linux, Ruby, etc.), with examples and tips. Also includes standard formats like ISO 8601 and RFC 2822.

Common Display Formats

Format Purpose PHP Format Linux/Ruby/POSIX Format Example Output
Full Date/Time d-m-Y H:i T %d-%m-%Y %H:%M %Z 05-07-2025 14:23 CEST
Short Date d-m-Y %d-%m-%Y 05-07-2025
@jeanpauldejong
jeanpauldejong / enable-swapfile-ubuntu.md
Last active June 27, 2025 08:27
Enable Swap on Ubuntu

Enable Swap on Ubuntu

Create a swap file on Ubuntu to increase system performance by allowing the system to use disk space as virtual memory.

Create a 2GB swap file:

sudo fallocate -l 2G /swapfile

If fallocate is not available, you can use dd:

@jeanpauldejong
jeanpauldejong / resize-volume-ubuntu-cloud-scaleway.md
Last active June 27, 2025 10:07
Resize Disk and Grow Filesystem on Ubuntu (Cloud e.g. Scaleway)

Resize the Volume of an Ubuntu Cloud Instance e.g. on Scaleway

First check that you have the cloud-guest-utils package installed:

dpkg -l | grep cloud-guest-utils

If it is not installed, you can install it with:

@jeanpauldejong
jeanpauldejong / mautic-ubuntu-nginx-mariadb-installation.md
Last active July 8, 2025 08:16
Mautic on Ubuntu 24.04 with Nginx, MariaDB, PHP8.3 and composer.

Install Mautic on Ubuntu 24.04 LEMP Server

This guide assumes you have provisioned your server with a LEMP stack (Nginx, MariaDB, PHP 8.3) using cloud-init-lemp.yml. It covers secure MariaDB setup, Composer installation, Mautic deployment, and HTTPS configuration for mautic.example.com.

1. Secure MariaDB and Create Database/User

Set your passwords and database info as needed. Replace all placeholders!

# Secure MariaDB (set root password, remove test DB, etc.)
@jeanpauldejong
jeanpauldejong / nginx-reverse-proxy-letsencrypt.md
Last active June 25, 2025 10:32
Nginx Reverse Proxy with Let's Encrypt (Certbot Standalone) & TLS Hardening

Nginx Reverse Proxy with Let’s Encrypt (Certbot Standalone) & TLS Hardening

This guide shows how to use Nginx as a reverse proxy with a legitimate Let’s Encrypt certificate, using Certbot in standalone mode (no need to reconfigure Nginx for HTTP-01 challenge). It also covers certificate renewal testing and TLS hardening in Nginx.

Prerequisites

  • Ubuntu 22.04/24.04 server (or similar)
  • Domain name pointed to your server’s public IP
  • Nginx installed (sudo apt install nginx)
  • Ports 80 and 443 open in your firewall
@jeanpauldejong
jeanpauldejong / 00_ubuntu-2404-initial-setup.md
Last active July 4, 2025 07:22
Ubuntu 24.04 LTS Initial Setup & Hardening

Ubuntu 24.04 Initial Setup & Hardening Guide

A concise, step-by-step guide for securing and configuring a fresh Ubuntu 24.04 server.

Alternatively you can skip the text and use the cloud-init script files cloud-init.yaml, cloud-init-docker.yaml, cloud-init-lemp.yaml, or cloud-init-nginx-proxy.yml for an automated setup.

Base Installation

  • Deploy the official Ubuntu 24.04 LTS image from your cloud provider or ISO.
  • Log in as the default user (or via SSH key if provided).