- Filebeat is a log shipper, capture files and send to Logstash for processing and eventual indexing in Elasticsearch
- Logstash is a heavy swiss army knife when it comes to log capture/processing
- Centralized logging, necessarily for deployments with > 1 server
- Super-easy to get setup, a little trickier to configure
- Captured data is easy to visualize with Kibana
- Wny not just Logstash (ELK is so hot right now)?
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
# in kB | |
export MINIMUM_AVAILABLE_MEMORY=1400000 | |
if [ ! -e "${NOTIFICATION_SOUND_PATH}" ]; then | |
export NOTIFICATION_SOUND_PATH="/fun/notification-sound-memory-alarm.mp3"; | |
if [ -z "${NOTIFICATION_SOUND_SOURCE}" ]; then | |
export NOTIFICATION_SOUND_SOURCE="https://proxy.notificationsounds.com/wake-up-tones/gentle-alarm-474/download/file-sounds-928-gentle-alarm.mp3"; | |
fi | |
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
const https = require('https'); | |
const defaultOptions = { | |
"port": 443, | |
"host": `127.0.0.1`, | |
"method": `GET`, | |
"headers": { | |
"Content-Type": `application/json`, | |
"Accept": `application/json`, | |
} |
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
version: '3' | |
services: | |
es1: | |
image: | |
"docker.elastic.co/elasticsearch/elasticsearch:7.6.0" | |
ports: | |
- "9200:9200" | |
- "9300:9300" | |
environment: | |
- "discovery.type=single-node" |
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
/** | |
* Custom deep diffing to tell what changes throughout our data transfers | |
* Don't recommend for testing functions or recursively-nested objects (like Backbone collections). | |
* @param item1 <> | |
* @param item2 <> | |
* @param [isReversed] <Boolean> | |
* @returns <Array>(Object*) | |
*/ | |
function deepDiff ( item1, item2, isReversed ) { |
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
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
Multi-series line chart rendered using React and D3.
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
// Q sample by Jeff Cogswell | |
/*=========== | |
We want to call these three functions in sequence, one after the other: | |
First we want to call one, which initiates an ajax call. Once that | |
ajax call is complete, we want to call two. Once two's ajax call is | |
complete, we want to call three. | |
BUT, we don't want to just call our three functions in sequence, as this quick |
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%' |