Updated: Dec 21, 2020
I’ve personally used these commands to debug in production. I also used GUI methods like k9s and lenses.io.
kubectl get pods --as-group="somecompany:somecompany-teamname" --as="test"
| select AURORA_VERSION(); | |
| select @@aurora_version; | |
| show variables like '%version'; |
| #!/bin/bash | |
| # Symlink a file | |
| ln -s [path of the target file] [symbolic name] | |
| # example | |
| ln -s my_folder/my_doc.txt my_document | |
| # Symlink a directory | |
| ln -s source_folder destination_folder |
| #!/bin/bash | |
| kubectl autoscale deployment <name-of-deployment> --cpu-percent=75 --min=2 --max=10 |
| #!/bin/bash | |
| # List installed JDK versions | |
| /usr/libexec/java_home -V | |
| # Export in current session | |
| export JAVA_HOME=`/usr/libexec/java_home -v <version>` | |
| # Create a function in .bashrc, .zshrc, .zshenv, etc | |
| function switch_openjdk_version() { |
| #!/bin/bash | |
| # List available platforms for building | |
| docker buildx ls | |
| # Create multiple builder instances to build multi-platform with build command | |
| docker buildx create --use | |
| docker buildx build --platform linux/amd64,linux/arm64 --push -t membermatters/membermatters . | |
| # Build for single platform |
| #!/bin/bash | |
| kubectl scale --replicas=0 deployment/<your-deployment> |
| #!/bin/bash | |
| # Prune all unused images | |
| docker image prune --all | |
| # The filtering flag (--filter) format is of “key=value”. If there is more than one filter, then pass multiple flags | |
| docker image prune --filter "foo=bar" | |
| # For more details on the filter flag option see official documentation mentioned in the description | |
| # Prune all unused images with no confirmation |
| #!/bin/bash | |
| # Get image manifest by tag | |
| MANIFEST=$(aws ecr batch-get-image --repository-name amazonlinux --image-ids imageTag=latest --output json | jq --raw-output '.images[0].imageManifest') | |
| # Or | |
| # Get image manifest by digest (this is found on the ECR repo page in the AWS Web Console) | |
| MANIFEST=$(aws ecr batch-get-image --repository-name amazonlinux --image-ids imageDigest=sha256:8e080763aa56a2d509f9614613019ff0d9fe9cfd651b2efdb8961356c9ea6e26 --query 'images[].imageManifest' --output text) | |
| # Update image with new tag | |
| aws ecr put-image --repository-name amazonlinux --image-tag previous.2018 --image-manifest "$MANIFEST" |
| #!/bin/bash | |
| set -x | |
| pip install -r /path/to/requirements.txt |