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
| # Compress a directory | |
| tar -zcvf archive-name.tar.gz directory-name | |
| # Extract files | |
| tar -xzvf file.tar.gz |
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
| aws eks update-kubeconfig --name example --profile named-profile |
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
| eksctl utils associate-iam-oidc-provider --cluster <cluster_name> --approve |
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
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python |
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 | |
| python3 -m venv /path/to/new/virtual/environment |
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 | |
| set -x | |
| pip install -r /path/to/requirements.txt |
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 | |
| # 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" |
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 | |
| # 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 |
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 | |
| kubectl scale --replicas=0 deployment/<your-deployment> |