Skip to content

Instantly share code, notes, and snippets.

@lemoony
Last active February 13, 2022 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lemoony/4905e7468b8f0a7991d6122d7d09e40d to your computer and use it in GitHub Desktop.
Save lemoony/4905e7468b8f0a7991d6122d7d09e40d to your computer and use it in GitHub Desktop.
SnipKit Example Gist #snipkitExample
#
# Echo something
#
# ${VAR1} Name: Message
# ${VAR1} Description: What to print on first line
echo "$VAR1"
# ${VAR2} Name: Application
# ${VAR2} Description: What to print on the first part of the second line
# ${VAR2} Default: Snipkit
# ${VAR3} Name: Statement
# ${VAR3} Description: What to print on the second part of the second line
# ${VAR3} Values: is great!, want's to make you more productive!, is a snippet manager for the terminal!
echo "${VAR2}" "${VAR3}"
#
# Find files containing string
#
# ${SEARCH_PATH} Name: Path
# ${SEARCH_PATH} Description: The search path
# ${PATTERN} Name: Pattern
# ${PATTERN} Description: Define a grep pettern to filter the results
grep -rnw "${SEARCH_PATH}" -e "${PATTERN}"
#
# Kubectl switch context & namespace
#
# ${CONTEXT} Name: Context
# ${CONTEXT} Description: The kube context to switch to
# ${CONTEXT} Values: test.k8s, int.k8s, prod.k8s
kubectl config use-context ${CONTEXT}
# ${NAMESPACE} Name: Namespace
# ${NAMESPACE} Description: The namespace to switch to
# ${NAMESPACE} Values: product-1, product-2
kubectl config set-context $(kubectl config current-context) --namespace=${NAMESPACE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment