Skip to content

Instantly share code, notes, and snippets.

View lalitkale's full-sized avatar
🏠

Lalit Kale lalitkale

🏠
  • ATechieThought Labs
  • Dublin, Ireland
View GitHub Profile
@lalitkale
lalitkale / async_await_best_practices_cheatsheet.md
Last active January 18, 2021 06:20 — forked from jonlabelle/async_await_best_practices_cheatsheet.md
C# Asynchronous Programming Guideline Cheat Sheet

Async Await Best Practices Cheat Sheet

Summary of Asynchronous Programming Guidelines

Name Description Exceptions
Avoid async void Prefer async Task methods over async void methods Event handlers
Async all the way Don't mix blocking and async code Console main method
Configure context Use ConfigureAwait(false) when you can Methods that require con­text
I have run an nginx container...
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg
I want to use Debian for debug:
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin debian
I can see the nginx process:
@lalitkale
lalitkale / gist:19ec673a063ed5a80831a867165691bd
Created August 18, 2020 05:26 — forked from anonymous/gist:9388472
Summing up contextual influence on systems architecture
1. Monolithic applications and architectures can vary in their monolithness. This is an under-specified description.
2. Microservice applications and architectures can vary in their microness. This is an under-specified description.
3. Microservices and monolithic architectures have both benefits and disadvantages.
4. Organizations will exploit those benefits while working around any weaknesses.
5. Success of the business is a large influence on the exploitation of benefits and implementation and costs of workarounds.
6. All benefits and work arounds are context-sensitive. Meaning that they are both technically and socially constructed by the organization that navigates them.
7. Path dependency is a thing. History matters and manifests in these architectural decisions and evolution in an organization.
8. Patterns exist to inform practice, not dictate it. Zealous adherence to an architectural pattern brings peril when it is to the exclusion of cultural context in actual practice.
9. Architectural patterns w
@lalitkale
lalitkale / Example1.cs
Created April 3, 2020 20:54 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@lalitkale
lalitkale / index.md
Created March 14, 2020 18:10 — forked from bojand/index.md
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

@lalitkale
lalitkale / ckad-learning.md
Created January 22, 2020 22:03 — forked from benc-uk/ckad-learning.md
Certified Kubernetes Application Developer (CKAD)
@lalitkale
lalitkale / ckad-learning.md
Created January 22, 2020 22:03 — forked from benc-uk/ckad-learning.md
Certified Kubernetes Application Developer (CKAD)
@lalitkale
lalitkale / git-hooks.txt
Created December 29, 2019 22:32
How To Setup GitHooks
Git Hooks Template: ~/.git-templates
To create git-hook, create following python file to invoke githooks. Below is the script
commit-msg.py
---
#!/usr/bin/env python
import re, sys, os
def main():
# example:
# feat(apikey): added the ability to add api key to configuration
@lalitkale
lalitkale / aws-lb-kb.md
Last active November 19, 2019 12:17
knowledgebase for aws-load-balancers
@lalitkale
lalitkale / falsehoods-programming-time-list.md
Created October 18, 2019 16:41 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).