Skip to content

Instantly share code, notes, and snippets.

Guy Elsmore-Paddock GuyPaddock

Block or report user

Report or block GuyPaddock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
GuyPaddock /
Created Oct 12, 2018
Demo of how sequential iterators behave with parallel streams in Java 8
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TestIterators {
public static void main(String[] args) {
List<String> strings =
GuyPaddock / idm-5.5--01--run-as-root.sql
Last active Jun 13, 2018
Wren:IDM 5.5 SQL Install Script for Postgres SQL
View idm-5.5--01--run-as-root.sql
-- Run this script as the Postgres ROOT user
-- Replace the following variables before you do:
-- PASSWORD_YOU_WANT - Should be the password you want to use for the
-- Wren:IDM user. DO NOT USE "openidm" as a
-- password.
-- ROOT_USER_ACCOUNT_NAME - Should be the name of the root account you are
-- logged-in as currently.
GuyPaddock / RSA-OAEP--A128CBC--openidm.rb
Last active Apr 26, 2018
How to use AES/CBC/PKCS5Padding and RSA/ECB/OAEPWithSHA-1AndMGF1Padding with Ruby 2.0.0 and Java
View RSA-OAEP--A128CBC--openidm.rb
# The ONLY example on the web of using Ruby 2.0.0 to encrypt a password with the
# hybrid encryption required for interoperability with ForgeRock OpenIDM / Wren
# Security Wren:IDM.
# In this example, a password is first encrypted with a symmetric,
# 128-bit AES cipher in cipher-block-chaining (CBC) mode. The symmetric cipher
# is initialized with a random "session key" (i.e. a random symmetric encryption
# key). Then, the RSA public key of an SSL certificate is used to encrypt
# that encryption key.
GuyPaddock / verify_ssl_cert.rb
Created Mar 8, 2018
Verifying SSL certificates with Ruby and OpenSSL
View verify_ssl_cert.rb
# This will only run in `irb -ropenssl`
require "socket"
require "openssl"
host = ""
port = 443
cert_store =
GuyPaddock / have_validation_errors.rb
Created Feb 13, 2018
An RSpec matcher for doing precise checks on active model validations errors.
View have_validation_errors.rb
# An RSpec matcher for checking Rails validation errors on an object.
# Usage:
# # Expect exactly three validation errors:
# # - field1 must not be empty
# # - field1 must be a number
# # - field2 must be greater than zero
# expect(x).to have_validation_errors
# .related_to(:field1)
GuyPaddock / simple_table.rb
Last active Nov 22, 2017
Enhanced Simple Table for ActiveAdmin + Arbre
View simple_table.rb
module ActiveAdmin
module Views
# Exposes Arbre's table support as a simple control for use in ActiveAdmin.
# Example usage:
# ```
# simple_table [ [ "User count", User.count ],
# [ "Item count", Item.count ],
# [ "Total Wishes", Wish.count ],
GuyPaddock / opendj.log
Created Jul 25, 2017
Debian dpkg behavior for all cases
View opendj.log
# Deps available; regular install, remove, and purge
dpkg -i opendj-deb-standard-repack.deb
Selecting previously unselected package opendj.
(Reading database ... 128058 files and directories currently installed.)
Unpacking opendj (from opendj-deb-standard-repack.deb) ...
/var/lib/dpkg/ Arguments: install
Setting up opendj (3.0.0) ...
/var/lib/dpkg/info/opendj.postinst Arguments: configure
Processing triggers for ureadahead ...
GuyPaddock /
Last active Apr 18, 2017 — forked from sukharevd/
Script to install JBoss Wildfly 10.x as service in Linux
/usr/bin/authbind --deep /usr/bin/java "$@"
GuyPaddock /
Created Apr 15, 2017
Scripts to package, install locally, and publish ForgeRock projects to the Rosie Artifactory
#Run script first in the same folder from:
function build() {
mvn clean deploy
if [ $? -ne 0 ] ; then
exit 1;
GuyPaddock / gradle_aop_agent.gradle
Created Mar 25, 2017
Getting Gradle to resolve path to agent dependencies
View gradle_aop_agent.gradle
// BEGIN: Dynamic agent JAR config
configurations {
// END: Dynamic agent JAR config
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
You can’t perform that action at this time.