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 | |
### BEGIN INIT INFO | |
# Provides: graylog2-web | |
# Required-Start: $graylog2 | |
# Required-Stop: $graylog2 | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts graylog2-web | |
# Description: Starts graylog2-web using start-stop-daemon | |
### END INIT INFO |
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 | |
### BEGIN INIT INFO | |
# Provides: graylog2 | |
# Required-Start: elasticsearch | |
# Required-Stop: elasticsearch | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts GrayLog2 | |
# Description: Starts GrayLog2 using start-stop-daemon | |
### END INIT INFO |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Parameters" : { | |
"InstanceType" : { | |
"Description" : "WebServer EC2 instance type", | |
"Type" : "String", | |
"Default" : "m1.small" | |
} | |
"KeyName" : { |
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 | |
/** | |
* Cache stampede protection examples | |
*/ | |
class cache | |
{ | |
/** | |
* @var array |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "PHP Blue-Green Deployment environment template", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type" : "String", | |
"MinLength" : "1", | |
"MaxLength" : "64", | |
"AllowedPattern" : "[-_ a-zA-Z0-9]*", |
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 | |
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' |
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 | |
function start_session($timeout = 1800) | |
{ | |
session_cache_limiter(false); | |
session_start(); | |
ini_set("session.gc_maxlifetime", $timeout); | |
if (isset($_SESSION['lastSeen'])) { | |
$heartbeatAgo = time() - $_SESSION['lastSeen']; | |
$timeLeft = $timeout - $heartbeatAgo; |
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
## _config/myconfig.yml | |
name: OrderController | |
--- | |
OrderController: | |
dependencies: | |
mailerService: %$MailerService | |
Injector: | |
MailerService: | |
factory: MailerFactory | |
MailerFactory: |
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 | |
/** | |
* CreateSomething | |
* | |
* Create a bunch of dataobjects, in this case 10 Members. | |
* | |
*/ | |
class CreateSomething extends BuildTask { | |
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 | |
class Model { | |
public function saveSomething(Member $member, $data) { | |
if($member && | |
$member instanceof Member && | |
$member->exists() && | |
Permissions::check($member, 'CMS_MAIN')) { | |
// dataobject banana |