Skip to content

Instantly share code, notes, and snippets.

@luckylittle
luckylittle / ocp4_all_resources.md
Created March 12, 2021 01:48
How can I list all resources and custom resources in OpenShift 4

How can I list all resources and custom resources in OpenShift

List all CRDs with CR name and Scope

oc get crd -o=custom-columns=NAME:.metadata.name,CR_NAME:.spec.names.singular,SCOPE:.spec.scope

List every single custom resources in the cluster

oc get $(oc get crd -o=custom-columns=CR_NAME:.spec.names.singular --no-headers | awk '{printf "%s%s",sep,$0; sep=","}') --ignore-not-found --all-namespaces -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace

List every single resource in the cluster (custom and non-custom)

oc get $(oc api-resources --verbs=list -o name | awk '{printf "%s%s",sep,$0;sep=","}') --ignore-not-found --all-namespaces -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace --sort-by='metadata.namespace'

@hermanbanken
hermanbanken / kustomize_vars.md
Created November 22, 2020 13:11
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@aalbertson
aalbertson / gist:e2f3a63ff92800a16c6251de0a0a1f85
Created February 5, 2019 19:52
example disable audio - vagrant mac virtualbox v2 config
$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.define "LogsParsing"
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.provision :file, source: './provision.sh', destination: '~/provision.sh'
config.vm.provision "shell", run: 'always', path: "./provision.sh", privileged: false
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 15, 2024 19:37
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 23, 2024 21:36
set -e, -u, -o, -x pipefail explanation
@vxhviet
vxhviet / simplifiedGitFlow.md
Last active August 11, 2023 18:31
A simplified version of Git Flow

Simplified Git-flow

                        RELEASE TAG
o----------------------------o-----------------o------------o------> MASTER
 \                          /  \                \----------/ HOTFIX
  \                        /    \                          \
   \----------------------/      \--------------------o-----o------> DEVELOP
                                  \                  /
 \----------------/ FEATURE
@meredian
meredian / fizz_buzz.md
Last active June 17, 2022 10:51
FizzBuzz in python

Задачка FizzBuzz

Напишите программу, которая выводит на экран числа от 1 до 100. При этом вместо чисел, кратных трем, программа должна выводить слово «Fizz», а вместо чисел, кратных пяти — слово «Buzz». Если число кратно и 3, и 5, то программа должна выводить слово «FizzBuzz»

Цитата: "Нормальный программист должен написать такую программу на бумажке за пару минут. Но вот что интересно: многие люди с профильным образованием вообще не могут справится с этой задачей. Были даже случаи, когда кандидаты, подававшие резюме на вакансию «Senior developer» тратили на эту программу больше 15 минут."

Подробнее про историю задачи и ее значимость можете прочитать по ссылке: https://habrahabr.ru/post/298134/

@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian