Skip to content

Instantly share code, notes, and snippets.

View johnsimcall's full-sized avatar

John Call johnsimcall

View GitHub Profile
#!/bin/bash
shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done;
@johnsimcall
johnsimcall / imageset-config.yaml
Last active May 16, 2023 14:22
oc-mirror ImageSetConfiguration for NVIDIA GPU Operator
---
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
registry:
imageURL: jcall-testing.dota-lab.iad.redhat.com:8443/oc-mirror/oc-mirror-metadata
mirror:
platform:
graph: true # this requires a download from github.com
channels:
@johnsimcall
johnsimcall / rhel8.ks
Created November 10, 2022 22:55
RHEL8 kickstart with RAID for UEFI, boot, and root (via LVM)
# Kicstart created by John Call
# Installs RHEL8 via HTTP
url --url="http://rhdata6/rhel8/"
graphical
lang en_US.UTF-8
firstboot --disable
rootpw --plaintext My-Password-123
services --enabled="chronyd"
timezone America/New_York --isUtc
@johnsimcall
johnsimcall / nncp-node1.yaml
Last active October 26, 2022 03:08
NodeNetworkConfigurationPolicy (NNCP) example
# https://docs.openshift.com/container-platform/4.11/networking/k8s_nmstate/k8s-nmstate-updating-node-network-config.html
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: node1
spec:
nodeSelector:
kubernetes.io/hostname: node1.example.com
desiredState:
@johnsimcall
johnsimcall / squid.conf
Last active October 25, 2022 18:53
squid behind squid - squid.conf
### ACL for Approved/Allowed sites, insert below this line in default config
#acl CONNECT method CONNECT
acl Approved_Sites dstdomain "/etc/squid/Approved_Sites.txt"
http_access deny !Approved_Sites
http_access allow Approved_Sites
### Force this proxy to use another proxy
#cache_peer hostname type http_port icp_port options
@johnsimcall
johnsimcall / imageset-config.yaml
Last active April 5, 2024 18:59
oc-mirror imageset-config.yaml for OpenShift Virtualization
### oc-mirror --config imageSetConfig.yaml file://./ocp-virt-4-14
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
local:
path: ./
mirror:
@johnsimcall
johnsimcall / ssh-tunnel-example-bastion.config
Last active October 22, 2022 07:22
systemd unit file for establishing an SSH tunnel to a remote host that runs (or can reach) a proxy service
Host example-bastion
HostName example-bastion.fqdn.com
IdentityFile /root/.ssh/id_ed25519 # -i
User john # -l
ExitOnForwardFailure yes
ServerAliveInterval 10
SessionType none # -N
RequestTTY no # -T
GatewayPorts yes # -g
LocalForward 3129 outside.proxy.com:3128 # -L
@johnsimcall
johnsimcall / ceph-snap-info.sh
Last active October 11, 2022 15:29
a Bash script to retrieve RBD snapshot info for OpenShift Data Foundation Regional Disaster Recovery
#!/bin/bash
set -e
if [ $# != 4 ]; then
echo "Usage: ceph-snap-info.sh <namespace> <pvc_name> <primary_context> <dr_context>"
echo "e.g. : ceph-snap-info.sh pacman mongo-storage west east"
exit 1;
fi
if [ ! $(oc whoami) ]; then
@johnsimcall
johnsimcall / Approved_Sites.txt
Last active October 20, 2023 21:33
Setup a restrictive Squid proxy
## /etc/squid/Approved_Sites.txt
# if you're installing OpenShift with vSphere integrations, put your vCenter FQDN/address in here too
# the OpenShift Machine API Operator will use the defined cluster proxy when creating Worker nodes/VMs
vcenter.example.com
# https://docs.openshift.com/container-platform/4.11/installing/install_config/configuring-firewall.html
# https://access.redhat.com/articles/3638561
.quay.io # allows cdn.quay.io
.redhat.io # allows registry.redhat.io
@johnsimcall
johnsimcall / query-vm.yaml
Created September 29, 2022 18:12
Ansible playbook to extract virtual machine and disk details from oVirt/RHVM
# file: query-vms.yml
# prerequisites:
# sudo dnf --enablerepo=rhv-4.4-manager-for-rhel-8-x86_64-rpms install "python*ovirt-engine-sdk4"
# or
# sudo dnf install https://resources.ovirt.org/pub/ovirt-4.4/rpm/el8/x86_64/python3-ovirt-engine-sdk4-4.4.15-1.el8.x86_64.rpm
# description:
# Simple playbook to extract basic details of VMs
# example invocation:
# ansible-playbook query-vms.yml