Skip to content

Instantly share code, notes, and snippets.

View tolleiv's full-sized avatar

Tolleiv Nietsch tolleiv

  • Bare.ID Gmbh - an AOE Group company
  • Wiesbaden, Deutschland
View GitHub Profile
@tolleiv
tolleiv / go.mod
Last active October 20, 2023 08:09
Small utility to extract used metrics from promql queries
module prom-stat
go 1.21.1
require github.com/prometheus/prometheus v0.47.2
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dennwc/varint v1.0.0 // indirect
@tolleiv
tolleiv / gist:3784342
Created September 25, 2012 20:48 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@tolleiv
tolleiv / README.md
Last active October 13, 2022 07:03
Font Awesome Dashing Widget

Font Awesome Dashing Widget

This is a Dashing widget and all components needed to port the original radiator information into an Dashing Widget.

##Usage

To use this widget, copy fa.html, fa.coffee, and fa.scss into the /widgets/fa directory. Or simply run dashing install da8fcf69316b1d16fcf6 to let dashing do that for you.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

@tolleiv
tolleiv / README.md
Last active August 10, 2021 21:01
Fortigate 300C logstash log parsing

Fortigate 300c log parsing in Logstash

QA ca be done with:

logstash-1.4.2/bin/logstash rspec --format documentation test.rb

apiVersion: v2
actions:
- name: "Run hey"
events:
- name: "sh.keptn.event.test.triggered"
tasks:
- name: "Run hey smoke tests"
image: "tolleiv/rakyll-hey:v0.1.4" # just the official Dockerfile build
cmd:
- /hey
@tolleiv
tolleiv / setup.sh
Created May 17, 2012 20:33
CMUSphinx (tutorial) setup
#!/bin/bash
# see http://cmusphinx.sourceforge.net/wiki/tutorialam
# see http://mnemonicplace.blogspot.de/2010/06/cmu-sphinx-error-wave2feat-error-while.html
sudo apt-get install build-essential autoconf libtool automake python-dev subversion bison vim
export PATH=/usr/local/bin:/usr/local/libexec/sphinxtrain:$PATH
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
mkdir ~/tutorial
cd ~/tutorial
@tolleiv
tolleiv / php.conf
Created August 23, 2016 07:39
Logstash PHP multiline
#
# Configure php error log filtering
#
filter {
if [type] == "php-error" {
multiline {
pattern => "%{SYSLOG5424SD:timestamp} PHP (?:%{LOGLEVEL:loglevel})"
negate => true
what => "previous"
}
@tolleiv
tolleiv / gist:5176269
Created March 16, 2013 12:59
Sample config to have a Nginx as reverse proxy with a fallback host included
upstream tracker {
server localhost:81;
server localhost:82 backup;
}
# HTTP server
server {
listen 80 default;
location / {
@tolleiv
tolleiv / gist:3c10fc3249afa70218adaa571a3835b5
Last active April 22, 2021 19:40
Amazon Managed Service for Prometheus price calculation
# What's the cost of keeping the top 25 metrics within Amazon Managed Service for Prometheus
# 1 -> amount of samples per minute
count(topk(25, count by (__name__, job)({__name__=~".+"}))) * 1 * 60 * 24 * 1/10000 * 0.002
# What's the cost of keeping all metrics within Amazon Managed Service for Prometheus
# 1 -> amount of samples per minute
count({__name__=~".+"}) * 1 * 60 * 24 * 1/10000 * 0.002
# * Doesn't take into account that it's geeting cheaper beyond 50 billion samples - you'll figure that out
@tolleiv
tolleiv / py.py
Last active February 1, 2021 19:04
Logarithmic regression with historical data - as seen on https://www.youtube.com/watch?v=gYm6OgeJAuE&ab_channel=sentdex
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import matplotlib.cm as mcm
# data prep
df = pd.read_csv('input.csv')
df = df.iloc[::-1]
df = df[df['Value'] > 0]