Skip to content

Instantly share code, notes, and snippets.

View pprishchepa's full-sized avatar

Pavel Prishchepa pprishchepa

View GitHub Profile
@pprishchepa
pprishchepa / gist:f27c4cd8d1b59041eac8c5b2bf9046db
Created October 14, 2016 09:38
Bash, Generate password, Environment Variable
# https://github.com/wikimedia/mediawiki-containers/blob/master/mediawiki-containers
if [ -z "$MEDIAWIKI_ADMIN_PASS" ];then
MEDIAWIKI_ADMIN_PASS=$(</dev/urandom tr -dc A-Za-z0-9 | head -c8)
fi
@pprishchepa
pprishchepa / bash
Created October 14, 2016 10:17
Curl, Download and save to file
#!/bin/sh
curl -L "https://raw.githubusercontent.com/bitnami/bitnami-docker-laravel/master/docker-compose.yml" > docker-compose.yml
/srv/app # php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
@pprishchepa
pprishchepa / countContainers.sh
Created November 28, 2016 13:54 — forked from ggtools/countContainers.sh
A simple script to count the containers on a Docker host.
#!/bin/bash
function countContainers() {
docker ps -q $1 | wc -l
}
function countCrashedContainers() {
docker ps -a | grep -v -F 'Exited (0)' | grep -c -F 'Exited ('
}
@pprishchepa
pprishchepa / nginx.conf
Created November 28, 2016 13:55 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pprishchepa
pprishchepa / nginx-drupal7-xml.conf
Last active December 2, 2016 10:29
Docker4Drupal Nginx + XML
server {
server_name SERVER_NAME;
listen 80;
root /var/www/html/;
index index.php;
fastcgi_keep_conn on;
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
@pprishchepa
pprishchepa / gist:caa3985719977c62fec203dc203b72c1
Last active January 18, 2017 03:51
varnish-caching-suggestion.txt
vcl 4.0;
...
sub vcl_recv {
...
# Protecting against the HTTPOXY CGI vulnerability.
unset req.http.proxy;
apiVersion: v1
kind: ReplicationController
metadata:
name: pma
spec:
replicas: 1
template:
metadata:
labels:
name: pma
#!/usr/bin/env bash
set -e
if [[ -n "${DEBUG}" ]]; then
set -x
fi
# Exec something....
@pprishchepa
pprishchepa / docker-compose-v3.yml
Created June 13, 2017 12:41 — forked from seeruk/docker-compose-v3.yml
Concourse CI working with Docker Compose V3 syntax.
version: "3"
services:
concourse-db:
image: postgres:9.5
environment:
- POSTGRES_DB=concourse
- POSTGRES_USER=concourse
- POSTGRES_PASSWORD=changeme
- PGDATA=/database