Skip to content

Instantly share code, notes, and snippets.

View steve-todorov's full-sized avatar

Steve Todorov steve-todorov

  • Carlspring Consulting & Development Ltd.
  • Bulgaria
View GitHub Profile
@steve-todorov
steve-todorov / 0_traefik_mirror_lab.md
Created April 16, 2024 09:48 — forked from neoakris/0_traefik_mirror_lab.md
Reproducible Demo of Traefik 2.0 Traffic Mirroring on EKS

Reproducible Demo of Traefik 2.0 Traffic Mirroring

Overview

What to expect in this doc:

  • Traefik 2.0 has traffic mirroring functionality that should work on generic Kubernetes, but there's no good how-to guides, let this be the first.
  • This is a how-to guide, that's optimized for understanding
@steve-todorov
steve-todorov / .gitignore
Created August 17, 2023 17:19 — forked from nicosingh/.gitignore
ECS using Terraform sample
*.tfbackup
.terraform/
*.tfstate
.terraform.tfstate.lock.info

README

After the 1948278201th time of having to apply this patch manually after a CSGO update I decided it's time for a script. In essense this script will:

  1. Detect the distribution
  2. Install the respective libtcmalloc via the disto's package manager.
  3. Search the lib paths to find the location of libtcmalloc_minimal.so.4
  4. Copy it into the GAMEROOT/bin/linux64 path.
@steve-todorov
steve-todorov / homebrew-gnubin.md
Created November 9, 2021 20:15 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@steve-todorov
steve-todorov / hfsc-shape.sh
Created September 26, 2021 13:09 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.

Simulate Bare-Metal IPMI for VMs in RHEL8 Libvirt

  • Install the Virtual BMC package in the machine to use as the vBMC server. Note1: When using OpenStack repos the python3-virtualbmc RPM might be available. These instrucctions do not use that package.
    pip3 install virtualbmc
    
    • The vBMC server can be running in any machine. When using a remote libvirt server it is recommended to have passwordless authentication from the vBMC server to the libvirt machines.
    • For this document the vBMC Server export vBMCServerIP=192.168.1.13
@steve-todorov
steve-todorov / KafkaProducerTest.java
Created April 28, 2021 22:15 — forked from itzg/KafkaProducerTest.java
Using embedded Kafka in Spring Boot unit test
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;

Motivation

Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.

Idea

Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.

TL;DR;

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
@steve-todorov
steve-todorov / AuthenticationToken.java
Created February 12, 2020 16:21 — forked from phuonghuynh/AuthenticationToken.java
Spring Security - Multiple Authentication Providers
public class AuthenticationToken extends AbstractAuthenticationToken {
private String token;
public AuthenticationToken(String token) {
super(null);
this.token = token;
setAuthenticated(false);
}