Skip to content

Instantly share code, notes, and snippets.

View therevoman's full-sized avatar

Nate Revo therevoman

  • Red Hat, Inc
  • Utah
View GitHub Profile
@therevoman
therevoman / git_rebase.md
Created September 21, 2019 03:09 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@therevoman
therevoman / fix_dnf_yum_database.txt
Created July 6, 2020 18:20 — forked from iamcryptoki/fix_dnf_yum_database.txt
Fix RPM/DNF/YUM database (BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery).
cd /var/lib/rpm/
mv __db.00* /tmp
rpm --rebuilddb
@therevoman
therevoman / delete.sh
Created September 25, 2020 22:33 — forked from RLovelett/delete.sh
Delete ZFS snapshots from dataset one-liner
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy

Simulate Bare-Metal IPMI for VMs in RHEL8 Libvirt

  • Install the Virtual BMC package in the machine to use as the vBMC server. Note1: When using OpenStack repos the python3-virtualbmc RPM might be available. These instrucctions do not use that package.
    pip3 install virtualbmc
    
    • The vBMC server can be running in any machine. When using a remote libvirt server it is recommended to have passwordless authentication from the vBMC server to the libvirt machines.
    • For this document the vBMC Server export vBMCServerIP=192.168.1.13

Create OCP RHCOS LiveCD w/embedded Ignition

  • Download latest coreos-installer
podman pull quay.io/coreos/coreos-installer:release
  • Download latest RHCOS LiveCD
curl -O https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/latest-4.6/rhcos-live.x86_64.iso
# list nodes
oc get nodes

# list cluster operators and their state
oc get co

# show cluster version and error messages
oc get clusterversion
@therevoman
therevoman / iperf-pods.md
Created December 1, 2020 06:09 — forked from williamcaban/iperf-pods.md
Using client/server iperf pods

Using iperf Pods

  • Create namespace or project for running iperf tests:
oc new-project iperf-test
  • Create server Pod
rm -f pod-iperf-server.yaml 

OCP4 Explicit Manual Upgrades with CLI

In this example, the latest 4.4.x it is 4.4.3 and it has this entry:

Pull From: quay.io/openshift-release-dev/ocp-release@sha256:039a4ef7c128a049ccf916a1d68ce93e8f5494b44d5a75df60c85e9e7191dacc

Validate your current version is in the list of upgrade path for the desired release. For 4.4.3 these are the possible upgrade paths:

NOTE: This is an unofficial procedure. Do NOT use this outside a lab environment. The official procedure is described in the official OCP documentation -- https://docs.openshift.com/container-platform/4.3/machine_management/adding-rhel-compute.html

copy kubeconfig to /root/.kube/config 
copy pull secret to /tmp/pull.json

export MC_NAME=`oc get machineconfigpool worker --output=jsonpath='{.status.configuration.name}'`

oc get machineconfig $MC_NAME --output=json > /tmp/worker.json
@therevoman
therevoman / KVM QCOW2 Images Cheat Sheet.md
Created December 1, 2020 06:10 — forked from williamcaban/Export RHV to QCOW2.md
Customizing and Expanding QCOW2 Images

Customizing RHEL8.1 qcow2 image

Need following packages:

yum -y install libguestfs-tools
  • Copy template image
export VMDISK="registry.qcow2"

cp /root/rhel-8.1-x86_64-kvm.qcow2 /var/lib/libvirt/images/pool/${VMDISK}