Skip to content

Instantly share code, notes, and snippets.

View hexfusion's full-sized avatar
🐀
scampering

Sam Batschelet hexfusion

🐀
scampering
  • Red Hat
  • gRPC stream
View GitHub Profile
TZ=UTC git --no-pager show \
--quiet \
--abbrev=12 \
--date='format-local:%Y%m%d%H%M%S' \
--format="%cd-%h"
GOPRIVATE=github.com/hexfusion/avalanchego-internal go mod tidy
#! /bin/sh -ex
IMG_URL=$1
IMAGE='/tmp/image.iso'
BASE_URL='http://192.168.2.160:8080'
IPXE_DIR='/tmp/ipxe'
KERNEL_OPTS='random.trust_cpu=on rd.luks.options=discard ignition.firstboot ignition.platform.id=metal console=tty0 console=ttyS0,115200n8'
ISO_MNT=`mktemp -d`
mkdir -p $IPXE_DIR
@hexfusion
hexfusion / atop-monitor.yml
Last active August 12, 2020 19:46
atop monitor in machineconfig
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
creationTimestamp: null
labels:
machineconfiguration.openshift.io/role: master
name: 10-atop-monitor
spec:
config:
@hexfusion
hexfusion / debug-etcd-operator.sh
Last active October 30, 2020 12:34 — forked from ironcladlou/debug-etcd-operator.sh
debug-etcd-operator.sh
#!/bin/bash
set -euo pipefail
function log {
local msg="$1"
echo -e "$\033[32m$(date +'%Y-%m-%d %H:%M:%S') $1 $\033[0;39m"
}
export KUBECONFIG=$(find $HOME/clusters -name kubeconfig | fzf)
package main
import (
"context"
"fmt"
"log"
"net"
"net/url"
"os"
"path"
@hexfusion
hexfusion / gist:94862c0e60b8d3da3b528fa5ec8f1eac
Created December 13, 2019 21:33 — forked from cgwalters/gist:5741d640f4c2af811f47c043de392c32
Overriding content in an old RHCOS AMI for testing
First, given a build like: https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/meta.json
Download the qemu image:
```
$ curl -L https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/rhcos-43.81.201911081536.0-qemu.x86_64.qcow2.gz | gunzip > rhcos-43.81.201911081536.0-qemu.x86_64.qcow2
```
Download new RPM or other content you want, in this case let's assume it's a new hyperkube we want to drop in `/usr/bin`:
`$ curl -L http://example/openshift-hyperkube-4.3.0-201912131246.git.0.09a9468.el8.x86_64.rpm | rpm2cpio | cpio -div`
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
#/usr/bin/env bash
set -euo pipefail
export ETCDCTL_API=3
# populate
ENDPOINTS=""
for base in kubernetes openshift; do
readarray RESOURCES <<< \
# sniff hypervisor
dmesg | grep Hypervisor
[ 0.000000] Hypervisor detected: KVM
# get key in bytes
etcdctl get $key -w fields | grep -oP "(?<=Value\" : \").*" | wc -c
# defrag status in MB
cat etcd_info/endpoint_status.json | jq '(.[0].Status.dbSize - .[0].Status.dbSizeInUse)/1000/1000'
[ storage ]
* https://haydenjames.io/linux-server-performance-disk-io-slowing-application/
[ fsync ]
* Usually you need 99% < 10ms, 99.9% < 100ms (99.999% < 1s).