Skip to content

Instantly share code, notes, and snippets.

View rafaeljesus's full-sized avatar

Rafael Jesus rafaeljesus

  • Berlin, Germany
View GitHub Profile

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])

@rafaeljesus
rafaeljesus / monzo-alertmanager-receiver.yaml
Created March 7, 2019 23:18 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
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 / gist:87e5fb87a3fd12377f591e31a1edd73c
Created June 12, 2018 08:31 — forked from fduran/gist:1870546
Linux check DNS cache snooping
# 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
package main
import (
"context"
"log"
"sync"
"time"
)
var wg sync.WaitGroup
package main
import (
"context"
"log"
"sync"
"time"
)
var wg sync.WaitGroup
@rafaeljesus
rafaeljesus / slides.md
Created November 23, 2017 19:11 — forked from shadowmaru/slides.md
Palestras da RubyConf BR 2017
@rafaeljesus
rafaeljesus / ResilientClientSamples.scala
Created November 3, 2017 13:32 — forked from mishriky/ResilientClientSamples.scala
Samples for Finagle Client Configuration
/**
* This is not meant to cover ALL possible ways of creating service clients; instead it focuses on the simplest way to
* do so, while maintaining the capability to customize the clients based on service level agreements/expectations
*
* @note Most of the filters can be applied to the HTTP client as well but have been omitted from the sample code to improve
* readability
*/
trait ClientSamples extends LazyLogging {
private[this] lazy val config = ConfigFactory.load()
@rafaeljesus
rafaeljesus / nullHandle.go
Created September 20, 2017 13:55 — forked from rsudip90/nullHandle.go
How I handled the null possible value in a sql database row in golang?
package main
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/go-sql-driver/mysql"