Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / gist:8d576858dea79d6bd27b
Created April 7, 2015 21:55
Additional fixes for the Toolbar in the Progressive premium theme for Drupal 7.
.toolbar.fixed-header.hidden-top .header {
margin-top: 1em;
}
.toolbar-drawer.fixed-header.hidden-top .header {
margin-top: 3em;
}
@GuyPaddock
GuyPaddock / opendj-server-legacy-pom.xml
Last active December 4, 2016 09:34
Modified OpenDJ Legacy Maven Build to include (Q)uick profile
<?xml version="1.0" encoding="UTF-8"?>
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
@GuyPaddock
GuyPaddock / gradle_aop_agent.gradle
Created March 25, 2017 15:52
Getting Gradle to resolve path to agent dependencies
// BEGIN: Dynamic agent JAR config
configurations {
runtimeAgent
}
// END: Dynamic agent JAR config
buildscript {
ext {
springBootVersion = '1.5.2.RELEASE'
}
@GuyPaddock
GuyPaddock / deployAM13.sh
Created April 15, 2017 19:00
Scripts to package, install locally, and publish ForgeRock projects to the Rosie Artifactory
#!/bin/bash
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e
function build() {
mvn clean deploy
if [ $? -ne 0 ] ; then
exit 1;
fi
}
@GuyPaddock
GuyPaddock / java_authbind.sh
Last active April 18, 2017 17:28 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
/usr/bin/authbind --deep /usr/bin/java "$@"
@GuyPaddock
GuyPaddock / opendj.log
Created July 25, 2017 20:46
Debian dpkg behavior for all cases
# 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/tmp.ci/preinst Arguments: install
Setting up opendj (3.0.0) ...
/var/lib/dpkg/info/opendj.postinst Arguments: configure
Processing triggers for ureadahead ...
@GuyPaddock
GuyPaddock / simple_table.rb
Last active November 22, 2017 05:16
Enhanced Simple Table for ActiveAdmin + Arbre
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
GuyPaddock / have_validation_errors.rb
Created February 13, 2018 04:07
An RSpec matcher for doing precise checks on active model validations errors.
##
# 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
GuyPaddock / verify_ssl_cert.rb
Created March 8, 2018 22:52
Verifying SSL certificates with Ruby and OpenSSL
# This will only run in `irb -ropenssl`
require "socket"
require "openssl"
host = "comodo.com"
port = 443
cert_store = OpenSSL::X509::Store.new
cert_store.set_default_paths
@GuyPaddock
GuyPaddock / RSA-OAEP--A128CBC--openidm.rb
Last active January 25, 2021 16:57
How to use AES/CBC/PKCS5Padding and RSA/ECB/OAEPWithSHA-1AndMGF1Padding with Ruby 2.0.0 and Java
##
# 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.