This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Compare prices for cloud storage providers: | |
# - S3 - AWS S3 from Amazon | |
# https://aws.amazon.com/s3/pricing/ | |
# - GS/GCS - Google Cloud Storage | |
# https://cloud.google.com/storage/pricing#north-america | |
# - R2 - R2 from CloudFrame | |
# https://developers.cloudflare.com/r2/platform/pricing/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pthread.h> | |
#include <dlfcn.h> | |
#include <stdlib.h> | |
// force jemalloc | |
void __attribute__((used)) force_jemalloc() | |
{ | |
/// calloc() is used in older glibc in dlsym() | |
/// force this symbol from the jemalloc to trigger endless loop | |
(void)calloc(0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <stdio.h> | |
int main() | |
{ | |
void *p = dlsym(RTLD_NEXT, "__pthread_mutex_lock"); | |
printf("__pthread_mutex_lock: %p (via RTLD_NEXT)\n", p); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pthread.h> | |
int main() | |
{ | |
// something broken in ASan in interceptor for __pthread_mutex_lock | |
// and only since glibc 2.36, and for pthread_mutex_lock everything is OK | |
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | |
return __pthread_mutex_lock(&mutex); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kazoo/client.py b/kazoo/client.py | |
index 27b7c38..0c0ecc0 100644 | |
--- a/kazoo/client.py | |
+++ b/kazoo/client.py | |
@@ -400,6 +400,7 @@ class KazooClient(object): | |
def _reset(self): | |
"""Resets a variety of client states for a new connection.""" | |
+ self.logger.log(BLATHER, "Reseting the client") | |
self._queue = deque() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Test for RWF_NOWAIT, does it always non-block? | |
/// The answer is, it may sometimes, for example when there is some issues with the underlying disk. | |
/// Or maybe when it accessing page entries, that are blocked for a long time, need to take a look deeper. | |
#define _GNU_SOURCE /// for preadv2() | |
#include <sys/uio.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <time.h> | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <memory> | |
struct NewDeleteOperators | |
{ | |
NewDeleteOperators() = default; | |
static void* operator new(size_t size) | |
{ | |
return ::malloc(size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import publicsuffix2 | |
import clickhouse_driver | |
ch = clickhouse_driver.Client(host='127.1') | |
pls = publicsuffix2.PublicSuffixList(idna=False) | |
def check_tld(tld): | |
print(tld) | |
host = 'foo.' + tld | |
ch_tld = ch.execute("SELECT cutToFirstSignificantSubdomainCustom(%(host)s, 'public_suffix_list')", params={ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Reproducer for bash bug that had been fixed in bash 5.1+ [1], report [2] | |
# | |
# [1]: https://git.savannah.gnu.org/cgit/bash.git/commit/?h=bash-5.1&id=8868edaf2250e09c4e9a1c75ffe3274f28f38581 | |
# [2]: https://lists.gnu.org/archive/html/bug-bash/2019-05/msg00110.html | |
# | |
function thread_worker() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
config_directives=( | |
--tcp_port=19000 | |
--mlock_executable=true | |
) | |
benchmark_args=( | |
-d 0 |