Skip to content

Instantly share code, notes, and snippets.

View aliesbelik's full-sized avatar

Aliaksandr Belik aliesbelik

View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
print "Processing ${ARGV[0]}, filtering domain ${ARGV[1]}\n";
open INPUT, ${ARGV[0]} or die $!;
open OUTPUT, ">${ARGV[0]}.filtered.xml" or die $!;
my $skip = 0;
while (my $line = <INPUT>) {
import java.util.*;
import java.text.*;
import org.json.*;
import io.jsonwebtoken.*
import org.apache.commons.codec.binary.Base64;
import com.google.gson.JsonObject;
// get JWT secret key from params
String [] params = Parameters.split(",");
String secret_key = params[0];
@aliesbelik
aliesbelik / tsung.md
Created March 1, 2016 14:44 — forked from clasense4/tsung.md
Install tsung centos 7

Install tsung centos 7

yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit
wget http://tsung.erlang-projects.org/dist/tsung-1.6.0.tar.gz
tar xfz tsung-1.6.0.tar.gz
cd tsung-1.6.0
./configure && make && make install

mkdir /root/.tsung
@aliesbelik
aliesbelik / tsung-centos-install.txt
Created March 1, 2016 14:46 — forked from aviafelix/tsung-centos-install.txt
installing tsung in centos
yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit firefox
wget http://tsung.erlang-projects.org/dist/tsung-x.x.x.tar.gz
tar zxfv tsung-1.4.2.tar.gz
cd tsung-1.4.2
./configure && make && make install
cp /usr/share/doc/tsung/examples/http_simple.xml /root/.tsung/tsung.xml

Socket's IP and Port

One socket connection's address have the quadruple :

{SrcIP, SrcPort, DstIP, DstPort}

One socket original address combine with {SrcIP, SrcPort}:

  • M avaliable SrcIPs
  • N avaliable SrtPorts
  • you can create (M * N) connections
@aliesbelik
aliesbelik / nginx-tuning.md
Created September 13, 2016 10:43 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@aliesbelik
aliesbelik / step-by-step-gatling-idea.md
Created September 17, 2018 23:20 — forked from groovybayo/step-by-step-gatling-idea.md
Gatling: Step by step guide to IntelliJ integration

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module

title: "Open Files Limit" description: "" project: "riak_kv" project_version: "2.2.3" menu: riak_kv-2.2.3: name: "Open Files Limit" identifier: "performance_open_files_limit" weight: 101


title: "Improving Performance" description: "" project: "riak_kv" project_version: "2.2.3" menu: riak_kv-2.2.3: name: "Performance" identifier: "managing_performance" weight: 206

@aliesbelik
aliesbelik / subl
Created February 13, 2019 20:23 — forked from cmalard/subl
Cygwin + Sublime Text 3 : works with files and Git
#!/bin/bash
# To create in [.babun/]cygwin/usr/local/bin/subl with chmod +x
ARGS=""
while test $# -gt 0
do
ARGS="$ARGS ${1#/cygdrive/[a-zA-Z]}"; # Remove /cygdrive and disk letter from the path
shift
done