Skip to content

Instantly share code, notes, and snippets.

@untergeek
untergeek / elasticsearch-template.json
Created August 7, 2014 18:25
My current logstash/elasticsearch-index template
{
"template" : "logstash-*",
"settings" : {
"number_of_shards" : 5,
"index.refresh_interval" : "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : true},
"dynamic_templates" : [ {
@rmoff
rmoff / gist:0b7866b7e17059920a9ab1a80ea18eb4
Created January 18, 2017 19:49
Metricbeat / Timelion / Kibana anomaly detection expression
$thres=0.02, .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).color(#eee).lines(10).label('Prediction'), .es(index='metricbeat*',metric='max:system.cpu.user.pct').color(#666).lines(1).label(Actual), .es(index='metricbeat*',metric='max:system.cpu.user.pct').lines(1).if(eq, 0, null).holt(0.9, 0.1, 0.9, 0.5h).subtract(.es(index='metricbeat*',metric='max:system.cpu.user.pct')).abs().if(lt, $thres, null, .es(index='metricbeat*',metric='max:system.cpu.user.pct')).points(10,3,0).color(#c66).label('Anomaly').title('max:system.cpu.user.pct / @rmoff')
@fxtentacle
fxtentacle / agent.conf
Created October 31, 2011 20:44
Hajo's logstash config
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kibana-ingress
annotations:
kubernetes.io/ingress.class: traefik
traefik.backend.loadbalancer.sticky: "true"
ingress.kubernetes.io/rewrite-target: "/"
spec:
tls:
1. Create the KV config:
docker run traefik \
storeconfig \
--consul \
--consul.prefix="traefik" \
--consul.watch \
--consul.endpoint="CONSUL_IP:8500" \
--consulcatalog=true \
--consulcatalog.endpoint="CONSUL_IP:8500" \
server {
listen 80 default;
server_name ~^(www\.)?(?<domain>.+)$;
root /srv/httpd/$domain/public_html/;
access_log /srv/httpd/$domain/logs/access.log;
location / {
index index.html index.htm index.php;

kops cluster config

kubeAPIServer:
  authorizationMode: RBAC
  authorizationRbacSuperUser: admin
  oidcCAFile: /srv/kubernetes/ca.crt
  oidcClientID: example
  oidcGroupsClaim: groups
  oidcIssuerURL: https://dex.example.com
  oidcUsernameClaim: email
#!/usr/bin/ruby
require 'json'
require 'net/http'
require 'shellwords'
require 'time'
require 'uri'
require 'yaml'
@target_sidecar_image = YAML.load(YAML.load(`kubectl --namespace=istio-system get configmap istio-sidecar-injector -o yaml`)['data']['config'])['template'].match(/.*(eu.gcr.io\/at-artefacts\/platform-istio-proxy.*)".*/)[1]
@dysinger
dysinger / aws-cfn-coreos-kubernetes.json
Last active September 9, 2019 01:31
CoreOS Kubernetes on AWS CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings": {
"RegionMap": {
"ap-northeast-1": {
"AMI": "ami-f9b08ff8"
},
"ap-southeast-1": {
"AMI": "ami-c24f6c90"
@lgg
lgg / run_letsencrypt
Created January 10, 2016 05:16
Let's encrypt auto authenticator runner for multiply domains
#!/bin/bash
#Vars
web_service='nginx'
config_path='/usr/local/letssl/'
le_path='/opt/letsencrypt'
exp_limit=20;
#Func
function check_ssl {