Skip to content

Instantly share code, notes, and snippets.

View aliesbelik's full-sized avatar

Aliaksandr Belik aliesbelik

View GitHub Profile
@aliesbelik
aliesbelik / gen-certs.sh
Created August 17, 2023 23:18 — forked from notmedia/gen-certs.sh
Creating Self-Signed certificates
rm *.pem
rm *.srl
rm *.cnf
# 1. Generate CA's private key and self-signed certificate
openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca-key.pem -out ca-cert.pem -subj "/C=FR/ST=Occitanie/L=Toulouse/O=Test Org/OU=Test/CN=*.test/emailAddress=test@gmail.com"
echo "CA's self-signed certificate"
openssl x509 -in ca-cert.pem -noout -text
@aliesbelik
aliesbelik / multiple-repository-and-identities-git-configuration.md
Created December 26, 2022 18:16 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@aliesbelik
aliesbelik / web-servers.md
Created November 21, 2022 16:22 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@aliesbelik
aliesbelik / publish-go-app-on-github.md
Last active August 30, 2021 19:50 — forked from lesovsky/publicating-go-application-on-github.md
Publicating Golang application on GitHub.
@aliesbelik
aliesbelik / latency.md
Last active May 31, 2021 17:49 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@aliesbelik
aliesbelik / writing-a-tsung-plugin.md
Last active January 7, 2024 15:15 — forked from mremond/writing-a-tsung-plugin.md
Writing a Tsung Plugin

Writing a Tsung plugin

This is a simple tutorial on writing a tsung plugin and a repost of our ProcessOne tutorial.

Since tsung is used to test servers lets define a simple server for testing. myserver.erl provides 3 operations: echo, add and subtract.

myserver.erl assumes the first byte to be a control instruction followed by 2 or more byte data. The echo operation merely returns the byte data while add and subtract performs these operations on the 2 byte data before returning the results. See the code of myserver.erl for details.

We assume the source files for tsung-1.2.1 are available. This example was compiled using Erlang OTP R11B-3.

@aliesbelik
aliesbelik / revert-a-commit.md
Last active February 28, 2019 01:40 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@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
@aliesbelik
aliesbelik / 00_dockerised_jmeter.md
Last active May 12, 2021 06:48 — forked from hhcordero/1_Dockerised_JMeter.md
Dockerized JMeter - A Distributed Load Testing Workflow
@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