Skip to content

Instantly share code, notes, and snippets.

View Stono's full-sized avatar
💭
coding!

Karl Stoney Stono

💭
coding!
View GitHub Profile
@Stono
Stono / gemini-pr-review.md
Last active March 5, 2026 18:19
A gemini instructions file for PR reviews

Role and Persona

You are "skippr," AI code review assistant at Autotrader UK. Your persona is that of a constructive, knowledgeable teammate who communicates crisply and professionally. Your primary goal is to find faults and pitfalls in the PR changes, and highlight them with direct, actionable guidance that helps developers improve their code and learn. Maintain an even, matter-of-fact tone. Do not add pleasantries or praise unless it explains a concrete benefit developers should preserve.

You must follow these rules when responding:

  • Do not invite a follow-up conversation, e.g. you should NOT say things like "let me know if you have more questions..." or "I am happy to discuss". This is because you are a one-shot review process; follow-up conversation should happen between other members of the team.
  • Ensure your feedback is actionable and clear. Explain why a change is recommended, not just what to change.
@Stono
Stono / create-docker-tls.sh
Last active February 4, 2026 02:30
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
#!/bin/bash
set -e
# Set Chrome user data directory
CHROME_LOCATION="$HOME/Library/Application Support/Google/Chrome"
# Gather profiles into arrays
profile_dirs=()
profile_labels=()
for profile_dir in "$CHROME_LOCATION"/Default "$CHROME_LOCATION"/Profile* "$CHROME_LOCATION"/Guest*; do
echo "Running $1"
args=("${@:2}") # Collect all arguments except the first one into an array
args_json=$(printf '"%s",' "${args[@]}") # Convert array into JSON format
args_json="[${args_json%,}]" # Remove the trailing comma and wrap in brackets
curl -v -X POST http://127.0.0.1:4000/exec/runs \
-H "Content-Type: application/json" \
-d '{
"cmd": "'$1'",
"args": '"$args_json"',
@Stono
Stono / 99-install-facetime-camera.sh
Created February 27, 2017 10:35
Install the kernal module required for the facetimehd camera to work on Linux
#!/bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
export KERNELRELEASE=${1}
echo "Installing FacetimeHD camera for $KERNELRELEASE"
cd /tmp
git clone https://github.com/patjak/bcwc_pcie.git
@Stono
Stono / gzip-decompressor.yaml
Created February 3, 2024 11:38
Gzip decompression EnvoyFilter
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
annotations:
description: Adds an accept-encoding (gzip) header to outbound requests, decompresses
responses
name: Enable compressed requests between services
name: enforce-compression
spec:
configPatches:
@Stono
Stono / gzip-compressor.yaml
Last active December 17, 2024 18:39
Gzip compression EnvoyFilter
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
annotations:
description: Ensures all Sidecars are capable of returning a gzip response
name: Enable Gzip
name: enable-gzip
namespace: istio-system
spec:
configPatches:
groups:
# These sum(irate()) functions are in separate groups, so they run in parallel
- name: istio.workload.istio_request_duration_milliseconds_bucket
interval: 10s
rules:
- record: workload:istio_request_duration_milliseconds_bucket:rate1m
expr: |
sum(irate(istio_request_duration_milliseconds_bucket{reporter="source", source_workload!=""}[1m]))
by (
@Stono
Stono / shutdown-sidecar-handler.ts
Created July 18, 2023 13:14
shutdown sidecar handler
import { retry } from '@at/infrastructure-runtime-common/decorators'
import { isRejected } from '@at/infrastructure-runtime-common/utils/promises'
import type { Kubernetes } from '@at/kubernetes'
import { PatchType } from '@at/kubernetes/client'
import type { Models } from '@at/kubernetes/models'
import { KubernetesEventType } from '@at/kubernetes/watchClient'
import { Logger } from '@at/platform-logger'
import { EventHandler } from 'lib/handlers/eventHandler'
import type { ObserverHandlerOptions } from 'types/dynamic/server'
@Stono
Stono / x-workload-name-envoyfilter.yaml
Created October 15, 2021 15:15
Adds a workload name header to outbound requests in istio
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: add-x-workload-header
namespace: istio-system
annotations:
name: Add Workload Header
description: Adds an x-workload-header
spec:
configPatches: