Skip to content

Instantly share code, notes, and snippets.

View FreedomBen's full-sized avatar
💭
Currently setting my status

Ben Porter FreedomBen

💭
Currently setting my status
View GitHub Profile
@FreedomBen
FreedomBen / disable-word-boundary.vim
Last active February 24, 2022 20:25
Disable word boundary wrapping
:set nolbr " Short for :set nolinebreak
@FreedomBen
FreedomBen / gist:274ad97ea9643fe2605ad4467fc1e0d2
Created February 24, 2022 20:11
Line break at Word boundary
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incid
idunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exerci
tation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure do
lor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt m
ollit anim id est laborum.
:set wrap
:set linebreak
#!/usr/bin/env bash
TOKEN="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
CACERT="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
NAMESPACE="$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)"
# Get Service's NodePort by label. Label in example is "cvhid=abcd-1234"
curl \
--silent \
--header "Authorization: Bearer ${TOKEN}" \
- Basic structure
- oc <verb> <noun> [name]
- There are some exceptions, like `oc help` or `oc logs <pod>` or `oc exec`
- Most commands support `oc <command> --help`
- Common resources (nouns)
- Pods
- Deployments
- Services
- Routes
- ConfigMaps
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: basic-ocp-demo
name: basic-ocp-demo
spec:
replicas: 1
selector:
@FreedomBen
FreedomBen / basic-ocp-demo.yaml
Created October 5, 2021 23:27
Basic Deployment config for the basic-ocp-demo
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: basic-ocp-demo
name: basic-ocp-demo
spec:
replicas: 1
selector:
@FreedomBen
FreedomBen / digall.sh
Last active August 16, 2024 11:41
A bash command that will run a `dig` against a specified target for all record types
#!/usr/bin/env bash
#
# To use, simply run `digall <domain>` such as:
#
# digall example.com
# digall sub.example.com
#
# Place this file in your PATH. Suggest either /usr/local/bin/ or ~/bin
#
#!/usr/bin/env bash
# Versoin one
oc get $(oc api-resources --namspaced=true | tail -n+2 | awk '{ print $1 }' | xargs | sed -e 's/\s/,/g')
# Version two (from https://access.redhat.com/solutions/4165791)
oc api-resources --verbs=list --namespaced -o name | xargs -n 1 oc get --show-kind --ignore-not-found -n $PROJECT_NAME