Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / idm-5.5--01--run-as-root.sql
Last active June 13, 2018 19:55
Wren:IDM 5.5 SQL Install Script for Postgres 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 / TestIterators.java
Created October 12, 2018 15:21
Demo of how sequential iterators behave with parallel streams in Java 8
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 / filter.sh
Created November 6, 2018 16:51
2017-10-19 - Eliminate Zero-width Spaces (\u200b) from PHP Source Files
#!/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 / render.sh
Created November 6, 2018 16:52
2017-10-19 - Render PHP Files to HTML in Bulk through CLI
#!/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 / HOWTO.md
Created November 16, 2018 20:43
WIP: Installing FileMaker Server 17 on Windows Server Essentials 2016

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 / HOWTO.md
Last active December 23, 2020 23:46
WIP: Configure RRAS on Server 2016 when Anywhere Access VPN is Enabled

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 / backup.sh
Last active December 11, 2018 19:18
Crude HP Touchpad WebOS Backup Script (run with `nohup` for best results over SSH; errors appear in errors.log)
#!/usr/bin/env sh
cd /media/cryptofs
tar -cvpjf webos-backup.tbz2 \
--exclude=/proc \
--exclude=/media/internal \
--exclude=/tmp \
--exclude=/dev \
--exclude=/sys \
--exclude=/var/run \
--exclude=/media/cryptofs/webos-backup.tbz2 \
@GuyPaddock
GuyPaddock / split_zip.sh
Last active March 18, 2019 15:22
Split a ZIP archive for Drupal Feeds Fetcher Archive + CSV into separate archives < 100 MB each (needed for Pantheon)
#!/usr/bin/env bash
##
# @file
# Asset Zip Splitter
#
# Splits a ZIP archive containing the following file structure into separate
# archives that contain no more than 100 MB each:
# - *.csv (CSV files that reference image files)
# - images/ (a folder of images referenced by the image files)
@GuyPaddock
GuyPaddock / print-time-and-checksum.sh
Created May 3, 2019 01:59
Calculate checksum over kubectl bash without timing out
#!/usr/bin/env bash
(while true; do date; sleep 1; done) &
sha1sum * | tee checksums.txt
@GuyPaddock
GuyPaddock / instructions.md
Last active September 24, 2023 08:05
Creating default Windows Theme

Introduction

This is a brief snippet for Windows 10 admins that want to make a Windows theme the default for new users without enforcing it via Group Policy.

Instructions

  1. Download and install the desired theme from the Windows Store (or create your own).
  2. Find the theme under %USERPROFILE%\AppData\Local\Microsoft\Windows\Themes\.
  3. Move .theme file to %SystemRoot%\Resources\Themes.
  4. Move backgrounds into %SystemRoot%\Resources\Themes\THEME_NAME\DesktopBackground. Any other theme files (like sounds, etc) should be copied to appropriate folders under %SystemRoot%\Resources\Themes\THEME_NAME.
  5. Open .theme file up for editing.
  6. Remove ImagesRootPIDL setting under Slideshow section of the file.