Skip to content

Instantly share code, notes, and snippets.

View Eseperio's full-sized avatar

E.Alamo Eseperio

View GitHub Profile
@Eseperio
Eseperio / readme.md
Last active June 13, 2025 08:41
Multiple PHP versions at same time on MacOS in 2022 and using Apache

Using Multiple PHP Versions Simultaneously in 2025 on macOS with Apache

This guide explains how to install and run several PHP versions at the same time on macOS, using Apache. Each PHP version is assigned to a specific directory, so you can easily switch PHP versions for any project simply by moving it to the relevant folder. This method allows instant version changes without having to update your server configuration every time.

1. Installing Multiple PHP Versions

To install different PHP versions, use Homebrew:

  1. Add the required tap:
class UniqueSelector {
static getElementSelector(element) {
if (element.id) {
return `#${element.id}`;
}
if (element.tagName === 'BODY') {
return 'body';
}
let selector = element.tagName.toLowerCase();
if (element.className) {
@Eseperio
Eseperio / block-ai-bots-server-wide.md
Created December 13, 2024 07:12
Block AI Bots Server-wide in Plesk or ModSecurity-powered Servers

Block AI Bots Server-wide in Plesk or ModSecurity-powered Servers

Introduction

AI bots can be aggressive and cause severe server overload by consuming excessive resources. Their primary purpose is to train their machine learning models using your data, often without your consent. This activity can degrade your server's performance, cause downtime, and compromise your site's availability. This guide explains how to block these unwanted AI bots using ModSecurity on Plesk-managed servers.

Step 1: Enable ModSecurity in Plesk

  1. Log in to Plesk as an administrator.
  2. Go to Tools & Settings > Web Application Firewall (ModSecurity).
  3. Ensure that ModSecurity is enabled and select the Balanced or Fast mode, depending on your server's configuration and performance needs.
@Eseperio
Eseperio / check-cloudflare
Created March 17, 2025 12:06
Check if cloudfront is requesting your server
#!/bin/bash
# This script downloads the AWS IP ranges JSON, extracts the CloudFront IP prefixes,
# and builds a tcpdump filter to capture traffic from those IP ranges.
# Check if jq is installed
if ! command -v jq &> /dev/null
then
echo "jq is required but not installed. Please install jq and run the script again."
exit 1
fi
@Eseperio
Eseperio / tip.md
Created August 6, 2025 17:11
Gitlab Deploy token not working with composer and private repositories

Gitlab Deploy token not working with composer and private repositories

Steps for fixing it:

  • Ensure your private repositories are configured as git and not as vcs. The latter causes composer to use gitlab api instead of https url, resulting in 404 for composer.
  • Check expiration date of token
  • Ensure you have addded your deploy token in composer config. composer config --global --list

Still lost: try highest verbosity level running composer with -vvv

@Eseperio
Eseperio / tricks.md
Created August 11, 2025 08:58
vue-advanced-chat tricks

While implementing that library, i´ve found two things that made me spent a lot of time fixing them.

    1. There is a bug for props that requires booleans being defined as strings "false" or "true" in order to work.
    1. Event it is written in readme, remember arrays must be defined as json.