Skip to content

Instantly share code, notes, and snippets.

@Tersoal
Tersoal / FullTextSearchFilter.php
Created October 1, 2020 09:02
Full text search for API Platform with one or more strings
<?php
namespace App\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\ORM\QueryBuilder;
@ravoro
ravoro / apache-404.conf
Created October 22, 2017 15:49
Fail2Ban filter for catching 404 responses.
# Fail2Ban filter for catching 404 responses.
#
# Useful if you wish to block an ip that is making too many 404 requests.
# Which is typical behavior for a vulnerability scanner.
[Definition]
failregex = ^<HOST> - .* "(GET|POST|HEAD).*HTTP.*" 404 .*$
ignoreregex =
@fevangelou
fevangelou / my.cnf
Last active June 14, 2024 15:08
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#