Skip to content

Instantly share code, notes, and snippets.

View melnikk's full-sized avatar
™️
...

Kir Melnikov melnikk

™️
...
View GitHub Profile
@melnikk
melnikk / Overriding Docker DNS.md
Last active December 27, 2016 08:22
The quick fix: Overriding Docker's DNS

Discover the address of your DNS server

You can find out what network's DNS server from within Ubuntu as follows:

$ nmcli dev show | grep 'IP4.DNS'
IP4.DNS[1]:                             10.0.0.2

Run Docker with the new DNS server

@melnikk
melnikk / delete_unassigned_shards.sh
Created May 17, 2017 13:32
Delete unassigned shards from Elasticsearch
#!/bin/bash
curl -XDELETE `curl http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason | grep UNASS | awk '{print "http://localhost:9200/" $1}'`
@melnikk
melnikk / curl.txt
Last active August 8, 2017 13:51
Replace value field in elasticsearch index
curl -XPOST 'localhost:9200/events/_update_by_query?pretty' -H 'Content-Type: application/json' -d'
{
"script": {
"inline": "ctx._source.tags = ctx._source.tags.replace(\".\", \"_\")"
},
"query" : {
"wildcard" : {
"tags" : "*deploy*"
}
}