Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# DMC: Create Ignition files for each node based on the base ignition file and the fake root for each host
# This script is a work in progress
# Things that we have learned so far....
# the bootstrap node I can set the network with the fake root ifcfg-ens3
# that has failed every time for the masters even though m4.2xlarge is ens3
# I've had to use the VPC DHCP option set
@dmc5179
dmc5179 / route53_dns_update.sh
Last active January 13, 2020 14:12
AWS Update Route53 DNS Record
#!/bin/bash
#
# Script to change the Route53 public DNS entry associated to this host
# with the new EIP assigned to this host when booted.
#
# Need to get EIP using the CLI since that IP is not actually assigned to the host
set -xe
INSTANCE_ID=""
HOSTED_ZONE=""
@dmc5179
dmc5179 / banner.js
Created January 28, 2020 03:00
IPA Warning Banner
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
* Dan Clark <danclark@redhat.com>
*
* Copyright (C) 2014 Red Hat
* Copyright (C) 2019 Red Hat
* see file 'COPYING' for use and warranty information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@dmc5179
dmc5179 / hosts
Created February 20, 2020 20:24
GeoAxis Integration in OCP 3
# Authentication via GEOAxIS, RH SSO, & htpasswd
openshift_master_identity_providers=[{'name':'GEOAxIS', 'login':'true', 'challenge':'false', 'mappingMethod':'add', 'kind':'OpenIDIdentityProvider', 'client_id':'openshift', 'client_secret':'${OCP_SSO_CLIENT_SECRET:=}', 'urls':{'authorize':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/auth?kc_idp_hint=${OCP_SSO_GEOAXIS_IDENTITY_PROVIDER_ALIAS:=GEOAxIS}', 'token':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/token', 'userInfo':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/userinfo'}, 'claims':{'id':['sub'], 'preferredUsername':['preferred_username'], 'name':['name'], 'email':['email']}}, {'name':'RHSSO', 'login':'true', 'challenge':'false', 'mappingMethod':'add', 'kind':'OpenIDIdentityProvider', 'client_id':'openshift', 'client_secret':'${OCP_SSO_CLIENT_SECRET:=}', 'urls':{'authorize':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/auth', 'token':'https://${OCP_S
#!/usr/bin/env bash
if [[ "$(whoami)" != "root" ]]
then
echo
echo "*** MUST BE root TO RUN THIS SCRIPT ***"
echo
exit 1
fi
@dmc5179
dmc5179 / galaxy-podman.sh
Last active March 25, 2020 17:49
Script to run Ansible Galaxy with podman like docker-compose
#!/bin/bash -xe
# Script to run Ansible Galaxy with podman like docker-compose
#GALAXY_NET="galaxy-net"
#SINGLE_POD="false"
SUDO=""
#if [[ `whoami` == root ]]
@dmc5179
dmc5179 / docker-ce-rhel8.sh
Last active March 20, 2021 16:55
Docker CE on RHEL 8 with IPTables
#!/bin/bash
# Add Docker CE Repo
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
# Configure Docker CE Repo
sudo sed -i '/^gpgkey=https:\/\/download.docker.com\/linux\/centos\/gpg/a module_hotfixes=True' /etc/yum.repos.d/docker-ce.repo
# Install Docker CE
sudo dnf install -y docker-ce
@dmc5179
dmc5179 / fahclient.spec
Created April 9, 2020 20:28
RPM Spec file for the Folding @ Home Client
Name: fahclient
Version: 7.5.1
Release: 1%{?dist}
Summary: Folding @ Home Client
Group: Applications/Internet
License: Restricted
URL: https://foldingathome.org/
Source: https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v7.5/fahclient_7.5.1-64bit-release.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@dmc5179
dmc5179 / aws-ec2-dead-snapshots.sh
Last active April 21, 2020 13:30
Script to find AWS EC2 Snapshots created for AMIs that no longer exist
#!/bin/bash
# Locate dead AWS EC2 Snapshots
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@dmc5179
dmc5179 / aws-ec2-stale-instances
Created April 21, 2020 13:31
Locate AWS EC2 instances that have been stopped for more than a defined number of days
#!/bin/bash
# Locate stale AWS EC2 Instances
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,