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
@rem *************************************************************************
@rem This script is used to set up your environment for development.
@rem It sets the following variables:
@rem
@rem
@rem JAVA_HOME - Location of the version of Java that you want to use for development.
@rem This variable must point to the root directory of a JDK
@rem installation and will be set for you by the installer.
@rem PATH - Adds the JDK and tool directories to the system path.
@rem CLASSPATH - Adds the JDK and tool jars to the classpath.
@willis7
willis7 / JenkinsHUD.groovy
Created December 17, 2013 13:50
A simple script for collecting the latest Jenkins build information, parsing it and writing it to the console in HTML format. Requires commons-codec-1.8.jar and commons-httpclient-3.1.jar on the classpath.
import org.apache.commons.httpclient.*
import org.apache.commons.httpclient.auth.*
import org.apache.commons.httpclient.methods.*
import groovy.xml.MarkupBuilder
def server = "localhost"
def port = 8093
def jenkinsHost = "https://${server}:${port}"
@willis7
willis7 / systemd-cheat-sheet.md
Last active November 17, 2022 10:11
Systemd Cheat Sheet

The most notable distribution using systemd is Fedora. Though it is used by many others. Additionally, with Debian having chosen to go with systemd over upstart, it will become the defacto upstart system for most distributions (ubuntu has already announced they will be dropping upstart for systemd).

Common Systemd Commands

  • systemctl -- list all known services
  • systemd-analyze blame -- time spent by each task during the boot process
  • systemd-analyze critical-chain -- list of the critical chain of tasks during the boot process
  • systemctl list-dependencies -- the list of the dependencies
    • systemctl list-dependencies sshd.service -- list sshd dependencies
    • systemctl list-dependencies graphical.target | grep target -- dependencies for a particular target
  • systemctl daemon-reload -- reload the configuration
@willis7
willis7 / runWLST.gradle
Created November 1, 2013 12:00
Running a wlst script from gradle.
configurations {
weblogic
}
dependencies {
weblogic "com.oracle.weblogic:wlfullclient:10.3"
}
task runWLST << {

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 / 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=""