Skip to content

Instantly share code, notes, and snippets.

View madhub's full-sized avatar

madhub

View GitHub Profile

Update the Target Framework

<PropertyGroup>
  <TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

Update Dependencies

Adjust for Breaking Changes and Deprecated APIs

Move away from Microsoft.AspNetCore.Authentication.ISystemClock to System.TimeProvider

@madhub
madhub / asp_core_http2.md
Last active March 21, 2024 13:11
Setting up asp.net core server HTTP2 without TLS

Socker connect with timeout

using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Net;
using System.Net.Sockets;

CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
// See https://aka.ms/new-console-template for more information
using System.IO.Pipes;
using System.Net.Http;
using System.Net.Http.Json;
using System.Net.Sockets;
using System.Runtime.InteropServices;

HttpClient client = CreateHttpClientConnectionToDockerEngine();
String dockerUrl = "http://localhost/v1.41/containers/json";
[ApiController]
    //[Route("[controller]")]
    public class LambdaController : ControllerBase
    {


        [HttpPost]
        [Route("2020-01-01/extension/register")]
        public  ActionResult Register([FromBody] object json)
@madhub
madhub / tips.md
Last active February 10, 2024 03:14
tips

Temmp https://github.com/jasonterando/S3BufferedUpload

Enabling verbose logging to see any AWS S3 SDK logic :

Amazon.AWSConfigs.LoggingConfig.LogResponses = Amazon.ResponseLoggingOption.Always;
Amazon.AWSConfigs.LoggingConfig.LogTo = Amazon.LoggingOptions.Console;
Amazon.AWSConfigs.AddTraceListener("Amazon", new System.Diagnostics.ConsoleTraceListener());

Generate Random bytes

@madhub
madhub / cplus.md
Created March 27, 2023 03:15
C++ samples
/**
 * Read all bytes from a file.
 * 
 * Taken from http://codereview.stackexchange.com/questions/22901/reading-all-bytes-from-a-file
 * 
 * Alternate form: static void ReadAllBytes(char const* filename, std::vector<char>& result)
 */

#include