Skip to content

Instantly share code, notes, and snippets.

View sneal's full-sized avatar

Shawn Neal sneal

View GitHub Profile
@sneal
sneal / uaac-client-add.sh
Created December 18, 2024 16:36
UAA Concourse Tasks
#!/usr/bin/env bash
vars_files_args=("")
for vf in ${VARS_FILES}
do
vars_files_args+=("--vars-file ${vf}")
done
om interpolate -c env/${CLIENT_FILE} ${vars_files_args[@]} > uaac_config.yml
@sneal
sneal / app.log
Created December 4, 2024 20:03
.NET 8 app with OpenSSL 3.3.x on cflinuxfs4
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22: calling init: /home/vcap/deps/0/dotnet-sdk/shared/Microsoft.NETCore.App/8.0.7/libSystem.Security.Cryptography.Native.OpenSsl.so
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22:
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22: opening file=/home/vcap/deps/0/dotnet-sdk/shared/Microsoft.NETCore.App/8.0.7/libSystem.Security.Cryptography.Native.OpenSsl.so [0]; direct_opencount=1
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22:
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22: symbol=CryptoNative_GetMaxMdSize; lookup in file=/home/vcap/deps/0/dotnet-sdk/shared/Microsoft.NETCore.App/8.0.7/libSystem.Security.Cryptography.Native.OpenSsl.so [0]
2024-11-29T18:35:52.13-0600 [APP/PROC/WEB/0] ERR 22: binding file /home/vcap/deps/0/dotnet-sdk/shared/Microsoft.NETCore.App/8.0.7/libSystem.Security.Cryptography.Native.OpenSsl.so [0] to /home/vcap/deps/0/dotnet-sdk/shared/Microsoft.NETCore.App/8.0.7/libSystem.Security.Cryptography.Native.OpenSsl
@sneal
sneal / inject-tasw.sh
Last active November 25, 2024 19:10
BASH script replacement for tile-injector
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
# Crack the tile open into the tasw directory
tasw_tiles=(./pas-windows-*.pivotal)
tasw_tile="${tasw_tiles=[0]}"
unzip "$tasw_tile" -d ./tasw
@sneal
sneal / README.md
Created November 1, 2024 22:12
Running dotnet-counters on a .NET 8 deployed to Cloud Foundry

Assumptions

  • .NET 8 app
  • dotnet buildpack
  • CF SSH access

Publish

We need to the dotnet CLI installed on the target application instance. To get dotnet installed and not have the buildpack remove it during staging we need to use a Framework Dependent Deployment. If you're running dotnet publish on an ARM processor you need to specify the runtime as linux-x64 otherwise you will get an error trying to start the app.

@sneal
sneal / iso.yml
Last active October 8, 2024 18:10
TPCF Isolation Segment product config
product-name: p-isolation-segment-iso3
product-properties:
.isolated_router_iso3.disable_insecure_cookies:
value: false
.isolated_router_iso3.drain_timeout:
value: 900
.isolated_router_iso3.drain_wait:
value: 20
.isolated_router_iso3.enable_w3c:
value: false
@sneal
sneal / README.md
Last active August 16, 2024 17:15
Azure - BOSH Director MySQL Migration

Migrate BOSH Azure MySQL DB to a new instance

These step describe the steps necessary to move a BOSH external MySQL 5.7 databases on Azure to a new instance.

Stop BOSH Director VM

Stop the BOSH Director VM in Azure. You can find the VM name in the Operations Manager BOSH Director tile under the Status tab. From the Azure CLI:

az vm stop --resource-group tas-resourcegroup --name 85a181e5-aa6b-4ea7-47b0-b2218b46002a
@sneal
sneal / README.md
Created August 13, 2024 21:02
TAS Log Rate Limits

TAS 4.0.20+ has ability to limit the log rate (bytes/sec) of applications to avoid having a single application overwhelm the logging system in Cloud Foundry.

The general settings or ways to configure logging limits are:

  • "Default log rate limit per app" in the TAS tile under App Developer Controls
  • CF org/space quotas
  • log-rate-limit-per-second app setting

Default log rate limit per app

The global default setting is just that, a default. It's the same as setting the per-app log-rate-limit-per-second on every single app in the foundation. This is not a way to keep devs from overriding this value. Devs can override

@sneal
sneal / main.go
Created January 11, 2024 19:58
CF apps running each diego cell
package main
import (
"context"
"fmt"
"github.com/cloudfoundry-community/go-cfclient/v3/client"
"github.com/cloudfoundry-community/go-cfclient/v3/config"
"github.com/cloudfoundry-community/go-cfclient/v3/resource"
"os"
)
@sneal
sneal / config.go
Last active December 6, 2023 18:39
go-cfclient config.New
func (c *Config) OAuth2HTTPClient(ctx context.Context) (*http.Client, error) {
// if explicitly configured with an oauth2 transport then use as-is
if _, ok := c.httpClient.Transport.(*oauth2.Transport); ok {
return c.httpClient, nil
}
// use our http.Client instance for token acquisition
oauthCtx := context.WithValue(ctx, oauth2.HTTPClient, c.httpClient)
var tokenSource oauth2.TokenSource
@sneal
sneal / README.md
Last active September 8, 2023 18:51
TAS External MySQL MIgration -> Internal TAS MySQL

Migration to TAS Internal MySQL

Migrating from an externally hosted MySQL DB server such as RDS or Oracle MySQL to the internally managed TAS HA cluster MySQL requires some extra steps to avoid application downtime. To avoid unnecessary downtime and churn we want to avoid having TAS system components ever see an empty MySQL database.

At a high level the overall procedure is:

  1. create single internal mysql instance
  2. bosh stop cloud_controller