Skip to content

Instantly share code, notes, and snippets.

View johnsimcall's full-sized avatar

John Call johnsimcall

View GitHub Profile
@johnsimcall
johnsimcall / byzanz_window.py
Created October 18, 2018 04:35 — forked from noamraph/byzanz_window.py
byzanz_window: Use byzanz to create a GIF screencast of a specific window
#!/usr/bin/env python
"""
Use byzanz to create a GIF screencast of a specific window.
Required tools:
sudo apt-get install byzanz x11-utils xdotool
A tip: use an extra-long duration (-d 100), record your shot, and use
gimp to shorten the duration of the last frame. You need to rename the layer
from "Frame 123 (100000 ms) (combine)" to "Frame 123 (1000 ms) (combine)".
@johnsimcall
johnsimcall / rhvm-backup.sh
Last active December 10, 2018 19:58
Cron file to backup RHV-M database
# file: /etc/cron.daily/rhvm-backup.sh
# author: jcall
# purpose: backup RHV-M database daily
# pre-requisites: "yum -y install tmpwatch"
#!/bin/bash
BACKUP_DIR="/var/rhvm-backups"
BACKUP_FILE="${BACKUP_DIR}/rhv-engine-backup-$(date +"%F_%T")"
BACKUP_DAYS=7d
@johnsimcall
johnsimcall / noip.service
Last active May 17, 2021 04:08 — forked from ericandrewlewis/noip2.service
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-IP Dynamic DNS Updater
#
# 1) Install DUC (Dynamic Update Client) and create the configuration file
# as described on noip website https://my.noip.com/#!/dynamic-dns/duc
# 2) Save this file as /etc/systemd/system/noip.service
# 3) Tell systemd to rescan unit files `sudo systemctl daemon-reload`
# 4) Execute `sudo systemctl enable --now noip`
#
# TODO: Secure this unit file via `systemd-analyze security noip.service`
# More info here https://www.redhat.com/sysadmin/mastering-systemd
@johnsimcall
johnsimcall / dnsmasq-dhcp-known-mac-addresses.conf
Last active September 22, 2023 13:12
Example DHCP (dnsmasq)
# Copy this config into a new file at /etc/dnsmasq.d/my-site.conf
# Only listen on a particular interface/ip address (avoid conflict with libvirt-managed virbr0)
interface=eno1
#listen-address=172.27.0.93
bind-interfaces
port=0 # don't answer DNS requests, we'll send them to the corporate DNS below
# Basic config for DHCP that uses existing router, DNS, and NTP devices
@johnsimcall
johnsimcall / 50-worker-rhsm-entitlement-template.yaml
Created August 18, 2021 19:22
MachineConfig template that applies Red Hat subscription information
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 50-worker-rhsm-entitlement
spec:
config:
ignition:
version: 3.2.0
@johnsimcall
johnsimcall / haproxy.cfg
Last active October 10, 2022 15:15
HAProxy for OpenShift 4
[root@bastion ~]# cat /etc/haproxy/haproxy.cfg
# "global" and "defaults" sections are default from RPM
#---------------------------------------------------------------------
# OpenShift
#---------------------------------------------------------------------
listen stats
bind :9000
mode http
@johnsimcall
johnsimcall / grub.cfg
Created August 23, 2021 16:33
PXE boot for RHCOS
#set timeout=10
#set default=0
menuentry 'BOOTSTRAP' {
linux rhcos-4.8.2-x86_64-live-kernel-x86_64 coreos.live.rootfs_url=http://172.27.0.93:8080/rhcos-4.8.2-x86_64-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://172.27.0.93:8080/bootstrap.ign
initrd rhcos-4.8.2-x86_64-live-initramfs.x86_64.img
}
menuentry 'CONTROL PLANE' {
linux rhcos-4.8.2-x86_64-live-kernel-x86_64 coreos.live.rootfs_url=http://172.27.0.93:8080/rhcos-4.8.2-x86_64-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://172.27.0.93:8080/master.ign
@johnsimcall
johnsimcall / openshift-nfs.txt
Last active November 8, 2023 07:39
Simplified NFS storage for OpenShift
cd ~/ocp/
git clone https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.git
cd nfs-subdir-external-provisioner
sed -i.backup 's/nfs-client/nfs-storage/g' ./deploy/class.yaml
sed -i.backup 's/namespace:.*/namespace: nfs-storage/g' ./deploy/rbac.yaml
sed -i.backup 's/namespace:.*/namespace: nfs-storage/g' ./deploy/deployment.yaml
@johnsimcall
johnsimcall / shane-ovirt-with-gluster.ks
Created October 28, 2021 14:30
Example oVirt Node kickstart (from Red Hat Virtualization 4.3 era)
#liveimg --url=file:///tmp/squashfs ### use this line when booting from ISO/USB
liveimg --url=http://nas/redhat-virtualization-host-latest.squashfs.img
lang en_US
keyboard us
timezone America/Denver --utc
rootpw --plaintext redhat1
network --device=link --bootproto=dhcp
%include /tmp/partitions
reboot
@johnsimcall
johnsimcall / gist:f17c2cb21e1365de7040296ac30ae421
Last active November 16, 2023 11:58
NFS server/export setup on RHEL8
dnf install nfs-utils
mkdir -p /exports/openshift
chmod 755 /exports/openshift
chown -R nfsnobody:nfsnobody /exports/openshift
semanage fcontext --add --type nfs_t "/exports/openshift(/.*)?"
restorecon -R -v /exports/openshift
echo "/exports/openshift *(insecure,no_root_squash,async,rw)" >> /etc/exports