Skip to content

Instantly share code, notes, and snippets.

View leopoldodonnell's full-sized avatar

Leo O'Donnell leopoldodonnell

View GitHub Profile
leopoldodonnell / Dockerfile
Last active April 29, 2021 15:25
EventStore Performance Monitor Tool
FROM node:14-alpine
ENV RW_CONNECTION="esdb://host.docker.internal:2113?Tls=false"
COPY ./ ./
RUN npm install
ENTRYPOINT [ "npx", "ts-node", "es-ratewatch.ts" ]
leopoldodonnell /
Last active July 15, 2021 19:43
Nestjs Startup

Nestjs In Under 15 Minutes

If you've got 15 minutes to spare and have docker installed, this Gist will get you started with a working debuggable Nestjs application using Docker with additional settings for vscode. Clearly you'll want to dig deeper, but this is a start...

Nestjs is a popular nodejs for typescript framework for building microservices. It enjoys a large active community, has many extensions and is easily extended. Documentation can be found here

Create the basic file structure from the Github Gist

leopoldodonnell /
Last active July 14, 2024 20:34
Install and run Postgres with an extension using docker-compose

Local Postgres

This gist is an example of how you can simply install and run and extended Postgres using docker-compose. It assumes that you have docker and docker-compose installed and running on your workstation.


  • Requires docker and docker-compose
  • Clone via http: git clone
  • Make executable
  • Build the image: docker-compose build
leopoldodonnell / Dockerfile
Created February 27, 2018 15:17
Go Dockerfile with SNYK
# A Dockerfile to build a go app with Snyk testing
FROM golang:alpine3.7 AS builder
# Build with your SNYK Token, but supply from command line
ARG SNYK_TOKEN=xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# Pass in the name of the application to build
ARG APP=your-app
leopoldodonnell /
Created February 8, 2018 11:09
A Bourne Shell script that will run a command in the background and will send it a SIGTERM when it is received
# The script demonstrates how to terminate a background process. It will run
# the process and wait till a SIGTERM signal is received, then it will pass that
# along to the background process and return its status.
# Syntax: command-line
leopoldodonnell / Dockerfile
Last active February 8, 2018 13:45
Docker Hardening for Alpine
FROM alpine:3.6
# A hardened base image for Alpine
# You can build this with different users and home directories
# Default to user 'app' with home '/home/app'
leopoldodonnell / k8s-cheat-sheet
Created December 13, 2016 13:59
Kubectl tricks etc
# Display all pods including IP info
kubectl get pods --all-namespaces --show-all -o wide
# Display all of the running containers
kubectl get pods -o jsonpath={.items[*].spec.containers[*].image} --all-namespaces --show-all |tr ' ' '\n' |sort -u
# Get the nodeport for a service - find a jsonpath way
servicename=`kubectl get svc some-service`
kubectl describe service $servicename |awk '$1 == "NodePort:" {sub(/\\/TCP/, "", $NF); print $NF}'
leopoldodonnell / monkey-patch.rb
Last active August 29, 2015 14:14
Monkey Patch a class without polluting the namespace and methods in a class
class ClassToMonkeyPatch
old_method = instance_method(:patched_method)
define_method(:patched_method) do |arg1, arg2, &block|
# delegate the rest to the old version of the method
res = old_method.bind(self).(arg1, arg2, &block)
leopoldodonnell / core-classes.sass
Created January 16, 2012 16:33
SASS from LESS Classes
* A SASS conversion by Leo O'Donnell ( ) of the excellent work by Jeffrey Way
* @see
* @see
@mixin border-radius( $radius: 3px )
-webkit-border-radius: $radius
-moz-border-radius: $radius
border-radius: $radius