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
GuyPaddock / HOWTO.md
Last active Jun 9, 2019
WIP: Configure RRAS on Server 2016 when Anywhere Access VPN is Enabled
View HOWTO.md

If you enable Anywhere Access VPN in WSE 2016, you will no longer be able to access RRAS admin UI. The message "Legacy mode is disabled" appears. This is because Access Anywhere configures the VPN in WS in a way that cannot be represented in the legacy UI. This makes it nearly impossible to setup other RRAS functionality like NAT or RAS, and there does not appear to be PowerSell cmdlets to address these gaps.

As a workaround, do not use Anywhere Access VPN. Instead, configure VPN manually in the RRAS admin UI. If you need to enable NAT + VPN, you will need to take special care to configure NAT first. For some reason, configuring NAT + VPN in one step leads to the NAT not functioning properly.

@GuyPaddock
GuyPaddock / HOWTO.md
Created Nov 16, 2018
WIP: Installing FileMaker Server 17 on Windows Server Essentials 2016
View HOWTO.md

Two services conflict with FileMaker Server 17 on ports 80 and 443:

  • IIS Web Site for Windows Server Essentials Connect (i.e. http://YOURSERVER/connect and https://YOURSERVER/remote) is bound on *:80 and *:443.
  • BranchCache (part of Windows Server) is bound on *:80 (and somehow is able to share that port with IIS).

Need to:

  • Move Windows Server Essentials to a different set of ports (temporarily), via IIS Admin Console.
  • Stop BranchCache (temporarily)

The goal is to trick the FileMaker Server installer into proceeding with install, so we can then tweak the IIS config AFTER install.

@GuyPaddock
GuyPaddock / render.sh
Created Nov 6, 2018
2017-10-19 - Render PHP Files to HTML in Bulk through CLI
View render.sh
#!/bin/env bash
for f in $(find . -maxdepth 1 -name '*.php'); do
directory=$(dirname "${f}");
basename=${f%.*}
mkdir -p "../rendered/${directory}";
php -f "${f}" > "../rendered/${basename}.html";
done
@GuyPaddock
GuyPaddock / filter.sh
Created Nov 6, 2018
2017-10-19 - Eliminate Zero-width Spaces (\u200b) from PHP Source Files
View filter.sh
#!/bin/env bash
for f in $(find . -name '*.php'); do
directory=$(dirname "${f}");
mkdir -p "../processed/${directory}";
cat "${f}" | tr "$(printf %b '\u200b')" " " > "../processed/${f}";
done
@GuyPaddock
GuyPaddock / TestIterators.java
Created Oct 12, 2018
Demo of how sequential iterators behave with parallel streams in Java 8
View TestIterators.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
public class TestIterators {
public static void main(String[] args) {
List<String> strings =
@GuyPaddock
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
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
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 = "comodo.com"
port = 443
cert_store = OpenSSL::X509::Store.new
cert_store.set_default_paths
@GuyPaddock
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
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 ],
You can’t perform that action at this time.