This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:fpm | |
# install the PHP extensions we need | |
RUN apt-get update && apt-get install -y libfreetype6-dev libpng-dev libjpeg62-turbo-dev libmemcached-dev zlib1g-dev && rm -rf /var/lib/apt/lists/* \ | |
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | |
&& docker-php-ext-install -j$(nproc) gd mysqli opcache pdo_mysql \ | |
&& pecl install memcached-3.0.4 \ | |
&& docker-php-ext-enable memcached | |
# set recommended PHP.ini settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is an example VCL file for Varnish. | |
# | |
# It does not do anything by default, delegating control to the | |
# builtin VCL. The builtin VCL is called when there is no explicit | |
# return statement. | |
# | |
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ | |
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ISingleton { | |
public static function getInstance(): ISingleton; | |
} | |
abstract class Singleton implements ISingleton { | |
private static $_instances = []; | |
final private function __construct () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
stdin, stdout, stderr = Open3.popen3('iptables -L -n') | |
bannedIp = [] | |
stdout.readlines.each {|ip| | |
m = ip.match /DROP\x20+all\x20+--\x20+(([0-9]{1,3}\.){3}[0-9]{1,3})\x20+(([0-9]{1,3}\.){3}[0-9]{1,3})\/([0-9]+)/ | |
unless m == nil then | |
bannedIp << m[1] | |
end | |
} |