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 | |
INSTANCE_PREFIX=${INSTANCE_PREFIX:?'provide the damn naming prefix of the instances'} | |
PROJECT=${PROJECT:?'provide the damn gcp project'} | |
IFS=$'\n' | |
declare -a disks_to_remove | |
for uid in $(oc get pvc --all-namespaces -o jsonpath='{range .items[*]}{@.metadata.uid}{"\n"}'); do | |
IFS=$'\n' | |
for disk in $(gcloud --project $PROJECT compute disks list --filter="name~$uid" --format="csv[no-heading](name,zone)"); do |
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
INSTANCE_PREFIX=${INSTANCE_PREFIX:?'Provide instance prefix'} | |
#!/bin/bash | |
while IFS= read -r image | |
do | |
echo "Removing $image" | |
gcloud --quiet compute images delete "$image"; | |
done < <(gcloud compute images list --filter=name=$INSTANCE_PREFIX | sed '1d'| awk '{ print $1 }') |
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_all_images_with_versions_json_array() { | |
oc projects -q \ | |
| xargs -I {} oc get -n {} dc -o json \ | |
| jq -r '.items[].spec.template.spec.containers[].image' \ | |
| awk -F: '$1 !~ /docker-registry.default.svc/ {print "{\"name\": \"" $1 "\", \"version\": \"" $2 "\"}"}' \ | |
| jq --slurp | |
} |
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 tqdm import trange | |
from time import sleep | |
from random import choice | |
POMODORO_IN_MILLIS = 1000 * 60 * 25 | |
colors = ["red", "green", "blue", "yellow", "magenta", "cyan", "white"] | |
pomodoros = 0 | |
while pomodoros < 4: | |
if pomodoros != 0: |
OlderNewer