botanikanet / get_prj_name_by_id.sh
0 likes
0 forks
1 files
Last active 6 days ago
| 1 | #!/bin/bash |
| 2 | # |
| 3 | usage() { |
| 4 | echo "$(basename ${0}) [-h|--help] [-t|--token-file=<file>] [-g|--gitlab-url=<url>] ID" |
| 5 | echo "Get project name from Gitlab by id" |
| 6 | echo " --help | -h Print this help" |
| 7 | echo " --token-file= | -t <file> Set file with Gitlab token" |
| 8 | echo " --gitlab-url=* | -g <url> Set Gtilab URL" |
| 9 | exit 1 |
| 10 | } |
botanikanet / get_group_src.sh
0 likes
0 forks
1 files
Last active 6 days ago
| 1 | #!/bin/bash |
| 2 | |
| 3 | function usage { |
| 4 | echo "basename ${0} Get src of group in Gitlab" |
| 5 | echo "--help | -h Print this help" |
| 6 | echo "--token-file= | -t <file> Set file with Gitlab token" |
| 7 | echo "--gitlab-url=* | -g <url> Set Gtilab URL" |
| 8 | echo "--group-id=* | -i <id> Set group id" |
| 9 | exit 1 |
| 10 | } |
botanikanet / get_all_src.sh
0 likes
0 forks
1 files
Last active 6 days ago
| 1 | #!/bin/bash |
| 2 | set -ex |
| 3 | |
| 4 | usage() { |
| 5 | echo "basename ${0} get all src from Gitlab" |
| 6 | echo "--help | -h Print this help" |
| 7 | echo "--token-file= | -t <file> Set file with Gitlab token" |
| 8 | echo "--gitlab-url=* | -g <url> Set Gtilab URL" |
| 9 | exit 1 |
| 10 | } |
botanikanet / k8s_get_all
0 likes
0 forks
1 files
Last active 4 months ago
| 1 | (echo KIND NAMESPACE NAME UID CREATED; kubectl api-resources --verbs=list --namespaced -o name | xargs -I {} kubectl get {} --namespace dns-manager --ignore-not-found -o custom-columns=KIND:.kind,NAMESPACE:.metadata.namespace,NAME:.metadata.name,UID:.metadata.uid,CREATED:.metadata.creationTimestamp --sort-by=.kind --no-headers) | column -t |
botanikanet / create_mr_from console
0 likes
0 forks
1 files
Last active 4 months ago
Создание MR из консоли
| 1 | git push -o merge_request.create -o merge_request.title="<Your MR Title>" -o merge_request.description="<Your MR Description>" origin <your-feature-branch> |
botanikanet / replace apt repo
0 likes
0 forks
1 files
Last active 4 months ago
| 1 | sed -i "s/\/[a-z]\+\.ubuntu\.com/\/mirror\.yandex\.ru/g" /etc/apt/sources.list |
botanikanet / ECR Cleanup
0 likes
0 forks
1 files
Last active 4 months ago
| 1 | aws ecr get-login-password | docker login --username AWS --password-stdin $(aws ecr describe-registry --query registryId --output text).dkr.ecr.eu-west-1.amazonaws.com |
| 2 | for REPOSITORY in $(aws ecr describe-repositories | jq -r '.repositories[].repositoryName'); do echo "${REPOSITORY}"; aws ecr describe-images --repository-name ${REPOSITORY} | jq --arg pull_t $(date +%Y-%m-%dT00:00:00 -d '1 months ago') --arg push_t $(date +%Y-%m-%dT00:00:00 -d '3 months ago') '.imageDetails|sort_by(.imagePushedAt) [:-20] | .[] | select(.lastRecordedPullTime? | . <= $pull_t ) | select(.imagePushedAt | . <= $push_t ) | "imageDigest=\(.imageDigest)"' | tr '\n' ' ' | xargs -n 99 -r aws ecr batch-delete-image --no-cli-pager --repository-name ${REPOSITORY} --image-ids; done |
botanikanet / kubectl get nodes with labels
0 likes
0 forks
1 files
Last active 4 months ago
Получить все ноды с конкретным label
| 1 | kubectl get nodes --label-columns topology.ebs.csi.aws.com/zone --label-columns node_type |
Newer
Older