Last active
November 2, 2020 14:47
-
-
Save discosultan/6179719410c1f4425d10fac49a071743 to your computer and use it in GitHub Desktop.
Cheat sheet for common programming tasks
This file contains 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
# Delete all evicted pods. | |
kubectl get po --all-namespaces --field-selector 'status.phase!=Running' -o yaml | kubectl delete -f - | |
# List all resources in a namespace. | |
kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n <namespace> | |
# Trigger cronjob manually. | |
kubectl create job --from=cronjob/<cronjob-name> <job-name> | |
# Run busybox. | |
kubectl run -i --tty busybox --image=busybox --restart=Never -- sh |
This file contains 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
-- Alter default privileges. | |
ALTER DEFAULT PRIVILEGES IN SCHEMA schema GRANT SELECT ON TABLES TO role; | |
-- Alter privileges. | |
GRANT SELECT ON ALL TABLES IN SCHEMA schema TO role; | |
-- Create role. | |
CREATE ROLE role; | |
ALTER ROLE role WITH PASSWORD 'role'; | |
ALTER ROLE role SET search_path = schema; | |
-- Create schema. | |
CREATE SCHEMA schema; | |
ALTER SCHEMA schema OWNER TO user; |
To fix a stuck Terraform Kinesis delivery stream:
- update underlying CloudFormation stack manually:
- rename delivery stream with "-2" suffix, for example
- switch to a new source stream
- run terraform apply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To remove trailing whitespace from all fiels using Visual Studio Code: