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
| kubectl get po --all-namespaces --field-selector 'status.phase==Failed' -o json | kubectl delete -f - | |
| kubectl get po --all-namespaces --field-selector 'status.phase==Evicted' -o json | kubectl delete -f - | |
| kubectl get po --all-namespaces --field-selector 'status.phase==Pending' -o json | kubectl delete -f - |
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
| #!/bin/bash | |
| kind_version=${1:-"v0.8.1"} | |
| kind_bin_path=/usr/local/bin/kind | |
| if [ ! -f ${kind_bin_path} ]; then | |
| # curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${kind_version}/kind-$(uname)-amd64 | |
| curl -Lo ./kind "https://kind.sigs.k8s.io/dl/${kind_version}/kind-$(uname)-amd64" | |
| chmod +x ./kind | |
| sudo mv ./kind ${kind_bin_path} |
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 | kubectl apply -f - | |
| apiVersion: extensions/v1beta1 | |
| kind: DaemonSet | |
| metadata: | |
| name: disk-checker | |
| labels: | |
| tier: monitoring | |
| app: disk-checker | |
| version: v1 | |
| spec: |
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
| #!/bin/bash | |
| node=${1}; | |
| k uncordon ${node} |
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
| #!/bin/bash | |
| # vault server -dev -dev-root-token-id="root" | |
| policy_name=mypolicy | |
| # export VAULT_ADDR='http://127.0.0.1:8200'; | |
| # pre-validation | |
| vault secrets list | |
| vault policy list | |
| # add policy |
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: v1 | |
| kind: Pod | |
| spec: | |
| # dnsConfig: | |
| # options: | |
| # - name: ndots | |
| # value: "1" | |
| containers: | |
| - name: dind | |
| image: abdennour/docker:19-dind-bash |
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
| #!/bin/bash | |
| team=${1}; | |
| repos_list_file=${2}; | |
| while read repo; do | |
| if [[ ! -d "$repo" ]]; then | |
| echo $repo clone... | |
| git clone git@bitbucket.org:${team}/${repo}.git; | |
| TIMEOUT=$((5 + RANDOM % 10)); |
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 perl:5-slim | |
| WORKDIR /data | |
| COPY myfile.txt . | |
| RUN perl -pe 's/\$([_A-Z]+)/$ENV{$1}/g' < myfile.txt > /tmp/myfile.txt | |
| RUN perl -pe 's/\$(\{)?([a-zA-Z_]\w*)(?(1)\})/$ENV{$2}/g' < /tmp/myfile.txt > myfile.txt | |
| # Only substitute variable that are defined perl -pe 's{\$(\{)?(\w+)(?(1)\})}{$ENV{$2} // $&}ge' |
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
| #!/bin/bash | |
| # Available SYNTAX: | |
| # --- $0 /path/file | |
| # --- $0 < /path/file | |
| # --- echo "my content" | $0 | |
| # either comes from first argument or from /dev/stdin. | |
| content_to_replace="${1:-/dev/stdin}" |
