Skip to content

Instantly share code, notes, and snippets.

View alexpyattaev's full-sized avatar
💘
Make code not war.

Alex Pyattaev alexpyattaev

💘
Make code not war.
View GitHub Profile
@alexpyattaev
alexpyattaev / master_updater.fish
Created November 28, 2025 20:33
Updates master of your local clone of an upstream repo.
#!/usr/bin/fish
# Update this to what you need
set repos /home/$USER/repo1 /home/$USER/repo2
for repo in $repos
cd $repo
git fetch upstream
@alexpyattaev
alexpyattaev / gist:745d6d6b56e8bc61cf84deebe04cbf92
Created October 20, 2025 16:18
Fake turbine peers for tests of agave retransmit
--- a/turbine/src/cluster_nodes.rs
+++ b/turbine/src/cluster_nodes.rs
@@ -444,6 +444,24 @@ fn get_nodes(
Node { node, stake }
}),
)
+ // Add a bunch of fake, unstaked nodes for testing.
+ .chain((0..5000).map(|i: u16| {
+ let addr_byte1 = (i / 256).min(255) as u8;
+
@alexpyattaev
alexpyattaev / virtual_pair.sh
Created January 11, 2025 22:39
Veth setup with packet loss
echo "This script should be run as root"
DELAY_MS=100
DELAY_DISTRIBUTION=50
LOSS_PERCENT=2
CLI="ip netns exec client"
SRV="ip netns exec server"
echo "Cleanup, ignore errors if this is first run"
ip netns del client
ip netns del server