Drop this into ~/.claude/settings.json (merge with existing keys — don't replace the whole file).
{
"hooks": {
"Stop": [Available OS: windows, linux (probably darwin for macOS, not tested though)
Available arch: x86_64 (others not tested)
Note: You can try to mix and match values from both lists above, there is no guarantee of success though, even though it should very likely work.
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define da_append(xs, x) \ | |
| do { \ | |
| if ((xs)->count >= (xs)->capacity) { \ | |
| if ((xs)->capacity == 0) (xs)->capacity = 256; \ | |
| else (xs)->capacity *= 2; \ | |
| (xs)->items = realloc((xs)->items, (xs)->capacity*sizeof(*(xs)->items)); \ | |
| } \ |
| This uses llm.datasette.io and OpenAI. | |
| I use `git commit --template` to provide the output from the LLM to Git. This way, if you do not like the results, you | |
| can quit your editor and no commit will be made. | |
| # Shell function for generating a diff and editing it in your default editor: | |
| gcllm() { | |
| GIT_DIR="$(git rev-parse --git-dir)" | |
| TEMPLATE="$GIT_DIR/COMMIT_EDITMSG_TEMPLATE" |
See the new site: https://postgresisenough.dev
| FROM golang:1.21.0-bullseye as builder | |
| COPY . /workdir | |
| WORKDIR /workdir | |
| ENV CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" | |
| ENV GOFLAGS="-buildmode=pie" | |
| RUN go build -ldflags "-s -w" -trimpath ./cmd/app |
| #!/bin/bash | |
| set -x | |
| function setenv-all-pods() { | |
| echo | |
| DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o jsonpath='{.items[*].metadata.name}') | |
| echo "Set Log4J setting for all pods by overriding LOG4J_FORMAT_MSG_NO_LOOKUPS with true." | |
| for deployment_name in $DEPLOYMENT_LIST; do | |
| kubectl -n $1 set env deployment $deployment_name LOG4J_FORMAT_MSG_NO_LOOKUPS="true" | |
| done |
DISCLAIMER #1: THIS GIST IS INFORMATIONAL ONLY AND NOT A COMPLETE SECURITY GUIDANCE. Use this data with care, and please recheck the commits if you want to cite them as the source.
DISCLAIMER #2: JDK MITIGATIONS ARE NOT THE WHOLE STORY. THE REAL FIX IS IN LOG4J, UPGRADE TO AT LEAST 2.15.0 OR SET log4j2.formatMsgNoLookups=true.
There might be more vectors than these mitigations cover. JDK mitigations shrink the attack surface, but they are not guaranteed to solve everything. I only checked this mitigates a few simple proof-of-concepts.
*TL;DR: Use JDK update releases that are less than 3 years old, and all known mitigations are there.