Skip to content

Instantly share code, notes, and snippets.

View pacphi's full-sized avatar
🎯
Focusing

Chris Phillipson pacphi

🎯
Focusing
View GitHub Profile
@pacphi
pacphi / AreaMapper.java
Created February 27, 2025 16:57
Data seeding - a sampling of interfaces and implementation facilitates loading data from CSV files
package me.pacphi.ai.resos.csv.impl;
import me.pacphi.ai.resos.csv.CsvEntityMapper;
import me.pacphi.ai.resos.csv.CsvMappingException;
import me.pacphi.ai.resos.csv.EntityMapper;
import me.pacphi.ai.resos.jdbc.AreaEntity;
@CsvEntityMapper("areas")
public class AreaMapper implements EntityMapper<AreaEntity> {
@pacphi
pacphi / SchemaCreator.java
Created February 27, 2025 16:12
A naive implementation that supports auto-generating Liquibase changesets and a changelog from Spring JDBC entities
package me.pacphi.ai.resos.config;
import jakarta.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
@pacphi
pacphi / EntityGenerator.java
Created February 17, 2025 18:46
JDBC Entity Generator Utility
package me.pacphi.ai.resos.util;
import com.github.javaparser.ParserConfiguration;
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.body.EnumDeclaration;
import com.github.javaparser.ast.body.FieldDeclaration;
import com.github.javaparser.ast.body.VariableDeclarator;
import com.github.javaparser.ast.type.ClassOrInterfaceType;
@pacphi
pacphi / 00-prereqs.md
Last active September 23, 2024 15:07
Zero to Hero with Tanzu Platform for K8s

Prerequisites

OS

  • MacOS or Linux

CLIs

  • certbot
  • these instructions geared for install on Ubuntu Linux via Snap
@pacphi
pacphi / install-certmanager-oci.sh
Last active January 3, 2023 17:32
EXPERIMENTAL: cert-manager webhook for OCI
#!/usr/bin/env bash
indent4() { sed 's/^/ /'; }
# Install the necessary resources to support cert-manager deployed on OKE
# vending valid certificate via a Let's Encrypt ClusterIssuer
# Set environemnt variables (these are sample values, please replace with your own)
export DOMAIN=foo.me
export EMAIL_ADDRESS=any@valid.email
@pacphi
pacphi / backend.tf
Last active January 27, 2021 05:51
Fun with Docker and Terraform. This sample also employs an Artifactory backend.
terraform {
backend "artifactory" {
username = "admin"
password = "xxx"
url = "https://krups.ironleg.me/artifactory"
repo = "terraform-state"
subpath = "tf4k8s/experiments/cluster/gke"
}
}
@pacphi
pacphi / reactor-stack-trace.log
Created June 27, 2019 15:30
Reactor error-handling rabbit hole
Retrieving logs for app cf-butler in org util / space stage as xxxx...
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT 2019-06-27T03:08:12,514 WARN [cloudfoundry-client-client-epoll-13] i.p.c.t.AppDetailTask: Could not obtain application details for organization=foo, space=Test, and applicationName=foo-test
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT java.util.concurrent.TimeoutException: Acquire operation took longer then configured maximum time
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT at io.netty.channel.pool.FixedChannelPool.<init>(...)(Unknown Source)
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT Assembly trace from producer [reactor.core.publisher.MonoPeek] :
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT reactor.core.publisher.Mono.checkpoint(Mono.java:1681)
2019-06-26T20:08:12.51-0700 [APP/PROC/WEB/0] OUT org.cloudfoundry.react
@pacphi
pacphi / bbl-diagnostics.sh
Last active October 4, 2018 03:19
On a Mac: Obtain diagnostics of a BBL deployed BOSH release
#!/bin/bash
# BBL Diagnostics
## @mantainer Chris Phillipson
## @version 1.0.2
# Fire up Terminal (or iTerm)
# Execute this sequence of commands to connect and authenticate then emit some diagnostics
if [ $# -eq 0 ]
@pacphi
pacphi / destroy-concourse-with-credhub-on-azure.sh
Last active October 2, 2018 21:13
On a Mac: Use BOSH Bootloader to destroy an existing cluster of Jump host, BOSH Director, Concourse and Credhub VMs
#!/bin/bash
# @name destroy-concourse-with-credhub-on-azure.sh
# @description This script provisions a Jumpbox, BOSH director, Credhub, and Concourse on Azure.
# @assumptions You have installed bbl-cli, terraform, bosh-cli, credhub-cli, git, and openssl on a Mac.
# and that a Service Account has been created in advance,
# @see https://github.com/cloudfoundry/bosh-bootloader/blob/master/docs/getting-started-gcp.md#create-a-service-account.
# @basedUpon https://github.com/pivotalservices/concourse-credhub
# @author Chris Phillipson
# @version 1.0.2
@pacphi
pacphi / destroy-concourse-with-credhub-on-gcp.sh
Last active October 2, 2018 15:26
On a Mac: Use BOSH Bootloader to destroy an existing cluster of Jump host, BOSH Director, Concourse and Credhub VMs
#!/bin/bash
# @name destroy-concourse-with-credhub-on-gcp.sh
# @description This script destroy an existing cluster of a Jumpbox, BOSH director, Credhub, and Concourse on Google Gloud Platform.
# @assumptions You have installed bbl-cli, terraform, bosh-cli, credhub-cli, git, and openssl on a Mac.
# and that a Service Account has been created in advance,
# @see https://github.com/cloudfoundry/bosh-bootloader/blob/master/docs/getting-started-gcp.md#create-a-service-account.
# @basedUpon https://github.com/pivotalservices/concourse-credhub
# @author Chris Phillipson
# @version 1.0.1