Skip to content

Instantly share code, notes, and snippets.

View Artem-Schander's full-sized avatar

Artem Schander Artem-Schander

View GitHub Profile
@Artem-Schander
Artem-Schander / 1. README.md
Last active October 20, 2018 14:14 — forked from joseluisq/1README.md
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@Artem-Schander
Artem-Schander / docker-swarm-auto-rebalance.sh
Last active September 30, 2020 17:47 — forked from zerowebcorp/docker-swarm-auto-rebalance.sh
Docker Swarm automatically rebalance when new worker node joins
FILE=/tmp/worker.nodes
touch ${FILE} || exit
for node in `docker node ls --filter role=worker -q`; do
if grep -Fxq "${node}" ${FILE}
then
echo "This node ${node} already exists"
else
echo "This node ${node} joined recently, so rebalance"
for service in `docker service ls -q`; do
docker service update --with-registry-auth --detach=true --force ${service}
FROM php:7.2-fpm
RUN export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS"
RUN apt-get update && apt-get install -y --no-install-recommends \
libmcrypt-dev mysql-client libmagickwand-dev git zip \
ghostscript imagemagick libmagickwand-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install imagick mcrypt-1.0.1 \