- Download and install VirtualBox.
- Download the CoreOS ISO
- Create a new VM in VirtualBox
- For the OS, Other Linux, 64-bit should be fine
- Give the VM 1gb of memory, like your physical hardware has.
- Create a disk of whatever size you want. I made a VMDK file that could expand dynamically up to 8gb.
- Mount the ISO in the VM
- Right click on the VM and click settings
- Go to the storage tab
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
#!/bin/env python3 | |
# | |
# TERRADIFF | |
# | |
# Small script to convert EOT diffs into single line diffs to make them easier to read | |
# | |
# How to use | |
# terraform plan | terradiff | |
# |
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
if [type] == "neo4j_logs" { | |
if [source] == "/var/log/neo4j/query.log" { | |
grok { | |
match => ["message", "%{TIMESTAMP_ISO8601:datetime} %{WORD:severity} +%{NUMBER:ms} ms: %{NOTSPACE:session-type} %{WORD:protocol} %{WORD:remoteUser} %{NOTSPACE:driver}/(\[)?%{DATA:driver-version}(\])? client/%{IP:clientip}:%{NUMBER:clientport} server/%{IP:serverip}:%{NUMBER:serverport}> %{WORD:remoteUser} - %{GREEDYDATA:query} - (%{GREEDYDATA:parameters})? - {}"] | |
match => ["message", "%{TIMESTAMP_ISO8601:datetime} %{WORD:severity} +%{NUMBER:ms} ms: %{NOTSPACE:session-type} %{WORD:protocol} %{IP:clientip} %{GREEDYDATA:endpoint} %{WORD:remoteUser} - %{GREEDYDATA:query} - (%{GREEDYDATA:parameters})? - {}"] | |
} | |
} | |
} |
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
#!/bin/bash | |
name=$RANDOM | |
url='http://localhost:9093/api/v1/alerts' | |
echo "firing up alert $name" | |
# change url o | |
curl -XPOST $url -d "[{ | |
\"status\": \"firing\", |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |