Skip to content

Instantly share code, notes, and snippets.

View ns-mkusper's full-sized avatar
👋

Mark Kusper ns-mkusper

👋
  • Chicago
View GitHub Profile
@mikesparr
mikesparr / gcp-k8s-iperf3-networking.sh
Last active November 8, 2023 19:38
Example deploying iperf3 network analysis server and client in Kubernetes cluster pods to test network throughput
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://github.com/esnet/iperf
# - https://cloud.google.com/artifact-registry/docs/docker/store-docker-container-images
# - https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/
# - https://kubernetes.io/docs/concepts/workloads/controllers/job/
#####################################################################
@WadeBarnes
WadeBarnes / container-throttling-queries.md
Last active November 10, 2023 19:19
Container throttling queries that I keep forgetting about

Queries to determine how much a container is being throttled

Examples courtesy of Jason Leach.

Example promql query for OCP:

avg(container_cpu_cfs_throttled_periods_total / container_cpu_cfs_periods_total {namespace=~"4a9599-prod", pod=~".*mediator.*", container_name!="POD", image!=""} * 100) BY (pod) 
  • The namespace portion of the query can be a problem when querying inside a namespace.
@ntimo
ntimo / .gitlab-ci.yml
Created October 20, 2022 18:23
Test Coder Tempaltes with GitLab CI
---
stages:
- tpl_test
- tpl_sync
integration_tests:
stage: tpl_test
image:
name: ubuntu:20.04
@Bill-tran
Bill-tran / how-to-install-openssl-1.1.1-on-centos-7.md
Created September 7, 2021 09:22
How to install openssl 1.1.1 on CentOS 7

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update
@peterroth
peterroth / protobuf-250-on-mac.txt
Created February 18, 2021 10:01
How to install protobuf 2.5.0 on Mac (10.15.7, Catalina). brew required!
brew install automake libtool wget
wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
tar -xvjf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./autogen.sh
./configure
make; make check
sudo make install
Validate the successful installation:
@Equim-chan
Equim-chan / README.adoc
Last active March 17, 2024 11:16
(obsolete) Equim's SOP for Archiving YouTube Livestream

Equim’s SOP for Archiving YouTube Livestream

This document describes an SOP for archiving a YouTube livestream, either public or private.

The demonstrations below are operated under Arch Linux, but it should work on other systems as well, including Windows MSYS2.

This SOP was originally written for archiving Gawr Gura’s unarchived streams.

Overview

@onomatopellan
onomatopellan / vhdx.txt
Last active January 21, 2024 21:57
How to automount an external vhdx file in WSL2
1. Ubuntu WSL2 must be already installed in C: system drive and user should be able to call windows binaries like wsl.exe from bash.
2. We will install Alpine WSL2 distro in an external partition/disk:
Download Alpine from here:
https://github.com/yuk7/AlpineWSL/releases/download/3.11.5-1/Alpine.zip
Extract the files in an external partition/disk. (for example D:\Alpine)
Make sure WSL2 is enabled by default (wsl.exe --set-default-version 2)
Inside the Alpine folder run Alpine.exe to install the Distro. An ext4.vhdx file will be created in that same folder.
@yosisa
yosisa / .lsp-docker
Last active December 13, 2023 23:45
Enable lsp-docker per project basis.
docker/image:name
@max-rocket-internet
max-rocket-internet / prom-k8s-request-limits.md
Last active April 15, 2024 08:06
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
@nchaigne
nchaigne / build-gcc-9.2.0-on-centos7.md
Last active April 18, 2024 08:00
Building GCC 9.2.0 on CentOS 7

Building GCC 9.2.0 on CentOS 7

Introduction

CentOS 7 distribution (as well as RHEL 7) ships with a somewhat outdated version of the GCC compiler (4.8.5 on CentOS 7.5), which may not be suitable to your compilation requirements. For example, C11 - which supersedes C99 - is fully supported only starting from GCC 4.9).

Additionally, recent versions of GCC (GCC6, GCC7, GCC8, GCC9) come with improvements which help detect issues at build time and offer suggestions on how to fix them. Sometimes, these are even actually helpful!

This note describes how to build the latest GCC (9.2.0 as of October 2019) from sources on CentOS 7. This should be applicable as is on RHEL 7. For other Linux distributions, adapt as needed.