Skip to content

Instantly share code, notes, and snippets.

@aterreno
aterreno / Project Side Bar.py
Created April 9, 2013 09:12
Simple python script to get the the folder view to sync with the current file in the editor.
# vi ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Project\ Side\ Bar/Project\ Side\ Bar.py
import sublime
import sublime_plugin
class SideBarListener(sublime_plugin.EventListener):
def on_activated(self, view):
view.window().run_command('reveal_in_side_bar')
@aterreno
aterreno / es.sh
Created May 9, 2013 16:42
Bash script that includes all you need to know on ES.
#!/bin/bash
export HOST="http://10.251.76.43:9201"
echo \
#deletes index
curl -XDELETE "$HOST/article-light/"
echo \
@aterreno
aterreno / nginx.conf
Created August 12, 2013 07:20
Let's say that for some reason you want to execute an OS command via HTTP.. This nginx config does it by using LUA. http://openresty.org/ kicks ass.
worker_processes 1;
user root;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
(defn go-right [[x y]] {:pos [(inc x) y]})
(defn go-left [[x y]] {:pos [(dec x) y]})
(defn go-down [[x y]] {:pos [x (inc y)]})
(defn go-up [[x y]] {:pos [x (dec y)]})
;; I'm pretty (cool) and I know it!
(defn enterprise-buzz
"To infinity and beyond!"
[look {[x y] :pos}]
(println (look [ x y]))
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@aterreno
aterreno / amq2.text
Created October 30, 2013 09:30
amq instance 2 exceptions
2013-10-30 09:18:11,259 | INFO | Not enough cluster members connected to elect a master. | org.apache.activemq.leveldb.replicated.MasterElector | main-EventThread
2013-10-30 09:18:22,219 | INFO | Not enough cluster members have reported their update positions yet. | org.apache.activemq.leveldb.replicated.MasterElector | main-EventThread
2013-10-30 09:18:22,254 | INFO | Promoted to master | org.apache.activemq.leveldb.replicated.MasterElector | main-EventThread
2013-10-30 09:18:22,404 | WARN | listeners are taking too long to process the events | org.apache.activemq.leveldb.replicated.groups.ChangeListenerSupport | main-EventThread
2013-10-30 09:18:22,405 | WARN | listeners are taking too long to process the events | org.apache.activemq.leveldb.replicated.groups.ChangeListenerSupport | main-EventThread
2013-10-30 09:18:22,437 | INFO | Using the pure java LevelDB implementation. | org.apache.activemq.leveldb.LevelDBClient | ActiveMQ BrokerService[localhost] Task-1
2013-10-30 09:18:22,804 | INFO | Master
@aterreno
aterreno / migrate-elastic-search-indexes.sh
Created November 4, 2013 16:21
Script to migrate elastic search index mappings between one host and another one
#!/bin/bash
SOURCE_URI='http://10.251.76.43:9200'
DEST_URI='http://localhost:9200'
declare -a indexes=(gallery linklist module pageversion poll standardmodule styles video)
echo "Getting mappings from: $SOURCE_URI"
for index in ${indexes[@]}

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)
@aterreno
aterreno / 0_reuse_code.js
Created June 1, 2014 21:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aterreno
aterreno / keybase.md
Created September 18, 2014 06:22
keybase.md

Keybase proof

I hereby claim:

  • I am aterreno on github.
  • I am aterreno (https://keybase.io/aterreno) on keybase.
  • I have a public key whose fingerprint is 5B0E 3B14 F716 1180 D27B DA1D D507 153A 4635 D7FE

To claim this, I am signing this object: