Skip to content

Instantly share code, notes, and snippets.

View PierreZ's full-sized avatar
👨‍💻
Working from home

Pierre Zemb PierreZ

👨‍💻
Working from home
View GitHub Profile
@PierreZ
PierreZ / outliers.mc2
Last active September 21, 2017 09:15
Cool Warpscripts
// Macro to show outliers or strange points
// Usage:
// [GTS ... ] a list of GTS
// 10 an upperbound (a LONG) of the number of outliers to detect.
// T a BOOLEAN indicating whether to use the mean (False), or the median (True) to calculate the Z-score
// @FIND_OUTLIERS
// Use example: $gts 10 T @FIND_OUTLIERS
<%
[{
"metric": "sys.cpu.nice",
"timestamp": 1346846400,
"value": 18,
"tags": {
"host": "web01",
"dc": "lga"
}
},
{
package main
import (
"bytes"
"encoding/base64"
"encoding/csv"
"fmt"
"io/ioutil"
"log"
"strings"
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
INFO[0106] right after Do
INFO[0106] Response from Warp is a 500
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
INFO[0106] parsed a JSON! yeah!
@PierreZ
PierreZ / PrometheusPushGatewayHandler.java
Created December 13, 2016 09:10
prometheus Psuhgateway
package io.warp10.plugins.prometheus;
import io.warp10.continuum.Configuration;
import io.warp10.continuum.TimeSource;
import io.warp10.continuum.store.Constants;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
@PierreZ
PierreZ / iot.md
Last active November 5, 2016 10:51
conf harden your brain Brest 2016

Sébastien Lambour

DEFCON16: 47 0-day ESP8266

hmac/AES/RSA...

Trust, but verify blockchain=trust N-1 code using hash (link like a transaction)

@PierreZ
PierreZ / pattern.mc2
Created October 9, 2016 16:27
Example of PATTERNS with Warp10
[ 'data' ] EXPORT
NEWGTS 'cos' RENAME
1 1080
<% DUP 'i' STORE DUP 2 * PI * 360 / COS $i * NaN NaN NaN 4 ROLL ADDVALUE %> FOR
[ SWAP bucketizer.last 1080 1 0 ] BUCKETIZE 'cos' STORE
NEWGTS 'pattern.to.detect' RENAME
@PierreZ
PierreZ / pattern.json
Last active October 8, 2016 21:19
example Zeppelin
{
"paragraphs": [{
"text": "%warpscript\nNEWGTS 'cos' RENAME\n1 720\n <% DUP 1000 * NOW - 2 * PI * 360 / COS NaN NaN NaN 4 ROLL ADDVALUE %> FOR\n\n[ SWAP bucketizer.last 720 1 0 ] BUCKETIZE 0 GET 'gts1' STORE\n\n{ 'unicorn' {\n 'gts' $gts1 \n\n 'params'\n [\n { 'key' 'key2' 'color' '#ff1010' }\n ]\n 'globalParams'\n { 'timestamps' 'true' }\n} } \n",
"dateUpdated": "2016-10-08T21:17:25+0000",
"config": {
"colWidth": 12,
"graph": {
"mode": "table",
"height": 300,
"optionOpen": false,
@PierreZ
PierreZ / main.go
Created September 23, 2016 08:32
aes bis
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
"crypto/rand"
"encoding/hex"
"errors"