Skip to content

Instantly share code, notes, and snippets.

View memes's full-sized avatar
☁️
Working in the cloud

Matthew Emes memes

☁️
Working in the cloud
View GitHub Profile
@memes
memes / sa_auth_status.sh
Created November 24, 2021 16:54
Standalone GCP service account tester based on embedded script in https://github.com/memes/terraform-google-sa-scopes-demo/blob/main/main.tf
#!/bin/sh
#
# Verify GCP service account default authentication status on VM
info()
{
echo "$0: INFO: $*" >&2
}
error()
@memes
memes / openpgp.md
Created November 14, 2022 22:41
openpgp.md

Verifying my cryptographic key: openpgp4fpr:ee2664dd38f53ba6849e99b7757446333d3ec29a

@memes
memes / setup.go
Last active August 7, 2023 18:41
go-logr and zerolog formatting for GCP stdout/stderr scraping
func initialiseLogging() logr.Logger {
// Setup structured logging to match Cloud Operations expectations, as much as possible
zerolog.TimestampFieldName = "time"
zerolog.TimeFieldFormat = time.RFC3339
zerolog.LevelFieldName = "severity"
zerolog.LevelTraceValue = "DEFAULT"
zerolog.LevelDebugValue = "DEBUG"
zerolog.LevelInfoValue = "INFO"
zerolog.LevelWarnValue = "WARNING"
zerolog.LevelErrorValue = "ERROR"