Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
jamiejackson / mailcatcher.service
Created January 6, 2016 19:34
MailCatcher Systemd Service / Daemon
[Unit]
Description=MailCatcher Service
After=network.service vagrant.mount
[Service]
Type=simple
ExecStart=/usr/local/bin/mailcatcher --foreground --ip 10.0.2.15
[Install]
WantedBy=multi-user.target
@jamiejackson
jamiejackson / Dockerfile
Created August 21, 2023 20:44
Ortus Redis Extension Causes Problem with Bundles Page in Lucee Server Admin
ARG LUCEE_TAG
FROM lucee/lucee:$LUCEE_TAG
RUN echo 'p' > /opt/lucee/server/lucee-server/context/password.txt
ENV LUCEE_EXTENSIONS ${LUCEE_EXTENSIONS},5C558CC6-1E67-4776-96A60F9726D580F1;name=Ortus Redis Cache;version=3.0.0.41
RUN prewarm.sh

Timeouts

Overview

This will serve to document various timeouts, what they're used for, and project-specific decisions as to their use/values.

Timeout Layers

In order to manage long running processes gracefully, we want to control when a request will be killed in different scenarios. The following table documents the different layers of the application stack and their associated timeout values.

| Step | Technology | Timeout | Notes |

@jamiejackson
jamiejackson / README.md
Last active June 8, 2023 16:27
Upgrade a Docker Secret in a Running Swarm Service

Update: I'm using this strategy, at the moment: https://github.com/jamiejackson/docker-secret-hash


This is a helper script for updating a secret in a running service. It does cause the service containers to restart (there's no avoiding that), but it does so as elegantly/conveniently as I know how.

See the motivation for this script, as well as alternatives, here.

Caveat:

  • Secret names with a length approaching 64 characters might exhibit weird behavior, as this relies on a version token being tacked onto the secret name. Since the secret name is truncated to 64 characters, a long name might result in a smaller (or nonexistent) version token, leading to uniqueness problems and unexpected behavior.
@jamiejackson
jamiejackson / README.md
Last active May 22, 2023 08:32
Terraform Masks Changes Even to Resources/Blocks that Don't Have Sensitive Information

I believe this applies to other resource/block types, but once you add a sensitive value to any aws_cloudfront_distribution's origin blocks. Changes to any aws_cloudfront_distribution's origin block will be masked in terraform plan output.

This hides important diff information from me.

Steps to reproduce:

  1. Spin up a CloudFront distribution using these tf files, in their stock state.
  2. Make a change to the origin_b_nonsensitive origin; e.g., change its origin_read_timeout to 59
  3. terraform plan will show you the diff. Hooray! Happy day!
  4. Use line 3 instead of line 2 to use a sensitive value (which gets used by origin_a_sensitive)
@jamiejackson
jamiejackson / README.md
Last active May 18, 2023 01:40
Read/Write YAML from CFML (Lucee & Adobe ColdFusion)

This is based on Ortus's version, but this returns native CFML arrays/structs.

@jamiejackson
jamiejackson / Dockerfile
Last active May 15, 2023 15:38
FusionReactor 9.2.2 Security Vulnerabilities
FROM alpine as builder
RUN apk add curl
RUN mkdir -p /opt/fusionreactor /opt/fusionreactor/conf \
&& cd /opt/fusionreactor \
&& curl -O https://download.fusionreactor.io/FR/FusionReactor-9.2.2/fusionreactor.jar \
&& curl -O https://download.fusionreactor.io/FR/FusionReactor-9.2.2/libfrjvmti_x64.so
FROM scratch
@jamiejackson
jamiejackson / readme.md
Last active March 7, 2023 22:39
Fender Champion 2 Button Foot Switch - 0071359000 - Channel and Effects

image image

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
setting 'cloudfront_access_token' var
${HOSTNAME} ${HOME} ${PKG_RELEASE} ${cloudfront_access_token} ${NGINX_VERSION} ${PATH} ${NJS_VERSION} ${PWD}
/docker-entrypoint.d/20-envsubst-on-templates.sh: 37: 3: Bad file descriptor
<cfscript>
thread name="createObjectThread" {
thread.hello = "foo";
sleep(40);
}
keepLooping = true;
loopTimeout = 20; // (ms)
while (keepLooping) {
if (createObjectThread.elapsedTime > loopTimeout) {