Skip to content

Instantly share code, notes, and snippets.

@SaveTheRbtz
SaveTheRbtz / boringssl.diff
Last active May 6, 2019 22:55
Re-enable AVX2/SHA extensions that were disabled after OpenSSL->BoringSSL fork.
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 / set_qdisc.sh
Last active January 8, 2022 17:45
mq+fq
#!/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 / edgemap-log.txt
Last active August 7, 2018 22:13
Edge Location Preference computation
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')
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 / lockstat.py
Last active April 10, 2024 15:20
eBPF-based lock profiling tool inspired by lockstat(1M)
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 Sasha Goldshtein
Copyright (c) 2018 Alexey Ivanov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
commit 9ed0fd60880a7359db62605f6f8a578f621e6326
Author: Alexey Ivanov <[email protected]>
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 / affinitize.py
Last active December 25, 2020 03:57
affinitization scripts, originally written by @behebot
#!/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
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 / choices_pb2.py
Last active September 28, 2021 15:46
DEG2021
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: choices.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
@SaveTheRbtz
SaveTheRbtz / keybase.md
Created December 28, 2021 07:16
keybase.md

Keybase proof

I hereby claim:

  • I am savetherbtz on github.
  • I am savetherbtz (https://keybase.io/savetherbtz) on keybase.
  • I have a public key ASBGVaV7YtaCOt3iI1SH9JZJY-ICJJhAZ3kX7FHex9GpQgo

To claim this, I am signing this object: