Skip to content

Instantly share code, notes, and snippets.

View dlbewley's full-sized avatar
📺

Dale Bewley dlbewley

📺
View GitHub Profile
@dlbewley
dlbewley / oc-curl
Created September 21, 2022 01:20
experimental "one liner" to export stackrox alerts (violations)
#!/bin/bash
# read values from 1Password, YMMV
CLUSTER="hub-lab-bewley-net"
VAULT="development"
ROX_CENTRAL_ENDPOINT="$(op read op://$VAULT/$CLUSTER/acs/endpoint)" # cluster
ROX_CENTRAL_ENDPOINT_PUB="$(op read op://$VAULT/$CLUSTER/acs/endpoint-pub)" # public
ROX_CA_CERT="$(op read op://$VAULT/$CLUSTER/acs/ca)"
ROX_API_TOKEN="$(op read op://$VAULT/$CLUSTER/acs/admin-token)"
@dlbewley
dlbewley / pre-commit
Last active August 20, 2021 00:57
Git pre-commit hook to allow tracking of example secrets but deny changes.
#!/bin/sh
# once you have tracked a file, .gitignore will not have an effect on it, even if you
# ignore the enclosing directory.
# be sure to commit example secrets before adding this to .git/hooks/pre-commit
# Redirect output to stderr.
exec 1>&2
DENY_LIST="secrets|certs"
@dlbewley
dlbewley / asciinema-clear-screen.json
Created August 8, 2021 23:25
How to add a clear screen command to an asciinema recording
[0.000001, "o", "\u001b[H\u001b[J"]
@dlbewley
dlbewley / get-install-config.sh
Last active August 4, 2021 19:04
How to recover the install-config.yaml used to deploy an OpenShift cluster
#!/bin/bash
oc extract cm/cluster-config-v1 -n kube-system --to=-
@dlbewley
dlbewley / extract-kubeconfig-acm-created-cluster.sh
Last active April 19, 2024 15:09
How to extract kubeconfig and kubeadmin password from OpenShift ClusterDeployment using RHACM
#!/bin/bash
# https://guifreelife.com/blog/2021/08/13/RHACM-Recover-Created-Cluster-Credentials-and-Kubeconfig/
#
# If an OpenShift cluster was created by RHACM this script will extract the
# kubeconfig and the default kubeadmin credentials.
#
# Prereqs:
# - Authenticated to hub cluster
# - Managed cluster name is the sames as the hosting namespace on hub cluster
@dlbewley
dlbewley / ceph-toolbox.sh
Last active April 6, 2023 22:32
How to run Ceph commands in OpenShift Container Storage OCS / ODF
#!/bin/bash
if [ "$1" == "off" ]; then
oc patch OCSInitialization/ocsinit -n openshift-storage \
--type=merge -p='{"spec":{ "enableCephTools": false}}'
sleep 3
echo "removing any existing toolbox pod"
oc delete pods -n openshift-storage -l app=rook-ceph-tools
else
oc patch OCSInitialization/ocsinit -n openshift-storage \
--type=merge -p='{"spec":{ "enableCephTools": true}}'
@dlbewley
dlbewley / docker-pull-secret.sh
Created March 1, 2021 17:21
Add Docker Hub Credentials as OpenShift Pull Secret
# https://developers.redhat.com/blog/2021/02/18/how-to-work-around-dockers-new-download-rate-limit-on-red-hat-openshift/
# https://docs.docker.com/docker-hub/access-tokens/
oc create secret docker-registry docker \
--docker-server=docker.io \
--docker-username=<username> \
--docker-password=<password> \
--docker-email=<email>
oc secrets link default docker --for=pull

Mac Livestreaming with OBS

To get OBS virtual camera or NDI to work in some video conferencing software you must disable library validation.

Typically, the Hardened Runtime’s library validation prevents an app from loading frameworks, plug-ins, or libraries unless they’re either signed by Apple or signed with the same team ID as the app. The macOS dynamic linker (dyld) provides a detailed error message when this happens. Use the Disable Library Validation Entitlement to circumvent this restriction.

Zoom, Ring Central

@dlbewley
dlbewley / Dockerfile
Last active March 22, 2016 19:19
OpenShift STI static httpd builder dockerfile test
# static-builder
FROM openshift/base-centos7
# TODO: Put the maintainer name in the image metadata
MAINTAINER Dale Bewley <[email protected]>
# TODO: Rename the builder environment variable to inform users about application you provide them
ENV BUILDER_VERSION 1.0
# TODO: Set labels used in OpenShift to describe the builder image
@dlbewley
dlbewley / hosts
Created January 29, 2016 21:53
OSE 3.1 HA Cluster Ansible Inventory Hosts file
# This is an example of a bring your own (byo) host inventory
# Create an OSEv3 group that contains the masters and nodes groups
[OSEv3:children]
masters
nodes
etcd
lb
# Set variables common for all OSEv3 hosts