Skip to content

Instantly share code, notes, and snippets.

@mywebpower
mywebpower / gist:eaae78a5278d6209a7b2accf5fdffe0e
Created December 12, 2018 20:08 — forked from drorata/gist:146ce50807d16fd4a6aa
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@mywebpower
mywebpower / sliced_scroll.sh
Created November 16, 2018 13:23 — forked from alissonsales/sliced_scroll.sh
Test ES sliced scroll
n_shards=$1
echo "ES version"
curl -s localhost:9200
echo "Create index"
curl -si -H 'Content-type: application/json' -X PUT localhost:9200/twitter -d '
{
"settings": {
"index": {
@mywebpower
mywebpower / logstash.conf
Created November 12, 2018 12:40 — forked from markwalkom/logstash.conf
Reindexing Elasticsearch with Logstash 2.0
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
scan => true
}

Reindexing with Logstash can be done with the following Logstash configuration:

 input {
   # We read from the "old" index
   elasticsearch {
     hosts => ["http://<host>:<port>"]
     index => "<old_index>"
     size => 500
 scroll =&gt; "5m"
FROM mirror-hub.docker.tech.lastmile.com/alpine:3.5
RUN apk add --no-cache curl jq
RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.5.3/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
COPY rmpeers /
CMD ["/rmpeers"]
#!/bin/bash -e
# Setup a Root CA in vault
# Generate and sign an Intermediate cert
#
# Requires:
# * A running vault server already initialzed and unsealed
# * Environment variable VAULT_TOKEN is set
# * vault cli (https://www.vaultproject.io)
# * httpie (https://github.com/jkbrzt/httpie)

Keybase proof

I hereby claim:

  • I am mywebpower on github.
  • I am allgoodbx (https://keybase.io/allgoodbx) on keybase.
  • I have a public key ASDlFWsVWD93md_UTK3ruSXCBMkGKtknUFBECW70aMFNkgo

To claim this, I am signing this object:

#!/usr/bin/env python
"""
Logging part of a multicast group scanner.
Needs to be run with capabilities allowing it to read
raw data from the network interface. (usually root)
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, April 2013.
"""
import sys
#!/usr/bin/python
"""
Multicast group scanner.
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, November 2014
"""
import gevent
from gevent import monkey
monkey.patch_all()
@mywebpower
mywebpower / default.vcl
Created January 17, 2012 00:57 — forked from petemcw/default.vcl
Lullabot's Custom Varnish VCL File
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# For more information on this VCL, visit the Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Define the internal network subnet.
# These are used below to allow internal access to certain files while not
# allowing access from the public internet.