Fail2ban

Step 1: Install Fail2ban (Debian/Ubuntu)

First, install Fail2ban by running:

sudo apt install fail2ban

Step 2: Navigate to the Fail2ban Directory

Change to the Fail2ban configuration directory:

cd /etc/fail2ban/

Step 3: Copy the Example Configuration File

Copy the example configuration file as a base for your custom configuration:

sudo cp jail.conf jail.local

Step 4: Create a New Filter

Navigate to the filter.d directory and create a new filter file:

cd filter.d/
sudo nano nginx-4xx.conf

Step 5: Define the Filter to Block Repeated 4xx Errors

Add the following content to the nginx-4xx.conf file:

[Definition]
failregex = ^<HOST>.*"(GET|POST|HEAD|CONNECT).*" (404|444|403|400) .*
ignoreregex = 127.0.0.1 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

Step 6: Edit the Jail Configuration to Use the New Filter

Go back to the previous directory and edit jail.local:

cd ..
sudo nano jail.local

Add the following section:

#
# Repeated 4xx errors (Nginx)
#
[nginx-4xx]
enabled = true
port = http,https
logpath = /var/log/nginx/access.log
maxretry = 4

Step 7: Restart Fail2ban for the Changes to Take Effect

Restart the Fail2ban service:

sudo systemctl restart fail2ban

Step 8: Check the Filter Status

Verify the filter is working:

sudo fail2ban-client status nginx-4xx

OR

For a prettified output:

sudo fail2ban-client get nginx-4xx banip | tr ' ' '\n'

Node PM2

Restart

                pm2 restart caileb.com
            

FFmpeg

Highest quality AV1

ffmpeg -i input -c:v av1_nvenc -preset p7 -cq 1 -b:v 0 -qmin 1 -qmax 5 -rc-lookahead 250 -spatial-aq 1 -aq-strength 15 -refs 16 -temporal-aq 1 -c:a flac -compression_level 8 highest_quality.mkv

Standard compression

ffmpeg -i input -vf "mpdecimate" -fps_mode vfr -c:v av1_nvenc -preset p7 -cq 30 -b:v 0 -maxrate 18.5M -bufsize 25M -g 240 -keyint_min 24 -rc vbr -c:a libopus -b:a 128k compressed.webm

Extreme compression

ffmpeg -i input -vf "mpdecimate,scale=-1:1080" -fps_mode vfr -c:v av1_nvenc -preset p7 -rc vbr -b:v 6M -maxrate 12M -bufsize 18M -g 300 -keyint_min 34 -c:a libopus -b:a 96k compressed.webm

Rocket.Chat

ffmpeg -i input -vf "mpdecimate,scale=-1:1440" -fps_mode vfr -c:v av1_nvenc -preset p7 -rc vbr -b:v 8M -maxrate 15M -bufsize 22M -g 270 -keyint_min 28 -c:a libopus -b:a 112k rocket_chat.webm

Useful HTML Stuffs

Make iFrames/Images Lazy Load MDN

Replace FitVids or other similar JS libraries with CSS' aspect-ratio MDN

Malware Removal

  1. Malwarebytes Free

    Easy-to-use tool that quickly detects and removes a broad range of malware.

  2. Emsisoft Emergency Kit

    Utilizes Bitdefender's engine on top of their own for a strong all-in-one cleanup.

  3. Sophos Scan & Clean

    Portable scanner with effective heuristic analysis for detecting malware.

  4. Kaspersky Virus Removal Tool

    Efficiently finds and removes stubborn malware threats.