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

https://frameio.geckoboard.com/dashboards/026BB9398258380D
@Marak
Marak / index.html
Created March 17, 2016 03:10
quick template
<h1>hello world</h1>
@Marak
Marak / chinese-lorem-translated.js
Last active February 8, 2016 03:12
translation from pull request to faker.js for adding chinese lorem ipsum
module [ "exports"] = [
'Abba', 'Achang', 'A big,' 'Adi', 'fools', 'hooligan', 'Afu', 'princes', 'donkey', 'Liza', 'Allah' 'Ali', 'Mom,' 'Oman', 'Mei', 'Niang'
'Lady', 'Auntie', 'flattery', 'Egypt', 'suffer side', 'one by one', 'beaten', 'wait until', 'hungry', 'one by one', 'survive', ' suffer shoulder, '' near to ',' scolded '' Punished ',' next '
'Beating', 'Damn,' 'Oh,' 'cancer', 'cancer', 'cancer', 'Airan', 'Wormwood', 'Fitch', 'Ai Peng', 'moxa', ' Artemisia ',' be too embarrassed to mention ',' find it difficult to ',' in the way ',' eyesore '
'Due', 'pet name', 'love', 'love', 'caress',' patriotism ',' loving ',' love ',' love ',' lovingly ',' love ',' Amy ',' loving ',' love ',' daughter ',' wife '
'Love', 'love', 'love that', 'hear', 'care', 'small love', 'love', 'love and hate', 're-love', 'love child', 'Pass' 'horse', 'saddle', 'amino' 'ammonia', 'ammonia'
'Placement', 'Anderson', 'Andhra', 'stable', 'settled', 'placed', 'law-abiding', 'appease', 'well', 'Anhui', 'settle down', 'quiet'
@Marak
Marak / 4channelz1.tsi
Created October 14, 2015 21:05
traktor z1 4 channel mixer
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<NIXML><TraktorSettings><Entry Name="DeviceIO.Config.Controller" Type="3" Value="RElPTQAAJiBESU9JAAAABAAAAAFERVZTAAAmDAAAAAFERVZJAAAmAAAAABoAVAByAGEAawB0AG8AcgAuAEsAbwBuAHQAcgBvAGwAIABaADEALgBEAGUAZgBhAHUAbAB0RERBVAAAJcBERElGAAAABAAAAABERElWAAAAGgAAAAkAMgAuADYALgA0ACAARABlAHYAAAAYRERJQwAAAAQAAAAARERQVAAAACwAAAAJAEsAbwBuAHQAcgBvAGwAWgAxAAAACQBLAG8AbgB0AHIAbwBsAFoAMUREREMAAAY2RERDSQAABBgAAAATRENEVAAAACAAAAAEAE0AbwBkAGUAAAABAAAAAD+AAAAAAAADAAAAAERDRFQAAAAuAAAACwBDAHIAbwBzAHMAIABGAGEAZABlAHIAAAACAAAAAD+AAAAAAAADAAAAAURDRFQAAAAmAAAABwBDAHUAZQAgAE0AaQB4AAAAAgAAAAA/gAAAAAAAAwAAAAJEQ0RUAAAAPAAAABIATABlAGYAdAAuAEYAaQBsAHQAZQByACAATwBuAC8ATwBmAGYAAAABAAAAAD+AAAAAAAADAAAAA0RDRFQAAAA+AAAAEwBSAGkAZwBoAHQALgBGAGkAbAB0AGUAcgAgAE8AbgAvAE8AZgBmAAAAAQAAAAA/gAAAAAAAAwAAAANEQ0RUAAAAKAAAAAgATABlAGYAdAAuAEMAdQBlAAAAAQAAAAA/gAAAAAAAAwAAAAREQ0RUAAAAKgAAAAkAUgBpAGcAaAB0AC4AQwB1AGUAAAABAAAAAD+AAAAAAAADAAAABERDRFQAAAAqAAAACQBMAGUAZgB0AC4ARwBhAGkAbgAAAAIAAAAAP4AAAAAAAAMAAAAFRENEVAA
@Marak
Marak / testHook.js
Created October 11, 2015 21:30
My first hook.io microservice
print("Hello, this is a Python script.")
print("Hook['params'] is populated with request parameters")
print(Hook['params']['hook'])
print("Hook['req'] is the http request")
print(Hook['req']['url'])
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 / dockerCheatSheet.md
Last active June 20, 2024 13:33
docker cheat sheet

Things I wish I knew before I started using Docker

Commands

Init docker on mac os

boot2docker init

Restart docker vm on mac os

boot2docker up
@Marak
Marak / testHook.js
Created September 11, 2015 20:02
My first hook.io microservice
module['exports'] = function simpleHttpRequest (hook) {
// npm modules available, see: http://hook.io/modules
var request = require('request');
request.get('http://httpbin.org/ip', function(err, res, body){
if (err) {
return hook.res.end(err.messsage);
}
hook.res.end(body);
})
};
@Marak
Marak / testHook.js
Created September 3, 2015 08:12
My first hook.io microservice
// A simple hello world microservice
// Click "Deploy Service" to deploy this code
// Service will respond to HTTP requests with a string
module['exports'] = function helloWorld (hook) {
// hook.req is a Node.js http.IncomingMessage
var host = hook.req.host;
// hook.res is a Node.js httpServer.ServerResponse
// Respond to the request with a simple string
hook.res.end(host + ' says, "Hello world!"');
};