Skip to content

Instantly share code, notes, and snippets.

View devops-school's full-sized avatar

DevOps School devops-school

View GitHub Profile
@devops-school
devops-school / AlgoBenchmarks.cs
Created November 27, 2025 06:11
BenchmarkDotNet: DOTNET Lab & Demo
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using System;
using System.Linq;
namespace BenchmarkDotNetLab
{
// Captures allocations & GC info
[MemoryDiagnoser]
// Rank methods from fastest to slowest
@devops-school
devops-school / Program.cs
Created November 26, 2025 07:56
DOTNET: Threading Design Example threading anti-patternsm, proper async/await & concurrency behavior
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
// Minimal API demo to show bad vs good threading practices in .NET
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
// Simple concurrency metrics
@devops-school
devops-school / Program.cs
Created November 26, 2025 07:15
DOTNET: Understanding Garbage Collection with Gen0, Gen1, Gen2
using System;
using System.Collections.Generic;
using System.Diagnostics;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("=========================================");
Console.WriteLine(" .NET GC Generations Demo (Gen0/1/2) ");
@devops-school
devops-school / Program.cs
Created November 26, 2025 06:52
DOTNET: Understanding Memory leaks and Debugging using dotMemory
using System.Diagnostics;
using System.Text;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
// ===============================================
// INTENTIONAL MEMORY LEAK DEMO
// ===============================================
//
@devops-school
devops-school / Program.cs
Created November 26, 2025 06:30
DOTNET: TLS & Its Versions impact on Performance
using System.Diagnostics;
using System.Net;
using System.Security.Authentication;
using System.Threading;
// Simple .NET minimal API to demo TLS 1.2 vs TLS 1.3 impact
// and expose basic in-process metrics at /metrics
var builder = WebApplication.CreateBuilder(args);
@devops-school
devops-school / CircularDependencyDemo.cs
Last active November 26, 2025 05:50
Circular Dependency in DOT NET
// ============================================================
// Circular Dependency Example (BAD) + Fixed Example (GOOD)
// Single-file demonstration for training
// ============================================================
using System;
using Microsoft.Extensions.DependencyInjection;
namespace CircularDependencyDemo
{
@devops-school
devops-school / mail.php
Created November 24, 2025 13:35
PHP Code for Godaddy VPS Server SMTP Email Relay
<?php
$host = 'n1smtpout.europe.secureserver.net';
$port = 25;
$from = 'contact@guestpostai.com';
$to = 'contact@guestpostai.com';
echo "<pre>Connecting to SMTP ($host:$port)...\n";
first last address city phone
Jane Garcia 643 2nd Ave Boston 9325763815
Emma Smith 5399 Maple St Houston 9084802186
Bob Smith 5016 Cedar St Boston 8985554810
Alice Brown 3417 1st Ave San Jose 2684754835
Olivia Miller 4543 Oak St San Jose 2339613320
Jane Martinez 9221 Pine St Dallas 8705643176
Alice Miller 7568 Broadway Houston 4414732574
Chris Jones 9324 Maple St Chicago 9741513938
Michael Johnson 4990 Maple St Houston 3556216310
@devops-school
devops-school / Linux-MySQLMariaDB-CPU-MEMORY.md
Created August 23, 2025 08:26
Linux + MySQL MariaDB: Who’s eating CPU RAM

Linux + MySQL/MariaDB: “Who’s eating CPU/RAM?” — Handy Commands

Below is a compact, copy-pasteable cheat-sheet to find which process, user, or application is consuming the most CPU and memory, plus MySQL/MariaDB commands to pinpoint hot databases and queries.


🧠 Quick System Snapshots

# Top CPU processes (non-interactive)
@devops-school
devops-school / install_artifactory.sh
Created July 27, 2025 11:27
How to install Jfrog Artifactory Automated Installation Script
#!/bin/bash
# === Variables ===
DB_NAME="artifactory"
DB_USER="artifactory"
DB_PASS="StrongPassword123!"
ARTIFACTORY_VERSION="7.117.7"
echo "=== JFrog Artifactory $ARTIFACTORY_VERSION Installation Started ==="