Skip to content

Instantly share code, notes, and snippets.

@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

}

@gschueler
gschueler / rundeck-2.0.2-h2-upgrade.sh
Last active January 2, 2019 13:58
Upgrade rundeck 2.0.2 h2 database from earlier 2.0.x version.
#!/bin/bash
set -e
#set -x
RDECK_BASE=${RDECK_BASE:-$(pwd)}
CONFFILE=$1
H2JAR=$2
if [ -z "$CONFFILE" ] ; then
if [ -f ${RDECK_BASE}/server/config/rundeck-config.properties ] ; then
CONFFILE=${RDECK_BASE}/server/config/rundeck-config.properties
@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 / Curl job run.md
Created January 18, 2011 04:06
How to run a rundeck job using curl

Run a Job using Curl

This document describes how to use CURL to interact with the RunDeck server to invoke a Job to run.

The steps are as follows:

  1. Authenticate to the RunDeck server and acquire a session cookie.
  2. Submit run request for particular Job ID, sending session cookie.
@gschueler
gschueler / template.sh
Last active July 13, 2017 16:30
bash template
#!/bin/bash
#/ does something ...
#/ usage: [..]
set -euo pipefail
IFS=$'\n\t'
readonly ARGS=("$@")
# <http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/>
# <http://redsymbol.net/articles/unofficial-bash-strict-mode/>
@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 / policy1.yaml
Last active May 4, 2017 17:27
example restriction for group to set of jobs
description: Admin, all access.
context:
project: '.*' # all projects
for:
resource:
- allow: '*' # allow read/create all kinds
adhoc:
- allow: '*' # allow read/running/killing adhoc jobs
job:
- match:
@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 / 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
@gschueler
gschueler / aclpolicy-template.yaml
Created September 24, 2013 20:56
template aclpolicy file
description: Project scope for group
context:
project: '.*'
for:
job:
- equals:
group: 'example'
name: 'Restart'
allow: [run,read]
- equals: