This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script to run dynamic dns for docker containers. | |
# DNS is served by dnsmasq running on the docker0 gateway ip, and dynamically | |
# updated at containers come and go. | |
# | |
# To use from docker, just provide the --dns option: | |
# docker run --dns <gateway> ... | |
# The gateway ip you need will be printed when this script is run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved to: http://github.com/barnybug/jg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Script to name all ec2 instances after the node name allocated to the | |
# elasticsearch running on that instance. This makes it easy to track back | |
# to the physical system from visualization tools like bigdesk and head. | |
# | |
# Run directly on any elasticsearch node or port forward 9200 to a node in the | |
# cluster. Simple run without arguments: | |
# ./ec2names.py | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST 'http://127.0.0.1:9200/test/a/1?pretty=true' -d '{"b": [{"i": [1]}]}' | |
curl -XPOST 'http://127.0.0.1:9200/_all/_flush?pretty=true' | |
curl -XGET 'http://127.0.0.1:9200/test/a/_search?q=*&fields=b.i&pretty=true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST 'http://127.0.0.1:9200/test/a/1?pretty=true' -d '{"b": {"i": [null]}}' | |
curl -XPOST 'http://127.0.0.1:9200/_all/_flush?pretty=true' | |
curl -XGET 'http://127.0.0.1:9200/test/a/_search?q=*&fields=b&pretty=true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"ok":true,"_index":"test","_type":"b","_id":"1","_version":1}{ | |
"took" : 2, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 5, | |
"successful" : 4, | |
"failed" : 1, | |
"failures" : [ { | |
"index" : "test", | |
"shard" : 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER='http://127.0.0.1:9200/' | |
curl -XDELETE "$SERVER/test/" | |
curl -XPUT "$SERVER/test/" | |
curl -XPUT "$SERVER/test/a/_mapping" -d '{"a": {"properties": {"field1": {"type": "integer"}}}}' | |
curl -XPUT "$SERVER/test/b/1" -d '{"field1": 1}' | |
sleep 1 | |
curl -XGET 'http://localhost:9200/test/a/_search?size=0' -d '{"facets":{"f":{"terms":{"field":"field1"}}},"query":{"match_all":{}}}' |
NewerOlder