Skip to content

Instantly share code, notes, and snippets.

View init.el
(use-package gist
:bind (("C-c a g l" . gist-list)
("C-c a g b" . gist-buffer)
("C-c a g B" . gist-buffer-private)
("C-c a g r" . gist-region)
("C-c a g R" . gist-region-private)))
slackorama /
Created May 11, 2016
Get the master that each node is using
for h in $list_of_es_hosts; do
echo -n "$h ";
curl -s http://$h:9200/_cluster/state/master_node,nodes | \
jq '.master_node as $master | .nodes[$master].name';
slackorama / *snippet*.sh
Last active Mar 18, 2016
Convert elasticsearch _search results to a table using csvtoolkit.
View *snippet*.sh
curl ... | \
jq '[.hits.hits[]._source | {"bucket": .bucketStart,
"rate": .totalBitRate, "cnt": .bitRateCnt}]' | \
in2csv --format=json | \
#!/usr/bin/env python
Usage: [options] <host>
-h --help show this
-v --version show version info
import re
board = [[0 for x in xrange(1000)] for x in xrange(1000)]
on_off = re.compile(r'(toggle|turn on|turn off) ([0-9]+),([0-9]+) through ([0-9]+),([0-9]+)')
def count_on(board):
return sum([sum(row) for row in board])
def toggle(v):
#!/usr/bin/env python
"""Grab the books from the current year from goodreads and emit some HTML.
import requests
from xml.dom import minidom
import datetime, time
from email.utils import parsedate
import sys
slackorama /
Last active Dec 23, 2015
Output top consumers of Elasticsearch fielddata by each node in a CSV format.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
es-fielddata [options]
-h --help show this
-v --version show version info
View *text*.txt
export GIT_RADAR_FORMAT="%{$reset_color%} %{$fg[grey]%}git:(%{$reset_color%}%{remote: }%{branch}%{ :local}%{$fg[grey]%})%{$reset_color%}%{ :changes}"
slackorama /
Last active Jan 8, 2019
Make Github starred repos bookmarks in pinboard. I wish IFTTT did this.
#!/usr/bin/env python
# send github starred repos to pinboard
# Get the token here:
from __future__ import print_function
import sys
View tidybz2.user.js
// ==UserScript==
// @name TidyBZ2
// @namespace
// @description Provide some keyboard shortcuts and clean up the interface for
// bugzilla2 version of bugzilla.
// @include https://*/show_bug.cgi?id=*
// @include https://*process_bug.cgi*
// @author Seth Mason
// @version 0.1
// @license Creative Commons public domain (