Skip to content

Instantly share code, notes, and snippets.

@jrussellsmyth
jrussellsmyth / dockerfile-here.md
Created July 12, 2025 21:16
Dockerfile HERE document

Self Contained Dockerfiles with addtitional file needs

Sometimes you need to create a docker container that has additional files included. One way to do this is to have the files available in the docker contex (typicallly the file you are running the docker command in) and using the COPY command.

This however requires multiple files and management of the context when building the image. This can be a problematic requirement.

For small text files, such as configuration documents or small shell scripts used for setup or execution, another possible soluton is a the use of a "Here Document" in conjunction

E-Yooso Z11 kyboard shortcuts

Sourced from https://defkey.com/e-yooso-z11-shortcuts and corrected based on keyboard in my hands.

E-Yooso Z11 is a 60 percent mechanical gaming keyboard. The wired keyboard has 61 keys. It is specifically designed for FPS gamers, but also suitable for working.

E-Yooso Z11 has 24 shortcuts and we have listed all of them below.

@jrussellsmyth
jrussellsmyth / git-cherry-pick-forks.md
Last active February 1, 2026 17:53
How to Cherry pick commits across forks

Cherry picking commits across forks

When working with forks in Git, you may need to pull specific commits from one fork to another. This can be useful when you want to include a specific change from one fork to another without merging the entire branch.

From another fork to your fork

From your fork to another fork

From another fork to your fork

  1. Identify the commit hash(es) of the commit(s) you want to cherry-pick. You can find this hash on GitHub or by using git log after fetching.
@jrussellsmyth
jrussellsmyth / traefik-lables-docker-compose.yml
Last active November 10, 2024 06:00
Docker lables for traefik
services:
myservice:
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.myservice.rule=Host(`localdev.jrussellsmyth.com`) && PathPrefix(`/myservice`)"
- "traefik.http.routers.myservice.service=myservice"
- "traefik.http.routers.myservice.entrypoints=web"
- "traefik.http.services.myservice.loadbalancer.server.port=80"
{
"name": "Debug Application - Local",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "cmd/main.go",
"env": {
"CONFIG_DIR_PATH":".",
"ENV":"dev",
"SPRING_PROFILES_ACTIVE": "local",
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/go
{
"name": "servicename [Go]",
"dockerComposeFile": [
"docker-compose.yml"
],
// the service in the compose file to use for the dev environment
"service": "go-service",
"workspaceFolder": "${localWorkspaceFolder}",
@jrussellsmyth
jrussellsmyth / docker-compose-socks-proxy.yml
Created October 10, 2024 15:27
docker compose service to allow connecting brower to behave as if it is in the compose
socks-proxy:
image: serjs/go-socks5-proxy
environment:
# - PROXY_USER=vscode
# - PROXY_PASSWORD=vscode
- PROXY_PORT=9090
ports:
- 9090:9090
#
# to run chrome on mac against the proxy
@jrussellsmyth
jrussellsmyth / docker-compose-go-devcontainer.yml
Last active October 10, 2024 15:23
service to include in a docker compose file to create a devcontainer for go development
go-service:
image: mcr.microsoft.com/devcontainers/go:1.22-bookworm
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '2'
memory: 2G
@jrussellsmyth
jrussellsmyth / gist:b2962f7ea7a4512b8a61772c6e9a7b5b
Created October 23, 2022 20:46
invert windows mouse wheel
Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value 1;}
@jrussellsmyth
jrussellsmyth / regex-substitution.go
Created June 10, 2022 20:04
Regex Search / Replace with substitutions in Go
// https://go.dev/play/p/XPjAjsNm_2H
package main
import (
"fmt"
"regexp"
)
func main() {
source := "http://some.dumb.domain/path/to/resource/12345"