Skip to content

Instantly share code, notes, and snippets.

View waynedovey's full-sized avatar
🎯
Focusing

Wayne Dovey waynedovey

🎯
Focusing
View GitHub Profile
@waynedovey
waynedovey / transcodeVideo.js
Last active August 29, 2015 14:11 — forked from Marak/transcodeVideo.js
Hook for transcoding video streams using FFMpeg
var Transcoder = require('stream-transcoder');
module['exports'] = function transcodeVideoStream (hook) {
var readStream = hook.open(hook.params.video);
hook.debug('Opening read stream to video');
hook.res.writeHead(200, {
"Content-Type": "video/mp4"
});
create high cpu on two master node (rough process)
yum install https://mirror.aarnet.edu.au/pub/epel/7/x86_64/Packages/s/stress-1.0.4-16.el7.x86_64.rpm
mv /bin/stress /bin/kworkers
/bin/openshift-service -q --cpu 2 --io 20 --timeout 600
@waynedovey
waynedovey / gist:77909a364ac825d8d258f07be78d1ffe
Created February 19, 2018 23:00
Cloudforms - OpenShift - API
CLOUDFORMS_URL="cloudforms.console.com"
CLOUDFORMS_PASSWORD="xxxxx"
CLOUDFORMS_TOKEN=`oc sa get-token -n management-infra management-admin`
CLOUDFORMS_GUID=`echo $GUID | awk '{print toupper($0)}'`
PUBLIC_MASTER_DNS=openshift.console.com
cat > /tmp/cloudforms.yaml << EOF
---
- hosts: all
environment:
apiVersion: v1
kind: Project
metadata:
labels:
app: collectorforopenshift
name: collectorforopenshift
annotations:
# openshift.io/node-selector: ''
# openshift.io/description: 'Monitoring OpenShift in Splunk, built by Outcold Solutions'
# openshift.io/display-name: 'Collector for OpenShift'
@waynedovey
waynedovey / gist:11eb2985a82caef86714d4124b901153
Created September 23, 2019 04:01
OpenShift 4 CheetSheet
# Display currently installed operators and cluster version
oc adm release info
# List the current Operators Status
oc get clusteroperators
# Upgrade from command line
oc adm upgrade
# Remotely connet to the cluster.
oc debug node/ip-10-216-29-190.ap-southeast-2.compute.internal --image=rhel-tools
@waynedovey
waynedovey / gist:2cbfb83a588922b4f187674a07fcaed9
Last active February 10, 2020 10:20
AWS User account create
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
pip install awscli --upgrade --user
export PATH=$PATH:~/.local/bin/
aws configure
aws iam create-user --user-name aws-ec2-manager
aws iam attach-user-policy \
--policy-arn arn:aws:iam::aws:policy/PowerUserAccess \
@waynedovey
waynedovey / ocp4-upi.json
Last active November 27, 2019 21:38
OpenShift 4 IAM Policies CutDown
{
"Statement": [
{
"Action": [
"cloudformation:CreateStack",
"cloudformation:DeleteStack",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStacks",
"cloudformation:ListStackResources",
"ec2:CreateTags",
@waynedovey
waynedovey / gist:37b9a897c83ddd4e178fc1b5f815ea1c
Last active May 13, 2020 04:49
Clean out the Git History if you have checked in a password by mistake
# Feature Branch
git checkout --orphan fixit
git add -A
git commit -m "update"
git branch -D feature/bastion-create
git branch -m feature/bastion-create
git push -f origin feature/bastion-create
git gc --aggressive --prune=all
# Master Branch
# Custom Node lables
https://access.redhat.com/solutions/4287111
# VMware Volume permissions
https://access.redhat.com/solutions/4821601
# Vmware Service account Permissons
@waynedovey
waynedovey / OpenShift CheetSheet
Last active May 8, 2020 04:08
OpenShift CheetSheet
#!/bin/bash
if [ -z "$1" ]; then
echo "pass a namespace" && exit 1
fi
APIURL=$(oc whoami --show-server)
NAMESPACE=${1}
oc get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >/tmp/$NAMESPACE.json
curl -k -H "Authorization: Bearer $(oc whoami -t)" -H "Content-Type: application/json" -X PUT --data-binary @/tmp/$NAMESPACE.json "$APIURL/api/v1/namespaces/$NAMESPACE/finalize"