Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
jamiejackson / aws-temp-token.sh
Created November 14, 2019 16:46 — forked from ogavrisevs/aws-temp-token.sh
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@jamiejackson
jamiejackson / README.md
Last active October 21, 2019 17:37
Vagrant Commands Slow to Start (Due to `Generating new plugin set instance. Skip gems - []`)
// plugins/myplugin/Application.cfc
...
// ignore this variable and what it controls. i just didn't want developers inadvertently
// saving rc-scoped queries *on my project*, which could bloat the session
variables.framework.allowQueriesInFlashContext = true;
include template="/hudexchange_deployment_root/lib/org/framework/_fw1_override_mixin.cfm";
...
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.define "vm1" do |machine|
machine.vm.hostname = "vm1"
machine.vm.network "private_network", ip: "192.168.50.77"
end
config.vm.define "vm2" do |machine|
@jamiejackson
jamiejackson / README.md
Created August 22, 2019 17:24
Hack: Set a variable from a trigger in Vagrant

I can't seem to set a variable from a trigger which would be used by a provisioner. Here's a really ugly hack that seems to work.

root@d53bce2e69a0:/# STR="My horse weighs 3000 kg but the car weighs more"
root@d53bce2e69a0:/# awk -v RS=[0-9]+ '{print RT+0;exit}' <<< "$STR"
0
root@d53bce2e69a0:/# echo $RT
root@d53bce2e69a0:/#
@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
Created September 7, 2018 00:59
Fix jwilder/nginx-proxy for Docker Swarm
FROM jwilder/nginx-proxy
COPY ./nginx.tmpl.patch /tmp/
RUN apt-get update && \
apt-get install -y patch && \
patch < /tmp/nginx.tmpl.patch && \
apt-get remove patch -y && \
apt-get autoremove && \
apt-get clean && \
@jamiejackson
jamiejackson / Dockerfile
Last active July 22, 2018 14:23
Installing CFSpreadsheet Extension in Docker Lucee 5.2
FROM lucee/lucee52:latest
ENV DEPLOY_DIR=/opt/lucee/server/lucee-server/deploy
WORKDIR $DEPLOY_DIR
RUN echo download to deploy dir \
&& curl -O https://raw.githubusercontent.com/Leftbower/cfspreadsheet-lucee-5/master/cfspreadsheet-lucee-5.lex
RUN ls -al "$DEPLOY_DIR" \
&& echo "warmup plugin" \
@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.