Skip to content

Instantly share code, notes, and snippets.

View divideby0's full-sized avatar

Cedric Hurst divideby0

  • Spantree Technology Group, LLC
  • Chicago, IL
View GitHub Profile
REGION=${REGION:-us-east-1}
UBUNTU_RELEASE=${UBUNTU_RELEASE:-trusty}
ARCH=${ARCH:-amd64}
INSTANCE_TYPE=${INSTANCE_TYPE:-hvm:ebs}
curl 'https://cloud-images.ubuntu.com/locator/ec2/releasesTable' --compressed | grep -Ei "\"$REGION\",\"$UBUNTU_RELEASE\",.*,\"$INSTANCE_TYPE\"" | grep -oEi "ami-\w+" | head -1
This file has been truncated, but you can view the full file.
{"year":2001,"make":"ACURA","model":"CL"}
{"year":2001,"make":"ACURA","model":"EL"}
{"year":2001,"make":"ACURA","model":"INTEGRA"}
{"year":2001,"make":"ACURA","model":"MDX"}
{"year":2001,"make":"ACURA","model":"NSX"}
{"year":2001,"make":"ACURA","model":"RL"}
{"year":2001,"make":"ACURA","model":"TL"}
{"year":2001,"make":"AM GENERAL","model":"HUMMER"}
{"year":2001,"make":"AMERICAN IRONHORSE","model":"CLASSIC"}
{"year":2001,"make":"AMERICAN IRONHORSE","model":"LEGEND"}
#!/usr/bin/env bash
set -o xtrace # trace what gets executed
set -o errexit # exit when a command fails.
set -o nounset # exit when your script tries to use undeclared variables
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DATA_DIR="${__dir}/containers/elasticsearch/data"
# Clear our example index
DELETE /vehicle
# Post a few car records with make, model and year
POST /vehicle/car/_bulk
{"index":{}}
{"make":"Saturn","model":"LW","year":2005}
{"index":{}}
{"make":"Honda","model":"Civic","year":2005}
{"index":{}}
# Create a few vehicles with different types
POST /vehicles_type_agg_test/_bulk
{"index":{"_id":"honda_civic","_type": "car"}}
{"make": "Honda", "model": "Civic"}
{"index":{"_id":"honda_accord","_type": "car"}}
{"make": "Honda", "model": "Accord"}
{"index":{"_id":"tesla_roadster","_type": "car"}}
{"make":"Tesla", "model": "Roadster"}
{"index":{"_id":"audi_a4","_type": "car"}}
{"make":"Audi", "model": "A4"}
@divideby0
divideby0 / docker-compose.yml
Created April 12, 2016 16:50
ELK reference setup
version: "2"
services:
elasticsearch:
image: elasticsearch
ports:
- 9200:9200
kibana:
image: kibana
ports:
- 5601:5601
@divideby0
divideby0 / docker-compose.yml
Created March 22, 2016 15:26
ELK Docker Compose Boilerplate
# Boilerplate ELK setup in Docker Compose
version: "2"
services:
elasticsearch:
image: elasticsearch
ports:
- 9200:9200
kibana:
image: kibana

Two degrees of Cortextual

Create the things

// Create people
CREATE (freethejazz: Person { name: "Jonathan Freeman" }),
       (amrita: Person { name: "Amrita Chavan" }),
Expected: <true>
but: was <false>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at com.sonian.elasticsearch.zookeeper.discovery.ZooKeeperDiscoveryTests$ClusterStateMonitor.await(ZooKeeperDiscoveryTests.java:720)
at com.sonian.elasticsearch.zookeeper.discovery.ZooKeeperDiscoveryTests.testMasterSwitchDuringSessionExpiration(ZooKeeperDiscoveryTests.java:345)
testNonMasterSessionExpiration(com.sonian.elasticsearch.zookeeper.discovery.ZooKeeperDiscoveryTests) Time elapsed: 15.322 sec <<< FAILURE!
java.lang.AssertionError:
Expected: <true>
.sessions h4 {
margin-bottom: 0;
}