This file contains hidden or 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
{ | |
"import": { | |
"1.5.0": "default-vac-v1.json", | |
"2.0.0": "default-vac-v2.json" | |
}, | |
"search_fields": [ | |
{ | |
"name": "status", | |
"target": "status", |
This file contains hidden or 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
# Install elasticsearch | |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
apt-get install apt-transport-https | |
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
apt-get update | |
apt-get install kibana | |
# Configure elastic | |
sed -i '/#server.host: 192.168.0.1/c\server.host: 0.0.0.0' /etc/kibana/kibana.yml |
This file contains hidden or 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
# Install filebeat & metricbeat | |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
apt-get install apt-transport-https | |
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
apt-get update | |
apt-get install filebeat metricbeat | |
# Configure filebeat | |
cat >/etc/filebeat/filebeat.yml <<EOL | |
filebeat.prospectors: |
This file contains hidden or 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
# Install elasticsearch | |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
apt-get install apt-transport-https | |
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
apt-get update | |
apt-get install elasticsearch | |
# Configure memory settings | |
mkdir -p /etc/systemd/system/elasticsearch.service.d | |
echo -e "[Service]\nLimitMEMLOCK=infinity" > /etc/systemd/system/elasticsearch.service.d/elasticsearch.conf |
This file contains hidden or 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
#!bin/python | |
from elasticsearch import Elasticsearch | |
from datetime import datetime | |
import time | |
es = Elasticsearch() | |
indices_state = es.cluster.state()['metadata']['indices'] |
This file contains hidden or 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
import pandas | |
from sklearn import linear_model, svm, tree, naive_bayes | |
from sklearn.model_selection import cross_val_score | |
import numpy as np | |
data = pandas.read_csv('train.csv') | |
def preprocess(data): | |
data['Fare'] = data['Fare'].fillna(data['Fare'].mean()) |
This file contains hidden or 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
@echo off | |
Setlocal EnableDelayedExpansion | |
for /L %%n in (1,0,5) do ( | |
SET /A N1=!RANDOM! * 255 / 32768 | |
SET /A N2=!RANDOM! * 255 / 32768 | |
SET /A N3=!RANDOM! * 255 / 32768 | |
SET /A N4=!RANDOM! * 255 / 32768 |
This file contains hidden or 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
filebeat.prospectors: | |
- input_type: log | |
paths: | |
- ./random_apache_log | |
output.elasticsearch: | |
hosts: ["127.0.0.1:9200"] |
This file contains hidden or 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 bash | |
while true | |
do | |
random_ip=$(dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -An -tu1 | sed -e 's/^ *//' -e 's/ */./g') | |
random_size=$(( (RANDOM % 65535) + 1 )) | |
current_date_time=$(date '+%d/%b/%Y:%H:%M:%S %z') | |
echo "$random_ip - - [$current_date_time] \"GET /data.php HTTP/1.1\" 200 $random_size" | tee -a 'random_log' |
This file contains hidden or 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
# Install latest OpenJDK | |
sudo apt-get update | |
sudo apt-get install openjdk-8-jre-headless | |
# Install elastic | |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
sudo apt-get install apt-transport-https | |
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
sudo apt-get update | |
sudo apt-get install elasticsearch |
NewerOlder