Skip to content

Instantly share code, notes, and snippets.

Sergey Khaladzinski gansbrest

View GitHub Profile
@gansbrest
gansbrest / unusedrds.sh
Last active Aug 22, 2018 — forked from akinnard/unusedrds.sh
Find unused rds instances
View unusedrds.sh
#!/bin/bash
osname=$( uname )
if [[ $osname == "Darwin" ]]; then
date="gdate"
else
date="date"
fi
DAYSBACK=14
@gansbrest
gansbrest / gist:52813f82eeb1ce89c19945b1b957380d
Created May 12, 2017
Works on Ubuntu local without libpcre3-dev
View gist:52813f82eeb1ce89c19945b1b957380d
gansbrest@ ~/Work/fc-wp-editor: docker-compose build --no-cache wordpress
Building wordpress
Step 1/15 : FROM php:7.1-apache
---> 399dbfe34f35
Step 2/15 : RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev git unzip && docker-php-ext-install -j$(nproc) zip intl mysqli iconv mcrypt opcache pdo pdo_mysql && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd && pecl install redis-3.1.1 && docker-php-ext-enable redis
---> Running in 2a07b5e032e7
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://security.debian.org jessie/updates/main amd64 Packages [509 kB]
View gist:ed1e8f261f5095851bf6f5fa615e005f
Sending build context to Docker daemon 101.4 MB
Step 1 : FROM php:7.1-apache
7.1-apache: Pulling from library/php
Digest: sha256:afeec69ac42a9356eb380a9b931acdae2b8b2dd2ff932877b24ecb9f2944434f
Status: Image is up to date for php:7.1-apache
---> e3e5c593479f
Step 2 : RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev git unzip && docker-php-ext-install -j$(nproc) zip intl mysqli iconv mcrypt opcache pdo pdo_mysql && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd && pecl install redis-3.1.1 && docker-php-ext-enable redis
---> Running in 11b87bf68745
Ign http://deb.debian.org jessie InRelease
Get:1 http://deb.debian.org jessie-updates InRelease [145 kB]
View gist:366c26a5e7ed36caaacaabd68232596c
FROM php:7.1-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libicu-dev \
git \
unzip \
libpcre3-dev \
@gansbrest
gansbrest / site.conf
Created Dec 7, 2016
nginx config for smyfony 3 docker
View site.conf
server {
listen 80 default_server; # redundant in new nginx versions
server_name _;
#index index.php index.html index.htm;
root /usr/share/nginx/html/web;
# Block access to "hidden" files and directories whose names begin with a
View symfony 3 docker-compose dev env
version: '2'
services:
app:
image: gansbrest/php7-fpm
volumes:
- .:/usr/share/nginx/html
environment:
XDEBUG_CONFIG: remote_host=192.168.1.13
depends_on:
View gist:04ddfe935a4e3fdcdc7f
<?php
echo "TEST";
if ($argv[1]) {
sleep(10);
echo "RUN AGAIN";
exit;
}
View gist:7873c95c59b03a9b2e7d
containers:
php-nginx:
background: false
image: gansbrest/php5.3
workdir: "/app"
onetime: true
environment:
XDEBUG_CONFIG: idekey=PHPSTORM
ports:
- 9999:9999
@gansbrest
gansbrest / gist:7b8c5138bfcb48d4192e
Last active Aug 29, 2015
http_host_proxy.patch
View gist:7b8c5138bfcb48d4192e
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 80b6eb1..5b28e98 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -333,7 +333,15 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
$confdir = 'sites';
$uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
- $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
+
View gist:586265cdefac9e9674e7
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5b28e98..a9b3410 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -438,7 +438,14 @@ function conf_init() {
// $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
// be modified by a visitor.
- if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) {
+
You can’t perform that action at this time.