Skip to content

Instantly share code, notes, and snippets.

✌️
I used to live in a sail boat in Caribbean

Rafael Jesus rafaeljesus

✌️
I used to live in a sail boat in Caribbean
Block or report user

Report or block rafaeljesus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View haproxy_rate_limiting.md

Introduction

So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

View prom_slo_affected_alert.yaml
rules:
- alert: PrometheusSLOAffected
annotations:
summary: 'Prometheus slo is affected'
description: 'Prometheus has slo affected during the last 15m {{humanize $value}}%'
runbook_path: platform/prometheus-slo-affected.md
expr: prometheus:composed_slo5m < 0.999
for: 15m
labels:
severity: page
View prom_slo_viol_alert.yaml
rules:
- alert: PrometheusSLOViolation
annotations:
description: 'Prometheus SLO is violated {{humanize $value}}%'
runbook_path: platform/prometheus-slo-violation.md
expr: prometheus:composed_slo4w < 0.999 and (hour() > 9 < 18 and day_of_week() > 0 < 5)
labels:
severity: page
team: platform
slack: platform-alerts
View kube_prom_comp.yaml
- record: prometheus_infrastructure_team:up:max_avg_over_time5m
expr: >
max (
avg_over_time (
up{job="prometheus-infra"}[5m]
)
)
- record: prometheus_infrastructure_team:up:avg_over_time4w
expr: >
avg_over_time (
@rafaeljesus
rafaeljesus / prom_comp_slo.yaml
Last active Jun 5, 2019
prometheus composed slo
View prom_comp_slo.yaml
- record: prometheus:composed_slo4w
expr: >
(
prometheus_product_team:up:max_avg_over_time4w +
prometheus_infrastructure_team:up:max_avg_over_time4w
) / 2
View monzo-alertmanager-receiver.yaml
receivers:
###################################################
## Slack Receivers
- name: slack-code-owners
slack_configs:
- channel: '#{{- template "slack.monzo.code_owner_channel" . -}}'
send_resolved: true
title: '{{ template "slack.monzo.title" . }}'
icon_emoji: '{{ template "slack.monzo.icon_emoji" . }}'
color: '{{ template "slack.monzo.color" . }}'
@rafaeljesus
rafaeljesus / Gopkg.toml
Last active Oct 18, 2018
Enabling Opencensus
View Gopkg.toml
[[constraint]]
name = "go.opencensus.io"
version = "0.17.0"
@rafaeljesus
rafaeljesus / tracer.go
Created Aug 18, 2018
Prometheus metrics jaeger
View tracer.go
package tracer
import (
"io"
opentracing "github.com/opentracing/opentracing-go"
"github.com/prometheus/client_golang/prometheus"
jaegercfg "github.com/uber/jaeger-client-go/config"
"github.com/uber/jaeger-client-go/rpcmetrics"
jprom "github.com/uber/jaeger-lib/metrics/prometheus"
@rafaeljesus
rafaeljesus / gist:87e5fb87a3fd12377f591e31a1edd73c
Created Jun 12, 2018 — forked from fduran/gist:1870546
Linux check DNS cache snooping
View gist:87e5fb87a3fd12377f591e31a1edd73c
# www.fduran.com
# Linux check DNS cache snooping
# check if somedomain (try popular ones like google.com etc) is cached in a dns_server
# with nslookup
nslookup -norecurse somedomain dns_server
# with dig
dig @dns_server somedomain A +norecurse
You can’t perform that action at this time.