Skip to content

Instantly share code, notes, and snippets.

View avantassel's full-sized avatar
💯

Andrew Van Tassel avantassel

💯
View GitHub Profile
@avantassel
avantassel / nginxoptimization.config
Created November 9, 2018 20:02 — forked from wearhere/nginxoptimization.config
Optimized nginx configuration for an AWS Elastic Beanstalk environment using an Application Load Balancer.
files:
"/opt/elasticbeanstalk/#etc#nginx#optimized-nginx.conf":
mode: "000644"
owner: root
group: root
encoding: plain
content: |
# Elastic Beanstalk Managed
# Elastic Beanstalk managed configuration file
@avantassel
avantassel / ebsnvme-id
Created June 19, 2018 19:20 — forked from lbernail/ebsnvme-id
ebsnvme-id script
#!/usr/bin/env python2.7
# Copyright (C) 2017 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#!/bin/bash -xe
# requires jq and 3 brokers to start
which jq || echo 'no jq found, bye!' && exit 1
ZK_HOST=zkhost1:2181/kafka
# record all topics
/usr/local/kafka/bin/kafka-topics.sh --zookeeper $ZK_HOST --list > all_topics
# generate json for listing which topics to reassign
@avantassel
avantassel / kafka_topics.sh
Created November 7, 2017 20:52 — forked from kapkaev/kafka_topics.sh
Calculate kafka topics sizes
#!/usr/bin/ruby
require 'net/ssh'
require 'pp'
def fetch(host)
data = []
Net::SSH.start(host, 'virool') do |ssh|
index_folders = ssh.exec!("ls -d /var/lib/kafka/*").split("\n")
data = index_folders.flat_map do |ifolder|
@avantassel
avantassel / purgePath
Created June 14, 2016 18:55 — forked from AD7six/purgePath
Script to ensure a folder used for caching always has x% free space. Generated with new_script http://linuxcommand.org/script_library.php
#!/bin/bash
################################################################################
#
# Delete least used files
#
################################################################################
PROGNAME=${0##*/}
PROGDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
VERSION="0.1"
<!DOCTYPE html>
<html>
<!-- ZevRoss Spatial Analysis, www.zevross.com -->
<!-- A note: if you're not seeing the elements in the custom
infowindow look at the cartodb dashboard and make sure they're
turned on
-->
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
@avantassel
avantassel / MNMP.sh
Created July 10, 2013 22:49 — forked from camshaft/MNMP.sh
#!/bin/bash
# vars
PHP_VERSION="5.3.6"
NGINX_VERSION="1.0.4"
MONGO_VERSION="1.8.1"
MEMCACHED_VERSION="1.4.5"
DIRECTORY=$(cd `dirname $0` && pwd)
PHP_DIR=$DIRECTORY/lib/php/$PHP_VERSION/