Skip to content

Instantly share code, notes, and snippets.

View Marak's full-sized avatar

Marak

View GitHub Profile
@Marak
Marak / haproxy_rate_limiting.md
Created April 20, 2019 15:12 — forked from procrastinatio/haproxy_rate_limiting.md
Rate limiting with HAproxy

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

module['exports'] = function (hook) {
var rest = require('restler'),
moment = require('moment');
var myGender = 'male',
myCountry = 'United States',
myDOB = '1986-05-01';
var currentDate = moment();
@Marak
Marak / highfive.js
Last active August 29, 2015 14:27 — forked from kmoe/highfive.js
module['exports'] = function highFive(hook) {
// hook.io has a range of node modules available - see
// https://hook.io/modules.
// We use request (https://www.npmjs.com/package/request) for an easy way to
// make the HTTP request.
var request = require('request');
// The parameters passed in via the slash command POST request.
var params = hook.params;
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
@Marak
Marak / anonymize-emails.py
Last active August 29, 2015 14:09 — forked from Siddhartha90/anonymize-emails.py
A python script which anonymizes email addresses in all files in current directory and sub-directories.
# A python script which anonymizes email addresses in all files in current directory and sub-directories.
# e.g. A file with the following contents:
# siddhartha@gmail.com
# Sid Phn#- 6385833322
# gupta49@illinois.edu
# weee@as.cd
# sid@yahoo.co.in
# Would change to:
/**
* Geocoder
*
* You pass it an address and it returns a geocoded response. You will need
* a Geocodio API Key.
*
* @param {string} api_key Your geocodio API Key
* @param {string} address An address.
*
* curl--data 'api_key=XXXXX&address=123 Maple Lane, Everywhere USA' http://hook.io/desmondmorris/geocoder
/**
* Geocoder
*
* You pass it an address and it returns a geocoded response. You will need
* a Geocodio API Key.
*
* @param {string} api_key Your geocodio API Key
* @param {string} address An address.
*
* curl--data 'api_key=XXXXX&address=123 Maple Lane, Everywhere USA' http://hook.io/desmondmorris/geocoder