Skip to content

Instantly share code, notes, and snippets.

John Veldboom jveldboom

Block or report user

Report or block jveldboom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View terraform-workspaces-template.tf
# 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"
}
@jveldboom
jveldboom / terraform-workspaces-vars.tf
Last active Nov 30, 2018
terraform-workspaces-vars
View terraform-workspaces-vars.tf
locals {
deployment_buckets = {
develop = "my-develop-bucket"
staging = "my-staging-bucket"
production = "my-production-bucket"
}
domains = {
develop = "develop.example.com"
View instance-count.py
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'])
View order.json
{
"order_num": "5066",
"customer_id": "1",
"po_num": null,
"email": "john@veldboom.com",
"phone": "",
"billing_name": "JOHN VELDBOOM",
"billing_addr1": "289 W MAIN ST",
"billing_addr2": "",
"billing_city": "NESS CITY",
@jveldboom
jveldboom / goaccess.conf
Created May 22, 2015
GoAccess Log Formats
View goaccess.conf
# stld
log-format %h %^[%d:%t %^] "%m %r %H" %s %b "%u"
# invubu
log-format %h %^[%d:%t %^] %m "%U" "%^" %^ %s %T %b "%u"
View SortMdArray.php
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') {
View gist:87615b2a5d49ac04e2c3
<?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';
View heka-system.conf
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`'"
View gmc_datafeed.php
<?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)) {
@jveldboom
jveldboom / SystemStats.php
Created Oct 30, 2014
Combine sar system stats
View SystemStats.php
<?php
/**
* sar documentation http://linux.die.net/man/1/sar
*/
class SystemStats
{
function __construct($sar)
{
$this->sar = $sar;
}
You can’t perform that action at this time.