Skip to content

Instantly share code, notes, and snippets.

View SaveTheRbtz's full-sized avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
@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
#!/bin/bash
#
# Copyright (c) 2015, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
/*
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2010 Luis R. Rodriguez <lrodriguez@atheros.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@SaveTheRbtz
SaveTheRbtz / transcript.txt
Created April 25, 2023 03:50
gpt-4 sci-fi reccomendations
Alexey Ivanov
Can you give me an advice on what sci-fi books I would read? Here is the list of things that I've enjoyed (i've also marked favorites):
* Cryptonomicon (favorite)
* Snow Crash
* Diamond Age
* Bobiverse series (favorite)
* Ciaphas Cain series
* Foundation series
* He Who Fights with Monsters series
* Kingkiller Chronicle
@SaveTheRbtz
SaveTheRbtz / aggregate_filestat.py
Created April 16, 2012 10:46
Linux per-file IO statistics
#!/usr/bin/env python
import logging as log
from fileinput import input
from collections import namedtuple, defaultdict
from pprint import pprint
if __debug__:
log_level = log.DEBUG
else:
@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 / 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:

@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 / linux_tcp_timeout_knobs.patch
Last active June 24, 2021 14:02
On the fly TCP timeout tuning for linux-3.2
commit 99f490afdc91d4965aafd5629567ef02c515e169
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Tue Apr 17 16:55:10 2012 +0400
YANDEX: tcpm: Added TCP sysctl tunables
I made following constants tunable for internal testing:
TCP_DELACK_MIN -> net.ipv4.tcp_delack_min
TCP_DELACK_MAX -> net.ipv4.tcp_delack_max
TCP_ATO_MIN -> net.ipv4.tcp_ato_min
@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