πŸ‹ CodeHackWithArun πŸ‹
15 subscribers
18 links
We're excited to have you here and can't wait to share our coding expertise with you on DotNet, Angular, Docker, Container, Kubernetes, Best Practices.

Let's dive into the world of programming and discover innovative solutions together.
Download Telegram
Channel name was changed to Β«πŸ‹ CodeHackWithArun πŸ‹Β»
Almost finished my new πŸ’₯content πŸ’₯to be published. A Friday or tomorrow could be a learning day.

Always block Fridays for at least 2 hours to learn new things, and read books/blogs/Youtube/Pluralsight.

DOT NOT LEARN ANYTHING IF YOU WANT AI TO WIN AND WRITE YOUR CODE #learning
#Kubernetes tip: Use labels to organize and manage your deployments effectively. They help you group resources, apply common configurations, and simplify updates. #DevOps #Containerization
πŸ’₯ Angular v16 Signals - The New Reactivity Model πŸ‘‡πŸ‘‡

✍️ The Angular team is released its new reactivity model to '@angular/core', which means core framework. Signals is a new reactivity model that allows components to share data; when you change a signal's value, it automatically updates anything that uses it.


What is a Signal?

πŸ‘‰ A signal is a variable + change notification

πŸ‘‰ A signal is reactive, and is called a "reactive primitive"

πŸ‘‰ A signal always has a value

πŸ‘‰ A signal is synchronous

πŸ‘‰ A signal is not a replacement for RxJS and Observables for asynchronous operations, such as http.get


πŸ”– Read More (https://www.arunyadav.in/codehacks/blogs/post/49/angular-v16-signals-the-new-reactivity-model)



#angular #angularv16 #developers #development #frontenddeveloper #UIUXDesigner #programmer #change
πŸ’₯ Working with Azure Cosmos DB in your Azure Functions πŸ‘‡πŸ‘‡
https://www.arunyadav.in/codehacks/blogs/post/52/working-with-azure-cosmos-db-in-your-azure-functions

Let's create something in real time.

πŸ’₯ Insert Record Function:

πŸ‘‰ The Insert Record function, as described in the previous code snippet, handles the HTTP POST request to insert a student record into a Cosmos DB collection.
πŸ‘‰ When a POST request is received, the function reads the request body, deserializes it into a StudentEntity object, and creates a new document in the specified Cosmos DB collection with the student record data.
πŸ‘‰The function returns the inserted document as the response.

πŸ’₯ Change Feed Function:

πŸ‘‰ The Change Feed function, as described in the previous code snippet, uses the Cosmos DB trigger to monitor changes in a specific Cosmos DB collection.
πŸ‘‰ When a change occurs, such as an insertion, update, or deletion of a document in the monitored collection, the Change Feed function is triggered.
πŸ‘‰ The function receives the batch of changed documents as the input parameter and can perform custom logic to process the changed documents.

πŸ’₯ Relationship between the functions:

πŸ‘‰ After the Insert Record function inserts a new student record into the Cosmos DB collection, the Change Feed function can be triggered if the insertion causes a change in the monitored collection.
πŸ‘‰The Change Feed function can then process the inserted document or perform any desired logic based on the change. For example, you can use the Change Feed function to send notifications, update related data, or trigger other actions whenever a new student record is inserted.

#cosmos #database #azure #development #programmer #developers
πŸ’₯ Angular Authentication using JWT token πŸ‘‡πŸ‘‡
https://www.arunyadav.in/codehacks/blogs/post/36/angular-authentication-using-jwt-token

πŸ’₯ Steps to implementing JWT authentication in angular

πŸ‘‰ Install dependencies
πŸ‘‰ Create a login page
πŸ‘‰ Create AuthService
πŸ‘‰ Store JWT token
πŸ‘‰ Create a guard to prevent route
πŸ‘‰Create Http Interceptor

#AngularAuthentication #JWTAuthentication #development #programmer #developers #AngularJWT #TokenAuthAngular
πŸ‘1
πŸ’₯ Use MediatR in .NET Core with CQRS implementation πŸ‘‡πŸ‘‡
https://www.arunyadav.in/codehacks/blogs/post/28/use-mediatr-in-net-core-with-cqrs-implementation-

πŸ’₯ CQRS (Command Query Responsibility Segregation)

πŸ‘‰ Categorized into two categories: Commands and Queries.
πŸ‘‰ It helps improve the maintainability and reliability of software systems.


πŸ’₯ Mediator Pattern

πŸ‘‰ MediatR is an "in-process" implementation
πŸ‘‰ It enables objects to not communicate directly with each other but instead send messages to the mediator
πŸ‘‰ It helps to implement flexible and scalable systems
πŸ‘‰ Objects can be added or removed without affecting the existing objects

πŸ’₯ Implementation using MediatR is a .Net library
πŸ’₯ Part 01 - Clean Architecture Overview πŸ‘‡πŸ‘‡
https://www.arunyadav.in/codehacks/blogs/post/20/part-01-clean-architecture-overview?prvew-on-tab=1

πŸ’₯ Clean Architecture consists of several circles or layers

πŸ‘‰ The innermost circle is the business logic
πŸ‘‰ The next layer is the interface adapters, which are responsible for converting data between the business logic and the outer layers.
πŸ‘‰ Finally, the outer layer is the frameworks and drivers, which are responsible for providing external services to the application

The flow of dependencies in the diagram moves toward the center. The centermost point is referred to as the Application Core, which acts as the nucleus of the diagram and is not dependent on any other layers. The entities and interfaces occupy the central position while domain services, which provide implementation to the central interfaces, surround them. The UI and Infrastructure layers, located on the exterior, are both dependent on the Application Core.

#Architecture #pattern #development #programmer #developers
πŸ’₯ Real-Time Applications with Azure SignalR, Angular, and .Net Core πŸ‘‡πŸ‘‡
https://www.arunyadav.in/codehacks/blogs/post/55/realtime-applications-with-azure-signalr-angular-and-net-core


We are creating a real-time chat application with a professional and user-friendly interface. The application allows users to enter their names, start a chat session, and exchange messages in real-time. We are using Angular, SignalR, and .NET Core to develop a real-time chat application.


#Azure #SignalR #DotNet #programmer #developers
Kubernetes clusters are under attack in hundreds of organizations

Kubernetes (K8s) clusters belonging to more than 350 organizations, open-source projects, and individuals have been detected as openly accessible and unprotected. More than half of those have been breached and had an active campaign with deployed malware/backdoors.

Two common misconfigurations exploited in the wild

1. The research highlighted two common misconfigurations, The first grants anonymous access with privileges whereby an anonymous unauthenticated user only undergoes one phase of authorization. "By default, the anonymous user has no permissions, but we have seen that practitioner in the wild, and in some cases, give privileges to the anonymous user," they wrote.

When mixing all the above, a severe misconfiguration is created. "We have seen cases in which practitioners bind the anonymous user role with other roles, often with admin roles, which puts their clusters in danger," according to the researchers.

2. The second issue is a misconfiguration of the kubectl proxy with flags that unknowingly expose the Kubernetes cluster to the internet, the researchers said. Impacted hosts included organizations across a variety of sectors such as financial services, aerospace, automotive, industrial, and security.

"When you run the same command with the following flags '–address=0.0.0.0 –accept-hosts .*', the proxy on your workstation will now listen and forward authorized and authenticated requests to the API server from any host that has HTTP access to the workstation. Mind, that the privileges are the same privileges that the user who ran the 'kubectl proxy' command has."