Skip to content

Instantly share code, notes, and snippets.

View dstokes's full-sized avatar

Drew Stokes dstokes

View GitHub Profile
// averaged scores across layer nets
{ '0': 3.7868791304080087,
'1': 1.2131208695919908,
BYTES_PER_ELEMENT: 8,
get: [Function: get],
set: [Function: set],
slice: [Function: slice],
subarray: [Function: subarray],
buffer:
{ '0': 252,
#!/bin/sh
set -e
apt-get update -q
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
apt-get install -qy openvpn curl iptables-persistent
cd /etc/openvpn
[ -f dh.pem ] || openssl dhparam -out dh.pem 2048
{% set workers = { 'worker': 'rake resque:work QUEUE=immediate,high,medium,low',
'data_seed_worker': 'rake resque:work QUEUE=data_seed',
'youtube_quota_worker': 'rake resque:youtube_quota_worker',
'scheduler': 'rake resque:scheduler'
'sidekiq': 'sidekiq' } %}
{
"Environment": "prod",
"VPC": "vpc-69f00f0c",
"Subnets": "subnet1,subnet2",
"Zones": "us-east-1a",
"ServerSecurityGroups": "...",
"ElbSecurityGroups": "...",
"Endpoint": "www2.o2lontour.com"
}
@dstokes
dstokes / Vagrantfile
Created July 1, 2014 19:19
Salt Development Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
$bootstrap = <<SCRIPT
#!/usr/bin/env bash
apt-get update
apt-get install -y git build-essential python-pip python-dev python-m2crypto
@dstokes
dstokes / Vagrantfile
Created July 7, 2014 22:09
SmartOS Vagrantfile (Virtualbox)
Vagrant.configure("2") do |config|
# existing box name
config.vm.box = "SmartOS"
# download url for box (if it doesn't already exist)
config.vm.box_url = "http://dlc-int.openindiana.org/aszeszo/vagrant/smartos-base1310-64-virtualbox-20130806.box"
# sync a local directory to the vm
#config.vm.synced_folder "/path/to/local/dir", "/path/to/vm/dir"
include:
- mysls
# this runs even when mysls errors
some_state:
cmd.run:
- name: do things
- require:
- sls: mysls
@dstokes
dstokes / Vagrantfile
Created July 25, 2014 18:18
salt auth error setup
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.define "master" do |master|
master.vm.hostname = "master"
master.vm.network :private_network, ip: "10.10.10.2"
master.vm.synced_folder ".", "/srv/salt/", nfs: true
master.vm.provider "virtualbox" do |v|
v.cpus = 2
{# set the value as a jinja variable #}
{%- mayvar = 'taco ' %}
{# add jinja variable to pillar data #}
mypillarkey: {{ myvar }}
{# add jinja variable to another pillar key #}
myotherpillarkey: {{ myvar }}
@dstokes
dstokes / redis-monitor.sh
Last active December 19, 2019 03:25
StatsD Redis Monitor in 10LOC
#!/bin/bash
#
# Report redis usage data to statsd
# Metric Format: <env>.<hostname>.<redis>.<metric>
#
# Add to crontab for periodic monitoring
#
STATSD_HOST=<host>
STATSD_PORT=8125