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
# S3 Bucket | |
resource "aws_s3_bucket" "deployment" { | |
bucket = "${local.deployment_bucket}" | |
} | |
# Amazon Certificate Manager | |
resource "aws_acm_certificate" "cert" { | |
domain_name = "${local.domain}" | |
validation_method = "DNS" | |
} |
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
locals { | |
deployment_buckets = { | |
develop = "my-develop-bucket" | |
staging = "my-staging-bucket" | |
production = "my-production-bucket" | |
} | |
domains = { | |
develop = "develop.example.com" |
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
import boto3 | |
ec2 = boto3.client('ec2'); | |
cloudwatch = boto3.client('cloudwatch'); | |
def lambda_handler(event, context): | |
count = 0 | |
response = ec2.describe_instances() | |
for r in response['Reservations']: | |
count += len(r['Instances']) |
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
{ | |
"order_num": "5066", | |
"customer_id": "1", | |
"po_num": null, | |
"email": "[email protected]", | |
"phone": "", | |
"billing_name": "JOHN VELDBOOM", | |
"billing_addr1": "289 W MAIN ST", | |
"billing_addr2": "", | |
"billing_city": "NESS CITY", |
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
# stld | |
log-format %h %^[%d:%t %^] "%m %r %H" %s %b "%u" | |
# invubu | |
log-format %h %^[%d:%t %^] %m "%U" "%^" %^ %s %T %b "%u" |
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
class SortMdArray { | |
public $sort_order = 'asc'; // default | |
public $sort_key = 'position'; // default | |
public function sortByKey(&$array) { | |
usort($array, array(__CLASS__, 'sortByKeyCallback')); | |
} | |
function sortByKeyCallback($a, $b) { | |
if($this->sort_order == 'asc') { |
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 | |
$workers = 400; | |
//10000 | |
echo 'StartServers '.($workers * .3).PHP_EOL; | |
echo 'MinSpareServers '.($workers * .05).PHP_EOL; | |
echo 'MaxSpareServers '.($workers * .10).PHP_EOL; | |
echo 'ServerLimit '.($workers).PHP_EOL; | |
echo 'MaxRequestWorkers '.($workers).PHP_EOL; | |
echo 'MaxRequestsPerChild 10000'; |
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
check process hekad-system with pidfile /var/run/hekad-system.pid | |
start program = "/bin/bash -c 'hekad --config=/usr/share/heka/conf.d/system.toml'" with timeout 60 seconds | |
stop = "/bin/bash -c 'kill -s SIGTERM `cat /var/run/hekad-system.pid`'" |
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 | |
require '../includes/class.common.php'; | |
require '../includes/class.images.php'; | |
$common = new common; | |
$images = new images; | |
// mysql connection | |
$conn=mysqli_connect("localhost","database","password","database_name"); | |
// Check connection | |
if (mysqli_connect_errno($conn)) { |
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 | |
/** | |
* sar documentation http://linux.die.net/man/1/sar | |
*/ | |
class SystemStats | |
{ | |
function __construct($sar) | |
{ | |
$this->sar = $sar; | |
} |
NewerOlder