-
Change
apiVersion
from:- apiVersion: v1
(or
apiVersion: apps.openshift.io/v1
)to:
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
#!/usr/bin/env bash | |
# | |
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file | |
# | |
# Rsyncs the data to a web accessible folder that can be displayed with e.g. | |
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4 | |
# | |
# This should typically be run as a cron job | |
# |
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
func getAllFilenames(fs *embed.FS, path string) (out []string, err error) { | |
if len(path) == 0 { | |
path = "." | |
} | |
entries, err := fs.ReadDir(path) | |
if err != nil { | |
return nil, err | |
} | |
for _, entry := range entries { | |
fp := filepath.Join(path, entry.Name()) |
oc get crd -o=custom-columns=NAME:.metadata.name,CR_NAME:.spec.names.singular,SCOPE:.spec.scope
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
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'
-
Change
apiVersion
from:- apiVersion: v1
(or
apiVersion: apps.openshift.io/v1
)to:
-
Change
apiVersion
from:- apiVersion: v1
(or
apiVersion: apps.openshift.io/v1
)to:
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
Questions are not from any actual exam!!! | |
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl | |
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] | |
Once the job has completed, check the logs to and export the result to pi-result.txt. | |
Solution: |
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
const EARTH_CIR_METERS = 40075016.686; | |
const degreesPerMeter = 360 / EARTH_CIR_METERS; | |
function toRadians(degrees) { | |
return degrees * Math.PI / 180; | |
}; | |
function latLngToBounds(lat, lng, zoom, width, height){ | |
const metersPerPixelEW = EARTH_CIR_METERS / Math.pow(2, zoom + 8); | |
const metersPerPixelNS = EARTH_CIR_METERS / Math.pow(2, zoom + 8) * Math.cos(toRadians(lat)); |
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
from pynamodb.models import Model | |
from pynamodb.constants import STRING | |
from pynamodb.attributes import UnicodeAttribute | |
ENUM = ('FOO', 'BAR', 'BAZ') | |
class EnumUnicodeAttribute(UnicodeAttribute): | |
""" | |
An enumerated unicode attribute |
NewerOlder