Skip to content

Instantly share code, notes, and snippets.

@rottenbytes
rottenbytes / Makefile
Created April 21, 2017 10:03
Makefile with loops
OS = $(shell uname -s)
CONFIGS = $(wildcard *.js)
empty =
tab = $(empty)$(shell printf '\t')$(empty)
define execute-command
$(tab)$(1)
endef
@rottenbytes
rottenbytes / .zshrc
Created April 21, 2017 07:16 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
@rottenbytes
rottenbytes / 0_reuse_code.js
Created August 18, 2016 12:00
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
@rottenbytes
rottenbytes / 01.md
Last active February 23, 2016 14:26
Yubikey and VIP access

Elasticsearch has many metrics that can be used to determine if a cluster is healthy. Listed below are the metrics that are currently a good idea to monitor with the reason(s) why they should be monitored and any possible recourse for issues.

Version

Unless otherwise noted, all of the API requests work starting with 1.0.0. If a newer version is required for a given metric, then it is noted by the metric's name.

Metrics

Metrics are an easy way to monitor the health of a cluster and they can be easily accessed from the HTTP API. Each Metrics table is broken down by their source.

Ohai.plugin(:PackagesList) do
provides "packages/list"
depends "platform"
collect_data(:linux) do
if platform == "debian"
packages Mash.new
# Desired=Unknown/Install/Remove/Purge/Hold
#| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
@rottenbytes
rottenbytes / dumper.rb
Last active August 29, 2015 14:10
quickly dump kibana dashboard
#!/usr/bin/env ruby
require "bundler/setup"
require "elasticsearch"
require "json"
require "getoptlong"
def help()
puts "Usage : dashboard_dumper.rb [options]"
puts "Options :"
#!/usr/bin/env ruby
require "elasticsearch"
require "getoptlong"
def help()
puts "Usage : snapshot.rb [options]"
puts "Options :"
puts " --host : specifies host to connect to"
puts " --repository : repository for the snapshot. must exist before calling this script"
java -cp clojure.jar clojure.main -e "(use 'clojure.xml) (->> (java.io.File. \"pom.xml\") (clojure.xml/parse) (:content) (filter #(= (:tag %) :version)) (first) (:content) (first) (println))"
.DS_Store
*.log
Gemfile.lock