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
@hexfusion
hexfusion / ServiceMonitoring.yaml
Created January 20, 2021 22:23 — forked from jcpowermac/ServiceMonitoring.yaml
vsphere exporter in openshift (will submit pr)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
k8s-app: vmware-exporter
name: vmware-exporter-monitor
namespace: openshift-vsphere-infra
spec:
endpoints:
- interval: 30s
#! /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
#!/bin/bash
choice=$(oc get --namespace openshift-etcd --selector etcd pods -o json | jq -r '.items[] | .spec.nodeName + " " + (.status.containerStatuses[] | select(.name=="etcd") | .containerID[8:])' | fzf)
IFS=' ' read node container_id <<< "$choice"
pid=$(oc debug --quiet nodes/$node -- chroot /host crictl inspect -o go-template --template '{{.info.pid}}' $container_id)
oc debug --quiet nodes/$node -- chroot /host strace -Tfe inject=fdatasync:delay_enter=800000 -e trace=fdatasync -p $pid
@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)
@hexfusion
hexfusion / tcpdump-pod
Last active May 5, 2020 17:28 — forked from ironcladlou/tcpdump-pod
OpenShift Network Helpers
#!/bin/bash
set -euo pipefail
NAMESPACE=$1
NAME=$2
IMAGE="${IMAGE:-quay.io/dmace/ditm}"
NODE_NAME="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ .spec.nodeName }}')"
CONTAINER_ID_URI="$(oc get --namespace $NAMESPACE pods $NAME -o go-template='{{ (index .status.containerStatuses 0).containerID }}')"
CONTAINER_ID="${CONTAINER_ID_URI:8}"
@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`
@hexfusion
hexfusion / NVIDIAonLenovoP50andFedora 28.txt
Created November 28, 2018 13:46 — forked from kurtis318/NVIDIAonLenovoP50andFedora 28.txt
NVIDIA on Lenovo P50 and Fedora 28
I have a Lenovo P50 ThinkPad that I am issued at work. I run the latest Fedora on my primary laptop for years but
have avoided running the NVIDA graphics drivers because installation was manual and could break with kernel updates.
I updated my personal Dell XPS 15 to use the new NVIDIA drivers that are now supported in Fedora 28 I think these were suppose to come from rpm-fusion but it looks like they are in Fedora 28 tree, I could be wrong. The install was as easy as just installing the nvidia-driver package and reboot. This worked without any issues. I could launch nvidia-settings and glxgears without any issues.
The purpose of this Gist post is to document how I got the NVIDIA drivers from Fedora 28 on the P50. It was not as easy as installing nvidia-driver and rebooting.
For starters, here are the specs for the P50:
[root@kwr50p kurtis] # inxi -SG
@hexfusion
hexfusion / arch-linux-install
Last active December 12, 2016 18:14 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# This assumes a wifi only system...
@hexfusion
hexfusion / README.md
Created February 8, 2016 15:06 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@hexfusion
hexfusion / gist:8f1dfbed3e2e5379f607
Created February 7, 2016 12:37 — forked from craigminihan/gist:b23c06afd9073ec32e0c
Build GCC 4.9.2 for C/C++ on CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
cd ~/Downloads
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install