Skip to content

Instantly share code, notes, and snippets.

@gschueler
gschueler / keygen.groovy
Created July 13, 2023 17:51
generate random key
import java.security.*;
def len=256
if(args.length>0){
len = Integer.parseInt(args[0])
}
byte[] sharedKey = new byte[len]
new SecureRandom().nextBytes(sharedKey)
@gschueler
gschueler / bc-providers.groovy
Created September 6, 2022 21:47
List PBE providers for Jasypt with BouncyCastle and groovy
@Grab('org.jasypt:jasypt:1.9.3')
import org.jasypt.registry.AlgorithmRegistry
@Grab('org.bouncycastle:bcprov-jdk15on:1.70')
import org.bouncycastle.jce.provider.BouncyCastleProvider
import java.security.Security
Security.addProvider(new BouncyCastleProvider());
Set digestAlgos = AlgorithmRegistry.getAllDigestAlgorithms();
Set pbeAlgos = AlgorithmRegistry.getAllPBEAlgorithms();
@gschueler
gschueler / gotchas.md
Created June 15, 2019 00:18
Groovy gotchas

an incomplete list of gotchas while using the Groovy language

for vs each

def findItem(key){
	def defval='some value'
	someMap.each{k,v->
		if(k.startsWith(key)){
			return v

}

enable debug logging for rundeck grails controller in rundeck 3

Create a file logback.groovy as above.

Launch rundeck with the following jvm system property: logging.config=<path to logback.groovy>

for example:

java -Xmx4g -Dlogging.config=pwd/server/config/logback.groovy -jar rundeck-3.0.20-20190408.war

@gschueler
gschueler / Overview.md
Last active June 7, 2017 15:36
Dev blog for data capture/data passing feature for Rundeck

Goals:

Data passing: Workflow steps can export data values that are made available to subsequent steps. Data capture: Step logger system can filter/process output log events to extract useful data values and use the data passing feature to pass them along.

Tasks:

Data Passing:

  • Ability to pass data from one step to the next. This will be via a workflow global data context.
@gschueler
gschueler / grails indexes.md
Created April 24, 2017 22:58
Grails indexes (2.x)

Notes on adding index definitions to Grails 2 domain classes

Add an index named MY_INDEX to two columns:

Inside your Domain class:

static mapping={
@gschueler
gschueler / Dockerfile
Created March 13, 2017 19:07
rundeck ubuntu 16.04
FROM ubuntu:16.04
RUN apt-get -y update && \
apt-get -y install openjdk-8-jdk apt-transport-https curl openssh-client uuid-runtime
ENV RDECK_BASE=/var/lib/rundeck
RUN mkdir $RDECK_BASE
RUN echo "deb https://rundeck.bintray.com/rundeck-deb /" | tee -a /etc/apt/sources.list
@gschueler
gschueler / gist:c4badb4985cc4badc455ade7f3aeff24
Last active July 14, 2016 18:32
grails 2.5.5 create-app bug
[~/devel/test-g255] 💩 ls
grails-2.5.5 grails-2.5.5.zip
[~/devel/test-g255] 🍺 which grails
/Users/greg/devel/test-g255/grails-2.5.5/bin/grails
[~/devel/test-g255] 🍺 grails create-app --stacktrace
| Configuring classpath
:: problems summary ::
:::: WARNINGS
module not found: org.codehaus.groovy#groovy-all;2.4.4
==== grailsPlugins: tried
@Grapes(
@Grab(group='org.rundeck', module='rundeck-api-java-client', version='13.1')
)
import org.rundeck.api.*;
def rundeck = RundeckClient.builder().url(args[0]).login(args[1],args[2]).build()
//def rundeck = RundeckClient.builder().url(args[0]).token(args[1]).build()
def project=args[3]
def jobs = rundeck.getJobs(project)
@gschueler
gschueler / gist:7f14ab424294286eb677
Created October 21, 2015 22:21
Geb grails functional test error
| Failure: edit page(domain.scheduledExecution.JobEditSpec)
| java.lang.VerifyError: Bad <init> method call from inside of a branch
Exception Details:
Location:
geb/navigator/SearchContextBasedBasicLocator.<init>(Lorg/openqa/selenium/SearchContext;Lgeb/navigator/factory/NavigatorFactory;)V @91: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
0000000: b800 214e 05bd 0004 5903 04bd 0004 5903
0000010: 2b53 b800 2753 5904 2c53 5910 ff12 02b8