Skip to content

Instantly share code, notes, and snippets.

@adubovikov
adubovikov / gist:6ba825e57fb1ff86c368bd307517f4f8
Created August 2, 2023 10:28 — forked from yuezhu/gist:47b15b4b8e944221861ccf7d7f5868f5
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem
@adubovikov
adubovikov / blog20190524-01.sh
Created July 31, 2023 21:50 — forked from haproxytechblog/blog20190524-01.sh
5 Ways to Extend HAProxy with Lua
$ haproxy -vv | grep Lua
Built with Lua version : Lua 5.3.5
@adubovikov
adubovikov / blog20190524-01.sh
Created July 31, 2023 21:50 — forked from haproxytechblog/blog20190524-01.sh
5 Ways to Extend HAProxy with Lua
$ haproxy -vv | grep Lua
Built with Lua version : Lua 5.3.5
@adubovikov
adubovikov / clickhousedump
Last active September 28, 2021 08:21 — forked from inkrement/clickhousedump
dump all clickhouse databases and tables
#!/bin/bash
PASSWORD="--password=password"
DBLIST="db1 db2 db3"
OUTDIR=.
while read -r db ; do
while read -r table ; do
@adubovikov
adubovikov / rxring.c
Created February 16, 2018 23:21 — forked from giannitedesco/rxring.c
TPACKET_V3 mmap packet sockets, showing off flexible frame sizes and multi-process hash fanout
/* Copyright (c) 2013 Gianni Tedesco
* Released under the terms of the GNU GPL version 3
* mmap() packet socket transmission
*/
#ifndef __linux__
#error "Are you loco? This is Linux only!"
#endif
#include <stdio.h>
@adubovikov
adubovikov / IpToCountry.cpp
Created November 22, 2017 09:48 — forked from markusl/IpToCountry.cpp
Faster C++ class to map IP addresses to countries using database from http://software77.net/geo-ip/
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
#include <algorithm>
#include <iostream>
#include <stdexcept>
#include <array>
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
@adubovikov
adubovikov / rds.sh
Created April 1, 2016 12:21 — forked from onyxraven/rds.sh
Amazon RDS Performance Tuning Settings
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB
#/32 = 496630545 = 473MB
#/64 = 248315272 = 236MB
#/128 = 124157636 = 118MB
#/256 = 62078818 = 59MB
#/512 = 31039409 = 29MB
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762
#/25165760 = 623 # half of max_connections = 1993.6MB
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608
#*(3/4) #default innodb pool size = 11922309120