Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
View envoy-lb.patch
diff --git a/source/common/upstream/load_balancer_impl.cc b/source/common/upstream/load_balancer_impl.cc
index 185652b66..09816b0cf 100644
--- a/source/common/upstream/load_balancer_impl.cc
+++ b/source/common/upstream/load_balancer_impl.cc
@@ -1,7 +1,10 @@
#include "common/upstream/load_balancer_impl.h"
+#include <algorithm>
#include <cstdint>
+#include <limits>
@SaveTheRbtz
SaveTheRbtz / affinitize.py
Last active Dec 25, 2020
affinitization scripts, originally written by @behebot
View affinitize.py
#!/usr/bin/env python
# mypy: allow-untyped-defs
"""
This script is used for applying affinity settings for various hardware devices.
Script originally based on Intel's [set_irq_affinity.sh](https://gist.github.com/SaveTheRbtz/8875474).
Over the years it was updated with heuristics based on the shape of Dropbox infrastructure.
Currently, this script can manage IRQ affinities, RPS, XPS, and RXQS. For the description of
View bbr2_prior_cwnd.patch
commit 9ed0fd60880a7359db62605f6f8a578f621e6326
Author: Alexey Ivanov <rbtz@dropbox.com>
Date: Sat Oct 12 16:55:05 2019 +0000
[DBX] net-tcp_bbr: v2: disable spurious warning
This warning is due to the fact that tcp_simple_retransmit() calls
tcp_set_ca_state(sk, TCP_CA_Loss);
@SaveTheRbtz
SaveTheRbtz / folded.svg
Last active Oct 13, 2019
eBPF-based lock profiling tool inspired by lockstat(1M)
View folded.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ipxe.patch
diff --git a/src/core/malloc.c b/src/core/malloc.c
index 32c20353..83f3e980 100644
--- a/src/core/malloc.c
+++ b/src/core/malloc.c
@@ -98,7 +98,7 @@ size_t freemem;
*
* Currently fixed at 512kB.
*/
-#define HEAP_SIZE ( 512 * 1024 )
+#define HEAP_SIZE ( 4 * 1024 * 1024 )
@SaveTheRbtz
SaveTheRbtz / edgemap-log.txt
Last active Aug 7, 2018
Edge Location Preference computation
View edgemap-log.txt
Loaded airports: 1035
Loaded GDPs: 209
Loaded cities: 25032
Top cities:
City(name='tokyo', country='jp', population=31480498, gdppc=34523.7007742331, latlong=(35.685, 139.751389), region='40')
City(name='new york', country='us', population=8107916, gdppc=56115.7184261955, latlong=(40.7141667, -74.0063889), region='NY')
City(name='london', country='gb', population=7421228, gdppc=43929.6908131028, latlong=(51.514125, -0.093689), region='H9')
City(name='seoul', country='kr', population=10323448, gdppc=27221.5240509661, latlong=(37.5985, 126.9783), region='11')
City(name='sydney', country='au', population=4394585, gdppc=56290.6468086817, latlong=(-33.861481, 151.205475), region='02')
City(name='los angeles', country='us', population=3877129, gdppc=56115.7184261955, latlong=(34.0522222, -118.2427778), region='CA')
View set_qdisc.sh
#!/bin/bash -ue
# Sets up mq+$shed combo for given interface.
if [ $# -ne 2 ] || [ -z "$1" ] || [ -z "$2" ]; then
echo "usage: $0 interface scheduler" >&2
echo " e.g: $0 eth0 fq" >&2
echo " e.g: $0 eth0 pfifo_fast" >&2
exit 64 # EX_USAGE
fi
@SaveTheRbtz
SaveTheRbtz / boringssl.diff
Last active May 6, 2019
Re-enable AVX2/SHA extensions that were disabled after OpenSSL->BoringSSL fork.
View boringssl.diff
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 73db3c2b..ab517119 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -84,8 +84,8 @@ die "can't locate x86_64-xlate.pl";
# output, so this isn't useful anyway.
#
# TODO(davidben): Enable these after testing. $avx goes up to 2 and $addx to 1.
-$avx = 0;
-$addx = 0;
@SaveTheRbtz
SaveTheRbtz / encrypt-pw-ssha.sh
Created Dec 11, 2016 — forked from surjikal/encrypt-pw-ssha.sh
Encrypt a password using SSHA. Use this for your `htpasswd` files.
View encrypt-pw-ssha.sh
#!/bin/sh
# http://wiki.nginx.org/Faq#How_do_I_generate_an_htpasswd_file_without_having_Apache_tools_installed.3F
PASSWORD=$1;
SALT="$(openssl rand -base64 3)"
SHA1=$(printf "$PASSWORD$SALT" | openssl dgst -binary -sha1 | sed 's#$#'"$SALT"'#' | base64);
printf "{SSHA}$SHA1\n"
@SaveTheRbtz
SaveTheRbtz / userspaceswap.c
Last active Dec 5, 2016
Ugly hack to redirect all malloc calls to a mmap(2)'ed file.
View userspaceswap.c
/*
* Redirect malloc(3) calls to a mmap(2)'ed file.
*
* Example of usage:
* $ cc -shared -o userspaceswap.dylib ./userspaceswap.c && \
* DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=./userspaceswap.dylib ffmpeg
*/
#include <dlfcn.h>
#include <errno.h>