Skip to content

Instantly share code, notes, and snippets.

View madhub's full-sized avatar

madhub

View GitHub Profile
@madhub
madhub / AwsSDKPipeline.md
Created December 20, 2025 04:36
Demo of using AWS SDK Pipeline extensibility
using Amazon;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.S3;
using System;
using System.Threading.Tasks;

namespace AwsRequestPipelineLoggerDemo
{

Software Architecture - High-level Perspective: Architecture focuses on the big picture, integrating components, services, and systems into a cohesive strategy For example, adopting a monolithic or microservices architecture

Architecture Influences Design: Choosing a microservices architecture will directly impact design decisions. For instance, the inability to perform a rollback across multiple services necessitates patterns like Saga for managing distributed transactions

Software Design - Tactical Focus: Design operates at a lower level, closer to the code, addressing the day-to-day decisions developers face.

A practical example of design would be implementing a connection pool https://dzone.com/articles/differences-between-software-design-and-software-architecture

During Application install set DOTNET_ROOT envionment variable All other configuration should be read from file. To make configuration easier Provide option for changing the storage folder dssgatwy install dssgatwy reinstall dssgatwy update dssgatwy status dssgatwy restart // this options should update the correspoding env files which are read by the service

The C4 model

https://learning.oreilly.com/library/view/learning-system-design/9781098157876/ The C4 model is a set of hierarchical abstractions and diagrams that is notation and tooling independent. It is an “abstraction-first” approach to illustrating software architecture that is rooted in abstractions that mirror software architects’ and developers’ thought processes and construction practices. Thanks to its limited abstractions and diagram types, the C4 model is user-friendly, simplifying the learning curve and application system_design_methodology_333744_01

  1. Enable JDK internal logging
All JDK modules use JUL (Java Util Logging, java.logging module) API, while most projects use SLF4J API. A JUL to SLF4J bridge component is provided by SLF4J library.
 <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.16</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.slf4j/jul-to-slf4j -->
@madhub
madhub / net9.md
Last active August 2, 2024 04:57
.net 9 features
  • SearchValues enhancement Until now we are limited. We can only search for char values. But what if we want to search for string values aka text inside other text? Well, we can't. But with .NET 9 we can! There are new overloads and basically SearchValues is applicable to text as well:
SearchValues<string> Names = SearchValues.Create(
        ["Steven", "Sherlock", "Holmes", "Michael", "Scott"],
        StringComparison.OrdinalIgnoreCase);

const string TextWithNames = "This is Steven and Michael. You know Michael Scott from the office. ";

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 May 28, 2025 06:25
Setting up asp.net core server HTTP2 without TLS

Socket 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";