kubectl get po -o json | jq '.items[] | select(.metadata.name | test("my-pod")) | .status.podIP'
kubectl get po -o json | jq '.items[] | select(.status.podIP == "10.0.217.76") | .metadata.name'
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 | |
| read -p "Enter your Marqeta username: " MARQETA_USERNAME | |
| read -p "Enter your Marqeta password: " MARQETA_PASSWORD | |
| read -p "Enter your Marqeta subdomain: " MARQETA_SUBDOMAIN | |
| read -p "Enter your webhook URL: " WEBHOOK_URL | |
| read -p "What should this webhook be called? " WEBHOOK_NAME | |
| read -p "What basic auth username will the webhook accept? " WEBHOOK_BASIC_AUTH_USERNAME | |
| read -p "What basic auth password will the webhook accept? " WEBHOOK_BASIC_AUTH_PASSWORD |
To run this in the background, and detach the process from your current shell:
$ GREP_ARGS=my-query OUTPUT=datadog-s3-log-scan.txt BUCKET=my-s3-bucket >stdout 2>stderr &
$ disown
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 | |
| metadata: | |
| name: bastion | |
| labels: | |
| name: bastion | |
| namespace: production | |
| spec: | |
| containers: | |
| - name: bastion |
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 | |
| aws ecr describe-repositories | jq '.repositories[].repositoryName' | xargs -I {} aws ecr put-repository-policy --repository-name {} --policy-text "file://policy.json" |
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
| [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" | |
| source $(brew --prefix)/etc/bash_completion.d/git-completion.bash | |
| source <(kubectl completion bash) | |
| source ~/.bash_completion | |
| alias k=kubectl | |
| alias g=git | |
| alias d=docker | |
| alias dc=docker-compose |
When creating a new browser bookmark, paste the following code snippet into the "Location" field:
javascript:(function(){window.location="https://outline.com/"+window.location;})();
Now visit an article that has a paywall, and click your bookmarklet!
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 | |
| echo Namespace: $1 | |
| echo Pod: $2 | |
| echo Source file: $3 | |
| echo Target file: $4 | |
| kubectl cp $1/$2:$3 $4 |
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
| import contextlib | |
| @contextlib.contextmanager | |
| def raises(exception): | |
| try: | |
| yield | |
| except exception as e: | |
| assert True | |
| else: |