Skip to content

Instantly share code, notes, and snippets.

@berinle
berinle / .gitattributes
Last active August 8, 2026 17:45
generic git attributes when working between windows and linux
# ---------------------------------------------------------------------------
# Line-ending normalization for Windows <-> Linux/macOS work.
#
# Rule of thumb: everything is stored as LF in the repository. Files that are
# only ever consumed by Linux (shell scripts, Dockerfiles, configs baked into
# images) are also checked out as LF on Windows, because CRLF breaks them.
# ---------------------------------------------------------------------------
# Default: let Git decide what is text, normalize to LF in the repo, and check
# out as LF everywhere — including Windows. Without the explicit `eol=lf`, Git
@berinle
berinle / cf-app-services.sh
Created August 3, 2026 19:31
list all apps and their service bindings
#!/usr/bin/env bash
# Report every app and the service instances bound to it.
# Usage: ./cf-app-services.sh [table|csv|json] (default: table)
set -euo pipefail
FORMAT="${1:-table}"
case "$FORMAT" in
-h|--help|help)
cat <<'USAGE'
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 13.3.0.24… VMware.CloudServices Desk {Connect-Vcs, Disconnect-Vcs, Get-VcsO…
Script 13.3.0.24… VMware.DeployAutomation Desk {Add-CustomCertificate, Add-DeployRule…
Script 13.3.0.24… VMware.ImageBuilder Desk {Add-EsxSoftwareDepot, Add-EsxSoftware…
Manifest 13.3.0.24… VMware.PowerCLI Desk
Script 13.3.0.24… VMware.PowerCLI.Sdk Core,Desk
Script 13.3.0.24… VMware.PowerCLI.Sdk.Types Core,Desk
Script 13.3.0.24… VMware.PowerCLI.VCenter Core,Desk {Get-VIMachineCertificate, Get-VITrust…
Script 13.3.0.24… VMware.PowerCLI.VCenter.Types.Appl… Core,Desk
@berinle
berinle / apply_tkg_gatekeeper.md
Last active April 25, 2024 11:24
Steps to apply gatekeeper to an existing TKG guest cluster

login to your guest cluster e.g.

❯ kubectl vsphere login --server=SERVER_IP --tanzu-kubernetes-cluster-namespace=NAMESPACE --tanzu-kubernetes-cluster-name=CLUSTER_NAME -u=administrator@vsphere.local --insecure-skip-tls-verify

run the gatekeeper.yaml (located in the gatekeeper directory of the cloned/downloaded project)

kubectl apply -f gatekeeper.yaml
@berinle
berinle / custom-tkgserviceconfigurations-proxy.yaml
Created September 29, 2023 14:32
Sample TkgServiceConfiguration
apiVersion: run.tanzu.vmware.com/v1alpha3
kind: TkgServiceConfiguration
metadata:
name: tkg-service-configuration
spec:
defaultCNI: antrea
proxy:
#supported format is `http://<user>:<pwd>@<ip>:<port>`
httpProxy: http://admin:PaSsWoRd@10.66.100.22:80
httpsProxy: http://admin:PaSsWoRd@10.66.100.22:80
@berinle
berinle / sample-tkg-cluster.yaml
Last active November 9, 2023 03:01
Sample snippet for TKG cluster
# https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-B2807BCD-0CE1-4C3A-9C0E-2B78F5DA0E90.html
apiVersion: run.tanzu.vmware.com/v1alpha2 #TKGS API endpoint
kind: TanzuKubernetesCluster #required parameter
metadata:
name: REPLACE_ME #cluster name, user defined
namespace: REPLACE_ME
spec:
topology:
controlPlane:
replicas: 1 #number of control plane nodes
@berinle
berinle / solrconfig.xml
Created August 21, 2023 14:00
solr testing
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@berinle
berinle / gist:1c2bc8ffadb4b2f74909a2f010f4bffa
Created May 19, 2023 23:13
wcp_deactivate_troubleshoot
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:310] [opID=64deebef] Processing cluster sync: "99f81a0c-6421-4c01-80b5-bf3111015bd1"
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:314] [opID=64deebef] Attempting to sync supervisor 99f81a0c-6421-4c01-80b5-bf3111015bd1 state with desired state.
2023-05-19T15:34:35.481Z debug wcp [logger/trace.go:77] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] [BEGIN] [kubelifecycle.(*Controller).syncKubeInstanceState:356] supervisor=99f81a0c-6421-4c01-80b5-bf3111015bd1
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:540] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] creating service accounts for cluster domain-c13
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:2161] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] Will create VMOperator service account
2023-05-19T15:34:35.481Z debug wcp [kubelifecycle/controller.go:2164] [opID=64deebef-99f81a0c-6421-4c01-80b5-bf3111015bd1] Will create AppPlatf
@berinle
berinle / nginx.yaml
Created May 15, 2023 14:37
sample nginx
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
namespace: dev
spec:
replicas: 3
selector:
@berinle
berinle / foobar.java
Created March 15, 2023 23:04
sample showing how to read from classpath in JAR
package com.example.foobar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;