Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
VARNISH_VERSION=3.0.3 | |
VMOD_REPOSITORY=https://github.com/nand2/libvmod-throttle.git | |
VMOD_NAME=libvmod-throttle | |
VMOD_VERSION='0.1' | |
VMOD_LICENSE='Simplified BSD License' | |
VMOD_VENDOR='Nicolas Deschildre' | |
VMOD_DESCRIPTION='Rate limiting in Varnish, on different time windows and keys' | |
sudo yum install -y pcre-devel python-docutils |
Sample PHP code to accept PagerDuty webhooks and send out notifications by email on state changes. | |
For more information, see http://developer.pagerduty.com/documentation/rest/webhooks | |
This example threads emails based on "$status: $description on $service" so each update to each incident would start a new thread. | |
This code is unsupported by PagerDuty. | |
<?php | |
$emailAddress = "[email protected]"; | |
# add as many as you need... | |
SetEnvIf CF-IPCountry SY RedirectSubdomain=syria | |
SetEnvIf CF-IPCountry AE RedirectSubdomain=uae | |
SetEnvIf CF-IPCountry EG RedirectSubdomain=egypt | |
# Only redirect if Host is not a subdomain | |
SetEnvIfNoCase Host ^.+\.example\.com$ !RedirectSubdomain | |
# Only redirect if cookie "noredirect" doesn't exist | |
SetEnvIfNoCase ^Cookie$ noredirect=true !RedirectSubdomain |
{ "Version": "2008-10-17", "Id": "http referer policy", "Statement": [ { "Sid": "readonly policy", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::BUCKET_NAME_HERE/*" } ] } |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
The project documentation (stored in the docs
directory) is a git subtree of the project wiki. This allows for the documentation to be referenced and edited from within the main project.
When cloning the main project repository for the first time, the wiki repository must be added as a remote.
git remote add wiki https://github.com//.wiki.git
require 'specinfra/backend/exec' | |
require 'open3' | |
module SpecInfra | |
module Backend | |
class Nsenter < Exec | |
def run_command(cmd, opt={}) | |
cmd = build_command(cmd) | |
cmd = add_pre_command(cmd) | |
ret = nsenter_exec!(cmd) |
""" | |
Custom parser for nginx log suitable for use by Datadog 'dogstreams'. | |
To use, add to datadog.conf as follows: | |
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")] | |
so, an example line would be: | |
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse | |
Log of nginx should be defined like that: | |
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for'; | |
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully | |
""" |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 20; |