Skip to content

Instantly share code, notes, and snippets.

View willis7's full-sized avatar
🏠
Working from home

Sion Williams willis7

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am willis7 on github.
  • I am willis7 (https://keybase.io/willis7) on keybase.
  • I have a public key whose fingerprint is 7599 8310 8F23 EC25 7C04 E092 F6FE BE4A 81C7 CC30

To claim this, I am signing this object:

@willis7
willis7 / Dockerfile
Created October 9, 2020 08:05
Example Dockerfile for use with a Java Spring Boot project built with Docker
FROM openjdk:8-jre-alpine
VOLUME /tmp
ADD build/libs/sdp-spring-boot*.jar app.jar
ADD .env .env
ENTRYPOINT [ "sh", "-c", "source .env && java -jar app.jar" ]
@willis7
willis7 / create_storrageacc_az_tfstate.sh
Last active July 30, 2020 13:18
Create a storage account on Azure for terraform
RESOURCE_GROUP_NAME=devops_tfstate
STORAGE_ACCOUNT_NAME=devops_tfstate$RANDOM
CONTAINER_NAME=github_tfstate
# Create resource group
az group create --name $RESOURCE_GROUP_NAME --location southuk
# Create storage account
az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob
@willis7
willis7 / migrate.sh
Created October 17, 2019 08:21
Mass migrating repositories to GitLab
for repo in $(cat repos.txt);
do git clone $repo --mirror;
slug=$(echo $repo | sed -n 's/.*\/\(.*\).git/\1/p');
cd $slug.git;
git remote add your_remote git@gitlab.com:your_organization/your_project/$slug.git;
git push your_remote --mirror;
cd -;
done
@willis7
willis7 / duplicates
Created August 20, 2018 10:14
search for duplicate words
#!/usr/bin/env perl
# Finds duplicate adjacent words.
use strict ;
my $DupCount = 0 ;
if (!@ARGV) {
print "usage: dups <file> ...\n" ;
@willis7
willis7 / passive_voice.sh
Created August 20, 2018 08:24
A script to find passive voice
#!/bin/bash
irregulars="awoken|\
been|born|beat|\
become|begun|bent|\
beset|bet|bid|\
bidden|bound|bitten|\
bled|blown|broken|\
bred|brought|broadcast|\
built|burnt|burst|\
@willis7
willis7 / weasel_words.sh
Last active August 20, 2018 08:24
A script to find weasel words
#!/bin/bash
weasels="many|various|very|fairly|several|extremely\
|exceedingly|quite|remarkably|few|surprisingly\
|mostly|largely|huge|tiny|((are|is) a number)\
|excellent|interestingly|significantly\
|substantially|clearly|vast|relatively|completely"
wordfile=""
@willis7
willis7 / cf_blue_green_deploy.sh
Created August 3, 2018 10:11
Blue Green Deployment with Cloud Foundry
#!/bin/bash
set -euo pipefail
cf login -a "$CF_API" -u "$CF_USER" -p "$CF_PASSWORD" -o "$CF_ORG" -s "$CF_SPACE"
APP_NAME_TMP="${APP_NAME}-venerable"
# Deploy a new application if doesn't exist and do blue-green otherwise
if [[ $(cf app "$APP_NAME" --guid 2>&1 1>/dev/null) == "App $APP_NAME not found" ]]; then
cf push
else
@willis7
willis7 / configure_sonarqube_runner.groovy
Created July 11, 2018 09:01
This adds a runner that will be installed automatically from Maven central
import jenkins.model.*
import hudson.plugins.sonar.*
import hudson.tools.*
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("hudson.plugins.sonar.SonarRunnerInstallation")
def installer = new SonarRunnerInstaller("[sonar runner version]")
def prop = new InstallSourceProperty([installer])
@willis7
willis7 / configure_sonarqube.groovy
Created July 11, 2018 09:00
Add the Sonar installation
import jenkins.model.*
import hudson.plugins.sonar.*
import hudson.plugins.sonar.model.*
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("hudson.plugins.sonar.SonarPublisher")
def sinst = new SonarInstallation(
"[name of the sonar installation - I use the host name]",