Skip to content

Instantly share code, notes, and snippets.

View zviryatko's full-sized avatar
😶‍🌫️
AI, AI everywhere...

Oleksandr Davyskyba zviryatko

😶‍🌫️
AI, AI everywhere...
View GitHub Profile
@zviryatko
zviryatko / README.md
Last active October 1, 2026 10:24
Reusable Drupal site:install profiling skill, php-spx instrumentation patch, and configurable runner

Drupal installation profiling with php-spx

A reusable skill, Bash runner, and temporary core patch for profiling Drupal's installer one task iteration at a time.

Save all three companion files in one directory, such as .agents/skills/profile-site-install/, and follow SKILL.md.

Requires Bash, patch, Drush, and CLI PHP with php-spx. Run inside your PHP environment from the Drupal project root; no particular container platform,

@zviryatko
zviryatko / README.md
Created September 23, 2026 22:36
Drupal core patches for faster site:install --existing-config

Drupal core site:install performance patches

Five custom patches from a Drupal 11.4 project, targeting drush site:install --existing-config:

  • Cache configuration collection names during import.
  • Cache translatable default configuration and locale support checks.
  • Optionally skip translation-status key/value operations during installation.
  • Avoid forced rebuilds of cold entity field maps.
  • Limit bundle-field cache invalidation during installation.
@zviryatko
zviryatko / Dockerfile
Created September 23, 2026 17:15
PHP-SPX setup Docker
# 1. `apk add` can be `apt install`, depends on your docker base image.
# 2. `php-spx` could be `php85-spx`, check your php version.
# 3. `/etc/php/conf.d/` dir depends on distro and php install, use `php -i | grep .ini` to find out.
# 4. `/var/www/html/web/sites/default/files/spx/` dir can be different, using drupal public files dir for easy access.
# 5. After setup open `http://site.localhost/?SPX_UI_URI=/&SPX_KEY=dev` and click Enable and Automatic start.
RUN apk add --no-cache php-spx \
&& touch /etc/php/conf.d/spx.ini \
&& echo 'spx.http_enabled=1' >> /etc/php/conf.d/spx.ini \
&& echo 'spx.http_key=dev' >> /etc/php/conf.d/spx.ini \
&& echo 'spx.data_dir="/var/www/html/web/sites/default/files/spx/"' >> /etc/php/conf.d/spx.ini \
@zviryatko
zviryatko / .mcp.json
Last active September 10, 2026 22:10
Profiling a Drupal site:install per-task with php-spx + an MCP server (self-documenting recipe for AI agents)
{
"mcpServers": {
"spx-mcp": {
"command": "docker",
"args": [
"compose", "exec", "-T",
"-e", "SPX_DATA_DIR=/var/www/html/docroot/sites/default/files/spx/",
"app", "php", "/opt/php-spx-mcp/bin/server.php"
]
}
@zviryatko
zviryatko / README.md
Last active October 21, 2025 06:56
MS Teams notification webhook script
  1. Create MS Teams simple chat
  2. Add workflow to it (on the left chat list click to triple dots and select Workflows)
image
  1. Add next workflow - basically it should Receive Webhook and Post Adaptive Card
image
  1. Add next script to your project and run with ./deploy.sh "Site name" "Env name" (don't forget to replace webhook url with one from teams).
name: automated-tests
# only manual run
on:
workflow_dispatch:
jobs:
automated-tests:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
@zviryatko
zviryatko / Dockerfile
Created April 11, 2024 09:11
Drupal development
FROM skilldlabs/php:82 as spx
RUN apk update && apk add php82-dev libzip-dev libxml2-dev openssl git unzip acl zlib-dev autoconf g++ make \
&& cd /opt \
&& wget https://github.com/NoiseByNorthwest/php-spx/archive/refs/heads/master.zip -O php-spx.zip \
&& unzip php-spx.zip \
&& rm php-spx.zip \
&& cd php-spx-master \
&& phpize82 \
&& ./configure --with-php-config=/usr/bin/php-config82 \
&& make \
@zviryatko
zviryatko / invoke.sh
Last active October 25, 2023 10:52
Invoke aws lambda with http request
#!/bin/bash
# Payload example:
# '{"httpMethod": "GET", "path": "/foo/bar"}'
FUNCTION_NAME=$1
PAYLOAD=$2
aws lambda invoke --function-name ${FUNCTION_NAME} --invocation-type RequestResponse --cli-binary-format raw-in-base64-out --payload "${PAYLOAD}" /tmp/response.json && cat /tmp/response.json | jq -r '.body' | jq
@zviryatko
zviryatko / README.md
Last active August 16, 2023 08:46
Useful bash scripts for analyzing AWS Aurora DB audit logs.

Usage

  1. Enable RDS logger
  2. Run some huge operations
  3. Download each audit log one by one in single folder.
  4. Run next command to join all logs to single file: cat * | awk -F "'" 'BEGIN{OFS="'\''"} NF-=1 {$1=""; print $0}' | cut -c2- > all.sql
  5. Download and run analyze.sh.

image

@zviryatko
zviryatko / BetterRestExportNested.php
Created August 7, 2023 20:03
Better REST export for Drupal 10 Views
<?php
namespace Drupal\better_rest_api\Plugin\views\display;
use Drupal\Core\Render\RenderContext;
use Drupal\Component\Utility\Html;
use Drupal\rest\Plugin\views\display;
use Drupal\views\Render\ViewsRenderPipelineMarkup;
/**