Skip to content

Instantly share code, notes, and snippets.

View dadoonet's full-sized avatar
🇪🇺
From Europe with ❤️

David Pilato dadoonet

🇪🇺
From Europe with ❤️
View GitHub Profile
@xeraa
xeraa / commands.sh
Created February 11, 2022 17:18
Elastic 8.0 security by default: Minimal setup with Docker for a 3 node cluster + Kibana
// Start the first node and keep the generated security credentials handy
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if the node has started correctly
curl --insecure --user elastic https://localhost:9200/
// Add your second node
docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0
// Check if it has joined the cluster
@spinscale
spinscale / filebeat.yml
Created February 14, 2020 16:35
Use filebeat to read CSV data
# Data is from https://www.sciencedirect.com/science/article/pii/S2352340918315191
filebeat.inputs:
- type: stdin
setup.template.overwrite: true
setup.template.append_fields:
- name: arrival_date
type: date
@russcam
russcam / AzureServicePrincipal.ps1
Created July 25, 2018 03:46
Creates a Service Principal within the Tenant of the selected Subscription
param
(
[Parameter(Mandatory=$true, HelpMessage="Provide a unique name for Service Principal")]
[ValidateScript({if ($_ -match '^[a-zA-Z0-9\-_]{8,}$') {
$true
} else {
throw "name must be a minimum 8 alphanumeric characters with no spaces. Hyphens and underscores also allowed"
}})]
[string] $name,
@dadoonet
dadoonet / search_kibana_console.txt
Last active April 23, 2024 21:06
Demo script for "A NoSQL search engine to find..." talk
### REINIT
DELETE user
PUT user
{
"mappings": {
"properties": {
"name": {
"type": "text"
},
"comments": {
#!/bin/bash
pkill -f 'elasticsearch.*cluster.name=8823'
rm -rf data/8823
bin/elasticsearch -Des.node.master=true -Des.cluster.name=8823 -Des.node.name=master 2>&1 >/dev/null &
sleep 1
bin/elasticsearch -Des.node.master=false -Des.cluster.name=8823 -Des.node.name=data1 2>&1 >/dev/null &
sleep 1
@dadoonet
dadoonet / test.sh
Created May 27, 2014 16:07
Using git bisect to find origin of an issue
#!/usr/bin/env bash
# To use this script, copy and paste it in elasticsearch git root dir
# launch
# git bisect start {bad revision} {good revision}
# git bisect run ./test.sh
echo " -> starting a new test"
echo "$(git show --quiet)"
@seang-es
seang-es / esdiagdump.sh-DEPRECATED
Last active August 29, 2015 14:01
esdiagdump.sh - create log bundle for ES support
#!/bin/bash
#
# esdiagdump
#
# Usage: esdiagdump [-h <hostname/IP>:<port>] [-o <output filename>]
# hostname defaults to localhost
# output file defaults to current directory/esdiagdump.out.<timestamp>
#
# This version is no longer being maintained. The current version lives in the elasticsearch/dev/shared/tools repository.
@drewr
drewr / tribe-localhost-unicast.md
Last active August 29, 2015 13:57
Three-node tribe using localhost/unicast.

Three-node dev tribe on a single host

Setup

drewr1

% bin/elasticsearch \
    -Des.cluster.name=drewr1 \
    -Des.network.host=127.0.0.1 \

-Des.discovery.zen.ping.unicast.hosts=127.0.0.1 \

curl -XPUT "http://localhost:9200/index2" -d'
{
"mappings": {
"child" : {
"_parent": {
"type": "child"
}
}
}
}'
@karmi
karmi / download.elasticsearch.conf
Created September 20, 2013 16:00
Create a local Nginx-based proxy for <http://download.elasticsearch.org> for demos at conferences, meetups, etc
# Create a local proxy for <http://download.elasticsearch.org>
# ============================================================
#
# This setup and Nginx configuration provides a local webserver which intercepts requests
# to <http://download.elasticsearch.org> and serves a local file instead,
# facilitating and speeding up demonstrations at conferences, meetups, etc.
#
#
# 1. Create directories for Nginx:
#