Skip to content

Instantly share code, notes, and snippets.

View carloswm85's full-sized avatar
🎯
Compiling...

Carlos W. Mercado carloswm85

🎯
Compiling...
View GitHub Profile

Why SSH Authentication Exists and Its Value for Git Repositories

SSH authentication provides secure, encrypted access to remote systems and services, replacing insecure protocols like Telnet with cryptographic key pairs for authentication. It enables safe remote command execution, file transfers, and server management over untrusted networks without exposing passwords.

The Foundation of SSH Authentication

SSH (Secure Shell) emerged as a replacement for vulnerable protocols, leveraging public-key cryptography where a private key remains local while a public key verifies identity on the server. The authentication flow uses asymmetric encryption to confirm access without transmitting credentials over the network.

---

Admin User Complete Lifecycle Flow

Sequence diagram showing the complete lifecycle of an admin user from login to logout, including all CRUD operations. This format is perfect for showing the temporal flow and interactions between components.

What the Diagram Shows:

🔵 Authentication Phase (Steps 1-6)

  • User enters credentials
  • System validates and creates claims (including "Admin" role)
  • Token/cookie is generated and sent to user
@carloswm85
carloswm85 / ntier-architecture-explanation.md
Last active December 11, 2025 16:00
This document provides a complete, end-to-end explanation of Layered (N-Tier) Architecture in .NET Core, demonstrating how responsibilities are separated into Presentation, Application, Business Logic, Data Access, and Database layers. It illustrates each layer with real-world controller, service, manager, and repository code, explains how depen…

https://www.perplexity.ai/search/level-layers-functionality-tec-XUGF.P3OQ222h9LUWsYxIw#3

"Supplement with specific repositories for complex queries" means that besides having a general, often generic repository for simple CRUD operations, you create specialized repository classes to handle more elaborate and performance-sensitive data retrieval needs that don't fit well into simple CRUD patterns. These specialized repositories encapsulate complex querying logic, using techniques like joins, projections, or raw SQL for efficiency.

Examples and Patterns:

  1. Specific Repository for Complex Queries
    • For example, you might have a generic IRepository<T> for basic CRUD, but also an IInvoiceRepository with methods like:

public interface IInvoiceRepository : IRepository

@carloswm85
carloswm85 / UpperCaseAttribute.cs
Created October 11, 2025 20:17 — forked from pazteddy/UpperCaseAttribute.cs
Atributo personalizado para convertir un texto a mayúsculas
[AttributeUsage(AttributeTargets.Property)]
public class UpperCaseAttribute : Attribute
{
}
public static class AttributeProcessor
{
public static void ApplyUpperCase(object obj)
{
@carloswm85
carloswm85 / PdfProtection.cs
Created September 25, 2025 13:01
The `PdfProtection` class is a utility for creating and managing password-protected PDF documents using iText 7, offering configurable security through encryption levels (40-bit, 128-bit, AES-128, AES-256) and fine-grained permission flags (printing, copying, modifying, annotating, filling forms, etc.). It allows both synchronous and asynchronou…
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using iText.Kernel.Exceptions;
using iText.Kernel.Pdf;
using iText.Kernel.Pdf.Canvas.Draw;
using iText.Layout;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using iText.Kernel.Geom;
using iText.Kernel.Pdf;
using iText.Kernel.Pdf.Canvas.Draw;
using iText.Layout;
using iText.Layout.Element;
using iText.Layout.Properties;
@carloswm85
carloswm85 / Instalaciones-DotNET.md
Created September 18, 2025 23:12 — forked from pazteddy/Instalaciones-DotNET.md
Instalaciones recomendadas para el curso .NET Backend: .NET Core, SQL Server y seguridad JWT
// Mask the field for the GDE file name input https://stackoverflow.com/a/56704775/7389293
$('.cuitcuil-mask').mask('00-00000000-0', {
'translation': {
//'#': { pattern: /#/, fallback: '#', optional: false },
},
placeholder: "__-________-_"
});