Skip to content

Instantly share code, notes, and snippets.

View Aaronontheweb's full-sized avatar
🚀
Shipping!

Aaron Stannard Aaronontheweb

🚀
Shipping!
View GitHub Profile
@Aaronontheweb
Aaronontheweb / MaterializedViewBenchmark.cs
Last active September 19, 2024 19:43
MaterializedViewState Serialization
// Note that you must explicitly enable compiler optimizations:
#LINQPad optimize+
void Main()
{
Util.AutoScrollResults = true;
BenchmarkRunner.Run<MaterializedViewStateBenchmarks>();
}
// You can define other methods, fields, classes and namespaces here
@Aaronontheweb
Aaronontheweb / dashboard.json
Created September 4, 2024 20:50
Phobos Experimental OTLP Dashboards (Prometheus Data Source, Grafana Dashboard)
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@Aaronontheweb
Aaronontheweb / AspDotNetClusteredRouterIntegrationSpec.cs
Created August 29, 2024 15:04
Akka.NET Integration Testing with WebApplicationFactory
// -----------------------------------------------------------------------
// <copyright file="AspDotNetClusteredRouterIntegrationSpec.cs" company="Petabridge, LLC">
// Copyright (C) 2021 - 2021 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
using System.Threading.Tasks;
using Phobos.Actor.Cluster.Integration.Tests.Services;
using Xunit;
using Xunit.Abstractions;
@Aaronontheweb
Aaronontheweb / docker-compose.yml
Created August 7, 2024 01:56
Docker Registry Self-Host
services:
registry:
image: registry:2
restart: unless-stopped
ports:
- "5000:5000"
environment:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
volumes:
- reg-data:/data
@Aaronontheweb
Aaronontheweb / grafana-loadbalancer.yaml
Last active June 13, 2024 14:02
MicroK8s observability load balancers
apiVersion: v1
kind: Service
metadata:
name: grafana-loadbalancer
namespace: observability
spec:
type: LoadBalancer
selector:
app.kubernetes.io/name: grafana
ports:
@Aaronontheweb
Aaronontheweb / configure-docker-drives.sh
Last active June 12, 2024 16:23
Raspberry PI External SSD Scripts
#!/bin/bash
# create the docker data drive
mkdir /mnt/docker-base
# allow the root service account, which docker runs as, to own this directory and have write permissions
chown -R root:root /mnt/docker-base
chmod 701 /mnt/docker-base
# create a `daemon.json` file for the docker runtime
@Aaronontheweb
Aaronontheweb / HOWTO.md
Last active June 6, 2024 19:23 — forked from ramonsmits/HOWTO.md
Install .NET 8 on Raspberry pi
@Aaronontheweb
Aaronontheweb / Program.cs
Created April 12, 2024 13:23
Akka.NET - Deleting Older Snapshots in Akka.Persistence actors that ONLY use the SnapshotStore
async Task Main()
{
var actorSystem = ActorSystem.Create("Sys");
var persistentActor = actorSystem.ActorOf<ExamplePersistentActor>("exampleActor");
var watch = persistentActor.WatchAsync();
// Sending multiple "save" commands to create snapshots
persistentActor.Tell("save-1");
await Task.Delay(TimeSpan.FromSeconds(1)); // spacing out snapshots, time-wise
@Aaronontheweb
Aaronontheweb / docker-compose.yml
Created March 8, 2024 19:21
Jaeger docker compose
version: '3.7'
services:
jaeger:
image: jaegertracing/all-in-one:1.55
hostname: jaeger
restart: always
ports:
- '16686:16686'
- '5775:5775/udp'
@Aaronontheweb
Aaronontheweb / projections.cs
Last active March 5, 2024 16:08
Read Journal Provider
Command<ProjectionStarting>(_ =>
{
// TODO: seeing multiple of these being logged, which makes me think there's a problem with our Akka.Streams graph
_log.Info("Projection for Tag [{0}] is starting from Offset [{1}] - instance [{2}] rand [{3}]", NuGetPersistenceTags.NuGetProductTag,
CurrentState.LastOffset.AsLong(), Self.Path.Uid, Random.Shared.Next());
Sender.Tell(ProjectionAck.Instance);
});
Command<ProjectionCompleted>(_ =>
{