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
// ########################################################################## | |
// # REST API jenkinsfile + oracle client | |
// ########################################################################## | |
// # Mantainer rcbpeixoto@gmail.com | |
// ########################################################################## | |
env.DOCKER_TAG="${params.BRANCH}" | |
env.BRANCH="${params.BRANCH}" | |
env.DOCKER_IMAGE="${env.JOB_BASE_NAME}" | |
env.DOCKER_NAME="${env.DOCKER_IMAGE}:${env.DOCKER_TAG}" | |
env.AWS_ENV="${env.DOCKER_IMAGE}-${env.DOCKER_TAG}" |
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
node("${params.BUILD_AGENT}") { | |
stage('Dangling Containers') { | |
sh 'docker ps -q -f status=exited | xargs --no-run-if-empty docker rm' | |
} | |
stage('Dangling Images') { | |
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi' | |
} | |
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
FROM node:8-alpine | |
LABEL MAINTAINER="rcbpeixoto@gmail.com" | |
ARG NODEJS_VERSION="8" | |
ARG IONIC_VERSION="3.20.0" | |
ARG GRADLE_VERSION="3.2" | |
ARG ANDROID_SDK_VERSION="4333796" | |
ARG ANDROID_HOME="/opt/android-sdk" | |
ARG GRADLE_HOME="/opt/gradle" |
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: |
NewerOlder