Skip to content

Instantly share code, notes, and snippets.

View ghstahl's full-sized avatar
💭
coding always coding

Herb Stahl ghstahl

💭
coding always coding
  • Santa Monica, CA
View GitHub Profile
@ghstahl
ghstahl / gist:a998b585c6d85562bb1ff01f548afb97
Created December 14, 2023 16:37
Zitadel v2.42.1 CPU Spike Logs
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="initialization started" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/init.go:71"
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="verify user" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_user.go:39" username=postgres
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="verify database" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_database.go:39" database=zitadel
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="verify grant" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_grant.go:34" database=zitadel user=postgres
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="verify zitadel" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:76" database=zitadel
2023-12-14 07:14:47 time="2023-12-14T15:14:47Z" level=info msg="verify system" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:37
@ghstahl
ghstahl / gist:92607574d57eae613b4b3e3e17c84615
Created November 28, 2023 18:18
zitadel v2.41.5 migration errors
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="initialization started" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/init.go:71"
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="verify user" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_user.go:39" username=postgres
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="verify database" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_database.go:39" database=zitadel
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="verify grant" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_grant.go:34" database=zitadel user=postgres
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="verify zitadel" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:76" database=zitadel
2023-11-28 10:10:32 time="2023-11-28T18:10:32Z" level=info msg="verify system" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:37
@ghstahl
ghstahl / gist:78451c6544c3268a8a9ff04d1dc24bfe
Last active September 4, 2024 15:07
zitadel v2.41.4 errors
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="initialization started" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/init.go:71"
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="verify user" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_user.go:39" username=postgres
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="verify database" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_database.go:39" database=zitadel
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="verify grant" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_grant.go:34" database=zitadel user=postgres
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="verify zitadel" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:76" database=zitadel
2023-11-25 08:31:45 time="2023-11-25T16:31:45Z" level=info msg="verify system" caller="/home/runner/work/zitadel/zitadel/cmd/initialise/verify_zitadel.go:37
@ghstahl
ghstahl / Mongo_usage_collection_with_uniqueness_and_bucket_ids.md
Last active November 30, 2023 15:42
Mongo_usage_collection_with_uniqueness_and_bucket_ids.md

Mongo Normal Collection Usage w/ Bucket ID

BEWARE: You can't have a uniqueness index on a timeseries collection. If you write usage records that MUST be unique, they must be taken care of in the aggregation.

stackoverflow
mongodb timeseries issue

Which then whats the point of using a timeseries DB for normal queries if there are duplicates.

To capture all usage records, even ones that come in with a timestamp in the deep past, we will bucket data as it comes in.

@ghstahl
ghstahl / mongo_timeseries_with_bucketid.md
Last active November 19, 2023 13:41
Mongo Timeseries w/ bucket ID

Mongo Timeseries w/ Bucket ID

BEWARE: You can't have a uniqueness index on a timeseries collection. If you write usage records that MUST be unique, they must be taken care of in the aggregation.

stackoverflow
mongodb timeseries issue

Which then whats the point of using a timeseries DB for normal queries if there are duplicates.

@ghstahl
ghstahl / gist:992992485035ffddde86ec8b50b9a63f
Created September 29, 2023 17:44
OpenFGA github type model with flat permissions
model
schema 1.1
type feature
relations
define access: subscriber_member from associated_plan
define associated_plan: [plan]
define subscriber: subscriber from associated_plan
type feature_repo
relations
define feature: [feature]
@ghstahl
ghstahl / webhooks-site-personal-redis-docker-compose.yml
Created August 15, 2023 14:43
webhooks-site-personal-redis-docker-compose.yml
version: '3'
services:
webhook:
image: "webhooksite/webhook.site"
# Enable build for development:
# build:
# dockerfile: Dockerfile
# context: ./
command: php artisan queue:work --daemon --tries=3 --timeout=10
ports:
@ghstahl
ghstahl / penfga-revoke-access-on-user-password-change_user_schema_1.1.json
Last active December 20, 2022 16:30
penfga-revoke-access-on-user-password-change_user_schema_1.1.json
{
"tuple_key": {
"object": "org:a",
"relation": "member",
"user": "user:ted"
},
"contextual_tuples": {
"tuple_keys": [{
"object": "integrity:1",
"relation": "member_in_context",
@ghstahl
ghstahl / openfga-revoke-access-on-user-password-change_user_tuples_schema_1.1.json
Created December 20, 2022 16:24
openfga-revoke-access-on-user-password-change_user_tuples_schema_1.1.json
[
{
"object": "user_repo:global",
"relation": "member",
"user": "user:anne"
},
{
"object": "integrity:0",
"relation": "member",
"user": "user:anne"
@ghstahl
ghstahl / openfga-revoke-access-on-user-password-change_authorization_model_schema_1.1.dsl
Created December 20, 2022 15:55
openfga-revoke-access-on-user-password-change_authorization_model_schema_1.1.dsl
model
schema 1.1
type user
type integrity
relations
define member_in_context: [user]
define member: [user] and member_in_context
type user_repo
relations
define integrity : [integrity]