Skip to content

Instantly share code, notes, and snippets.

View pchalamet's full-sized avatar
🦄
unraveling the mist

Pierre Chalamet pchalamet

🦄
unraveling the mist
View GitHub Profile
@pchalamet
pchalamet / ProcessGroup.cs
Last active December 23, 2024 19:38
Attempt to start a child process in parent group so it's automatically killed if parent die
using System.Runtime.InteropServices;
namespace ProcessGroup;
//
// Attempt to start a child process and enroll it in the same process group as the parent.
// Goal is to be able to kill the child process if the parent process is killed.
//
public static class Process
{
[DllImport("libc")]
@pchalamet
pchalamet / msbuild-crash.md
Last active November 1, 2024 16:35
MSBuild crash
docker run --rm --net=host --name 8C91EC60706A76686DEE83F23CE80DD78D48E014DCCB1F7389F9F5EF9D9BFF09 -v /var/run/docker.sock:/var/run/docker.sock -v /Users/pierre/.terrabuild/home/containers:/root -v /Users/pierre/.terrabuild/home/tmp:/tmp -v /Users/pierre/src/MagnusOpera/terrabuild/terrabuild/src:/terrabuild -w /terrabuild/Terrabuild.Common --entrypoint dotnet -e DOTNET_CLI_TELEMETRY_OPTOUT -e DOTNET_NOLOGO -e DOTNET_SKIP_FIRST_TIME_EXPERIENCE mcr.microsoft.com/dotnet/sdk:8.0.302 build --no-dependencies --configuration Debug

✘ build Terrabuild.Common
@dotnet build
9/27/2024 11:51:49 AM ERR System.IO.IOException: The system cannot open the device or file specified. : 'NuGet-Migrations'
9/27/2024 11:51:49 AM ERR    at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
9/27/2024 11:51:49 AM ERR    at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
9/27/2024 11:51:49 AM ERR    at NuGet.Common.Migrations.MigrationRunner.Run(String migrationsDirect
@pchalamet
pchalamet / Silo.cs
Last active November 12, 2019 05:12
silo logs
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.Configuration;
using Orleans.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using cart.grain;
using System.Net;
@pchalamet
pchalamet / vector.fs
Created November 27, 2018 11:08
error FS0003: This value is not a function and cannot be applied. Why ?
type Vector1(x : float) =
member this.X = x
static member inline (*) (value : float, v : Vector1) =
Vector1(v.X * value)
static member inline (*) (v : Vector1, value : float) =
Vector1(v.X * value)
module Vector =