Skip to content

Instantly share code, notes, and snippets.

@pauldougan
pauldougan / README.md
Last active April 23, 2024 22:20
Run node.js from gist

Run node.js from a gist

npx https://gist.github.com/pauldougan/45e7e9324257a9b34d1f051b7805e513

@pauldougan
pauldougan / nodejs_notes.md
Last active January 20, 2024 20:40
Notes on running nodejs
@pauldougan
pauldougan / README.md
Last active April 24, 2024 09:20
Generate a Time-based one-time password (TOTP) in TypeScript

Generate a Time-based one-time password (TOTP) in TypeScript

A simple command line example that generates a TOTP code in TypeScript in accordance with IETF rfc6238

Usage

totp.ts

NAME
 totp.ts - generate a TOTP code
@pauldougan
pauldougan / clientID.jsh
Last active February 15, 2024 15:58
generate client ID
import java.security.SecureRandom;
import java.util.Base64.Encoder;
int ENTROPY_BYTES = 20;
SecureRandom RANDOM = new SecureRandom();
Base64.Encoder ENCODER = Base64.getUrlEncoder().withoutPadding();
byte[] buffer = new byte[ENTROPY_BYTES];
RANDOM.nextBytes(buffer)
System.out.println(ENCODER.encodeToString(buffer))
@pauldougan
pauldougan / csv-tools.md
Last active October 1, 2022 07:16
some csv tools

CSV tools - a partial list

I tend to wrangle a lot of spreadsheet data but don't always want to use use google sheets and habitually convert to csv and process them locally.

This is a list of some of my favourite tools, its non exhaustive and biased towards my preference for terminal based user interfaces

1. visidata - the swiss army tool for tabular data

https://www.visidata.org/

@pauldougan
pauldougan / cnb-and-cf.md
Last active June 23, 2022 12:02
cnb and cf

Cloud Native buildpacks and Cloud Foundry

Introduction

Cloud Foundry supports two models for running applications in containers:

  1. Cloud Foundry Buildpacks
  2. Cloud Foundry Docker support

Some tenants prefer one of the other and others mix and match.

@pauldougan
pauldougan / korifi-notes.md
Last active November 2, 2022 09:30
Notes on Korifi

Notes on Korifi

Taking the first release v0.1.0 of korifi for a spin on a local single node kubernetes cluster. (FYI I recently tested this on 29th Sept 2022 with korifi v0.3.0 and these notes are still valid)

Not yet tested on v0.4.0 which brings helm packaging

TLDR; it can be installed in 14 minutes on a standard GDS macbook pro with 8GB of RAM