- Basic structure
- oc [name]
- There are some exceptions, like
oc help
oroc logs <pod>
oroc exec
- Most commands support
oc <command> --help
- Common resources (nouns)
- Pods
- Deployments
- Services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initial from: https://wiki.archlinux.org/index.php/dnsmasq | |
# Some from: https://www.tecmint.com/setup-a-dns-dhcp-server-using-dnsmasq-on-centos-rhel/ | |
#listen-address=::1,127.0.0.1,192.168.2.1 | |
# Cloudflare | |
#server=1.1.1.1 | |
#server=1.0.0.1 | |
# Cloudflare family block malware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF > check-endianness.c | |
#include <stdio.h> | |
int main() { | |
int n = 1; | |
// little endian if true | |
if(*(char *)&n == 1) { | |
printf("Little endian\n"); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int n = 1; | |
// little endian if true | |
if(*(char *)&n == 1) { | |
printf("Little endian\n"); | |
} else { | |
printf("Big endian\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get your IP address from home or work: curl -s 'https://api.ipify.org' | |
# Replace with your IP. Can get it with the above command if you'd like | |
# This can also be a CIDR range if you own or trust a block | |
MY_IP=<ip> | |
firewall-cmd --zone-public --permanent --remove-service=cockpit | |
firewall-cmd --zone=public --permanent \ | |
--add-rich-rule="rule family=\"ipv4\" source address=\"${MY_IP}\" port protocol=\"tcp\" port=\"9090\" accept" | |
firewall-cmd --reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -k "https://basic-ocp-demo-basic-ocp-demo-project.apps.cluster1.example.com/healthz" | |
# or build the curl URL programmatically! | |
curl -k "https://$(oc get route basic-ocp-demo -o jsonpath="{.spec.host}")/healthz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
annotations: | |
deployment.kubernetes.io/revision: "1" | |
kubectl.kubernetes.io/last-applied-configuration: | | |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"basic-ocp-demo"},"name":"basic-ocp-demo","namespace":"basic-ocp-demo-project"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"basic-ocp-demo"}},"template":{"metadata":{"labels":{"app":"basic-ocp-demo"}},"spec":{"containers":[{"env":[{"name":"BASIC_OCP_DEMO_ENV","value":"master"}],"image":"quay.io/freedomben/basic-ocp-demo:latest","imagePullPolicy":"Always","name":"basic-ocp-demo","ports":[{"containerPort":4567,"protocol":"TCP"}],"readinessProbe":{"httpGet":{"path":"/healthz","port":4567,"scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":1}}]}}}} | |
creationTimestamp: "2021-01-08T02:09:21Z" | |
generation: 1 | |
labels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: basic-ocp-demo | |
name: basic-ocp-demo | |
spec: | |
replicas: 1 | |
selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This module defines some handy functions for use in iex | |
# | |
defmodule DebugTools do | |
@doc ~S""" | |
Cast all the params provided here into an Ecto.Changeset. | |
This defeats Ecto's whitelist approach so you should never use this in real code! | |
It's intended as a debug tool for use in tests of IEx sessions. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i -e '/printf.*TERMINATED/i \\tprintf(" HACKED! \\n");' 2048.c |