Skip to content

Instantly share code, notes, and snippets.

View kvaps's full-sized avatar
🔳
This mess is mine!

Andrei Kvapil kvaps

🔳
This mess is mine!
View GitHub Profile
@kvaps
kvaps / test_disk.sh
Last active January 6, 2024 04:20
Test disk with fio and parse results
#!/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
)
@Andor
Andor / components--victoriametrics.jsonnet
Last active October 7, 2021 11:03
qbec helm victoriametrics
local p = import '../../params.libsonnet';
local params = p.components.victoriametrics;
local k = import '1.21/main.libsonnet';
local vm = importstr 'data://victoriametrics/github.com/VictoriaMetrics/helm-charts/raw/347d4558d9c25cd341718bf5a2ee167da042c080/packages/victoria-metrics-cluster-0.9.6.tgz';
{
local ns = k.core.v1.namespace,
namespace::
@cristiklein
cristiklein / test-cloud-init.sh
Last active January 11, 2024 07:07
Short script to quickly test cloud-init configuration files
#!/bin/bash
set -e
IMAGE_URL=https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
IMAGE_FILE=$(basename $IMAGE_URL)
if [ ! -e $IMAGE_FILE ]; then
wget $IMAGE_URL
fi

Parse the kubernetes manifest in yaml or json, don't care a manifest type.

Examples:

package main

import (
	"bytes"
	"context"
@vholer
vholer / iso2ext
Created March 15, 2020 15:22
ISO 9660 to ext2 conversion without root privileges
#!/bin/bash
# Simple conversion script of ISO 9660 image into image based
# on ext2/3/4 filesytem. Completely unprivileged, without needing
# to mount both images. Free to use under Apache 2.0 License.
# 2020, Vlastimil Holer <vlastimil.holer@gmail.com>
set -e -o pipefail
TYPE=${TYPE:-ext2}
@EddieIvan01
EddieIvan01 / raw_mode_posix.go
Created February 14, 2020 09:58
syscall to set raw-mode-input terminal in Go (Posix/Windows)
// +build darwin linux
package main
import (
"os"
"syscall"
"unsafe"
)
@bmaupin
bmaupin / convert-deploymentconfig-to-deployment.md
Last active November 29, 2023 08:24
Convert OpenShift DeploymentConfig to Kubernetes Deployment
  1. Change apiVersion from:

    - apiVersion: v1

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

    to:

@redbaron
redbaron / example.yaml
Last active March 24, 2020 13:06
Ansible jsonnet filter
- name: Load kube-apiserver.yaml
slurp:
src: "{{tmpconfdir.path}}/etc/kubernetes/manifests/kube-apiserver.yaml"
register: "apiserver_yaml"
# Implement https://github.com/kubernetes/kubeadm/issues/1105#issuecomment-544887733
- name: Patch apiserver healthcheck
vars:
mixin: |
{spec+: {containers: [super.containers[0] + {
@xorel
xorel / oned.aug
Last active February 19, 2020 16:08
Augeas lens for oned.conf
module Oned =
autoload xfm
(* primitives *)
let sep = del /[ \t]*=[ \t]*/ " = "
let eol = del /\n/ "\n"
let opt_space = del /[ \t]*/ ""
let opt_space_nl = del /[ \t\n]*/ "\n"
let comma = del /,/ ","
let left_br = del /\[/ "["
@madchap
madchap / unwatch.sh
Last active April 11, 2022 18:52
Unwatch all github repos from organization (unsubscribe)
# get api token with proper perms, ensure full "repos" for private repo access.
$ export auth="Authorization: token 123345465hfghfghfghgfhgfhfg"
$ export org="your_org"
# get the last page in the Link header. github API limits per_page to 100. Anything over this will require pagination.
$ curl -I -H "$auth" https://api.github.com/orgs/$org/repos
# go over all pages. Put this in a script, and save it.
#!/bin/bash