Skip to content

Instantly share code, notes, and snippets.

#! perl
# This extension implements vim like scrollback buffer navigation, search, and
# paste. Initially based on the searchable-scrollback extension and some gf
# related code borrowed from the matcher extension.
#
# Copyright (C) 2007 - 2013 Eric Van Dewoestine
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
apiVersion: jenkins.io/v1alpha2
kind: Jenkins
metadata:
name: custom
spec:
groovyScripts:
configurations:
- name: jenkins-operator-user-configuration-sporting
configurationAsCode:
configurations:
apiVersion: jenkins.io/v1alpha2
kind: Jenkins
metadata:
name: custom
spec:
groovyScripts:
configurations:
- name: jenkins-operator-user-configuration-sporting
configurationAsCode:
configurations:
@bechampion
bechampion / cast.go
Created October 23, 2019 10:11
cast golang
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type FruitBasket struct {
Name string
rm -rf .terraform
TC=" -no-color"
terraform init
Initializing modules...
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-01-spoke-rms-uat...
- cassandra-01-spoke-rms-uat in .terraform/modules/cassandra-01-spoke-rms-uat
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-02-spoke-rms-uat...
- cassandra-02-spoke-rms-uat in .terraform/modules/cassandra-02-spoke-rms-uat
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-03-spoke-rms-uat...
- cassandra-03-spoke-rms-uat in .terraform/modules/cassandra-03-spoke-rms-uat
rm -rf .terraform
TC=" -no-color"
terraform init
Initializing modules...
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-01-spoke-rms-prod...
- cassandra-01-spoke-rms-prod in .terraform/modules/cassandra-01-spoke-rms-prod
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-02-spoke-rms-prod...
- cassandra-02-spoke-rms-prod in .terraform/modules/cassandra-02-spoke-rms-prod
Downloading git@github.com:sportingsolutions/SS.Terraform.Module.Instances.git for cassandra-03-spoke-rms-prod...
- cassandra-03-spoke-rms-prod in .terraform/modules/cassandra-03-spoke-rms-prod
#!/bin/bash
#Caching meh
[[ -f /tmp/bmgprojcache ]] || touch /tmp/bmgprojcache
[[ -f /tmp/bmgvmcache ]] || touch /tmp/bmgvmcache
#if file is not even populated
if [[ $(find /tmp/bmgprojcache -mmin +60 -print) || $(wc /tmp/bmgprojcache | awk '{ print $1}') == 0 ]]
then
echo "re-caching projects"
gcloud projects list --format=json | jq '.[].projectId' -r > /tmp/bmgprojcache
CREDS="user:password"
SOURCE="http://localhost:8081"
DEST="http://localhost:8081"
for i in $(curl -s -H"Content-Type: application/json" -u ${CREDS} $SOURCE/service/rest/v1/repositories | jq '.[]|select(.format=="apt" or .format=="yum")|select(.type=="proxy" or .type=="group")|.name+","+.format+","+.type' -r)
do
IFS="," read -r NAME FORMAT TYPE < <( echo $i)
JJ=$(curl -s -H"Content-Type: application/json" -u ${CREDS} ${SOURCE}/service/rest/v1/repositories/${FORMAT}/${TYPE}/${NAME} | jq -c '.name=.name+"_v2"')
echo ${JJ}
curl -s -H"Content-Type: application/json" -u ${CREDS} ${SOURCE}/service/rest/v1/repositories/${FORMAT}/${TYPE} -d @<(echo ${JJ})
done
CREDS="user:password"
SOURCE="http://10.14.232.51:8081"
DEST="http://localhost:8081"
for i in $(curl -s -H"Content-Type: application/json" -u ${CREDS} $SOURCE/service/rest/v1/blobstores | jq '.[].name | select(contains("bmg"))' -r)
do
BB=$(curl -s -H"Content-Type: application/json" -u ${CREDS} ${SOURCE}/service/rest/v1/blobstores/google/${i} | jq -c '.name=.name+"_v2"| .bucketName=.bucketName+"_v2" | .credentialFilePath="/opt/sonatype/nexus/creds/gcp.json"| del(.softQuota)')
curl -vvv -H"Content-Type: application/json" -u ${CREDS} ${SOURCE}/service/rest/v1/blobstores/google/ -d @<(echo ${BB})
done