This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # migrate.sh — One-shot migration script for fresh Proxmox host | |
| # | |
| # Takes a ZFS pool from TrueNAS, fixes properties, runs setup scripts, | |
| # deploys services, restores Docker volumes, and prints remaining manual steps. | |
| # | |
| # Usage: | |
| # bash /path/to/migrate.sh <pool-name> | |
| # | |
| # Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Back up Docker named volumes before a migration. | |
| # | |
| # Named volumes live on the container's local filesystem, NOT on your ZFS pool, | |
| # so they won't survive a migration unless explicitly backed up. | |
| # | |
| # Usage: | |
| # ./backup-docker-volumes.sh <backup-dir> [volume1] [volume2] ... | |
| # | |
| # Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int Parallelism = 3; | |
| const int NumItems = 20; | |
| TimeSpan ProcessingTime = TimeSpan.FromMilliseconds(100); | |
| Console.WriteLine("WorkQueue starting"); | |
| await using (WorkQueue workQueue1 = new(Parallelism)) | |
| { | |
| List<Task> tasks = new(NumItems); | |
| for (int i = 0; i < NumItems; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public sealed class AsyncMutex : IAsyncDisposable | |
| { | |
| private readonly string _name; | |
| private Task? _mutexTask; | |
| private ManualResetEventSlim? _releaseEvent; | |
| private CancellationTokenSource? _cancellationTokenSource; | |
| public AsyncMutex(string name) | |
| { | |
| _name = name; |