Skip to content

Instantly share code, notes, and snippets.

View kshyju's full-sized avatar

Shyju Krishnankutty kshyju

View GitHub Profile
variables:
headers:
none: ''
plaintext: '--header "Accept: text/plain,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7" --header "Connection: keep-alive"'
html: '--header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Connection: keep-alive"'
json: '--header "Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7" --header "Connection: keep-alive"'
connectionclose: '--header "Connection: close"'
presetHeaders: none
jobs:
@kshyju
kshyju / chocolateylogs.txt
Created December 17, 2024 03:46
chocolatey logs
2024-12-16 19:43:01,400 16480 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2024-12-16 19:43:01,416 16480 [INFO ] - Installing the following packages:
2024-12-16 19:43:01,416 16480 [INFO ] - sysinternals
2024-12-16 19:43:01,416 16480 [INFO ] - By installing, you accept licenses for the packages.
2024-12-16 19:43:01,528 16480 [DEBUG] - Process Tree: Chocolatey CLI => Chocolatey CLI => powershell => WindowsTerminal => explorer
2024-12-16 19:43:01,540 16480 [DEBUG] - Updating User Agent to 'Chocolatey Command Line/2.4.1 (Chocolatey CLI) via NuGet Client/6.4.1 (Microsoft Windows NT 10.0.26100.0)'.
2024-12-16 19:43:01,607 16480 [DEBUG] - Running list with the following filter = ''
2024-12-16 19:43:01,607 16480 [DEBUG] - --- Start of List ---
2024-12-16 19:43:01,624 16480 [DEBUG] - Process Tree: Chocolatey CLI => Chocolatey CLI => powershell => WindowsTerminal => explorer
2024-12-16 19:43:01,624 16480 [DEBUG] - Updating User Agent to 'Chocolatey Command Line/2.4.1 (Chocolatey CLI) via NuGet Cl
# Create a directory
$directoryPath = "C:\ExampleDirectory"
New-Item -ItemType Directory -Path $directoryPath -Force
# Create a file in the directory
$filePath = "$directoryPath\example.txt"
"Hello, World!" | Out-File -FilePath $filePath
# Output the result
Write-Output "Directory and file created successfully."
param(
[string]$ParametersJsonBase64,
[string]$WindowsLocalAdminUserName,
[string]$WindowsLocalAdminPasswordBase64)
$ErrorActionPreference = 'Stop'
function ScheduleCrankAgentStart {
Write-Verbose 'Scheduling crank-agent start...'
@kshyju
kshyju / Ubuntu 20.04 With .NET9 SDK
Created November 13, 2024 19:06
Ubuntu 20.04 With .NET9 SDK
# Use Ubuntu 20.04 as the base image
FROM ubuntu:20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install essential packages and dependencies
RUN apt-get update && \
apt-get install -y \
wget \
{
"4.68.0": {
"templates": "https://functionscdn.azureedge.net/public/TemplatesApi/3.1.1648.zip",
"workerRuntimes": {
"dotnet": {
"net6": {
"displayInfo": {
"displayName": ".NET 6.0",
"hidden": false,
"displayVersion": "v4",
@kshyju
kshyju / EventPipeAOTSocketException.MD
Created January 22, 2024 17:22
GRPC Exception when AOT published with EventPipe support
Minimal repro app

https://github.com/kshyju/DotnetAppLoader/tree/case_2-aot-e2e-fails

Exception

Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error connecting to subchannel.", DebugException="System.Net.Sockets.SocketException: Unknown error (0xffffffff)") ---> System.Net.Sockets.SocketException (0xFFFFFFFF): Unknown error (0xffffffff) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError, CancellationToken) + 0x47 at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16) + 0x4e at System.Net.Sockets.Socket.<g__WaitForConnectWithCancellation|285_0>d.MoveNext() + 0x18f

@kshyju
kshyju / cli-feed4.json
Created November 15, 2023 19:33
4.62.0 vs 4.63.0
{
"4.63.0": {
"templates": "https://functionscdn.azureedge.net/public/TemplatesApi/3.1.1648.zip",
"workerRuntimes": {
"dotnet": {
"net6": {
"displayInfo": {
"displayName": ".NET 6.0",
"hidden": false,
"displayVersion": "v4",
@kshyju
kshyju / Linq_Where_First_Benchmarks.cs
Created February 8, 2023 18:20
LINQ Where+SingleOrDefault vs SingleOrDefault Benchmarks
using BenchmarkDotNet.Attributes;
namespace Benchmarks
{
public record Foo(string Name, string Value, int category);
[MemoryDiagnoser]
public class LinqBenchmarks
{
private IEnumerable<Foo> items;
@kshyju
kshyju / App.csproj
Last active September 7, 2023 16:33
ConsoleAppDI
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>