Skip to content

Instantly share code, notes, and snippets.

@drewr
drewr / slides.txt
Created September 15, 2013 07:29
Getting started with ES
=-= 1
curl -XDELETE localhost:9200/esnoob >/dev/null
curl -XPUT localhost:9200/esnoob -d'
{
"mappings": {
"t": {
"properties": {
"address": {
"type": "string"
}
@drewr
drewr / recovery.sh
Last active December 20, 2015 20:38
curl -s p.draines.com/shards.sh | sh | fgrep ' r ' | sort >/tmp/1
sleep 30
curl -s p.draines.com/shards.sh | sh | fgrep ' r ' | sort >/tmp/2
diff -u /tmp/[12]
#!/bin/sh
curl -s localhost:9200/_cluster/nodes\?all | python -c'
import sys, json
d = json.load(sys.stdin)
for id, n in d["nodes"].iteritems():
print "%s %s %s %s" % (n["version"],
n["jvm"]["vm_name"],
n["jvm"]["version"],
n["transport"]["bound_address"])
echo -n $(curl -s localhost:9200 | python -c 'import sys,json; j = json.load(sys.stdin); print j["version"]["number"]') ""
curl -s localhost:9200/_nodes/_local/jvm | python -c 'import sys,json; j = json.load(sys.stdin); print j["nodes"].items()[0][1]["jvm"]["version"]'
{
"title": "Twitters",
"rows": [
{
"title": "Options",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
@drewr
drewr / mljam.hs
Last active December 19, 2015 13:19
--
-- https://raw.github.com/strangeloop/lambdajam2013/master/jams/learning/Lambda-Jam.txt
--
-- ghc --make mljam.hs -O2 -threaded
-- ./mljam +RTS -N3
--
module Main where
import Text.CSV
{
"bytes": 2953,
"contributors": null,
"coordinates": {
"coordinates": [
-91.09631538,
30.3799838
],
"type": "Point"
},
#!/bin/sh
curl -s -XDELETE localhost:9200/test >/dev/null
curl -s -XPOST localhost:9200/test -d'
{
"mappings": {
"t": {
"properties": {
"application": {