This file contains 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: |
This file contains 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 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 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 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
#!/usr/bin/env python3 | |
"""Nexus Artifact Downloader | |
Search and download nexus artifacts. | |
Usage: | |
./artifact-downloader.py download [options] | |
./artifact-downloader.py search [options] | |
./artifact-downloader.py (-h | --help) | |
./artifact-downloader.py --version |
This file contains 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/sh | |
# Darkify Slack on Mac OS: | |
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh | |
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js" | |
# Thanks to: https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99#gistcomment-2358430 | |
if [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then | |
# Backup original CSS for reverts: |
This file contains 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
#!/usr/bin/env bash | |
function walk() { | |
for secret in $(vault list $1 | tail -n +3) | |
do | |
if [[ ${secret} == *"/" ]] ; then | |
walk "${1}${secret}" | |
else | |
echo "${1}${secret}" | |
fi |
This file contains 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 | |
DRY_RUN=${DRY_RUN:-"true"} | |
ECHO='echo ' | |
OLDPWD=$(pwd) | |
cd ${GITHUB_DIR?:'yo man, provide a damn github root dir'} | |
for dir in $(find . -maxdepth 1 -type d | tail -n +2); do | |
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
if [[ "$(git log $branch --since "2 months ago" | wc -l)" -eq 0 ]]; then | |
if [[ "$DRY_RUN" = "false" ]]; then | |
ECHO="" |
This file contains 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
cd ${GITHUB_REPOS:?} | |
cd ~/kohls/github | |
for dir in $(find . -maxdepth 1 -type d | tail -n +2); do | |
cd $dir | |
git fetch --prune | |
git remote prune origin | |
cd .. | |
done |
NewerOlder