Skip to content

Instantly share code, notes, and snippets.

@ericxyan
ericxyan / TICKvsELK.md
Last active April 28, 2020 02:35
TICK Stack vs ELK Stack

TICK Stack

Solution for collecting, storing, visualizing and alerting on time-series data at scale. All components of the platform are designed to work together seamlessly.

  • Telegraf: Collects time-series data from a variety of sources
  • InfluxDB:
  • Chronograf: Visualizes and graphs
  • Kapacitor: Alerting, ETL and detects anomalies in time-series data

Why Influx?

  • Open Source - MIT
  • Integrated - Data collection, storage, visualization and alerting

Commands

  • Count lines in a file
wc -l <filename>
  • copy public key to remote server
# Generate a key pair
ssh-keygen
# Copy key to remote server

Time Series Data

What is Time series data?

What is TSDB(Time Series Database)?

TSDB

  • InfluxDB
  • OpenTSDB
  • KDB+
  • Graphite
  • Riak TS

My Java study notes.

My Python study notes.

My Javascript study notes.

import httplib2 as http
import json
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
headers = {
'Accept': 'application/json',
import cv2
import numpy as np
from matplotlib import pyplot as plt
# show gray image
plt.imshow(img, cmap=plt.get_cmap('gray'))
@ericxyan
ericxyan / bgr2rgb.py
Last active March 28, 2016 18:30
Opencv read image as BGR, a
import cv2
import numpy as np
import matplotlib.pyplot as plt
# show diff
# Approach 0
img = cv2.imread('messi4.jpg')
b,g,r = cv2.split(img)
img2 = cv2.merge([r,g,b])
plt.subplot(121);plt.imshow(img) # expects distorted color
plt.subplot(122);plt.imshow(img2) # expect true color
@ericxyan
ericxyan / myNetlify.js
Created March 16, 2016 00:44
Customized Netlify authentication.js
(function(window, undefined) {
var SITE_ID = null;
var NETLIFY_API = "https://api.netlify.com";
var NetlifyError = function(err) {
this.err = err;
};
NetlifyError.prototype.toString = function() {
return this.err.message;
};
var authWindow, base, providers;