Skip to content

Instantly share code, notes, and snippets.

Avatar
🔳
This mess is mine!

Andrei Kvapil kvaps

🔳
This mess is mine!
View GitHub Profile
View drbd_transport_rdma.c
// SPDX-License-Identifier: GPL-2.0-or-later
/*
drbd_transport_rdma.c
This file is part of DRBD.
Copyright (C) 2014-2021, LINBIT HA-Solutions GmbH.
*/
#undef pr_fmt
@kvaps
kvaps / convert-deploymentconfig-to-deployment.md
Created Jan 25, 2022 — forked from bmaupin/convert-deploymentconfig-to-deployment.md
Convert OpenShift DeploymentConfig to Kubernetes Deployment
View convert-deploymentconfig-to-deployment.md
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@kvaps
kvaps / test_disk.sh
Last active Jul 19, 2022
Test disk with fio and parse results
View test_disk.sh
#!/bin/sh
run(){
name="$1"
shift
(
set -x
# defailt parameters
fio -name="$name" -filename=$disk -output-format=json -ioengine=libaio -direct=1 -randrepeat=0 "$@" > results/$disk_dashed-$name.json
)
@kvaps
kvaps / indent-to-nindent.sh
Created Dec 28, 2021
Oneliner to replace indents with nindents in Helm chart
View indent-to-nindent.sh
grep -rnoP '(?<= indent )[0-9]+' > /tmp/11
cat /tmp/11 | awk -F: '{print $1 " " $2 " " $3}' | while read file line indent; do echo "file=$file line=$line indent=$indent"; sed -i -e "$line s/^ *{{-\?/$(printf '%0.s ' $(seq 1 $indent)){{-/" -e "$line s/ indent \([0-9]\+\)/ nindent \1/g " $file; done
@kvaps
kvaps / raw_mode_posix.go
Created Aug 22, 2021 — forked from EddieIvan01/raw_mode_posix.go
syscall to set raw-mode-input terminal in Go (Posix/Windows)
View raw_mode_posix.go
// +build darwin linux
package main
import (
"os"
"syscall"
"unsafe"
)
@kvaps
kvaps / envoy.yaml
Last active Jul 26, 2021
ACME-proxy for multiple backends on envoy
View envoy.yaml
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 10000 }
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
@kvaps
kvaps / one_xmlrpc_client.sh
Created Jun 29, 2021
OpenNebula XML-RPC shell client debug script
View one_xmlrpc_client.sh
#!/bin/bash
print_value() {
case "$1" in
string:*) echo ' <param><value><string>'${1##string:}'</string></value></param>' ;;
i4:*) echo ' <param><value><i4>'${1##i4:}'</i4></value></param>' ;;
int:*) echo ' <param><value><int>'${1##int:}'</int></value></param>' ;;
boolean:*) echo ' <param><value><boolean>'${1##boolean:}'</boolean></value></param>' ;;
array:*)
echo ' <param><value><array><data>'
@kvaps
kvaps / old-firefox-jre-docker.sh
Created May 3, 2021
Run old firefox with the java applet in the container to access old iLO and KVM consoles
View old-firefox-jre-docker.sh
mkdir -p /tmp/1
cd /tmp/1
cat > Dockerfile <<\EOT
FROM i386/ubuntu:12.04
RUN apt-get update \
&& apt-get install -y firefox=11.0+build1-0ubuntu4 icedtea-6-plugin libstdc++5
EOT
docker build -t firefox-jre .
@kvaps
kvaps / 3par
Last active Nov 12, 2020
3par-linstor-benchmark
View 3par
# fio -ioengine=libaio -name=test -bs=4k -direct=1 -numjobs=1 -iodepth=1 -randrepeat=0 -rw=randwrite -filename=/dev/mapper/mpathc -runtime=60
test: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [w(1)][0.6%][w=176KiB/s][w=44 IOPS][eta 02h:57m:30s]
test: (groupid=0, jobs=1): err= 0: pid=4129882: Thu Nov 12 16:02:14 2020
write: IOPS=2448, BW=9796KiB/s (10.0MB/s)(583MiB/60958msec); 0 zone resets
slat (usec): min=4, max=685, avg=36.64, stdev=19.01
clat (usec): min=198, max=1012.8k, avg=366.08, stdev=3744.08
lat (usec): min=208, max=1012.8k, avg=403.32, stdev=3744.27