#Some discussions on logging from docker: Using logstash Using Papertrail
A lot of this boils down to whether you want a single or multi-process (systemd, supervisord etc.) container...
#Some discussions on logging from docker: Using logstash Using Papertrail
A lot of this boils down to whether you want a single or multi-process (systemd, supervisord etc.) container...
in docker-compose.yml: | |
nginx: | |
restart: always | |
build: ./nginx/ | |
ports: | |
- "80:80" | |
extra_hosts: | |
# requires `export DOCKERHOST="$(ifconfig en0 inet | grep "inet " | awk -F'[: ]+' '{ print $2 }')"` in ~/.bash_profile | |
- "dockerhost:$DOCKERHOST" |
require 'yaml' | |
require 'fileutils' | |
config = { | |
local: './vagrant/vagrant-local.yml', | |
main: './vagrant/vagrant-main.yml' | |
} | |
# Копирование и чтение конфига из файла | |
FileUtils.cp config[:main], config[:local] unless File.exist?(config[:local]) |
<?php | |
/** | |
* Helper class to compute human readable date intervals , e.g. 1 hour 5 minutes 24 seconds | |
*/ | |
class DateIntervals | |
{ | |
private $forms = [ | |
'eng' => [ | |
'years' => ['year', 'years'], |
mysql --database=dbname -B -N -e "SHOW FULL TABLES WHERE Table_Type = 'BASE TABLE'" | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --database=dbname & |
<?php | |
namespace console\controllers\behaviors; | |
use Yii; | |
use yii\base\ActionEvent; | |
use yii\base\Behavior; | |
use yii\base\Exception; | |
use yii\console\Controller; |
<?php | |
/** | |
* @param string $string Subject | |
* @param int $length Max string length | |
* @param bool $exactLength Truncate string with exact $length | |
* @param string $append Ellipsis string | |
* @return string | |
*/ | |
class TruncateString |
<?php | |
use yii\base\Object; | |
use yii\helpers\Console; | |
/** | |
* Usage: | |
* $consoleProgress = new ConsoleProgress(['max' => 365]); | |
* $consoleProgress->start(); | |
* foreach($days in $day) { |
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |
[unix_http_server] | |
file=/tmp/supervisor.sock ; path to your socket file | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
logfile_backups=10 ; number of backed up logfiles | |
loglevel=error ; info, debug, warn, trace | |
pidfile=/var/run/supervisord.pid ; pidfile location | |
nodaemon=false ; run supervisord as a daemon |