This file contains hidden or 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
{ "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/*" } ] } |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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]"; | |
This file contains hidden or 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
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 |
This file contains hidden or 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
;;; auto-rsync-mode -- minor mode for auto rsync | |
;; | |
;; Author: @l3msh0 | |
;; | |
;;; Example | |
;; | |
;; (require 'auto-rsync) | |
;; (auto-rsync-mode t) | |
;; (setq auto-rsync-dir-alist |
This file contains hidden or 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 | |
/* | |
Author | |
====== | |
Author: Cathal Garvey. | |
Website: http://cgarvey.ie/ | |
Help/Details Page: http://cgarvey.ie/blog/archive/2013/01/23/manually-generating-salted-hashed-wordpress-passwords/ | |
Copyright |
This file contains hidden or 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 | |
ssl_expiry() { | |
# Show usage info if not called with a hostname | |
if [ $# -eq 0 ]; then | |
echo "Usage: ssl_expiry HOSTNAME" | |
return 0 | |
fi | |
domain=$1 |
This file contains hidden or 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 | |
class NewRelic_Error extends Exception {} | |
function NewRelic_Date(DateTime $date) { | |
return $date->format('Y-m-d') . 'T' . $date->format('H:i:s') . 'Z'; | |
} | |
function NewRelic_Metrics2Array(SimpleXMLElement $result) { | |
$return = array(); |
This file contains hidden or 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
# Activates mod_security | |
SecRuleEngine On | |
# Only filters requests for /toto | |
SecRule REQUEST_FILENAME "!^/toto" "phase:1,skip:5,nolog" | |
# Only filters requests for rosalind | |
SecRule REQUEST_HEADERS:Host "rosalind\.abgenomica\.com" "phase:1,skip:5,nolog" | |
# Stores the number of visits in variable IP.pagecount | |
SecAction "phase:1,nolog,initcol:IP=%{REMOTE_ADDR},setvar:IP.pagecount=+1,expirevar:IP.pagecount=60" | |
# Denies requests when excessive | |
# 429 would be a better error status but mod_security rewrites it as 500 :-( |
This file contains hidden or 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 | |
# pre-commit git hook to check the validity of a puppet manifest | |
# | |
# Prerequisites: | |
# gem install puppet-lint puppet | |
# | |
# Install: | |
# /path/to/repo/.git/hooks/pre-comit | |
# Source RVM if needed |