Skip to content

Instantly share code, notes, and snippets.

@asenchi
asenchi / nginx-elasticsearch-proxy.conf
Created June 25, 2018 18:25 — forked from abrudtkuhl/nginx-elasticsearch-proxy.conf
NGINX Reverse Proxy Authentication For Elasticsearch
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost/_search?q=*
#
# is rewritten to:
#
# file name terraform/modules/aws_vpc/vpc.tf
# first create the VPC.
# Prefix resources with var.name so we can have many environments trivially
resource "aws_vpc" "mod" {
cidr_block = "${var.cidr}"
enable_dns_hostnames = "${var.enable_dns_hostnames}"
enable_dns_support = "${var.enable_dns_support}"
tags {
Name = "${var.env}_vpc"
@asenchi
asenchi / jessfraz.md
Created April 19, 2018 22:26 — forked from acolyer/jessfraz.md
Containers, operating systems and other fun things from The Morning Paper
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
--[[
Graphs the Cpu Load and number of processes of the system running heka.
Config:
- sec_per_row (uint, optional, default 60)
FROM ubuntu:14.04
MAINTAINER Chance Zibolski <[email protected]> (@chance)
RUN apt-get update && \
apt-get install -yq --no-install-recommends \
build-essential \
bzr \
ca-certificates \
cmake \
from time import time
from logging.config import fileConfig
from twisted.internet import epollreactor
epollreactor.install()
from flask import Flask, request
app = Flask(__name__)
fileConfig("logging.ini")
func min(a1 int, a2 int, a3 int) int {
min := a1
if a2 < min {
min = a2
}
if a3 < min {
min = a3
}
return min
}
package LevenshteinDistance
import "fmt"
import "math"
func compare(a, b string) int {
var cost int
d := make([][]int, len(a)+1)
for i := 0; i < len(d); i++ {
d[i] = make([]int, len(b)+1)