Skip to content

Instantly share code, notes, and snippets.

Apache config snippets :
Alias /kibana3 /var/www/kibana3
# Elasticsearch API is behind /es/
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|DELETE)
RewriteRule .* - [F]
RewriteCond %{LA-U:REMOTE_USER} !^$
RewriteRule /es/(.*)logstash-([0-9]+.[0-9]+.[0-9]+)(.*) /es/$1%{LA-U:REMOTE_USER}-$2$3 [N] # Redirect all logstash-xx-xx-xx accesses to user aliases
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
#!/bin/sh
# Do elasticsearch optimize on logstash previous day index
# if $1 = all then optimize all indicies
esindex="/opt/elasticsearch/data/elasticsearch/nodes/0/indices"
# Grab yesterday's values
D=`date +%d -d yesterday`
M=`date +%m -d yesterday`
Y=`date +%Y -d yesterday`
datadog-repo:
pkgrepo:
- managed
- humanname: "DataDog Agent"
- name: deb http://apt.datadoghq.com/ unstable main
- keyserver: keyserver.ubuntu.com
- keyid: C7A7DA52
- file: /etc/apt/sources.list.d/datadog.list
datadog-pkg:
@garlandkr
garlandkr / notes.md
Created November 20, 2013 01:25 — forked from dutc/notes.md

schedule

6:30 - 6:40: settling in
6:40 - 7:00: Julian, quick introduction to PyPy
7:00 - 7:10: Andy, quick introduction to CLI
7:10 - 7:15: James, NYC Python announcements
7:15 - 8:30: James, CPython workshop
8:30 - 9:00: mingling + sponsor announcements

themes

openssl genrsa -des3 -out trexglobal.com.key 4096
openssl req -new -key trexglobal.com.key -out trexglobal.com.csr
cp -v trexglobal.com.{key,original}
openssl rsa -in trexglobal.com.original -out trexglobal.com.key
rm -v trexglobal.com.original
openssl x509 -req -days 9999 -in trexglobal.com.csr -signkey trexglobal.com.key -out trexglobal.com.crt
# This will cause full debug output to go to the console
import boto
boto.set_stream_logger('foo')
ec2 = boto.connect_ec2(debug=2)
"""
Requeriments:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
import time
import sys
#!/bin/bash
#==============
# Start
#==============
init() {
sudo apt-get update
sudo apt-get -y dist-upgrade
---
# Deploys a new version of foo
- name: Deploy new version of foo
hosts: tag_type_appserver:&tag_stage_prod
user: ubuntu
sudo: true
gather_facts: false
serial: 1
vars_prompt: