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
#!/bin/bash | |
ROOT_DIR="/u/apps" | |
KEEP_RELEASES=5 | |
echo "Cleaning releases folders (retaining $KEEP_RELEASES):" | |
for APP_DIR in $(find $ROOT_DIR -maxdepth 2 -type d -name releases); do | |
CURRENT_RELEASE=$(readlink -f "$APP_DIR/../current" | xargs basename) | |
echo " $APP_DIR (current: $CURRENT_RELEASE)" |
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
# /etc/rsyslog.conf Configuration file for rsyslog. | |
# | |
# For more information see | |
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html | |
# | |
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf | |
# | |
# WARNING: This config has been converted to RainerScript format which could | |
# affect config files provided by other software in /etc/rsyslog.d/ | |
# It should behave the same as the legacy-format config file that ships |
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
#!/bin/sh -e | |
# | |
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the | |
# Docker daemon using a JSON config file. On Linux, this file is normally located at | |
# /etc/docker/daemon.json. You should use this JSON config method if you are running | |
# a version of Docker that is at least 1.10! | |
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24: | |
# { | |
# "bip": "192.168.254.1/24" | |
# } |
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
#!/bin/bash | |
################################################### | |
# BlueSpice ExtendedSearch in a box, er, container | |
# | |
# This script runs the Java / Tomcat / Solr apps inside a container using Docker so they don't need | |
# to be installed on your local server at all. | |
# | |
# Installation: | |
# 1. Install Docker: https://docs.docker.com/installation/, then do this: | |
# 2. mkdir -p /opt/bluespice_data |
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
#!/bin/sh -e | |
# This script will DESTROY /dev/xvdb and /dev/xvdc and remount them | |
# for Docker temp and volume storage. | |
# It is intended for EC2 instances with 2 ephemeral SSD instance stores | |
# like the c3.xlarge instance type. | |
service docker stop || true | |
# Setup Instance Store 0 for Docker Temp | |
# (set in /etc/default/docker) |
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
# A better bash-git prompt using git-prompt | |
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
LIGHT_WHITE="\[\033[1;37m\]" | |
WHITE="\[\033[0;37m\]" | |
GRAY="\[\033[1;30m\]" | |
BLACK="\[\033[0;30m\]" | |
RED="\[\033[0;31m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
GREEN="\[\033[0;32m\]" |
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
#!/bin/bash | |
# Set PHP-FPM pool workers CPU affinity so each worker gets one CPU core | |
# Note that FPM recycles threads, so you'll need to run this on cron periodically | |
# Author: Steve Kamerman | |
CPUS=$(grep -c CPU /proc/cpuinfo) | |
FPM_PIDS=$(ps auxw | grep php-fpm | grep pool | awk '{ print $2; }') | |
if [ "$FPM_PIDS" = "" ]; then |
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
#!/bin/bash | |
# This script fixes the Docker error that prevents containers from being (re)started | |
# with an error message like this: | |
# Cannot start container 7831d3502e: [8] System error: Unit docker-7831d3502e.scope already exists. | |
echo "Stopping Docker containers" | |
docker stop $(docker ps -q) > /dev/null 2>&1 | |
echo "Clearing orphaned cgroups" |
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 | |
-------------------------------------------------------------- | |
Total Iterations: 10,000,000 | |
time(): 0.73976612091064 seconds (13,517,785/sec) | |
microtime(): 4.2245488166809 seconds (2,367,116/sec) | |
microtime(true): 1.2555038928986 seconds (7,964,929/sec) | |
HHVM | |
-------------------------------------------------------------- | |
Total Iterations: 10,000,000 |
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
#!/bin/sh -e | |
# Upgrade Docker to 1.10 from 1.8+ | |
# curl -sSL https://gist.githubusercontent.com/kamermans/3b33d1b36c4bf570415c/raw/upgrade_docker.sh | sh | |
echo "Upgrading Docker Compose" && sleep 2 | |
COMPOSE=$(which docker-compose || echo /usr/local/bin/docker-compose) | |
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > $COMPOSE | |
chmod +x $COMPOSE | |
echo "Migrating Docker data to 1.10+ format" && sleep 2 |