Skip to content

Instantly share code, notes, and snippets.

View phpclub's full-sized avatar
🎯
Focusing

Alexandr Smirnov phpclub

🎯
Focusing
View GitHub Profile
@andypost
andypost / php85-allocator-bench.md
Last active May 27, 2026 14:37
profiling PHP 8.5 with memory allocators on Alpinelinux

Memory allocators on Alpine Linux — PHP & multi-threaded servers

Measured 2026-05-07 to 2026-05-08 on Alpine edge, x86_64, 8 cores, 14 GB RAM. PHP 8.5.6, opcache always on. Drupal 11.x-dev (7 455 vendor .php, 8 499 classes) as the realistic single-threaded workload. A small C harness (8 pthreads × 2 000 000 small mallocs) for the multi-threaded contention scenario.

11 allocators tested:

| Allocator | Version | Source |

@pavelkorolevxyz
pavelkorolevxyz / settings.json
Created February 4, 2026 16:05
Хук и скрипт для активации скиллов в Claude Code (без него они работают крайне рандомно)
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/skill-activation.sh"
}
╭─── Claude Code v2.1.12 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back Jonny! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ │
│ │ ───────────────────────────────────────────────────────────────── │
│ ▐▛███▜▌ │ Recent activity
@umputun
umputun / skill-activation-hook.md
Last active May 27, 2026 01:31
Mandatory Skill Activation Hook for Claude Code

Mandatory Skill Activation Hook for Claude Code

Forces Claude to evaluate and activate relevant skills before implementation. By default, Claude Code often ignores available skills entirely and proceeds with generic responses instead of leveraging specialized skill knowledge.

Problem Solved

Claude Code frequently skips skill evaluation and jumps straight to implementation, missing out on specialized context and workflows that skills provide. This hook injects a system reminder on every prompt submission that enforces a three-step sequence: evaluate → activate → implement.

Files Required

@phpclub
phpclub / dnf_copy
Created April 3, 2025 18:21
How to replicate installed package selection from one Almalinux instance to another?
the Dnf repoquery subcommand supports has a new option for listing all user-installed packages:
$ dnf repoquery --qf '%{name}' --userinstalled \
| grep -v -- '-debuginfo$' \
| grep -v '^\(kernel-modules\|kernel\|kernel-core\|kernel-devel\)$' > pkgs_a.lst
In contrast to other methods, it also lists all debuginfo packages. The additional grep in the above example filters them out.
To install the list on host B:
$ < pkgs_a.lst xargs dnf -y install
# Add Repository to your system (ondrej/php PPA)
sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
# Install PHP 7.1
sudo apt install php7.1
@phpclub
phpclub / setup_russiantrustedca.md
Created May 28, 2024 07:07 — forked from jidckii/setup_russiantrustedca.md
Установка сертификатов НУЦ Минцифры в Alpine Linux

Установка сертификатов НУЦ Минцифры в Alpine Linux

Проверяем:

curl -vvv -XGET -I https://www.sberbank.ru/ru/certificates

Устанавливаем:

@phpclub
phpclub / README.md
Last active May 21, 2024 14:24 — forked from lcrilly/README.md
Prometheus exporter for NGINX Unit metrics

Prometheus exporter for NGINX Unit metrics

The NGINX Unit control API includes a /status endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.

The application (run by Unit) queries the /status URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.

These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.

Step 0. Install the preferred Unit language module (unit-php or unit-python)

@lcrilly
lcrilly / README.md
Last active August 8, 2025 12:32
Prometheus exporter for NGINX Unit metrics

Prometheus exporter for NGINX Unit metrics

The NGINX Unit control API includes a /status endpoint for usage statistics. This is a solution for exposing these metrics in Prometheus format.

The application (run by Unit) queries the /status URI on the control socket and converts the JSON response into Prometheus text format. PHP and Python implementations are available.

These instructions assume an existing Unit installation with a working configuration. We will add a new listener on the default prometheus port (9090) and route it directly to the Prometheus app.

Step 0. Install the preferred Unit language module (unit-php or unit-python)

@EvilFreelancer
EvilFreelancer / docker-compose.yml
Created April 25, 2023 23:06
docker-compose with k3s server and agent
version: '3'
services:
k3s-server:
image: rancher/k3s
command: server --disable-agent
environment:
K3S_KUBECONFIG_OUTPUT: /output/kubeconfig.yaml
volumes:
- ./k3s-server:/var/lib/rancher/k3s
- ./kubeconfig.yaml:/output/kubeconfig.yaml