{"@attributes":{"version":"2.0"},"channel":{"title":"Posts on rmauro.dev \u2014 Technical Blog","link":"https:\/\/rmauro.dev\/posts\/","description":"Recent content in Posts on rmauro.dev \u2014 Technical Blog","generator":"Hugo","language":"en-us","lastBuildDate":"Fri, 13 Mar 2026 10:00:00 -0400","item":[{"title":"Keep Gmail Lean: Archive Everything Locally on Linux (Pi4\/Pi5 Included)","link":"https:\/\/rmauro.dev\/keep-gmail-lean-archive-everything-locally-on-raspberry\/","pubDate":"Fri, 13 Mar 2026 10:00:00 -0400","guid":"https:\/\/rmauro.dev\/keep-gmail-lean-archive-everything-locally-on-raspberry\/","description":"<h1 id=\"linux-email-archive-pi4pi5-compatible\" class=\"relative group\">Linux Email Archive (Pi4\/Pi5 Compatible) <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#linux-email-archive-pi4pi5-compatible\" aria-label=\"Anchor\">#<\/a><\/span><\/h1><h2 id=\"introduction\" class=\"relative group\">Introduction <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#introduction\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>If your Gmail account keeps growing, this setup gives you the best of both worlds: a lean cloud mailbox and a complete local archive you fully control. In this guide, you will mirror all mail to a Linux host using Maildir, index everything with Notmuch for fast local search, and enforce a retention policy that keeps only the last 90 days on Gmail while preserving full history locally.<\/p>"},{"title":"WebRTC Deep Dive: ICE, TURN, and SFU","link":"https:\/\/rmauro.dev\/webrtc-deep-dive-ice-turn-and-sfu\/","pubDate":"Tue, 05 Aug 2025 14:17:32 -0400","guid":"https:\/\/rmauro.dev\/webrtc-deep-dive-ice-turn-and-sfu\/","description":"<p>If you\u2019ve ever joined a Google Meet call, participated in an online game with voice chat, or watched a live stream in your browser, you\u2019ve likely used WebRTC without even realizing it.<\/p>\n<p>It\u2019s the technology that enables real-time, peer-to-peer communication directly in browsers and apps - no plugins required.<\/p>\n<p>Behind the scenes, however, making two devices talk to each other across the internet is more complex than it sounds. Firewalls, NAT devices, and varying network conditions make direct connections challenging.<\/p>"},{"title":"On the Road to Host My Own Data","link":"https:\/\/rmauro.dev\/on-the-road-to-host-my-own-data\/","pubDate":"Tue, 22 Jul 2025 19:45:33 -0400","guid":"https:\/\/rmauro.dev\/on-the-road-to-host-my-own-data\/","description":"<p>At some point, you start to wonder: what would it take to run the services I rely on most \u2014 myself?<\/p>\n<p>I wasn\u2019t aiming for a dramatic cloud exodus. But I wanted more control over the services I use every day \u2014 especially for photo storage, document management, and backups. Rather than spreading my personal data across Google Photos, Google Drive, Dropbox, and iCloud, I decided to take a different path.<\/p>"},{"title":"Make Your Machine Talk: Piper TTS Offline","link":"https:\/\/rmauro.dev\/how-to-run-piper-tts-on-your-raspberry-pi-offline-voice-zero-internet-needed\/","pubDate":"Mon, 07 Jul 2025 20:26:01 -0400","guid":"https:\/\/rmauro.dev\/how-to-run-piper-tts-on-your-raspberry-pi-offline-voice-zero-internet-needed\/","description":"<p>Want to make your computer <em>talk<\/em> \u2014 using real, natural-sounding voices without needing the cloud?<\/p>\n<p>In this tutorial, we\u2019ll set up <a href=\"https:\/\/github.com\/rhasspy\/piper\" target=\"_blank\" rel=\"noreferrer\"><strong>Piper TTS<\/strong><\/a> on a local system and give it a voice. It\u2019s fast, offline, and perfect for voice assistants, robotics, Raspberry Pi projects, or just impressing your friends.<\/p>\n<hr>\n<h2 id=\"what-youll-need\" class=\"relative group\">What You\u2019ll Need <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-youll-need\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li>Python 3 installed (recommended: Python 3.8 or newer)<\/li>\n<li>Linux environment (x86_64 or ARM64) - or Windows with WSL<\/li>\n<li>Internet connection (just for setup)<\/li>\n<li>A speaker or headphones<\/li>\n<li>Terminal access<\/li>\n<\/ul>\n<blockquote>\n<p>I have tested on Raspberry Pi OS 64-bit (Bookworm), Ubuntu 22.04, and Windows 11 using WSL. Works on most modern 64-bit Linux environments.<\/p>"},{"title":"Monitor Jetson Orin Nano Temperature in Real-Time with a Bash Script","link":"https:\/\/rmauro.dev\/monitor-jetson-orin-nano-temperature-in-real-time-with-a-bash-script\/","pubDate":"Sat, 05 Jul 2025 21:24:54 -0400","guid":"https:\/\/rmauro.dev\/monitor-jetson-orin-nano-temperature-in-real-time-with-a-bash-script\/","description":"<p>To monitor Jetson Orin Nano temperatures in a clean vertical format, create a Bash script that reads and parses the built-in <code>tegrastats<\/code> output.<\/p>\n<p>First, create a script file:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">nano jetson-temp-monitor.sh\n<\/span><\/span><\/code><\/pre><\/div><p>Paste the following:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\"><span class=\"cp\">#!\/bin\/bash\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># Trap Ctrl+C to show cursor again and exit cleanly<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">trap<\/span> <span class=\"s2\">&#34;tput cnorm; exit&#34;<\/span> INT\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># Hide the cursor for cleaner output<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">tput civis\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># Start tegrastats and process its output line by line<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">tegrastats <span class=\"p\">|<\/span> <span class=\"k\">while<\/span> <span class=\"nb\">read<\/span> -r line<span class=\"p\">;<\/span> <span class=\"k\">do<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    clear  <span class=\"c1\"># Clear the terminal screen on each update<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\"># Extract temperature values using grep and Perl-compatible regex (-oP)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">cpu_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;cpu@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">gpu_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;gpu@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">soc0_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;soc0@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">soc1_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;soc1@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">soc2_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;soc2@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nv\">tj_temp<\/span><span class=\"o\">=<\/span><span class=\"k\">$(<\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;<\/span><span class=\"nv\">$line<\/span><span class=\"s2\">&#34;<\/span> <span class=\"p\">|<\/span> grep -oP <span class=\"s1\">&#39;tj@\\K[0-9.]+C&#39;<\/span><span class=\"k\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\"># Print the temperatures in a vertical format<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;Jetson Orin Nano Temperature Monitor&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;------------------------------------&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;CPU Temp  : <\/span><span class=\"si\">${<\/span><span class=\"nv\">cpu_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;GPU Temp  : <\/span><span class=\"si\">${<\/span><span class=\"nv\">gpu_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;SoC0 Temp : <\/span><span class=\"si\">${<\/span><span class=\"nv\">soc0_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;SoC1 Temp : <\/span><span class=\"si\">${<\/span><span class=\"nv\">soc1_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;SoC2 Temp : <\/span><span class=\"si\">${<\/span><span class=\"nv\">soc2_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;Tj Temp   : <\/span><span class=\"si\">${<\/span><span class=\"nv\">tj_temp<\/span><span class=\"k\">:-<\/span><span class=\"nv\">N<\/span><span class=\"p\">\/A<\/span><span class=\"si\">}<\/span><span class=\"s2\">&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"nb\">echo<\/span> <span class=\"s2\">&#34;Press Ctrl+C to stop.&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">done<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Save and exit. Then make it executable:<\/p>"},{"title":"Run Docker on WSL2 Without Docker Desktop \ud83d\udc33","link":"https:\/\/rmauro.dev\/run-docker-on-wsl2-without-docker-desktop\/","pubDate":"Sun, 29 Jun 2025 23:22:32 -0400","guid":"https:\/\/rmauro.dev\/run-docker-on-wsl2-without-docker-desktop\/","description":"<p>Let\u2019s install Docker inside a WSL2 Linux distro, configure it to run without <code>sudo<\/code>, set up auto-start on launch, and enable log rotation to keep things clean\u2014all without the bloated Docker Desktop.<\/p>\n<p>Docker Desktop isn\u2019t just unnecessary\u2014it\u2019s heavy, intrusive, and now comes with licensing restrictions. Running Docker natively inside WSL2 is faster, lighter, and fully under your control. Let\u2019s set it up the right way.<\/p>\n<h2 id=\"prerequisites-\" class=\"relative group\">Prerequisites \u2705 <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prerequisites-\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li>WSL2 already installed<\/li>\n<li>Ubuntu (or another Linux distro Debian based for this article) running under WSL2<\/li>\n<\/ul>\n<h2 id=\"install-docker-inside-wsl2-\" class=\"relative group\">Install Docker (Inside WSL2) \ud83d\udd27 <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#install-docker-inside-wsl2-\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>To install the Docker Community Engine, let&rsquo;s run the following script.<\/p>"},{"title":"Running llama.cpp in Docker on Raspberry Pi","link":"https:\/\/rmauro.dev\/running-llama-cpp-in-docker-on-raspberry-pi\/","pubDate":"Sat, 14 Jun 2025 12:47:32 -0400","guid":"https:\/\/rmauro.dev\/running-llama-cpp-in-docker-on-raspberry-pi\/","description":"<p>Running large language models on a Raspberry Pi isn\u2019t just possible\u2014it\u2019s fun. Whether you&rsquo;re a hacker exploring local AI, a developer prototyping LLM workflows, or just curious about how far you can push a Pi, this tutorial is for you.<\/p>\n<p>We\u2019ll show you how to build and run <code>llama.cpp<\/code> in Docker on an ARM-based Pi to get a full LLM experience in a tiny, reproducible container. No weird dependencies. No system pollution. Just clean, fast, edge-side inference.<\/p>"},{"title":"Running LLM llama.cpp Natively on Raspberry Pi","link":"https:\/\/rmauro.dev\/running-llm-llama-cpp-natively-on-raspberry-pi\/","pubDate":"Sat, 14 Jun 2025 12:33:30 -0400","guid":"https:\/\/rmauro.dev\/running-llm-llama-cpp-natively-on-raspberry-pi\/","description":"<p>For developers and hackers who enjoy squeezing maximum potential out of compact machines, getting a large language model like <code>llama.cpp<\/code> running natively on a Raspberry Pi is a rewarding challenge. This guide walks you through compiling llama.cpp from source, downloading a model, and running inference - all on the Pi itself.<\/p>\n<h2 id=\"prerequisites\" class=\"relative group\">Prerequisites <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prerequisites\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><h3 id=\"hardware\" class=\"relative group\">Hardware <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#hardware\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><ul>\n<li>Raspberry Pi 4, 5, or newer<\/li>\n<li>64-bit Raspberry Pi OS<\/li>\n<li>4GB RAM minimum (8GB+ recommended)<\/li>\n<li>Heatsink or fan recommended for cooling<\/li>\n<\/ul>\n<h3 id=\"software\" class=\"relative group\">Software <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#software\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><ul>\n<li>Git<\/li>\n<li>CMake (v3.16+)<\/li>\n<li>GCC or Clang<\/li>\n<li>Python 3 (optional, for Python bindings)<\/li>\n<\/ul>\n<hr>\n<h2 id=\"step-by-step-guide\" class=\"relative group\">Step-by-Step Guide <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#step-by-step-guide\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><h3 id=\"install-required-tools\" class=\"relative group\">Install required tools <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#install-required-tools\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo apt update <span class=\"o\">&amp;&amp;<\/span> sudo apt upgrade -y\n<\/span><\/span><span class=\"line\"><span class=\"cl\">sudo apt install -y git build-essential cmake python3-pip libcurl4-openssl-dev\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"clone-and-build-llamacpp\" class=\"relative group\">Clone and Build llama.cpp <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#clone-and-build-llamacpp\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">git clone https:\/\/github.com\/ggerganov\/llama.cpp.git\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">cd<\/span> llama.cpp\n<\/span><\/span><span class=\"line\"><span class=\"cl\">cmake -B build\n<\/span><\/span><span class=\"line\"><span class=\"cl\">cmake --build build --config Release -j<span class=\"k\">$(<\/span>nproc<span class=\"k\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>This step takes sometime. Here we&rsquo;re compiling <code>llama-cpp<\/code> software.<\/p>"},{"title":"MinIO Storage with C#","link":"https:\/\/rmauro.dev\/getting-started-with-minio-and-charp\/","pubDate":"Mon, 17 Feb 2025 13:14:24 -0500","guid":"https:\/\/rmauro.dev\/getting-started-with-minio-and-charp\/","description":"<p>MinIO is a high-performance, self-hosted object storage system that&rsquo;s S3-compatible.<\/p>\n<p>I came across MinIO while looking fora self-hosted alternative to AWS S3. I needed a object storage that was lightweight and open source.<\/p>\n<p>MinIO stood out because it has S3 API Compatbility while being simple to deploy with Docker.<\/p>\n<p>In this guide, you&rsquo;ll learn how to:<\/p>\n<ul>\n<li>Install and run MinIO using Docker<\/li>\n<li>Set up a C# Minimal API<\/li>\n<li>Perform basic CRUD operations (upload, download, list, and delete objects)<\/li>\n<li>Understand the benefits of using MinIO<\/li>\n<\/ul>\n<h2 id=\"prerequisites\" class=\"relative group\">Prerequisites <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prerequisites\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Ensure you have the following installed:<\/p>"},{"title":"Getting started with KNN and C#","link":"https:\/\/rmauro.dev\/getting-started-with-knn-and-c\/","pubDate":"Tue, 04 Feb 2025 11:57:45 -0500","guid":"https:\/\/rmauro.dev\/getting-started-with-knn-and-c\/","description":"<p>K-Nearest Neighbors (k-NN) regression is a simple yet effective technique for predicting numeric values. This post demonstrates how to implement k-NN regression in C# from scratch.<\/p>\n<p>For simplicity, we use a small synthetic dataset:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"kt\">double<\/span><span class=\"p\">[][]<\/span> <span class=\"n\">trainData<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"kt\">double<\/span><span class=\"p\">[][]<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\u00a0 \u00a0 <span class=\"k\">new<\/span> <span class=\"kt\">double<\/span><span class=\"p\">[]<\/span> <span class=\"p\">{<\/span><span class=\"m\">1.0<\/span><span class=\"p\">,<\/span> <span class=\"m\">1.1<\/span><span class=\"p\">,<\/span> <span class=\"m\">100.0<\/span><span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\u00a0 \u00a0 <span class=\"k\">new<\/span> <span class=\"kt\">double<\/span><span class=\"p\">[]<\/span> <span class=\"p\">{<\/span><span class=\"m\">2.0<\/span><span class=\"p\">,<\/span> <span class=\"m\">2.2<\/span><span class=\"p\">,<\/span> <span class=\"m\">200.0<\/span><span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\u00a0 \u00a0 <span class=\"k\">new<\/span> <span class=\"kt\">double<\/span><span class=\"p\">[]<\/span> <span class=\"p\">{<\/span><span class=\"m\">3.0<\/span><span class=\"p\">,<\/span> <span class=\"m\">3.3<\/span><span class=\"p\">,<\/span> <span class=\"m\">300.0<\/span><span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\u00a0 \u00a0 <span class=\"k\">new<\/span> <span class=\"kt\">double<\/span><span class=\"p\">[]<\/span> <span class=\"p\">{<\/span><span class=\"m\">4.0<\/span><span class=\"p\">,<\/span> <span class=\"m\">4.4<\/span><span class=\"p\">,<\/span> <span class=\"m\">400.0<\/span><span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\">\/\/ Test data<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kt\">double<\/span><span class=\"p\">[]<\/span> <span class=\"n\">testInput<\/span> <span class=\"p\">=<\/span> <span class=\"p\">{<\/span> <span class=\"m\">2.5<\/span><span class=\"p\">,<\/span> <span class=\"m\">2.6<\/span> <span class=\"p\">};<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Each row represents an instance with two input features and one output value.<\/p>\n<h4 id=\"k-nn-regression-implementation\" class=\"relative group\">K-NN Regression Implementation <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#k-nn-regression-implementation\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><p>The algorithm calculates the Euclidean distance between the test point and training instances, selects the k nearest neighbors, and averages their output values.<\/p>"},{"title":"Socket Client over PowerShell","link":"https:\/\/rmauro.dev\/socket-client-over-powershell\/","pubDate":"Mon, 09 Dec 2024 13:31:57 -0500","guid":"https:\/\/rmauro.dev\/socket-client-over-powershell\/","description":"<p>In this article let&rsquo;s use PowerShell to create a socket client and do a simple call to a webserver.<\/p>\n<blockquote>\n<p>There are multiple ways to create sockets using PowerShell. For this article let&rsquo;s take use <code>TcpClient<\/code> object for it&rsquo;s simplicity.<\/p>\n<\/blockquote>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#set-up-the-client-socket\">Set up the Client Socket<\/a><\/li>\n<li><a href=\"#sending-the-request\">Sending the Request<\/a><\/li>\n<li><a href=\"#reading-the-response\">Reading the Response<\/a><\/li>\n<li><a href=\"#finally-close-the-connection\">Closing the Connection<\/a><\/li>\n<li><a href=\"#complete-code\">Complete Code<\/a><\/li>\n<\/ul>\n<h2 id=\"set-up-the-client-socket\" class=\"relative group\">Set up the Client Socket <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#set-up-the-client-socket\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Let&rsquo;s start by creating the client object. TcpClient it&rsquo;s a very easy way to handle TCP connections as a client.<\/p>"},{"title":"Building Your Own wc Tool in C# Code Challenge","link":"https:\/\/rmauro.dev\/building-your-own-wc-tool-in-c-code-challenge\/","pubDate":"Mon, 14 Oct 2024 19:51:21 -0400","guid":"https:\/\/rmauro.dev\/building-your-own-wc-tool-in-c-code-challenge\/","description":"<p>The Unix <code>wc<\/code> (word count) tool is a classic command-line utility that counts the number of lines, words, and characters in a text file. In this post, we&rsquo;ll work on a minimalistic version of this tool using C#.<\/p>\n<p>For this project let&rsquo;s focus on clarity over optimization, so even beginners can follow along.<\/p>\n<h2 id=\"introduction\" class=\"relative group\">Introduction <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#introduction\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The <code>wc<\/code> tool is quite useful for analyzing text files in the terminal. It provides simple statistics:<\/p>"},{"title":"Implicit Using in C#","link":"https:\/\/rmauro.dev\/implicit-using-in-csharp\/","pubDate":"Fri, 30 Aug 2024 18:51:34 -0400","guid":"https:\/\/rmauro.dev\/implicit-using-in-csharp\/","description":"<h2 id=\"introduction\" class=\"relative group\">Introduction <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#introduction\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>C# 10 introduced implicit usings, a feature designed to reduce boilerplate code by automatically including commonly used namespaces in your projects. This helps make your code cleaner and easier to manage. In this article, we&rsquo;ll explore what implicit usings are, how they work, how to manage them, and the benefits they offer.<\/p>\n<h3 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><ul>\n<li><a href=\"#what-are-implicit-usings\">What Are Implicit Usings<\/a><\/li>\n<li><a href=\"#how-implicit-usings-works\">How Implicit Usings Works<\/a><\/li>\n<li><a href=\"#enabling-implicit-usings\">Enabling Implicit Usings<\/a><\/li>\n<li><a href=\"#adding-usings-to-implicit-usings\">Adding Usings to Implicit Usings<\/a><\/li>\n<\/ul>\n<h2 id=\"what-are-implicit-usings\" class=\"relative group\">What Are Implicit Usings <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-are-implicit-usings\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Implicit usings automatically include a predefined list of <code>using<\/code> directives in your C# files, so you don&rsquo;t need to manually add them.<\/p>"},{"title":"Getting Started with Tmux on Terminal","link":"https:\/\/rmauro.dev\/getting-started-with-tmux-on-terminal\/","pubDate":"Fri, 30 Aug 2024 17:37:35 -0400","guid":"https:\/\/rmauro.dev\/getting-started-with-tmux-on-terminal\/","description":"<p>Tmux is a terminal multiplexer that allows you to run multiple terminal sessions within a single window. It is a powerful tool for anyone who spends significant time in the terminal, offering persistent sessions, multiple panes, and flexible session management. In this guide, we will cover how to install tmux, its basic and advanced commands, and provide references for further learning.<\/p>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ol>\n<li><a href=\"#introduction\">Introduction<\/a><\/li>\n<li><a href=\"#installing-tmux-using-apt\">Installing Tmux Using apt<\/a><\/li>\n<li><a href=\"#basic-tmux-commands\">Basic Tmux Commands<\/a><\/li>\n<li><a href=\"#advanced-tmux-commands\">Advanced Tmux Commands<\/a><\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n<h2 id=\"installing-tmux\" class=\"relative group\">Installing Tmux <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#installing-tmux\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Installing tmux on a Debian-based system (like Ubuntu) or WSL Terminal is straightforward using the <code>apt<\/code> package manager.<\/p>"},{"title":"Publish C# Project to Nuget.org","link":"https:\/\/rmauro.dev\/publish-csharp-project-to-nuget-org\/","pubDate":"Sat, 24 Aug 2024 20:31:57 -0400","guid":"https:\/\/rmauro.dev\/publish-csharp-project-to-nuget-org\/","description":"<p>Using NuGet packages and nuget.org are a great way to share our .NET projects with other developers and also distribute your code across multiple projects.<\/p>\n<p>In this guide, we&rsquo;ll walk through the process of publishing an existing .NET project as a NuGet package on NuGet.org. Let&rsquo;s use the <code>Rmauro.Extensions.Configuration.EnvFiles<\/code> project as an example, which is hosted on GitHub.<\/p>\n<h2 id=\"prepare-the-project-for-packaging\" class=\"relative group\">Prepare the Project for Packaging <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prepare-the-project-for-packaging\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Let&rsquo;s start by cloning the project or using DevContainers to edit in Github Cloud (as demonstrated here <a href=\"https:\/\/rmauro.dev\/create-and-configure-a-github-codespace\/\" target=\"_blank\" rel=\"noreferrer\">Create and Configure a GitHub Codespace<\/a><\/p>"},{"title":"How to Record Video and Audio with FFmpeg: A Minimalist Approach","link":"https:\/\/rmauro.dev\/how-to-record-video-and-audio-with-ffmpeg-a-minimalist-approach\/","pubDate":"Fri, 23 Aug 2024 10:25:18 -0400","guid":"https:\/\/rmauro.dev\/how-to-record-video-and-audio-with-ffmpeg-a-minimalist-approach\/","description":"<p>Recording high-quality video and audio doesn\u2019t have to be complex or expensive. With <strong>FFmpeg<\/strong>, a powerful open-source multimedia framework, you can capture video and audio effortlessly using simple command-line instructions.<\/p>\n<p>This tutorial will guide you through a minimalist approach to recording with <strong>FFmpeg<\/strong>, ensuring you get the most out of its capabilities without the need for cumbersome software.<\/p>\n<p>In this article, we&rsquo;ll explore how to utilize FFmpeg for recording screencasts and audio effectively. Whether you&rsquo;re a seasoned developer looking to create tutorial videos or someone just starting out, this guide will provide you with step-by-step instructions and essential tips to get you started.<\/p>"},{"title":"C# Enum Bitwise Operations","link":"https:\/\/rmauro.dev\/csharp-enum-bitwise-operations\/","pubDate":"Sun, 18 Aug 2024 18:24:22 -0400","guid":"https:\/\/rmauro.dev\/csharp-enum-bitwise-operations\/","description":"<p>Enums in C# offer more than just a simple way to define named constants\u2014they can be a powerful tool for handling complex scenarios when combined with bitwise operations.<\/p>\n<p>In this post, we will dive into advanced C# enum usage, focusing on bitwise operations to create powerful and flexible code. By understanding how to effectively use C# enum flags with bitwise AND\/OR operations, you can optimize your applications and write more efficient C# code.<\/p>"},{"title":"Create and Configure a GitHub Codespace","link":"https:\/\/rmauro.dev\/create-and-configure-a-github-codespace\/","pubDate":"Sat, 17 Aug 2024 19:52:55 -0400","guid":"https:\/\/rmauro.dev\/create-and-configure-a-github-codespace\/","description":"<p>GitHub Codespaces provides a powerful, cloud-based development environment that we can start and stop in seconds, tailored specifically to our project\u2019s needs.<\/p>\n<p>In this tutorial, let&rsquo;s go through the process of set up and configure a <strong>GitHub Codespace<\/strong> using an existing repository.<\/p>\n<p>Let&rsquo;s dive in and see how you can get started with GitHub Codespaces today!<\/p>\n<h2 id=\"-table-of-contents\" class=\"relative group\">\ud83d\ude80 Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#%E2%8C%9A-before-you-startmind-the-costs\">Before You Start - Mind the Costs<\/a><\/li>\n<li><a href=\"#step-1-create-a-github-codespace\">Create a GitHub Codespace<\/a><\/li>\n<li><a href=\"#step-2-select-a-pre-build-configuration\">Select a Pre-Build Configuration<\/a><\/li>\n<li><a href=\"#step-3-save-and-push-changes\">Save and Push Changes<\/a><\/li>\n<li><a href=\"#step-4-stop-current-codespace\">Stop Current Codespace<\/a><\/li>\n<li><a href=\"#the-codespace-dashboard\">The Codespace Dashboard<\/a><\/li>\n<\/ul>\n<h2 id=\"-before-you-start---mind-the-costs\" class=\"relative group\">\u231a Before You Start - Mind the Costs <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-before-you-start---mind-the-costs\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>GitHub Codespaces offers a powerful cloud-based development environment with a <strong>free usage cota<\/strong> but it&rsquo;s <strong>NOT free.<\/strong> Understanding the pricing structure can help you manage costs effectively.<\/p>"},{"title":"Create a Configuration Provider for Microsoft.Extensions.Configuration","link":"https:\/\/rmauro.dev\/create-configuration-provider-microsoft-extensions-configuration\/","pubDate":"Mon, 12 Aug 2024 23:22:23 -0400","guid":"https:\/\/rmauro.dev\/create-configuration-provider-microsoft-extensions-configuration\/","description":"<p>Let&rsquo;s create a custom configuration provider for <code>Microsoft.Extensions.Configuration<\/code>. This guide will walk you through the steps to build and integrate your own provider, tailored to meet your specific configuration needs.<\/p>\n<p>.NET Core&rsquo;s <code>IConfiguration<\/code> interface is a powerful tool for managing application settings, and it can be extended to include environment variables stored in a <code>.env<\/code> file using a custom configuration provider.<\/p>\n<h2 id=\"in-this-series\" class=\"relative group\">In This Series <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#in-this-series\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"https:\/\/rmauro.dev\/read-env-file-in-csharp\/\" target=\"_blank\" rel=\"noreferrer\">Reading .env Files in C#<\/a><\/li>\n<li>Create a Configuration Provider for Microsoft.Extensions.Configuration (You&rsquo;re here)<\/li>\n<li>Creating NuGet Package for EnvReader (coming soon)<\/li>\n<\/ul>\n<p>In this post, we\u2019ll demonstrate how to integrate the <code>EnvReader<\/code> class into <code>IConfiguration<\/code>, enabling seamless configuration management for your C# applications with support for DotEnv files.<\/p>"},{"title":"Logging Performance Improvements with Source Generators in C# .NET","link":"https:\/\/rmauro.dev\/logging-improvements-with-source-generators-in-net\/","pubDate":"Sat, 10 Aug 2024 11:41:00 -0400","guid":"https:\/\/rmauro.dev\/logging-improvements-with-source-generators-in-net\/","description":"<p>Source Generators in .NET have become increasingly popular among developers for their ability to generate code during compilation, leading to performance optimizations and cleaner codebases. In this article, we explore how you can leverage .NET Source Generators to significantly improve logging performance and maintainability in .NET applications.<\/p>\n<p>In this post, we will explore how to use source generators for logging, the improvements and benefits they bring, and some practical tips to get the most out of this feature.<\/p>"},{"title":"Load .env Files in C# .NET","link":"https:\/\/rmauro.dev\/read-env-file-in-csharp\/","pubDate":"Thu, 08 Aug 2024 10:18:17 -0400","guid":"https:\/\/rmauro.dev\/read-env-file-in-csharp\/","description":"<p>In C#, managing application configuration using environment variables stored in a <strong>.env<\/strong> file is a best practice, especially for handling different environments like development, staging, and production.<\/p>\n<p>A <em>.env<\/em> file is a convenient way to store these variables locally during development.<\/p>\n<p>In this post, let&rsquo;s check how to read a <em>.env<\/em> file in a C# application without relying on any third-party libraries. In Fact it&rsquo;s pretty simple to do.<\/p>\n<h2 id=\"in-this-series\" class=\"relative group\">In This Series <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#in-this-series\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li>Reading .env Files in C# (this article)<\/li>\n<li><a href=\"https:\/\/rmauro.dev\/create-configuration-provider-microsoft-extensions-configuration\/\" target=\"_blank\" rel=\"noreferrer\">Create a Configuration Provider for Microsoft.Extensions.Configuration<\/a><\/li>\n<li>Creating NuGet Package for EnvReader (coming soon)<\/li>\n<\/ul>\n<h2 id=\"why-use-a-env-file\" class=\"relative group\">Why Use a .env File? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#why-use-a-env-file\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>A <em>.env<\/em> file contains key-value pairs representing environment variables.<br>\nIt helps in keeping configuration separate from the codebase and is especially useful for.<\/p>"},{"title":"The Strategy Design Pattern in C# Applications","link":"https:\/\/rmauro.dev\/the-strategy-design-pattern-in-csharp\/","pubDate":"Wed, 07 Aug 2024 13:11:21 -0400","guid":"https:\/\/rmauro.dev\/the-strategy-design-pattern-in-csharp\/","description":"<p>The Strategy design pattern offers a powerful solution for making algorithms interchangeable within your applications. Let&rsquo;s cover C# application and implementation in this article.<\/p>\n<p>By encapsulating related algorithms within a family and allowing them to be swapped seamlessly, this pattern enhances flexibility and maintainability.<\/p>\n<p>In this post, we&rsquo;ll dive into the Strategy pattern, explore its key concepts, and implement a simple example in C#.<\/p>\n<h2 id=\"understanding-the-strategy-pattern\" class=\"relative group\">Understanding the Strategy Pattern <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#understanding-the-strategy-pattern\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The Strategy pattern is a behavioral design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable. It allows the algorithm to vary independently from the clients that use it.<\/p>"},{"title":"Oracle SYSDATE minus INTERVAL - Subtracting Time Units","link":"https:\/\/rmauro.dev\/oracle-sysdate-internal-subtracting-time\/","pubDate":"Tue, 06 Aug 2024 13:15:16 -0400","guid":"https:\/\/rmauro.dev\/oracle-sysdate-internal-subtracting-time\/","description":"<p>Oracle&rsquo;s <code>SYSDATE<\/code> function, combined with the <code>INTERVAL<\/code> keyword, provides a convenient way to manipulate dates and times.<\/p>\n<h2 id=\"operations-with-sysdate-on-oracle\" class=\"relative group\">Operations with SYSDATE on Oracle <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#operations-with-sysdate-on-oracle\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Here are examples of subtracting different time units from the current date and time.<\/p>\n<h3 id=\"subtracting-months\" class=\"relative group\">Subtracting Months <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#subtracting-months\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>To subtract six months from the current date:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-sql\" data-lang=\"sql\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"n\">SYSDATE<\/span><span class=\"w\"> <\/span><span class=\"o\">-<\/span><span class=\"w\"> <\/span><span class=\"nb\">INTERVAL<\/span><span class=\"w\"> <\/span><span class=\"s1\">&#39;6&#39;<\/span><span class=\"w\"> <\/span><span class=\"k\">MONTH<\/span><span class=\"w\"> <\/span><span class=\"k\">AS<\/span><span class=\"w\"> <\/span><span class=\"s2\">&#34;Six Months Ago&#34;<\/span><span class=\"w\"> <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"n\">DUAL<\/span><span class=\"p\">;<\/span><span class=\"w\">\n<\/span><\/span><\/span><\/code><\/pre><\/div><h3 id=\"subtracting-days\" class=\"relative group\">Subtracting Days <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#subtracting-days\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>To subtract 10 days from the current date:<\/p>"},{"title":"Connect to Memcached Server Using only Terminal","link":"https:\/\/rmauro.dev\/connecting-to-memcached-using-terminal\/","pubDate":"Sun, 04 Aug 2024 17:30:20 -0400","guid":"https:\/\/rmauro.dev\/connecting-to-memcached-using-terminal\/","description":"<p>Recently, I encountered an intriguing code challenge: <a href=\"#references\">build a CLI to connect to Memcached<\/a>.<\/p>\n<p>My initial thought was to use <code>telnet<\/code> to interact with the Memcached server. However, after spending some time reading the <a href=\"#references\">Memcached protocol documentation<\/a> I decided to use <strong>Netcat<\/strong> instead.<\/p>\n<p>This blog post shares my experience and explains how to use <code>netcat<\/code> to connect to Memcached, illustrating some basic commands.<\/p>\n<h2 id=\"prerequisites\" class=\"relative group\">Prerequisites <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prerequisites\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Ensure the following before starting:<\/p>"},{"title":"Set up GitHub with SSH Config","link":"https:\/\/rmauro.dev\/github-ssh-key-authentication-and-ssh-config\/","pubDate":"Sat, 27 Jul 2024 17:52:26 -0400","guid":"https:\/\/rmauro.dev\/github-ssh-key-authentication-and-ssh-config\/","description":"<p>By setting up SSH keys for GitHub, you can securely connect to your repositories without the hassle of repeatedly entering your username and password.<\/p>\n<p>This guide will walk you through the process of setting up and using SSH keys with GitHub via the SSH config file.<\/p>\n<blockquote>\n<p>While many developers use the <code>ssh-agent<\/code> to manage their SSH keys, an alternative method involves configuring the SSH config file for even smoother operations.<\/p>"},{"title":"Recursive Calls in C#: A Deep Dive","link":"https:\/\/rmauro.dev\/recursive-calls-in-csharp\/","pubDate":"Fri, 19 Jul 2024 15:18:44 -0400","guid":"https:\/\/rmauro.dev\/recursive-calls-in-csharp\/","description":"<p>Recursion functions are like a magical mirror that reflects upon itself. It&rsquo;s a concept where a function calls itself, creating a mesmerizing loop of self-referential elegance.<\/p>\n<p>Let&rsquo;s break it down how recursive functions works using <strong>Factorial Calculation<\/strong> as sample.<\/p>\n<h2 id=\"what-is-a-factorial\" class=\"relative group\">What is a Factorial? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-a-factorial\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Before we dive into the code, let&rsquo;s unravel the mystery of factorials.<br>\nA factorial of a non-negative integer N, denoted as N!, is the product of all positive integers from 1 to N.<\/p>"},{"title":"Exit Codes in C# Applications","link":"https:\/\/rmauro.dev\/exit-codes-in-csharp-applications\/","pubDate":"Wed, 17 Jul 2024 13:32:06 -0400","guid":"https:\/\/rmauro.dev\/exit-codes-in-csharp-applications\/","description":"<p>When developing console applications in C#, it&rsquo;s important to communicate the success or failure of your program back to the operating system.<\/p>\n<p>This is achieved through exit codes, which are integers returned by the program when it finishes execution.<\/p>\n<p>An exit code of <code>0<\/code> typically signifies success, while any non-zero value indicates an error.<\/p>\n<h2 id=\"setting-exit-codes-in-c\" class=\"relative group\">Setting Exit Codes in C# <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#setting-exit-codes-in-c\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>In C#, you can set the exit code using the <code>Environment.ExitCode<\/code> property or the <code>Environment.Exit<\/code> method. Here&rsquo;s how you can use both:<\/p>"},{"title":"Singleton Design Pattern - When Not to Use It","link":"https:\/\/rmauro.dev\/singleton-design-pattern-when-and-when-not-to-use-it\/","pubDate":"Fri, 12 Jul 2024 02:35:01 -0400","guid":"https:\/\/rmauro.dev\/singleton-design-pattern-when-and-when-not-to-use-it\/","description":"<p>The Singleton design pattern is one of the simplest yet most powerful design patterns in software development.<\/p>\n<p>It ensures that a class has only one instance and provides a global point of access to that instance.<\/p>\n<p>Let&rsquo;s explore its implementation in C# and discuss scenarios where it is appropriate to use this pattern and when it is better to avoid it.<\/p>\n<h2 id=\"table-of-contents\" class=\"relative group\">**\ud83d\udce2**Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#%F0%9F%A7%BEsingleton-design-pattern\">Singleton Design Pattern<\/a><\/li>\n<li><a href=\"#when-to-use-the-singleton-pattern\">When to Use the Singleton Pattern<\/a><\/li>\n<li><a href=\"#when-not-to-use-the-singleton-pattern\">When Not to Use the Singleton Pattern<\/a><\/li>\n<\/ul>\n<h2 id=\"singleton-design-pattern\" class=\"relative group\">**\ud83e\uddfe**Singleton Design Pattern <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#singleton-design-pattern\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The Singleton pattern restricts the instantiation of a class to one single instance.<\/p>"},{"title":"Reading appsettings.json from a Console Application","link":"https:\/\/rmauro.dev\/reading-appsettings-json-from-a-console-application\/","pubDate":"Wed, 10 Jul 2024 10:18:00 -0400","guid":"https:\/\/rmauro.dev\/reading-appsettings-json-from-a-console-application\/","description":"<p>When developing C# .NET applications, it&rsquo;s common to store configuration settings in a JSON file, typically named <code>appsettings.json<\/code>.<\/p>\n<p>This approach is not only useful for ASP.NET applications but can also be effectively used in C# Console Applications.<\/p>\n<p>Before we start, let&rsquo;s make sure to have:<\/p>\n<ul>\n<li>.NET SDK installed on your machine.<\/li>\n<li>A basic understanding of C# and .NET.<\/li>\n<\/ul>\n<h2 id=\"-step-by-step-guide\" class=\"relative group\">\ud83d\ude97 Step-by-Step Guide <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-step-by-step-guide\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>First, create a new .NET console application.<\/p>"},{"title":"Understanding the Monad Design Pattern","link":"https:\/\/rmauro.dev\/understanding-the-monad-design-pattern\/","pubDate":"Sun, 07 Jul 2024 03:40:03 -0400","guid":"https:\/\/rmauro.dev\/understanding-the-monad-design-pattern\/","description":"<p>Monads are a powerful concept in functional programming that help manage side effects and maintain clean, composable code.<\/p>\n<p>In this post, we&rsquo;ll explore the <code>Maybe<\/code> monad design pattern using JavaScript, which is used to handle operations that might fail or return null\/undefined.<\/p>\n<h3 id=\"what-is-a-monad\" class=\"relative group\">What is a Monad? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-a-monad\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>In simple terms, a monad is a design pattern that allows you to wrap values, chain operations, and handle side effects in a consistent way.<\/p>"},{"title":"Slowloris Attack #whitehat","link":"https:\/\/rmauro.dev\/slow-loris-attack\/","pubDate":"Sun, 07 Jul 2024 02:16:34 -0400","guid":"https:\/\/rmauro.dev\/slow-loris-attack\/","description":"<p>Denial-of-Service (DoS) attacks are a critical threat to web server security. One particularly insidious type is the Slowloris attack, which can incapacitate a server with minimal resources.<\/p>\n<p>Remember, this guide is for educational purposes only, and any unauthorized testing on live servers is illegal and unethical.<\/p>\n<h4 id=\"what-is-a-slow-loris-attack\" class=\"relative group\">What is a Slow Loris Attack? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-a-slow-loris-attack\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><p>A Slow Loris attack involves sending numerous incomplete HTTP requests to a target server.<\/p>"},{"title":"SQL Injection with SQLMap #whitehat","link":"https:\/\/rmauro.dev\/sql-injection-with-sqlmap\/","pubDate":"Sat, 06 Jul 2024 19:22:28 -0400","guid":"https:\/\/rmauro.dev\/sql-injection-with-sqlmap\/","description":"<p>SQLMap is a powerful and popular open-source tool used to detect and exploit SQL injection vulnerabilities.<\/p>\n<p>Let&rsquo;s dive into a basic usage of SQLMap.<\/p>\n<h2 id=\"pre-requirements\" class=\"relative group\">Pre-Requirements <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#pre-requirements\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><h4 id=\"linux-installation\" class=\"relative group\">Linux Installation <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#linux-installation\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">sudo apt-get install sqlmap\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"windows-installation\" class=\"relative group\">Windows Installation <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#windows-installation\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><ul>\n<li>Download and install from SQLMap from the <a href=\"https:\/\/sqlmap.org\/\" target=\"_blank\" rel=\"noreferrer\">official website<\/a><\/li>\n<\/ul>\n<p>\n\n\n\n\n\n\n  \n  \n<figure><img src=\"https:\/\/rmauro.dev\/images\/sql-injection-with-sqlmap\/sql-maps.webp\" alt=\"\" class=\"mx-auto my-0 rounded-md\" \/>\n<\/figure>\n<\/p>"},{"title":"Set up Entity Framework Core In Memory Database Provider","link":"https:\/\/rmauro.dev\/set-up-entity-framework-core-in-memory-store\/","pubDate":"Thu, 04 Jul 2024 22:30:13 -0400","guid":"https:\/\/rmauro.dev\/set-up-entity-framework-core-in-memory-store\/","description":"<p>One of the useful features of EF Core is the In-Memory Database Provider, which is perfect for testing purposes. In this guide, we will walk through setting up EF Core with an in-memory database, demonstrating how to configure and use it effectively.<\/p>\n<h2 id=\"step-by-step-guide\" class=\"relative group\">Step-by-Step Guide <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#step-by-step-guide\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Start by creating a new .NET console using the .NET CLI and add the required packages.<\/p>"},{"title":"Hangfire Implementing Background Jobs","link":"https:\/\/rmauro.dev\/implementing-background-jobs-with-hangfire-a-hands-on-guide\/","pubDate":"Mon, 01 Jul 2024 16:36:57 -0400","guid":"https:\/\/rmauro.dev\/implementing-background-jobs-with-hangfire-a-hands-on-guide\/","description":"<p>Hangfire is a robust library for managing background jobs in .NET applications, allowing developers to easily create and manage tasks that run asynchronously.<\/p>\n<p>Whether you&rsquo;re scheduling recurring tasks, executing one-off jobs, or managing time-consuming operations without blocking the main thread, Hangfire provides a flexible and reliable solution. In this article, we&rsquo;ll walk through setting up Hangfire to automatically clean up expired JWT tokens from a database, ensuring your authentication system remains efficient and secure.<\/p>"},{"title":"HTTP 400 Bad Request","link":"https:\/\/rmauro.dev\/400-bad-request\/","pubDate":"Fri, 28 Jun 2024 18:45:07 -0400","guid":"https:\/\/rmauro.dev\/400-bad-request\/","description":"<p>HTTP status code 400, known as &ldquo;Bad Request,&rdquo; indicates that the server cannot process the client&rsquo;s request due to client-side errors. These errors can include malformed request syntax, invalid request message framing, or deceptive request routing.<\/p>\n<p>A common scenario for a 400 status code is when the client sends a request with incorrect parameters, such as an invalid query string or body data that doesn&rsquo;t conform to the expected format. This response helps in debugging issues during API development, signaling the need to correct the request before resubmission.<\/p>"},{"title":"HTTP 403 Forbidden","link":"https:\/\/rmauro.dev\/http-403-forbidden\/","pubDate":"Fri, 28 Jun 2024 18:41:37 -0400","guid":"https:\/\/rmauro.dev\/http-403-forbidden\/","description":"<p>HTTP status code 403, or &ldquo;Forbidden,&rdquo; indicates that the server understands the client&rsquo;s request but refuses to authorize it. Unlike a 401 status code, which signifies missing or invalid authentication, a 403 status means that the client&rsquo;s credentials are recognized but they do not have permission to access the requested resource.<\/p>\n<p>This status is often encountered when a user tries to access a restricted area of a website or an API endpoint for which they lack the necessary privileges. For example, a regular user might receive a 403 response when attempting to access an admin panel.<\/p>"},{"title":"HTTP 401 Unauthorized","link":"https:\/\/rmauro.dev\/http-401-unauthorized\/","pubDate":"Fri, 28 Jun 2024 18:37:46 -0400","guid":"https:\/\/rmauro.dev\/http-401-unauthorized\/","description":"<p>HTTP status code 401, also known as &ldquo;Unauthorized,&rdquo; is a crucial response status in web development and API communications.<\/p>\n<p>It indicates that the client&rsquo;s request has not been fulfilled because it lacks valid authentication credentials.<\/p>\n<p>A typical scenario involving a 401 status code is when accessing a protected endpoint in a REST API. The client needs to include a valid token or API key in the request headers. If this authentication token is expired, invalid, or absent, the server will deny access, returning a 401 response.<\/p>"},{"title":"Oracle Remove Duplicate from Table","link":"https:\/\/rmauro.dev\/oracle-remove-duplicate-from-table\/","pubDate":"Thu, 27 Jun 2024 17:20:45 -0400","guid":"https:\/\/rmauro.dev\/oracle-remove-duplicate-from-table\/","description":"<p>Let&rsquo;s explore a one effective method to remove duplicate rows from an Oracle table.<\/p>\n<p>Duplicate data can be a common problem when working with databases, and it&rsquo;s crucial to eliminate such redundancy to ensure data accuracy and improve query performance.<\/p>\n<p>Using this simple query we can find and <strong>DELETE<\/strong> duplicate rows from Oracle TABLE.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-sql\" data-lang=\"sql\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">DELETE<\/span><span class=\"w\"> <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"n\">your_table<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">WHERE<\/span><span class=\"w\"> <\/span><span class=\"n\">rowid<\/span><span class=\"w\"> <\/span><span class=\"k\">NOT<\/span><span class=\"w\"> <\/span><span class=\"k\">IN<\/span><span class=\"w\"> \n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">(<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">    <\/span><span class=\"k\">SELECT<\/span><span class=\"w\"> <\/span><span class=\"k\">MIN<\/span><span class=\"p\">(<\/span><span class=\"n\">rowid<\/span><span class=\"p\">)<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">    <\/span><span class=\"k\">FROM<\/span><span class=\"w\"> <\/span><span class=\"n\">your_table<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">    <\/span><span class=\"k\">GROUP<\/span><span class=\"w\"> <\/span><span class=\"k\">BY<\/span><span class=\"w\"> <\/span><span class=\"n\">column1<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">    \t   <\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">column2<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"w\">           <\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">column3<\/span><span class=\"w\">\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">);<\/span><span class=\"w\">\n<\/span><\/span><\/span><\/code><\/pre><\/div><p>Removing Duplicates Generic Solution<\/p>"},{"title":"HTTP Status Codes Explained: From 200 OK to 429 Too Many Requests","link":"https:\/\/rmauro.dev\/http-status-codes-explained-from-200-ok-to-429-too-many-requests\/","pubDate":"Wed, 26 Jun 2024 09:58:43 -0400","guid":"https:\/\/rmauro.dev\/http-status-codes-explained-from-200-ok-to-429-too-many-requests\/","description":"<p>HTTP (Hypertext Transfer Protocol) status codes are three-digit numbers returned by web servers (such as Apache, IIS, Nginx, Kestrel, among others) to indicate the outcome of a client\u2019s request.<\/p>\n<p>These codes serve as communication tools between web clients (usually browsers and mobile applications) and servers about the outcome of the HTTP request.<\/p>\n<p>Let\u2019s discuss HTTP status codes in a developer\u2019s context \ufe0f\ud83d\udd28.<\/p>\n<h4 id=\"when-to-use-them\" class=\"relative group\">When to Use Them <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#when-to-use-them\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><ul>\n<li>Whenever a client makes a request (e.g. fetching a webpage or submitting a form), the server responds with an appropriate status code<\/li>\n<li>Use them to indicate whether the request succeeded, encountered an error, or needs further action<\/li>\n<\/ul>\n<h4 id=\"why-they-matter\" class=\"relative group\">Why They Matter <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#why-they-matter\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><ul>\n<li>Status codes help us troubleshoot issues. When something goes wrong (e.g. a broken link or server error), these codes provide clues<\/li>\n<li>They guide our decision-making. For instance, a 404 (Not Found) tells us a resource isn\u2019t available, so we can handle it gracefully<\/li>\n<\/ul>\n<h4 id=\"how-to-use-them\" class=\"relative group\">How to Use Them <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#how-to-use-them\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><ul>\n<li>As developers, we encounter status codes when building APIs, handling requests, or designing error pages.<\/li>\n<li>Understanding their meanings helps us create robust, user-friendly applications.<\/li>\n<\/ul>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#status-ranges\">Status Ranges<\/a><\/li>\n<li><a href=\"#most-used-status-codes\">Most used Status Codes<\/a><\/li>\n<li><a href=\"#common-status-codes\">Common Status Codes<\/a><\/li>\n<li><a href=\"#all-http-status-code-list\">All HTTP Status Code List<\/a><\/li>\n<\/ul>\n<h2 id=\"status-ranges\" class=\"relative group\">Status Ranges <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#status-ranges\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Status codes are grouped into five ranges, each with a specific meaning:<\/p>"},{"title":"Using dbms_stats to Gather Oracle Stats for Schema, Table and Indexes","link":"https:\/\/rmauro.dev\/gather-oracle-stats-for-schema-tables-indexes\/","pubDate":"Tue, 25 Jun 2024 15:40:32 -0400","guid":"https:\/\/rmauro.dev\/gather-oracle-stats-for-schema-tables-indexes\/","description":"<p>In Oracle databases, maintaining up-to-date statistics is crucial for optimal query performance. The <code>dbms_stats<\/code> package is a powerful tool that helps database administrators gather and manage these statistics for schemas, tables, and indexes.<\/p>\n<p>In this guide, we will walk you through the essential steps to effectively use <code>dbms_stats<\/code> to collect accurate Oracle database statistics, ensuring that your database performs at its best.<\/p>\n<p>Whether you&rsquo;re optimizing a large enterprise database or fine-tuning a smaller environment, this tutorial will provide you with the knowledge you need to manage Oracle stats with confidence.<\/p>"},{"title":"Oracle ODP.NET with truly Async Methods in C#","link":"https:\/\/rmauro.dev\/oracle-odp-net-with-truly-async-methods-in-csharp\/","pubDate":"Thu, 24 Aug 2023 14:01:18 -0400","guid":"https:\/\/rmauro.dev\/oracle-odp-net-with-truly-async-methods-in-csharp\/","description":"<p>Oracle&rsquo;s ODP.NET 23c Dev (or <em>Oracle.ManagedDataAccess.Core<\/em>) release brings genuine async\/asynchronous methods to support to database interactions in C#, revolutionizing the way developers work with Oracle databases.<\/p>\n<p>Under <em>PreRelease<\/em> until today : 2023-08-24<\/p>\n<p>\n\n\n\n\n\n\n  \n  \n<figure><img src=\"https:\/\/rmauro.dev\/images\/oracle-odp-net-with-truly-async-methods-in-csharp\/oracle-pre-release.webp\" alt=\"\" class=\"mx-auto my-0 rounded-md\" \/>\n<\/figure>\n<\/p>\n<p>Oracle.ManagedDataAccess.Core - pre release<\/p>\n<h2 id=\"asyncawait-in-c\" class=\"relative group\">Async\/Await in C# <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#asyncawait-in-c\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Before delving into the specifics of ODP.NET 23c Dev for C#, let&rsquo;s take a moment to understand the power of asynchronous programming in C#.<\/p>"},{"title":"Oracle PIVOT Command - Turn Rows into Columns","link":"https:\/\/rmauro.dev\/oracle-pivot-command-turn-rows-into-columns\/","pubDate":"Sun, 06 Aug 2023 19:13:31 -0400","guid":"https:\/\/rmauro.dev\/oracle-pivot-command-turn-rows-into-columns\/","description":"<p>Discover the technical prowess of Oracle&rsquo;s PIVOT command, a robust feature that efficiently converts rows into columns.<\/p>\n<p>This blog post delves into the syntax, use cases, and practical examples to illustrate how PIVOT simplifies data analysis and reporting in Oracle databases.<\/p>\n<h2 id=\"understanding-the-pivot-command\" class=\"relative group\">Understanding the PIVOT Command <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#understanding-the-pivot-command\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The PIVOT command is an extension of the SQL SELECT statement in Oracle. It lets you rotate rows into columns, effectively transposing data to achieve a more structured and readable output.<\/p>"},{"title":"C# Get JWT Token from Request .NET 6","link":"https:\/\/rmauro.dev\/csharp-get-jwt-token-request\/","pubDate":"Mon, 29 May 2023 19:28:28 -0400","guid":"https:\/\/rmauro.dev\/csharp-get-jwt-token-request\/","description":"<p>This blog post will explore extracting a JWT token from incoming requests using C#.<\/p>\n<p>We will explore two methods using Minimal APIs, but it&rsquo;s the same process for MVC Controllers.<\/p>\n<p>JSON Web Tokens (JWT) have become famous for securing web applications and APIs. JWTs provide a way to transmit claims between parties securely and are widely used for authentication and authorization purposes.<\/p>\n<blockquote>\n<p>Check out this article how to set up JWT Authentication in your project:<br>\n<a href=\"https:\/\/rmauro.dev\/jwt-authentication-with-csharp-dotnet\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/rmauro.dev\/jwt-authentication-with-csharp-dotnet\/<\/a><\/p>"},{"title":"Oracle JSON_TABLE Transforming JSON into Table","link":"https:\/\/rmauro.dev\/oracle-json-table-transforming-json-into-relational-format\/","pubDate":"Wed, 24 May 2023 13:35:29 -0400","guid":"https:\/\/rmauro.dev\/oracle-json-table-transforming-json-into-relational-format\/","description":"<p>The function <strong>JSON_TABLE<\/strong> allows us to transform JSON data into a table relational format.<\/p>\n<p>This article will explore the Oracle <strong>JSON_TABLE<\/strong> function and its syntax and provide examples to demonstrate its usage and capabilities.<\/p>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#understanding-the-oracle-function-jsontable\">Understanding the Oracle function JSON_TABLE<\/a><\/li>\n<li><a href=\"#example-using-oracle-jsontable\">Example Using Oracle JSON_TABLE<\/a><\/li>\n<li><a href=\"#additional-considerations\">Additional Considerations<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<h2 id=\"understanding-the-oracle-function-json_table\" class=\"relative group\">Understanding the Oracle function JSON_TABLE <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#understanding-the-oracle-function-json_table\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The JSON_TABLE function in Oracle converts JSON data into a relational format by extracting specified JSON data elements and returning them as rows and columns.<\/p>"},{"title":"Oracle MERGE Statement SQL","link":"https:\/\/rmauro.dev\/oracle-merge-to-update-sql\/","pubDate":"Sun, 21 May 2023 14:45:58 -0400","guid":"https:\/\/rmauro.dev\/oracle-merge-to-update-sql\/","description":"<p>Oracle MERGE statement is one of those powerful commands which allows you to perform <strong>INSERT<\/strong> and <strong>UPDATE<\/strong> operations in a single statement based on specific conditions.<\/p>\n<p>This article will explore the <strong>MERGE<\/strong> command in <strong>Oracle<\/strong>.<\/p>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#what-is-the-merge-to-update-command\">What is the MERGE to UPDATE Command<\/a><\/li>\n<li><a href=\"#example-using-merge-to-update\">Example Using MERGE to UPDATE<\/a><\/li>\n<li><a href=\"#additional-considerations\">Additional Considerations<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<h2 id=\"what-is-the-merge-command\" class=\"relative group\">What is the MERGE Command <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-the-merge-command\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>The MERGE statement in Oracle combines the INSERT and UPDATE operations into a single statement.<\/p>"},{"title":"XGH \/ eXtreme Go Horse","link":"https:\/\/rmauro.dev\/extreme-go-horse-xgh-process-source\/","pubDate":"Tue, 02 May 2023 12:00:00 -0400","guid":"https:\/\/rmauro.dev\/extreme-go-horse-xgh-process-source\/","description":"<p>Have you ever participated in a project that uses eXtreme Go Horse Programming, aka XGH?<\/p>\n<h2 id=\"the-xgh-commandments\" class=\"relative group\">The XGH Commandments <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#the-xgh-commandments\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ol>\n<li>I think therefore it&rsquo;s not XGH.<br>\nIn XGH you don&rsquo;t think, you do the first thing that comes to your mind. There&rsquo;s not a second option as the first one is faster.<\/li>\n<li>There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.<br>\nXGH is faster than any development process you know (see Axiom 14).<\/li>\n<li>You&rsquo;ll always need to do more and more XGH.<br>\nFor every solved problem using XGH 7 more are created. And all of them will be solved using XGH. Therefore XGH tends to the infinite.<\/li>\n<li>XGH is completely reactive.<br>\nErrors only come to exist when they appear.<\/li>\n<li>In XGH anything goes.<br>\nDoes it solve the problem? Did it compile? You commit and don&rsquo;t think about it anymore.<\/li>\n<li>You commit always before updating.<br>\nIf things go wrong your part will always be correct&hellip; and your colleagues will be the ones dealing with the problems.<\/li>\n<li>XGH don&rsquo;t have schedules.<br>\nSchedules given to you by your clients are all but important. You will ALWAYS be able to implement EVERYTHING in time (even if that means accessing the DB through some crazy script).<\/li>\n<li>Be ready to jump off when the boat starts sinking. Or blame someone else.<br>\nFor people using XGH someday the boat sinks. As time passes by the system grows into a bigger monster. You better have your resume ready for when the thing comes down. Or have someone else to blame.<\/li>\n<li>Be authentic. XGH doesn&rsquo;t follow patterns.<br>\nWrite code as you may want. If it solves the problem you must commit and forget about it.<\/li>\n<li>There&rsquo;s no refactoring just rework.<br>\nIf things ever go wrong just use XGH to quickly solve the problem. Whenever the problem requires rewriting the whole software it&rsquo;s time for you to drop off before the whole thing goes down.<\/li>\n<li>XGH is anarchic.<br>\nThere&rsquo;s no need for a project manager. There&rsquo;s no owner and everyone does whatever they want when the problems and requirements appear.<\/li>\n<li>Always believe in improvement promises.<br>\nPutting TODO comments in the code as a promise that the code will be improved later helps the XGH developer. He\/She won&rsquo;t feel guilt for the shit he\/she did. Sure there won&rsquo;t any refactoring (see Axiom 10).<\/li>\n<li>XGH is absolute.<br>\nDelivery dates and costs are absolute things. Quality is relative. Never think about quality but instead think about the minimum time required to implement a solution. Actually, don&rsquo;t think. Do!<\/li>\n<li>XGH is not a fad.<br>\nScrum, XP? Those are just trends. XGH developers don&rsquo;t follow temporary trends. XGH will always be used by those who despise quality.<\/li>\n<li>XGH is not always WOP (Workaround-oriented programming).<br>\nMany WOP requires smart thinking. XGH requires no thinking (see Axiom 1).<\/li>\n<li>Don&rsquo;t try to row against the tide.<br>\nIf your colleagues use XGH and you are the only sissy who wants to do things the right way then quit it! For any design pattern that you apply correctly, your colleagues will generate 10 times more rotten code using XGH.<\/li>\n<li>XGH is not dangerous until you see some order in it.<br>\nThis axiom is very complex but it says that an XGH project is always in chaos. Don&rsquo;t try to put order into XGH (see Axiom 16). It&rsquo;s useless and you&rsquo;ll spend a lot of precious time. This will make things go down even faster. Don&rsquo;t try to manage XGH as it&rsquo;s auto-sufficient (see Axiom 11) as it&rsquo;s also chaos.<\/li>\n<li>XGH is your bro. But it&rsquo;s vengeful.<br>\nWhile you want it XGH will always be at your side. But be careful not to abandon him. If you start something using XGH and then turn to some trendy methodology you will be fucked up. XGH doesn&rsquo;t allow refactoring (see Axiom 10) and your new sissy system will collapse. When that happens only XGH can save you.<\/li>\n<li>If it&rsquo;s working don&rsquo;t bother.<br>\nNever ever change - or even think of a question - a working code. That&rsquo;s a complete waste of time even more because refactoring doesn&rsquo;t exist (see Axiom 10).<br>\nTime is the engine behind XGH and quality is just a meaningless detail.<\/li>\n<li>Tests are for pussies.<br>\nIf you ever worked with XGH you better know what you&rsquo;re doing. And if you know what you&rsquo;re doing why test then? Tests are a waste of time. If it compiles it&rsquo;s good.<\/li>\n<li>Be used to the &rsquo;living on the edge&rsquo; feeling.<br>\nFailure and success are really similar and XGH is not different. People normally think that a project can have greater chances of failing when using XGH. But success is just a way of seeing it.<br>\nThe project failed. Did you learn something with it? Then for you, it was a success!<\/li>\n<li>The problem is only yours when your name is on the code docs.<br>\nNever touch a class of code that you&rsquo;re not the author. When a team member dies or stays away for too long the thing will go down. When that happens use Axiom 8.<\/li>\n<\/ol>\n<h2 id=\"buy-the-book-on-amazon\" class=\"relative group\">Buy the Book on Amazon <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#buy-the-book-on-amazon\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>\n\n\n\n\n\n\n  \n  \n<figure><img src=\"https:\/\/rmauro.dev\/images\/extreme-go-horse-xgh-process-source\/xhg-book.webp\" alt=\"xhg-book\" class=\"mx-auto my-0 rounded-md\" \/>\n<\/figure>\n<\/p>"},{"title":"C# JWT Authentication .NET 6","link":"https:\/\/rmauro.dev\/jwt-authentication-with-csharp-dotnet\/","pubDate":"Thu, 27 Apr 2023 23:44:59 -0400","guid":"https:\/\/rmauro.dev\/jwt-authentication-with-csharp-dotnet\/","description":"<p>In this article, we will work on implementing C# JWT Authentication using .NET 7 - which also works for .NET 6, and preview .NET 8 - using ASP.NET Core.<\/p>\n<p>Security is a significant concern today, with so much sensitive information, and not so much sensitive ones, being transmitted across the internet. One way to ensure that only authorized users access restricted information is through authentication.<\/p>\n<p>OAuth 2 and JWT Tokens (<strong>J<\/strong>SON <strong>W<\/strong>eb <strong>T<\/strong>oken) are the most common ways to ensure modern Web Applications and Mobile Applications authentication.<\/p>"},{"title":"DALL-E Art-Generator with C# .NET","link":"https:\/\/rmauro.dev\/generating-images-from-text-with-csharp-and-open-ai-dall-e\/","pubDate":"Sat, 15 Apr 2023 16:21:04 -0400","guid":"https:\/\/rmauro.dev\/generating-images-from-text-with-csharp-and-open-ai-dall-e\/","description":"<p>We will explore how to use the DALL-E Image Generator in conjunction with C# .NET.<\/p>\n<p>With just a few steps, we&rsquo;ll develop a small POC (Proof of Concept) that uses the <strong>DALL-E<\/strong> model to generate images from text phrases using C#.<\/p>\n<h2 id=\"what-is-dall-e-art-generator\" class=\"relative group\">What is DALL-E Art-Generator <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-dall-e-art-generator\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>DALL-E can generate images of almost anything, from a yellow submarine to a pig with wings. It has been trained on a massive dataset of images and textual descriptions, allowing it to learn how to generate images from natural language input.<\/p>"},{"title":"Getting Started with Serilog Custom Enrichers","link":"https:\/\/rmauro.dev\/serilog-custom-enricher-on-aspnet-core\/","pubDate":"Mon, 03 Apr 2023 20:05:15 -0400","guid":"https:\/\/rmauro.dev\/serilog-custom-enricher-on-aspnet-core\/","description":"<p><strong>Serilog<\/strong> is a popular logging library for <strong>.NET<\/strong> that provides a flexible and extensible way to log messages from applications.<\/p>\n<p>One of the key features of Serilog is the ability to <strong>Enrich Log Events<\/strong> with additional contextual information that can help troubleshoot and debug.<\/p>\n<p>In this blog post, we will explore how to create a Custom Enricher with Serilog to add custom properties to log events.<\/p>\n<h2 id=\"development\" class=\"relative group\">Development <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#development\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>To create a custom enricher with Serilog, we should define a class that implements the <code>ILogEventEnricher<\/code> interface.<\/p>"},{"title":"Getting Started with Chat GPT integration in a .NET C# Console Application","link":"https:\/\/rmauro.dev\/getting-started-with-chat-gpt-integration-with-csharp-console-application\/","pubDate":"Sun, 02 Apr 2023 12:42:29 -0400","guid":"https:\/\/rmauro.dev\/getting-started-with-chat-gpt-integration-with-csharp-console-application\/","description":"<p>With the use of <strong>C#<\/strong>, we can develop a console application that uses the <strong>Chat GPT<\/strong> model to generate human-like responses to input.<\/p>\n<p>In this blog post, we will explore the steps to develop a console application using <strong>OpenAI&rsquo;s Chat GPT<\/strong> model using C#.<\/p>\n<p><em>OpenAI<\/em> is a leading organization in the field of artificial intelligence, and one of its popular AI models is the Chat GPT (Generative Pretrained Transformer).<\/p>\n<h2 id=\"-what-are-openai-and-chat-gpt\" class=\"relative group\">\ud83d\udcac What are OpenAI and Chat GPT? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-what-are-openai-and-chat-gpt\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>OpenAI is a prominent organization that develops AI for various applications, including natural language processing. One of their popular AI models is the Chat GPT, a generative language model that uses a transformer architecture to process input text and generate human-like responses. It&rsquo;s commonly used for chatbots and other natural language processing tasks.<\/p>"},{"title":"Define Implicit and Explicit Operator - C# Tips","link":"https:\/\/rmauro.dev\/define-implicit-explicit-operator-csharp-tips\/","pubDate":"Thu, 10 Nov 2022 13:48:49 -0500","guid":"https:\/\/rmauro.dev\/define-implicit-explicit-operator-csharp-tips\/","description":"<p>C# allows us to define Implicit and Explicit operators. Unlike casting _I<strong>mplicit<\/strong>_and <strong><em>Explicit<\/em><\/strong> operators defines how C# should behave when encountering an equals sign.<\/p>\n<p><strong><em>Implicit<\/em><\/strong> operator execution can be invoked when assigning a variable or calling a method.<\/p>\n<p>To use <strong><em>Explicit<\/em><\/strong> operator we should do the same as casting an object. It&rsquo;s similar to a <strong><em>cast<\/em><\/strong> an object.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"kd\">public<\/span> <span class=\"k\">record<\/span> <span class=\"nc\">class<\/span> <span class=\"n\">Email<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span> <span class=\"n\">Value<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\">\/\/define implicit operator<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kd\">implicit<\/span> <span class=\"kd\">operator<\/span> <span class=\"kt\">string<\/span><span class=\"p\">(<\/span><span class=\"n\">Email<\/span> <span class=\"k\">value<\/span><span class=\"p\">)<\/span> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">=&gt;<\/span> <span class=\"k\">value<\/span><span class=\"p\">.<\/span><span class=\"n\">Value<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    \n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\">\/\/define implicit operator<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kd\">implicit<\/span> <span class=\"kd\">operator<\/span> <span class=\"kt\">byte<\/span><span class=\"p\">[](<\/span><span class=\"n\">Email<\/span> <span class=\"k\">value<\/span><span class=\"p\">)<\/span> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">=&gt;<\/span> <span class=\"n\">Encoding<\/span><span class=\"p\">.<\/span><span class=\"n\">UTF8<\/span><span class=\"p\">.<\/span><span class=\"n\">GetBytes<\/span><span class=\"p\">(<\/span><span class=\"k\">value<\/span><span class=\"p\">.<\/span><span class=\"n\">Value<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"c1\">\/\/define explict operator<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kd\">explicit<\/span> <span class=\"kd\">operator<\/span> <span class=\"n\">Email<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span> <span class=\"k\">value<\/span><span class=\"p\">)<\/span> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">=&gt;<\/span> <span class=\"k\">new<\/span> <span class=\"n\">Email<\/span><span class=\"p\">(<\/span><span class=\"k\">value<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Define custom operators on Record Class<\/p>"},{"title":"Calculate Time Ago with .NET C#","link":"https:\/\/rmauro.dev\/calculate-time-ago-with-csharp\/","pubDate":"Mon, 26 Sep 2022 10:00:52 -0400","guid":"https:\/\/rmauro.dev\/calculate-time-ago-with-csharp\/","description":"<p>Here is a small extension method over <em>System.DateTime<\/em> that gives its relative time readable for humans, such as:<\/p>\n<ul>\n<li>one minute ago<\/li>\n<li>2 minutes ago<\/li>\n<li>one hour ago<\/li>\n<li>3 hours ago<\/li>\n<li>3 days ago<\/li>\n<\/ul>\n<p>Check out this extension method over the <em>DateTime<\/em> structure using switch patterns.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kt\">string<\/span> <span class=\"n\">AsTimeAgo<\/span><span class=\"p\">(<\/span><span class=\"k\">this<\/span> <span class=\"n\">DateTime<\/span> <span class=\"n\">dateTime<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"n\">TimeSpan<\/span> <span class=\"n\">timeSpan<\/span> <span class=\"p\">=<\/span> <span class=\"n\">DateTime<\/span><span class=\"p\">.<\/span><span class=\"n\">Now<\/span><span class=\"p\">.<\/span><span class=\"n\">Subtract<\/span><span class=\"p\">(<\/span><span class=\"n\">dateTime<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"k\">return<\/span> <span class=\"n\">timeSpan<\/span><span class=\"p\">.<\/span><span class=\"n\">TotalSeconds<\/span> <span class=\"k\">switch<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">&lt;=<\/span> <span class=\"m\">60<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;{timeSpan.Seconds} seconds ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"n\">_<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"n\">timeSpan<\/span><span class=\"p\">.<\/span><span class=\"n\">TotalMinutes<\/span> <span class=\"k\">switch<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">&lt;=<\/span> <span class=\"m\">1<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">&#34;about a minute ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">&lt;<\/span> <span class=\"m\">60<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;about {timeSpan.Minutes} minutes ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"n\">_<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"n\">timeSpan<\/span><span class=\"p\">.<\/span><span class=\"n\">TotalHours<\/span> <span class=\"k\">switch<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">&lt;=<\/span> <span class=\"m\">1<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">&#34;about an hour ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">&lt;<\/span> <span class=\"m\">24<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;about {timeSpan.Hours} hours ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">_<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"n\">timeSpan<\/span><span class=\"p\">.<\/span><span class=\"n\">TotalDays<\/span> <span class=\"k\">switch<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"p\">&lt;=<\/span> <span class=\"m\">1<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">&#34;yesterday&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"p\">&lt;=<\/span> <span class=\"m\">30<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;about {timeSpan.Days} days ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"p\">&lt;=<\/span> <span class=\"m\">60<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">&#34;about a month ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"p\">&lt;<\/span> <span class=\"m\">365<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;about {timeSpan.Days \/ 30} months ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"p\">&lt;=<\/span> <span class=\"m\">365<\/span> <span class=\"p\">*<\/span> <span class=\"m\">2<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">&#34;about a year ago&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">          <span class=\"n\">_<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"s\">$&#34;about {timeSpan.Days \/ 365} years ago&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Extension method AsTimeAgo<\/p>"},{"title":"SSH Exposed to Internet - 8 steps check list","link":"https:\/\/rmauro.dev\/8-actions-for-hardening-your-linux-server-for-internet\/","pubDate":"Sun, 11 Sep 2022 16:57:43 -0400","guid":"https:\/\/rmauro.dev\/8-actions-for-hardening-your-linux-server-for-internet\/","description":"<p>Exposing virtual machines to the internet it&rsquo;s not an easy task. Often managed using an SSH connection we must secure our machines as much as we can against hacker attacks.<\/p>\n<p>Let&rsquo;s go through some often and ease configurations that will make it an attacker hard if trying to access your machine.<\/p>\n<h2 id=\"-in-this-issue\" class=\"relative group\">\ud83d\udcac In this issue <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-in-this-issue\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#creating-a-non-root-user\">Creating a non-root user and use eventually elevated privileged<\/a><\/li>\n<li><a href=\"#enabling-ufw-uncomplicated-firewall\">Enabling UFW Uncomplicated Firewall<\/a><\/li>\n<li><a href=\"#adding-unattended-upgrades\">Unattended Upgrades<\/a><\/li>\n<li><a href=\"#hardening-the-ssh-configuration\">Hardening the SSH Access<\/a>\n<ul>\n<li><a href=\"#using-ssh-keys-instead-of-passwords\">Use SSH Keys instead of Password<\/a><\/li>\n<li><a href=\"#changing-default-port-for-ssh\">Change the default Port for SSH<\/a><\/li>\n<li><a href=\"#disable-password-authentication-over-ssh\">Disable Password Login<\/a><\/li>\n<li><a href=\"#disable-root-user-login\">Disable Root Login over SSH<\/a><\/li>\n<li><a href=\"#using-ssh-config-file-on-ssh-client\">Use <em>config<\/em> file in SSH client for easier connection<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"-information-well-use-in-our-lab\" class=\"relative group\">\ud83d\udc49 Information we&rsquo;ll use in our lab <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#-information-well-use-in-our-lab\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>User: <em>root<\/em><br>\nPassword: generated with a <em>password generator<\/em><br>\nDescription: Our <strong>Root<\/strong> user<\/p>"},{"title":"Create a Minimal API with .NET 6","link":"https:\/\/rmauro.dev\/create-a-minimal-api-with-dotnet-6\/","pubDate":"Mon, 04 Jul 2022 16:16:53 -0400","guid":"https:\/\/rmauro.dev\/create-a-minimal-api-with-dotnet-6\/","description":"<p>One of the new features of .NET 6 is the arrival of a new template, which will replace the default and bring a good reduction in code writing. Including the removal of the <em>Startup.cs<\/em> file.<\/p>\n<p>.NET 6 was <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-6\/\" target=\"_blank\" rel=\"noreferrer\">released<\/a> as LTS (long-term stable) which means support for 3 years. So we have to learn about this new baby. Don&rsquo;t forget the new C# 10 features as well.<\/p>\n<blockquote>\n<p>Minimal APIs are architected to create HTTP APIs with minimal dependencies. They are ideal for microservices and apps that want to include only the minimum files, features, and dependencies in ASP.NET Core.<br>\n<em><strong>microsoft.com<\/strong><\/em><\/p>"},{"title":"Set up Serilog in .NET 6 as a logging provider","link":"https:\/\/rmauro.dev\/setup-serilog-in-net6-as-logging-provider\/","pubDate":"Sun, 26 Jun 2022 18:04:20 -0400","guid":"https:\/\/rmauro.dev\/setup-serilog-in-net6-as-logging-provider\/","description":"<p>Serilog is a robust API for logging with many configurations and sinks (outputs) and it is straightforward to get started in any .NET version.<\/p>\n<p>With <strong>.NET 6<\/strong> the way we used to configure <strong>Serilog<\/strong> as a logging provider in .NET 5 is gone (no more, no way sir, no no, goodbye), it&rsquo;s no longer there.<br>\nBootstrapping a .NET 6 application is different from the older version but still pretty easy.<\/p>"},{"title":"Optimizing Query Performance on C# ODP.NET - Oracle Managed Data Access","link":"https:\/\/rmauro.dev\/optmizing-data-access-with-oracle-managed-ado-net\/","pubDate":"Fri, 10 Jun 2022 10:38:46 -0400","guid":"https:\/\/rmauro.dev\/optmizing-data-access-with-oracle-managed-ado-net\/","description":"<p>Oracle C# drive is already pretty fast with the default configuration. But we can always tweak it a little to make it even faster.<br>\nBy controlling the <code>FetchSize<\/code> property in <code>ODP.NET<\/code> we can make fewer <em>round trips<\/em> to Oracle Database and fetch the data faster.<\/p>\n<p>Let&rsquo;s take a look at how it&rsquo;s done and make your data access faster.<\/p>\n<h2 id=\"setup-the-environment\" class=\"relative group\">Setup the Environment <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#setup-the-environment\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Before we get started let&rsquo;s set up our environment for testing.<\/p>"},{"title":"Adding Startup.cs back to .NET 6 Project","link":"https:\/\/rmauro.dev\/adding-startup-back-to-net-6-project\/","pubDate":"Sun, 05 Jun 2022 10:20:46 -0400","guid":"https:\/\/rmauro.dev\/adding-startup-back-to-net-6-project\/","description":"<p>When <em>.NET 6<\/em> was released, the first big change was the lack of <strong>Startup.cs<\/strong>. This is very nice and all. But sometimes we just want it back, and here is how.<\/p>\n<p>First, create a new file called <strong>Startup.cs<\/strong> at the root of your project with the following content - don&rsquo;t forget the namespace.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"kd\">public<\/span> <span class=\"k\">class<\/span> <span class=\"nc\">Startup<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">readonly<\/span> <span class=\"n\">IConfiguration<\/span> <span class=\"n\">configuration<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"n\">Startup<\/span><span class=\"p\">(<\/span><span class=\"n\">IConfiguration<\/span> <span class=\"n\">configuration<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">this<\/span><span class=\"p\">.<\/span><span class=\"n\">configuration<\/span> <span class=\"p\">=<\/span> <span class=\"n\">configuration<\/span> <span class=\"p\">??<\/span> <span class=\"k\">throw<\/span> <span class=\"k\">new<\/span> <span class=\"n\">ArgumentNullException<\/span><span class=\"p\">(<\/span><span class=\"n\">nameof<\/span><span class=\"p\">(<\/span><span class=\"n\">configuration<\/span><span class=\"p\">));<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"k\">void<\/span> <span class=\"n\">ConfigureServices<\/span><span class=\"p\">(<\/span><span class=\"n\">IServiceCollection<\/span> <span class=\"n\">services<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    \t<span class=\"n\">services<\/span><span class=\"p\">.<\/span><span class=\"n\">AddControllers<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"k\">void<\/span> <span class=\"n\">Configure<\/span><span class=\"p\">(<\/span><span class=\"n\">IApplicationBuilder<\/span> <span class=\"n\">app<\/span><span class=\"p\">,<\/span> <span class=\"n\">IWebHostEnvironment<\/span> <span class=\"n\">env<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">app<\/span><span class=\"p\">.<\/span><span class=\"n\">UseRouting<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">app<\/span><span class=\"p\">.<\/span><span class=\"n\">UseEndpoints<\/span><span class=\"p\">(<\/span><span class=\"n\">endpoints<\/span> <span class=\"p\">=&gt;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">endpoints<\/span><span class=\"p\">.<\/span><span class=\"n\">MapDefaultControllerRoute<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">});<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Then at <strong>Program.cs<\/strong> change to the following.<\/p>"},{"title":"Oracle Database on Docker for Development","link":"https:\/\/rmauro.dev\/oracle-database-on-docker-for-development\/","pubDate":"Mon, 30 May 2022 13:15:12 -0400","guid":"https:\/\/rmauro.dev\/oracle-database-on-docker-for-development\/","description":"<p>Lets set up an <em>Oracle Database<\/em> instance for development purpose using Docker is very easy. And it also runs in WSL2 over Windows.<\/p>\n<p>Let&rsquo;s use the <strong>oracleinanutshell\/oracle-xe-11g<\/strong> image. <a href=\"https:\/\/hub.docker.com\/r\/oracleinanutshell\/oracle-xe-11g\" target=\"_blank\" rel=\"noreferrer\">https:\/\/hub.docker.com\/r\/oracleinanutshell\/oracle-xe-11g<\/a><\/p>\n<h2 id=\"table-of-contents\" class=\"relative group\">Table Of Contents <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#table-of-contents\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"#running-oracle-database-on-docker\">Running Oracle Database On Docker<\/a><\/li>\n<li><a href=\"#set-up-a-new-user-and-configure-the-tablespace\">Set Up a New User and Configure the Tablespace<\/a><\/li>\n<li><a href=\"#connect-using-sql-developer\">Connect Using SQL Developer<\/a><\/li>\n<\/ul>\n<h2 id=\"running-oracle-database-on-docker\" class=\"relative group\">Running Oracle Database on Docker <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#running-oracle-database-on-docker\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Run the following commands in your terminal.<\/p>"},{"title":"AZ-900 - Useful Resources for the Exam","link":"https:\/\/rmauro.dev\/az-900-useful-resources-for-the-exam\/","pubDate":"Tue, 08 Jun 2021 22:12:58 -0400","guid":"https:\/\/rmauro.dev\/az-900-useful-resources-for-the-exam\/","description":"<p>Azure Fundamentals exam is an opportunity to prove knowledge of cloud concepts, Azure services, Azure workloads, security and privacy in Azure, as well as Azure pricing and support.<br>\nCandidates should be familiar with the general technology concepts, including concepts of networking, storage, compute, application support, and application development.<\/p>\n<p>Here are some helpful websites and tips you should look at before taking the exam.<\/p>\n<h2 id=\"browse-these-websites\" class=\"relative group\">Browse these websites <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#browse-these-websites\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"https:\/\/azure.microsoft.com\/overview\/cloud-computing-dictionary\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/azure.microsoft.com\/overview\/cloud-computing-dictionary\/<\/a><\/li>\n<li><a href=\"https:\/\/azure.microsoft.com\/services\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/azure.microsoft.com\/services\/<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MicrosoftLearning\/AZ-900T0x-MicrosoftAzureFundamentals\" target=\"_blank\" rel=\"noreferrer\">https:\/\/github.com\/MicrosoftLearning\/AZ-900T0x-MicrosoftAzureFundamentals<\/a> (labs)<\/li>\n<li><a href=\"https:\/\/www.microsoft.com\/en-us\/learning\/exam-az-900.aspx\" target=\"_blank\" rel=\"noreferrer\">https:\/\/www.microsoft.com\/en-us\/learning\/exam-az-900.aspx<\/a> (exam page)<\/li>\n<\/ul>\n<h2 id=\"microsoft-learn\" class=\"relative group\">Microsoft Learn <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#microsoft-learn\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/learn\/modules\/intro-to-azure-fundamentals\/introduction\" target=\"_blank\" rel=\"noreferrer\">https:\/\/docs.microsoft.com\/en-us\/learn\/modules\/intro-to-azure-fundamentals\/introduction<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/learn\/paths\/az-900-describe-cloud-concepts\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/docs.microsoft.com\/en-us\/learn\/paths\/az-900-describe-cloud-concepts\/<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/learn\/modules\/fundamental-azure-concepts\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/docs.microsoft.com\/en-us\/learn\/modules\/fundamental-azure-concepts\/<\/a><\/li>\n<\/ul>\n<h2 id=\"about-the-az-900-course\" class=\"relative group\">About the AZ-900 Course <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#about-the-az-900-course\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Each course is organized into four modules each module supporting an exam study area:<\/p>"},{"title":"Health Checks on your ASP.NET Core Application","link":"https:\/\/rmauro.dev\/adding-health-checks-to-net-core-application\/","pubDate":"Sun, 25 Apr 2021 13:14:00 -0400","guid":"https:\/\/rmauro.dev\/adding-health-checks-to-net-core-application\/","description":"<h2 id=\"health-endpoint-monitoring-pattern\" class=\"relative group\">Health Endpoint Monitoring pattern <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#health-endpoint-monitoring-pattern\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p><code>Health Check<\/code> in <strong>.NET 5<\/strong> is very simple. With just a few lines of code, you can set up everything to monitor the <strong>Health of our Application<\/strong>.<\/p>\n<blockquote>\n<p>Implement functional checks in an application that external tools can access through exposed endpoints at regular intervals. This can help to verify that applications and services are performing correctly.<\/p>"},{"title":"Add Build Time to your C# Assembly","link":"https:\/\/rmauro.dev\/add-build-time-to-your-csharp-assembly\/","pubDate":"Wed, 21 Apr 2021 22:38:58 -0400","guid":"https:\/\/rmauro.dev\/add-build-time-to-your-csharp-assembly\/","description":"<p>Having the Assembly version is great. This give us insights of wich version is running. Have the <em>build time<\/em> can also useful. Specially when we&rsquo;re troubleshooting our application and we&rsquo;re not sure of which version is running.<\/p>\n<p>For instance besides having only the assembly <em><code>version<\/code><\/em> we can have the <em><code>version + time<\/code><\/em> of the build. Such as <code>version 1.1.0 build at 2021-04-21 23:11:00<\/code>.<\/p>\n<h2 id=\"prelude\" class=\"relative group\">Prelude <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#prelude\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Often in our <em>Developer<\/em>, <em>DevOps<\/em> or <em>infrastructure<\/em> life we find ourselves wondering:<\/p>"},{"title":"Create a free MongoDb Cluster in the Cloud - Mongo Atlas free account","link":"https:\/\/rmauro.dev\/create-a-free-mongodb-cluster-in-the-cloud-mongo-atlas-free-account\/","pubDate":"Sun, 18 Apr 2021 21:12:09 -0400","guid":"https:\/\/rmauro.dev\/create-a-free-mongodb-cluster-in-the-cloud-mongo-atlas-free-account\/","description":"<p>**<strong>MongoDB<\/strong> is a document-oriented NoSQL database used for high volume data storage. Instead of using tables and rows as in the traditional relational databases, MongoDB makes use of collections and documents.<\/p>\n<p>MongoDb is very easy to get started - That is why I love <strong>MongoDb<\/strong>. I think it&rsquo;s the best to get started as a software developer.<\/p>\n<p>If you are like me - like <strong>MongoDb<\/strong> - or you&rsquo;re just studying it. Mongo Atlas is the right choice for you - get out of infrastructure bottlenecks.<\/p>"},{"title":"API Key Authentication - Extending the native implementation","link":"https:\/\/rmauro.dev\/api-key-authentication-extending-the-native-implementation\/","pubDate":"Sun, 28 Mar 2021 17:43:45 -0400","guid":"https:\/\/rmauro.dev\/api-key-authentication-extending-the-native-implementation\/","description":"<p>In this article, we&rsquo;re going to create the code (and understand how it works) to handle API Key authentication with just three lines of code extending the native Authentication mechanism.<br>\nWe want a simple and stupid solution and not some crazy implementation using <em>MVC<\/em> <code>[Attributes]<\/code> or any customized <em>middleware<\/em> to handle the Authentication.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"n\">services<\/span><span class=\"p\">.<\/span><span class=\"n\">AddAuthentication<\/span><span class=\"p\">(<\/span><span class=\"n\">ApiKeyAuthNDefaults<\/span><span class=\"p\">.<\/span><span class=\"n\">SchemaName<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">.<\/span><span class=\"n\">AddApiKey<\/span><span class=\"p\">(<\/span><span class=\"n\">opt<\/span> <span class=\"p\">=&gt;<\/span> <span class=\"c1\">\/\/here is our handler<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">opt<\/span><span class=\"p\">.<\/span><span class=\"n\">ApiKey<\/span> <span class=\"p\">=<\/span> <span class=\"s\">&#34;Hello-World&#34;<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">opt<\/span><span class=\"p\">.<\/span><span class=\"n\">QueryStringKey<\/span> <span class=\"p\">=<\/span> <span class=\"s\">&#34;key&#34;<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">});<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Solution - Adding API Key Authentication Service<\/p>\n<p>Ok, ok, ok. I know it&rsquo;s hard to find a good implementation of API Key Authentication out there on the internet. I think it&rsquo;s also hard to ourself&rsquo;s needing of API Key Authentication on daily basis.<br>\nBut now you found it now! Hope you like it. Leave a comment :)<\/p>"},{"title":"Native Dependency Injection in Azure Functions with C#","link":"https:\/\/rmauro.dev\/native-dependency-injection-in-azure-functions-with-csharp\/","pubDate":"Thu, 01 Oct 2020 14:58:00 -0400","guid":"https:\/\/rmauro.dev\/native-dependency-injection-in-azure-functions-with-csharp\/","description":"<p>C# Azure Functions support dependency injection through the native container.<\/p>\n<p>This allows us to use the Dependency Inject principle in native Azure Functions. In this post, we&rsquo;re going to create a simple function to demonstrate the use of it.<\/p>\n<h2 id=\"introduction\" class=\"relative group\">Introduction <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#introduction\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><blockquote>\n<p>Azure Functions allows you to run small pieces of code (called &ldquo;functions&rdquo;) without worrying about application infrastructure. With Azure Functions, the cloud infrastructure provides all the up-to-date servers you need to keep your application running at scale.<br>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-overview\" target=\"_blank\" rel=\"noreferrer\">https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/functions-overview<\/a><\/p>"},{"title":"Endpoint Monitoring with Azure Application Insights","link":"https:\/\/rmauro.dev\/endpoint-monitoring-with-azure-application-insights\/","pubDate":"Mon, 28 Sep 2020 11:14:09 -0400","guid":"https:\/\/rmauro.dev\/endpoint-monitoring-with-azure-application-insights\/","description":"<p>Let&rsquo;s explore the use of Microsoft Azure Application Insights to monitor the health of our application using the endpoint <em>\/healthcheck<\/em>.<\/p>\n<p>Applications Insights it&rsquo;s a great tool for monitoring, error logging, performance monitoring, dependency mapping, and other things. In other words, it&rsquo;s a full APM - Application Performance Management - ready for you to use in Production Environments.<\/p>\n<blockquote>\n<p>Application Insights, a feature of <a href=\"https:\/\/docs.microsoft.com\/pt-br\/azure\/azure-monitor\/overview\" target=\"_blank\" rel=\"noreferrer\">Azure Monitor<\/a>, is an extensible Application Performance Management (APM) service for developers and DevOps professionals.<br>\n<a href=\"https:\/\/docs.microsoft.com\/pt-br\/azure\/azure-monitor\/app\/app-insights-overview\" target=\"_blank\" rel=\"noreferrer\">https:\/\/docs.microsoft.com\/pt-br\/azure\/azure-monitor\/app\/app-insights-overview<\/a><\/p>"},{"title":"Adding Health Checks UI","link":"https:\/\/rmauro.dev\/adding-health-checks-ui\/","pubDate":"Mon, 21 Sep 2020 14:17:00 -0400","guid":"https:\/\/rmauro.dev\/adding-health-checks-ui\/","description":"<p>This is the second article about <strong>Health Checks<\/strong> and <strong>Application Monitoring<\/strong>.<\/p>\n<p>Health check by it self is very good feature. But Health Checks with a UI is much better, in fact is awesome!<\/p>\n<ol>\n<li><a href=\"https:\/\/rmauro.dev\/adding-health-checks-to-net-core-application\/\" target=\"_blank\" rel=\"noreferrer\">Adding Health Check endpoint<\/a><\/li>\n<li><strong>Adding UI Health Check<\/strong> [this article]<\/li>\n<li><a href=\"https:\/\/rmauro.dev\/endpoint-monitoring-with-azure-application-insights\/\" target=\"_blank\" rel=\"noreferrer\">Endpoint Monitoring with Azure Application Insights<\/a><\/li>\n<li>Using Azure App Services Endpoint Monitoring<\/li>\n<\/ol>\n<p>This article assumes that you already have Health Checks up and running.<br>\nIf not go back to <a href=\"https:\/\/rmauro.dev\/adding-health-checks-to-net-core-application\/\" target=\"_blank\" rel=\"noreferrer\">article<\/a>.<\/p>"},{"title":"Generating a Self-Signed Certificate using Powershell","link":"https:\/\/rmauro.dev\/generating-a-self-signed-certificate-using-powershell\/","pubDate":"Wed, 16 Sep 2020 18:57:25 -0400","guid":"https:\/\/rmauro.dev\/generating-a-self-signed-certificate-using-powershell\/","description":"<p>A self-signed certificate it&rsquo;s very easy to create and helps on with local development and testing.<\/p>\n<p>With a <strong>Single Line<\/strong> of PowerShell code we create a certificate.<\/p>\n<p>First, open the <code>PowerShell<\/code> as <strong>Administrator<\/strong>  and run the following command:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-powershell\" data-lang=\"powershell\"><span class=\"line\"><span class=\"cl\"><span class=\"nb\">New-SelfSignedCertificate<\/span> <span class=\"p\">`<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"err\">\u2013<\/span><span class=\"n\">DnsName<\/span> <span class=\"p\">&lt;<\/span><span class=\"nb\">DNS-Name<\/span><span class=\"p\">&gt;<\/span> <span class=\"p\">`<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"n\">-CertStoreLocation<\/span> <span class=\"s2\">&#34;cert:\\LocalMachine\\My&#34;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Create Self Signed Cert<\/p>\n<p>The <em>default<\/em> expiration is <strong>1 year<\/strong>. If you want a custom expiration date use option <code>-NotAfter<\/code>.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-powershell\" data-lang=\"powershell\"><span class=\"line\"><span class=\"cl\"><span class=\"nb\">New-SelfSignedCertificate<\/span> <span class=\"p\">`<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"err\">\u2013<\/span><span class=\"n\">DnsName<\/span> <span class=\"p\">&lt;<\/span><span class=\"nb\">DNS-Name<\/span><span class=\"p\">&gt;<\/span> <span class=\"p\">`<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"n\">-CertStoreLocation<\/span> <span class=\"s2\">&#34;cert:\\LocalMachine\\My&#34;<\/span> <span class=\"p\">`<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"n\">-NotAfter<\/span> <span class=\"p\">[<\/span><span class=\"no\">System.DateTime<\/span><span class=\"p\">]::<\/span><span class=\"n\">AddYears<\/span><span class=\"p\">(<\/span><span class=\"mf\">3<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Create Self Signed Cert with Expiration Date<\/p>"},{"title":"Compress files in memory (.zip) using C#","link":"https:\/\/rmauro.dev\/compress-zip-files-in-memory-using-csharp\/","pubDate":"Wed, 09 Sep 2020 15:59:29 -0400","guid":"https:\/\/rmauro.dev\/compress-zip-files-in-memory-using-csharp\/","description":"<p>Here is a code snippet of how to compress one or many files to a zip archive in memory using C#.<\/p>\n<blockquote>\n<p><em>It works in .Net Core and .Net Full Framework<\/em><\/p>\n<\/blockquote>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kt\">byte<\/span><span class=\"p\">[]<\/span> <span class=\"n\">GetZipArchive<\/span><span class=\"p\">(<\/span><span class=\"k\">params<\/span> <span class=\"n\">InMemoryFile<\/span><span class=\"p\">[]<\/span> <span class=\"n\">files<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kt\">byte<\/span><span class=\"p\">[]<\/span> <span class=\"n\">archiveFile<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">using<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">archiveStream<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">MemoryStream<\/span><span class=\"p\">())<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"k\">using<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">archive<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">ZipArchive<\/span><span class=\"p\">(<\/span><span class=\"n\">archiveStream<\/span><span class=\"p\">,<\/span> <span class=\"n\">ZipArchiveMode<\/span><span class=\"p\">.<\/span><span class=\"n\">Create<\/span><span class=\"p\">,<\/span> <span class=\"kc\">true<\/span><span class=\"p\">))<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">foreach<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">file<\/span> <span class=\"k\">in<\/span> <span class=\"n\">files<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"kt\">var<\/span> <span class=\"n\">zipArchiveEntry<\/span> <span class=\"p\">=<\/span> <span class=\"n\">archive<\/span><span class=\"p\">.<\/span><span class=\"n\">CreateEntry<\/span><span class=\"p\">(<\/span><span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">FileName<\/span><span class=\"p\">,<\/span> <span class=\"n\">CompressionLevel<\/span><span class=\"p\">.<\/span><span class=\"n\">Fastest<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">zipStream<\/span> <span class=\"p\">=<\/span> <span class=\"n\">zipArchiveEntry<\/span><span class=\"p\">.<\/span><span class=\"n\">Open<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"n\">zipStream<\/span><span class=\"p\">.<\/span><span class=\"n\">Write<\/span><span class=\"p\">(<\/span><span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">Content<\/span><span class=\"p\">,<\/span> <span class=\"m\">0<\/span><span class=\"p\">,<\/span> <span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">Content<\/span><span class=\"p\">.<\/span><span class=\"n\">Length<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"n\">archiveFile<\/span> <span class=\"p\">=<\/span> <span class=\"n\">archiveStream<\/span><span class=\"p\">.<\/span><span class=\"n\">ToArray<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">return<\/span> <span class=\"n\">archiveFile<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>compress code<\/p>\n<p>Very simple, right?<\/p>\n<p>Here is a sample Console Application in C# <strong>.Net Core<\/strong>.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System.IO<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System.IO.Compression<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">namespace<\/span> <span class=\"nn\">ConsoleApp1<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">class<\/span> <span class=\"nc\">InMemoryFile<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kd\">public<\/span> <span class=\"kt\">string<\/span> <span class=\"n\">FileName<\/span> <span class=\"p\">{<\/span> <span class=\"k\">get<\/span><span class=\"p\">;<\/span> <span class=\"k\">set<\/span><span class=\"p\">;<\/span> <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kd\">public<\/span> <span class=\"kt\">byte<\/span><span class=\"p\">[]<\/span> <span class=\"n\">Content<\/span> <span class=\"p\">{<\/span> <span class=\"k\">get<\/span><span class=\"p\">;<\/span> <span class=\"k\">set<\/span><span class=\"p\">;<\/span> <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">class<\/span> <span class=\"nc\">Program<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kd\">static<\/span> <span class=\"k\">void<\/span> <span class=\"n\">Main<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span><span class=\"p\">[]<\/span> <span class=\"n\">args<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">fs<\/span> <span class=\"p\">=<\/span> <span class=\"n\">File<\/span><span class=\"p\">.<\/span><span class=\"n\">OpenRead<\/span><span class=\"p\">(<\/span><span class=\"s\">@&#34;C:\\Users\\rmauro\\Pictures\\cool-computer.webp&#34;<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"kt\">var<\/span> <span class=\"n\">files<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span><span class=\"p\">[]<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"n\">LoadFromFile<\/span><span class=\"p\">(<\/span><span class=\"s\">@&#34;C:\\Users\\rmauro\\Pictures\\cool-computer.webp&#34;<\/span><span class=\"p\">),<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"n\">LoadFromFile<\/span><span class=\"p\">(<\/span><span class=\"s\">@&#34;C:\\Users\\rmauro\\Pictures\\34778.webp&#34;<\/span><span class=\"p\">),<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"kt\">var<\/span> <span class=\"n\">result<\/span> <span class=\"p\">=<\/span> <span class=\"n\">GetZipArchive<\/span><span class=\"p\">(<\/span><span class=\"n\">files<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">fw<\/span> <span class=\"p\">=<\/span> <span class=\"n\">File<\/span><span class=\"p\">.<\/span><span class=\"n\">OpenWrite<\/span><span class=\"p\">(<\/span><span class=\"s\">@&#34;C:\\Users\\rmauro\\Pictures\\out.zip&#34;<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">memZip<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">MemoryStream<\/span><span class=\"p\">(<\/span><span class=\"n\">result<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">memZip<\/span><span class=\"p\">.<\/span><span class=\"n\">CopyTo<\/span><span class=\"p\">(<\/span><span class=\"n\">fw<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">fw<\/span><span class=\"p\">.<\/span><span class=\"n\">Close<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">Console<\/span><span class=\"p\">.<\/span><span class=\"n\">ReadKey<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kd\">static<\/span> <span class=\"n\">InMemoryFile<\/span> <span class=\"n\">LoadFromFile<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span> <span class=\"n\">path<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">fs<\/span> <span class=\"p\">=<\/span> <span class=\"n\">File<\/span><span class=\"p\">.<\/span><span class=\"n\">OpenRead<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">memFile<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">MemoryStream<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">fs<\/span><span class=\"p\">.<\/span><span class=\"n\">CopyTo<\/span><span class=\"p\">(<\/span><span class=\"n\">memFile<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"n\">memFile<\/span><span class=\"p\">.<\/span><span class=\"n\">Seek<\/span><span class=\"p\">(<\/span><span class=\"m\">0<\/span><span class=\"p\">,<\/span> <span class=\"n\">SeekOrigin<\/span><span class=\"p\">.<\/span><span class=\"n\">Begin<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">return<\/span> <span class=\"k\">new<\/span> <span class=\"n\">InMemoryFile<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span> <span class=\"n\">Content<\/span> <span class=\"p\">=<\/span> <span class=\"n\">memFile<\/span><span class=\"p\">.<\/span><span class=\"n\">ToArray<\/span><span class=\"p\">(),<\/span> <span class=\"n\">FileName<\/span> <span class=\"p\">=<\/span> <span class=\"n\">Path<\/span><span class=\"p\">.<\/span><span class=\"n\">GetFileName<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">)<\/span> <span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"kt\">byte<\/span><span class=\"p\">[]<\/span> <span class=\"n\">GetZipArchive<\/span><span class=\"p\">(<\/span><span class=\"k\">params<\/span> <span class=\"n\">InMemoryFile<\/span><span class=\"p\">[]<\/span> <span class=\"n\">files<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"kt\">byte<\/span><span class=\"p\">[]<\/span> <span class=\"n\">archiveFile<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">using<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">archiveStream<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">MemoryStream<\/span><span class=\"p\">())<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"k\">using<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">archive<\/span> <span class=\"p\">=<\/span> <span class=\"k\">new<\/span> <span class=\"n\">ZipArchive<\/span><span class=\"p\">(<\/span><span class=\"n\">archiveStream<\/span><span class=\"p\">,<\/span> <span class=\"n\">ZipArchiveMode<\/span><span class=\"p\">.<\/span><span class=\"n\">Create<\/span><span class=\"p\">,<\/span> <span class=\"kc\">true<\/span><span class=\"p\">))<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                    <span class=\"k\">foreach<\/span> <span class=\"p\">(<\/span><span class=\"kt\">var<\/span> <span class=\"n\">file<\/span> <span class=\"k\">in<\/span> <span class=\"n\">files<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                        <span class=\"kt\">var<\/span> <span class=\"n\">zipArchiveEntry<\/span> <span class=\"p\">=<\/span> <span class=\"n\">archive<\/span><span class=\"p\">.<\/span><span class=\"n\">CreateEntry<\/span><span class=\"p\">(<\/span><span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">FileName<\/span><span class=\"p\">,<\/span> <span class=\"n\">CompressionLevel<\/span><span class=\"p\">.<\/span><span class=\"n\">Fastest<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                        <span class=\"k\">using<\/span> <span class=\"nn\">var<\/span> <span class=\"n\">zipStream<\/span> <span class=\"p\">=<\/span> <span class=\"n\">zipArchiveEntry<\/span><span class=\"p\">.<\/span><span class=\"n\">Open<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                        <span class=\"n\">zipStream<\/span><span class=\"p\">.<\/span><span class=\"n\">Write<\/span><span class=\"p\">(<\/span><span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">Content<\/span><span class=\"p\">,<\/span> <span class=\"m\">0<\/span><span class=\"p\">,<\/span> <span class=\"n\">file<\/span><span class=\"p\">.<\/span><span class=\"n\">Content<\/span><span class=\"p\">.<\/span><span class=\"n\">Length<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                <span class=\"n\">archiveFile<\/span> <span class=\"p\">=<\/span> <span class=\"n\">archiveStream<\/span><span class=\"p\">.<\/span><span class=\"n\">ToArray<\/span><span class=\"p\">();<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">            <span class=\"k\">return<\/span> <span class=\"n\">archiveFile<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>sample console application for compress file\/folder<\/p>"},{"title":"Getting the file name without extension in C# - #TIP","link":"https:\/\/rmauro.dev\/getting-the-file-name-without-extenion-in-csharp\/","pubDate":"Tue, 08 Sep 2020 13:47:00 -0400","guid":"https:\/\/rmauro.dev\/getting-the-file-name-without-extenion-in-csharp\/","description":"<p>These days I was asking myself how to get the file name without the extension. I confess I was tempted to use a regex to solve this problem :)<\/p>\n<p>But no worries. There is a method in <code>System.IO.Path<\/code> specific for this situation.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System.IO<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/ Get file name without extension<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">static<\/span> <span class=\"kt\">string<\/span> <span class=\"n\">GetFileName<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span> <span class=\"n\">path<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">return<\/span> <span class=\"n\">Path<\/span><span class=\"p\">.<\/span><span class=\"n\">GetFileNameWithoutExtension<\/span><span class=\"p\">(<\/span><span class=\"n\">path<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/ Get file name without extension<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cs\">\/\/\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">static<\/span> <span class=\"kt\">string<\/span> <span class=\"n\">GetFileName<\/span><span class=\"p\">(<\/span><span class=\"n\">FileInfo<\/span> <span class=\"n\">fileInfo<\/span><span class=\"p\">)<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"k\">return<\/span> <span class=\"n\">Path<\/span><span class=\"p\">.<\/span><span class=\"n\">GetFileNameWithoutExtension<\/span><span class=\"p\">(<\/span><span class=\"n\">fileInfo<\/span><span class=\"p\">.<\/span><span class=\"n\">Name<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div>"},{"title":"Yet Another AZ-203 Microsoft Official Course Delivered.","link":"https:\/\/rmauro.dev\/az203-official-course-delivered-yes\/","pubDate":"Tue, 21 Jan 2020 19:46:31 -0500","guid":"https:\/\/rmauro.dev\/az203-official-course-delivered-yes\/","description":"<p>Yet Another AZ-203 Microsoft Official Course Delivered.<\/p>\n<p>Another AZ-203 official Microsoft course delivered with success! Class members feedback was great. And I loved to make over 22 new colleagues these two weeks.<\/p>\n<p>\n\n\n\n\n\n\n  \n  \n<figure><img src=\"https:\/\/res-1.cloudinary.com\/ht54oxr6q\/image\/upload\/q_auto\/v1\/ghost-blog-images\/1fa28e72-a883-4f88-82aa-9c841734198f.webp\" alt=\"\" class=\"mx-auto my-0 rounded-md\" \/>\n<\/figure>\n<\/p>\n<p>\n\n\n\n\n\n\n  \n  \n<figure><img src=\"https:\/\/res-2.cloudinary.com\/ht54oxr6q\/image\/upload\/q_auto\/v1\/ghost-blog-images\/801a16eb-63aa-4a84-b520-c993d753d551.webp\" alt=\"\" class=\"mx-auto my-0 rounded-md\" \/>\n<\/figure>\n<\/p>\n<p>I should say, this course is awesome. The level of topics is at beginning easy, them going to middle level and a lot of times pretty hard! :)<\/p>\n<p>Ps.: Mostly as online class members! Over 32 students online.<\/p>"},{"title":"Create Azure App Service though AZ Cli","link":"https:\/\/rmauro.dev\/create-azure-app-service-though-az-cli\/","pubDate":"Wed, 08 Jan 2020 12:06:26 -0500","guid":"https:\/\/rmauro.dev\/create-azure-app-service-though-az-cli\/","description":"<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># generate a unique name and store as a shell variable<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">webappname<\/span><span class=\"o\">=<\/span>mywebapp<span class=\"nv\">$RANDOM<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># create a resource group<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az group create --location westeurope --name myResourceGroup\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># create an App Service plan<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az appservice plan create --name <span class=\"nv\">$webappname<\/span> --resource-group myResourceGroup --sku FREE\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># create a Web App<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az webapp create --name <span class=\"nv\">$webappname<\/span> --resource-group myResourceGroup --plan <span class=\"nv\">$webappname<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># store a repository url as a shell variable<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nv\">gitrepo<\/span><span class=\"o\">=<\/span>https:\/\/github.com\/Azure-Samples\/php-docs-hello-world\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># deploy code from a Git repository<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az webapp deployment <span class=\"nb\">source<\/span> config --name <span class=\"nv\">$webappname<\/span> --resource-group myResourceGroup --repo-url <span class=\"nv\">$gitrepo<\/span> --branch master --manual-integration\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"c1\"># print out the FQDN for the Web App<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"nb\">echo<\/span> http:\/\/<span class=\"nv\">$webappname<\/span>.azurewebsites.net\n<\/span><\/span><\/code><\/pre><\/div>"},{"title":"Create Azure Virtual Machine Using PowerShell","link":"https:\/\/rmauro.dev\/create-azure-virtual-machine-using-powershell\/","pubDate":"Fri, 03 Jan 2020 17:44:57 -0500","guid":"https:\/\/rmauro.dev\/create-azure-virtual-machine-using-powershell\/","description":"<h2 id=\"quick-configuration\" class=\"relative group\">Quick Configuration <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#quick-configuration\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><h2 id=\"getting-the-public-ip\" class=\"relative group\">Getting the public Ip <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#getting-the-public-ip\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">Get-AzPublicIpAddress -ResourceGroupName &#34;demo003&#34; | Select &#34;IpAddress&#34;\n<\/span><\/span><\/code><\/pre><\/div><h2 id=\"full-configured-virtual-machine\" class=\"relative group\">Full Configured Virtual Machine <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#full-configured-virtual-machine\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><h2 id=\"getting-the-public-ip-1\" class=\"relative group\">Getting the public Ip <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#getting-the-public-ip-1\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">Get-AzPublicIpAddress -ResourceGroupName &#34;demo004&#34; | Select &#34;IpAddress&#34;\n<\/span><\/span><\/code><\/pre><\/div><h2 id=\"removing-deployment\" class=\"relative group\">Removing deployment <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#removing-deployment\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">Remove-AzResourceGroup -Name demo003\n<\/span><\/span><span class=\"line\"><span class=\"cl\">Remove-AzResourceGroup -Name demo004\n<\/span><\/span><\/code><\/pre><\/div>"},{"title":"Azure Storage Disks - Managed and unmanaged disks","link":"https:\/\/rmauro.dev\/azure-storage-disks\/","pubDate":"Fri, 03 Jan 2020 16:25:54 -0500","guid":"https:\/\/rmauro.dev\/azure-storage-disks\/","description":"<h2 id=\"managed-disks\" class=\"relative group\">Managed disks <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#managed-disks\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li>The Azure platform manages the disk and the backing storage<\/li>\n<li>You don&rsquo;t have to worry about storage account limits and thresholds<\/li>\n<\/ul>\n<h2 id=\"unmanaged-disks\" class=\"relative group\">Unmanaged disks <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#unmanaged-disks\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><ul>\n<li>You manually create and manage virtual hard disks (VHDs) in your Storage account<\/li>\n<li>You will need to consider account throughput and capacity limits when using this model<\/li>\n<\/ul>\n<p><strong>Managed disks<\/strong> - Managed disks are the newer and recommended disk storage model. They elegantly solve this complexity by putting the burden of managing the storage accounts onto Azure. You specify the size of the disk, which can be up to 4 terabytes (TB), and Azure creates and manages both the disk and the storage. You don&rsquo;t have to worry about storage account limits, which makes managed disks easier to scale out than managed discs.<\/p>"},{"title":"Azure App Service and Cloudflare with Full SSL (Strict)","link":"https:\/\/rmauro.dev\/azure-app-service-and-cloudflare-with-full-ssl-strict\/","pubDate":"Sun, 15 Dec 2019 18:39:13 -0500","guid":"https:\/\/rmauro.dev\/azure-app-service-and-cloudflare-with-full-ssl-strict\/","description":"<p>In this article we will set up Cloudflare as a reverse proxy and Azure Web Apps as a web service. Looking for the best security configuration that Cloudflare offers in the free tier.<\/p>\n<p>At the end we will have the following configuration:<\/p>\n<ul>\n<li>CloudFlare as reverse proxy<\/li>\n<li>Azure Web App as a web service<\/li>\n<li>Valid SSL (green lock)<\/li>\n<li>Full trust SSL between Cloudflare and Azure Web Apps (Cloudflare validating server side certificate)<\/li>\n<li>Application Domains <em>\/<\/em> (A Name) and <em><a href=\"https:\/\/rmauro.dev\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/rmauro.dev\/<\/a><\/em> (C Name)<\/li>\n<\/ul>\n<p>Our goal beyond valid SSL (green lock) is end-to-end encryption.<br>\nEncryption between Cloudflare and the user and between Cloudflare and Azure Web App.<\/p>"},{"title":"Practice of SQL Injection","link":"https:\/\/rmauro.dev\/practice-of-sql-injection\/","pubDate":"Sat, 14 Dec 2019 13:38:29 -0500","guid":"https:\/\/rmauro.dev\/practice-of-sql-injection\/","description":"<h2 id=\"first-do-you-know-or-remember-what-sql-injection-is\" class=\"relative group\">First, do you know (or remember) what SQL Injection is? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#first-do-you-know-or-remember-what-sql-injection-is\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p><em>(para vers\u00e3o em <a href=\"https:\/\/rmauro.dev\/sql-injection-na-pratica\/\" target=\"_blank\" rel=\"noreferrer\">portugu\u00eas<\/a>)<\/em><\/p>\n<p>According to OWASP.org (<a href=\"https:\/\/www.owasp.org\/index.php\/SQL%5FInjection\" target=\"_blank\" rel=\"noreferrer\">https:\/\/www.owasp.org\/index.php\/SQL%5FInjection<\/a>).<\/p>\n<blockquote>\n<p>A SQL injection attack consists of insertion or &ldquo;injection&rdquo; of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data.<\/p>\n<\/blockquote>\n<p>That is, a web service technique invasion through SQL commands.As long as the web service (<em>website<\/em>, <em>webservice<\/em>, <em>REST API<\/em>, amoung others) is susceptible to the SQL Injection attack, you can execute unforeseen SQL commands on the system.<\/p>"},{"title":"SQL Injection na Pr\u00e1tica - Executando o Ataque","link":"https:\/\/rmauro.dev\/sql-injection-na-pratica\/","pubDate":"Mon, 02 Dec 2019 20:58:29 -0500","guid":"https:\/\/rmauro.dev\/sql-injection-na-pratica\/","description":"<h2 id=\"primeiro-voc\u00ea-sabe-ou-lembra-se-o-que-\u00e9-sql-injection\" class=\"relative group\">Primeiro, voc\u00ea sabe (ou lembra-se) o que \u00e9 SQL Injection? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#primeiro-voc%c3%aa-sabe-ou-lembra-se-o-que-%c3%a9-sql-injection\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p><em>(for <a href=\"https:\/\/rmauro.dev\/practice-of-sql-injection\/\" target=\"_blank\" rel=\"noreferrer\">english version<\/a>)<\/em><\/p>\n<p>Segundo OWASP.org (<a href=\"https:\/\/www.owasp.org\/index.php\/SQL%5FInjection\" target=\"_blank\" rel=\"noreferrer\">https:\/\/www.owasp.org\/index.php\/SQL%5FInjection<\/a>).<\/p>\n<blockquote>\n<p>A SQL injection attack consists of insertion or &ldquo;injection&rdquo; of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data.<\/p>\n<\/blockquote>\n<p>Ou seja, \u00e9 uma t\u00e9cnica de invas\u00e3o de servi\u00e7os web atrav\u00e9s de comandos SQL.<br>\nDesde que o servi\u00e7o web (<em>website<\/em>, <em>webservice<\/em>, <em>REST API<\/em>, etc) esteja sucet\u00edvel ao ataque <em>SQL Injection<\/em>, voc\u00ea consegue executar comandos SQL n\u00e3o previstos no sistema.<\/p>"},{"title":"Come\u00e7ando com Machine Learning - Escrevendo um Perceptron","link":"https:\/\/rmauro.dev\/comecando-com-machine-learning-escrevendo-um-perceptron\/","pubDate":"Sat, 02 Nov 2019 23:04:13 -0400","guid":"https:\/\/rmauro.dev\/comecando-com-machine-learning-escrevendo-um-perceptron\/","description":"<p>Voc\u00ea sabe o que \u00e9 um <strong>Perceptron<\/strong>?<\/p>\n<p>Perceptron \u00e9 um dos building blocks (componentes) da <strong>rede neural feed foward<\/strong>. Uma rede neural \u00e9 essencialmente baseada em N Perceptrons.<\/p>\n<p>Segundo wikipedia:<\/p>\n<blockquote>\n<p>In machine learning, the <em>perceptron<\/em> is an algorithm for supervised learning of binary classifiers. A binary classifier is a function which can decide whether or not an input, represented by a vector of numbers, belongs to some specific class.<\/p>\n<\/blockquote>\n<p>Ou seja, \u00e9 um programa que com base em <strong>entradas<\/strong> (n\u00fameros), capaz de <strong>classific\u00e1-los<\/strong> em classes (n\u00fameros).<\/p>"},{"title":"C# Conversions - Casting, implicit and explicit conversion","link":"https:\/\/rmauro.dev\/csharp-implicit-conversion-cast-explicit-conversion\/","pubDate":"Sun, 29 Sep 2019 16:35:05 -0400","guid":"https:\/\/rmauro.dev\/csharp-implicit-conversion-cast-explicit-conversion\/","description":"<p>Fist the data types available.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">int            whole numbers\n<\/span><\/span><span class=\"line\"><span class=\"cl\">long           whole numbers (bigger range)\n<\/span><\/span><span class=\"line\"><span class=\"cl\">float          floating-point numbers\n<\/span><\/span><span class=\"line\"><span class=\"cl\">double         double precision\n<\/span><\/span><span class=\"line\"><span class=\"cl\">decimal        monetary values\n<\/span><\/span><span class=\"line\"><span class=\"cl\">char           single character\n<\/span><\/span><span class=\"line\"><span class=\"cl\">bool           boolean\n<\/span><\/span><span class=\"line\"><span class=\"cl\">DateTime       moments in time\t\n<\/span><\/span><span class=\"line\"><span class=\"cl\">string         sequence of characters\n<\/span><\/span><\/code><\/pre><\/div><p>Table of implicit conversion made by C#.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">From           To \n<\/span><\/span><span class=\"line\"><span class=\"cl\">sbyte          short int long float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">byte           short ushort int uint long ulong float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">short          int long float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">ushort         int uint long ulong float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">int            long float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">uint           long ulong float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">long ulong     float double decimal \n<\/span><\/span><span class=\"line\"><span class=\"cl\">float          double \n<\/span><\/span><span class=\"line\"><span class=\"cl\">char           ushort int uint long ulong float double decimal\n<\/span><\/span><\/code><\/pre><\/div><p>By the way, you cannot implicitly convert a <strong>long<\/strong> value to an <strong>int<\/strong>, because this conversion risks losing information (the long value might be outside the range supported by the int type).<\/p>"},{"title":"Deploying .Net container App to Heroku cloud","link":"https:\/\/rmauro.dev\/deploying-net-container-app-to-heroku-cloud\/","pubDate":"Sun, 18 Aug 2019 14:15:42 -0400","guid":"https:\/\/rmauro.dev\/deploying-net-container-app-to-heroku-cloud\/","description":"<p>I&rsquo;m tired of searching every time I need to deploy to heroku cloud. Being that said I&rsquo;m finally writing down the steps do deploy a docker container app to Heroku cloud.<\/p>\n<p>By the way, Heroku Cloud it is really cool.<\/p>\n<h3 id=\"requirements-to-deploy\" class=\"relative group\">Requirements to deploy <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#requirements-to-deploy\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><ul>\n<li>Docker client (windows or linux) installed <a href=\"https:\/\/docs.docker.com\/docker-for-windows\/install\/\" target=\"_blank\" rel=\"noreferrer\">Link<\/a><\/li>\n<li>Heroku CLI (command line interface) installed <a href=\"https:\/\/devcenter.heroku.com\/articles\/heroku-cli\" target=\"_blank\" rel=\"noreferrer\">Link<\/a><\/li>\n<li>Application with a Dockerfile<\/li>\n<\/ul>\n<h3 id=\"changes-you-have-to-make-in-your-dockerfile\" class=\"relative group\">Changes you have to make in your Dockerfile <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#changes-you-have-to-make-in-your-dockerfile\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>First remove the <code>Entrypoint<\/code> and <code>EXPOSE<\/code> statments of your Dockerfile.<\/p>"},{"title":"Azure Kubernets - az cli","link":"https:\/\/rmauro.dev\/azure-kubernets-az-cli\/","pubDate":"Sun, 02 Jun 2019 20:31:00 -0400","guid":"https:\/\/rmauro.dev\/azure-kubernets-az-cli\/","description":"<p>Steps to create Azure Kubernet Services (AKS) though azure cli tool.<\/p>\n<h5 id=\"demo-1\" class=\"relative group\">Demo 1 <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#demo-1\" aria-label=\"Anchor\">#<\/a><\/span><\/h5><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">\/\/ Create resource group\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az group create --name kbgroup2 --location eastus\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\/\/ Create AKS cluster\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az aks create \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --resource-group kbgroup2 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --name kbcluster2 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --node-count 1 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --enable-addons monitoring \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --generate-ssh-keys\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"connect-to-the-cluster\" class=\"relative group\">Connect to the cluster <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#connect-to-the-cluster\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">#if you&#39;re in  Azure Cloud Shell skip this step\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az aks install-cli\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">#getting the credentials\n<\/span><\/span><span class=\"line\"><span class=\"cl\">az aks get-credentials \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">--resource-group kbgroup2 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">--name kbcluster2 \n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">kubectl get nodes\n<\/span><\/span><\/code><\/pre><\/div><p>Save the file deployment.yaml with the following contents.<\/p>"},{"title":"Demo - Azure Batch","link":"https:\/\/rmauro.dev\/demo-azure-batch\/","pubDate":"Sun, 02 Jun 2019 17:25:27 -0400","guid":"https:\/\/rmauro.dev\/demo-azure-batch\/","description":"<h4 id=\"creating-the-resource-group\" class=\"relative group\">Creating the Resource Group <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-resource-group\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az group create --name &#34;az203_batch_demo001&#34; --location CentralUS\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"creating-the-storage-account\" class=\"relative group\">Creating the storage account <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-storage-account\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az storage account create \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --name az203batchstoragexd \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --access-tier hot \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --https-only true \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --kind BlobStorage \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --location CentralUS \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --sku Standard_LRS \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --resource-group az203_batch_demo001\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"creating-the-batch-account\" class=\"relative group\">Creating the Batch Account <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-batch-account\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az batch account create \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --name az203batchaccountxd \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --storage-account az203batchstoragexd \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --resource-group az203_batch_demo001 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --location CentralUS\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"login-and-create-the-pool\" class=\"relative group\">Login and create the Pool <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#login-and-create-the-pool\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az batch account login \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --name az203batchaccountxd \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --resource-group az203_batch_demo001 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --shared-key-auth\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">az batch pool create \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --id mypool \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --vm-size Standard_A1_v2 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --target-dedicated-nodes 2 \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --image canonical:ubuntuserver:16.04-LTS \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --node-agent-sku-id &#34;batch.node.ubuntu 16.04&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">az batch pool show \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --pool-id mypool \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  --query &#34;allocationState&#34;\n<\/span><\/span><\/code><\/pre><\/div><h4 id=\"creating-the-job-inside-the-pool\" class=\"relative group\">Creating the Job inside the Pool <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-job-inside-the-pool\" aria-label=\"Anchor\">#<\/a><\/span><\/h4><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az batch job create --id myjob --pool-id mypool\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"job-task-execution-commands\" class=\"relative group\">Job Task (Execution commands) <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#job-task-execution-commands\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-gdscript3\" data-lang=\"gdscript3\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">for<\/span> <span class=\"n\">i<\/span> <span class=\"ow\">in<\/span> <span class=\"p\">{<\/span><span class=\"mf\">1.<\/span><span class=\"o\">.<\/span><span class=\"mi\">4<\/span><span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">do<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"n\">az<\/span> <span class=\"n\">batch<\/span> <span class=\"n\">task<\/span> <span class=\"n\">create<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">--<\/span><span class=\"n\">task<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">mytask<\/span><span class=\"o\">$<\/span><span class=\"n\">i<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">--<\/span><span class=\"n\">job<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">myjob<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"o\">--<\/span><span class=\"n\">command<\/span><span class=\"o\">-<\/span><span class=\"n\">line<\/span> <span class=\"s2\">&#34;\/bin\/bash -c &#39;printenv | grep AZ_BATCH; sleep 90s&#39;&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">done<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">az<\/span> <span class=\"n\">batch<\/span> <span class=\"n\">task<\/span> <span class=\"n\">show<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">job<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">myjob<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">task<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">mytask1<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \t\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">az<\/span> <span class=\"n\">batch<\/span> <span class=\"n\">task<\/span> <span class=\"n\">file<\/span> <span class=\"n\">list<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">job<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">myjob<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">task<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">mytask1<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">output<\/span> <span class=\"n\">table<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"n\">az<\/span> <span class=\"n\">batch<\/span> <span class=\"n\">task<\/span> <span class=\"n\">file<\/span> <span class=\"n\">download<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">job<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">myjob<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">task<\/span><span class=\"o\">-<\/span><span class=\"n\">id<\/span> <span class=\"n\">mytask1<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">file<\/span><span class=\"o\">-<\/span><span class=\"n\">path<\/span> <span class=\"n\">stdout<\/span><span class=\"o\">.<\/span><span class=\"n\">txt<\/span> \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\">     <span class=\"o\">--<\/span><span class=\"n\">destination<\/span> <span class=\"o\">.\/<\/span><span class=\"n\">stdout<\/span><span class=\"o\">.<\/span><span class=\"n\">txt<\/span>\n<\/span><\/span><\/code><\/pre><\/div><h3 id=\"after-done-experimenting\" class=\"relative group\">After done experimenting <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#after-done-experimenting\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>Don&rsquo;t forget to delete the resources created.<\/p>"},{"title":"az cli (bash) create resource though Resource File","link":"https:\/\/rmauro.dev\/azcli-create-resource-though-resource-file\/","pubDate":"Sun, 02 Jun 2019 14:49:19 -0400","guid":"https:\/\/rmauro.dev\/azcli-create-resource-though-resource-file\/","description":"<p>The resource file <code>azuredeploy.json<\/code><\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-gdscript3\" data-lang=\"gdscript3\"><span class=\"line\"><span class=\"cl\"><span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;$schema&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;https:\/\/schema.management.azure.com\/schemas\/2015-01-01\/deploymentTemplate.json#&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;contentVersion&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;1.0.0.0&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;parameters&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"s2\">&#34;storageAccountType&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;type&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;string&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;defaultValue&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;Standard_LRS&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;allowedValues&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;Standard_LRS&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;Standard_GRS&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;Standard_ZRS&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;Premium_LRS&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">],<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;metadata&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;description&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;Storage Account type&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"s2\">&#34;location&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;type&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;string&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;defaultValue&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[resourceGroup().location]&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;metadata&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;description&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;Location for all resources.&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;variables&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"s2\">&#34;storageAccountName&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[concat(&#39;store&#39;, uniquestring(resourceGroup().id))]&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;resources&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;type&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;Microsoft.Storage\/storageAccounts&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;name&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[variables(&#39;storageAccountName&#39;)]&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;location&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[parameters(&#39;location&#39;)]&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;apiVersion&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;2018-07-01&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;sku&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;name&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[parameters(&#39;storageAccountType&#39;)]&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;kind&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;StorageV2&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;properties&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">],<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"s2\">&#34;outputs&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"s2\">&#34;storageAccountName&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;type&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;string&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">      <span class=\"s2\">&#34;value&#34;<\/span><span class=\"p\">:<\/span> <span class=\"s2\">&#34;[variables(&#39;storageAccountName&#39;)]&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">},<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"s2\">&#34;storageUri&#34;<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;type&#34;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&#34;string&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">        <span class=\"s2\">&#34;value&#34;<\/span><span class=\"p\">:<\/span><span class=\"s2\">&#34;[reference(variables(&#39;storageAccountName&#39;)).primaryEndpoints.blob]&#34;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>Go to <code>https:\/\/shell.azure.com<\/code> and open your subscription.<\/p>\n<p>In <strong>bash<\/strong> format (not <em>PowerShell<\/em>) run the following scripts.<\/p>"},{"title":"Conference API Sample","link":"https:\/\/rmauro.dev\/conference-api-sample\/","pubDate":"Sat, 01 Jun 2019 17:01:13 -0400","guid":"https:\/\/rmauro.dev\/conference-api-sample\/","description":"<p>This is a sample API hosted by Microsoft.<\/p>\n<p><a href=\"https:\/\/conferenceapi.azurewebsites.net\/?format=json\" target=\"_blank\" rel=\"noreferrer\">https:\/\/conferenceapi.azurewebsites.net\/?format=json<\/a><\/p>"},{"title":"Enable Local Cache in Azure Web App","link":"https:\/\/rmauro.dev\/enable-local-cache-in-azure-web-app\/","pubDate":"Sat, 01 Jun 2019 15:01:27 -0400","guid":"https:\/\/rmauro.dev\/enable-local-cache-in-azure-web-app\/","description":"<h2 id=\"what-is-local-cache-in-azure-webapp\" class=\"relative group\">What is Local Cache in Azure WebApp? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#what-is-local-cache-in-azure-webapp\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Local cache in Azure Web is really a cache that caches the storage of your Web App.<\/p>\n<h2 id=\"how-to-enable-it\" class=\"relative group\">How to enable it? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#how-to-enable-it\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>To enable local cache you should go to your <strong>Azure Subscription<\/strong> them navigate to your <strong>Web App<\/strong> that you wishs to enable local cache.<\/p>"},{"title":"C# DateTime Cheat sheet - ToString() Format","link":"https:\/\/rmauro.dev\/c-datetime-tostring-format\/","pubDate":"Fri, 31 May 2019 16:38:34 -0400","guid":"https:\/\/rmauro.dev\/c-datetime-tostring-format\/","description":"<p>Cheat sheet with C# DateTime formats.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-csharp\" data-lang=\"csharp\"><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"k\">using<\/span> <span class=\"nn\">System.Globalization<\/span><span class=\"p\">;<\/span> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"kd\">public<\/span> <span class=\"k\">class<\/span> <span class=\"nc\">Program<\/span> <span class=\"p\">{<\/span> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">    <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"k\">void<\/span> <span class=\"n\">Main<\/span><span class=\"p\">(<\/span><span class=\"kt\">string<\/span><span class=\"p\">[]<\/span> <span class=\"n\">args<\/span><span class=\"p\">)<\/span>  <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"n\">DateTime<\/span> <span class=\"n\">dt<\/span> <span class=\"p\">=<\/span> <span class=\"n\">DateTime<\/span><span class=\"p\">.<\/span><span class=\"n\">Now<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"kt\">string<\/span><span class=\"p\">[]<\/span> <span class=\"n\">format<\/span> <span class=\"p\">=<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;d&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s\">&#34;D&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;f&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s\">&#34;F&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;g&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s\">&#34;G&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;m&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;r&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;s&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;t&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s\">&#34;T&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;u&#34;<\/span><span class=\"p\">,<\/span> <span class=\"s\">&#34;U&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;y&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;dddd, MMMM dd yyyy&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;ddd, MMM d \\&#34;&#39;\\&#34;yy&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;dddd, MMMM dd&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;M\/yy&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"s\">&#34;dd-MM-yy&#34;<\/span><span class=\"p\">,<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"p\">};<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"kt\">string<\/span> <span class=\"n\">date<\/span><span class=\"p\">;<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"k\">for<\/span> <span class=\"p\">(<\/span><span class=\"kt\">int<\/span> <span class=\"n\">i<\/span> <span class=\"p\">=<\/span> <span class=\"m\">0<\/span><span class=\"p\">;<\/span> <span class=\"n\">i<\/span> <span class=\"p\">&lt;<\/span> <span class=\"n\">format<\/span><span class=\"p\">.<\/span><span class=\"n\">Length<\/span><span class=\"p\">;<\/span> <span class=\"n\">i<\/span><span class=\"p\">++)<\/span> <span class=\"p\">{<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"n\">date<\/span> <span class=\"p\">=<\/span> <span class=\"n\">dt<\/span><span class=\"p\">.<\/span><span class=\"n\">ToString<\/span><span class=\"p\">(<\/span><span class=\"n\">format<\/span><span class=\"p\">[<\/span><span class=\"n\">i<\/span><span class=\"p\">],<\/span> <span class=\"n\">DateTimeFormatInfo<\/span><span class=\"p\">.<\/span><span class=\"n\">InvariantInfo<\/span><span class=\"p\">);<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">           <span class=\"n\">Console<\/span><span class=\"p\">.<\/span><span class=\"n\">WriteLine<\/span><span class=\"p\">(<\/span><span class=\"n\">String<\/span><span class=\"p\">.<\/span><span class=\"n\">Concat<\/span><span class=\"p\">(<\/span><span class=\"n\">format<\/span><span class=\"p\">[<\/span><span class=\"n\">i<\/span><span class=\"p\">],<\/span> <span class=\"s\">&#34; :&#34;<\/span> <span class=\"p\">,<\/span> <span class=\"n\">date<\/span><span class=\"p\">));<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">       <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> \n<\/span><\/span><span class=\"line\"><span class=\"cl\">  <span class=\"cm\">\/** Output.\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   *\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * d :08\/17\/2000\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * D :Thursday, August 17, 2000\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * f :Thursday, August 17, 2000 16:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * F :Thursday, August 17, 2000 16:32:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * g :08\/17\/2000 16:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * G :08\/17\/2000 16:32:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * m :August 17\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * r :Thu, 17 Aug 2000 23:32:32 GMT\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * s :2000-08-17T16:32:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * t :16:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * T :16:32:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * u :2000-08-17 23:32:32Z\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * U :Thursday, August 17, 2000 23:32:32\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * y :August, 2000\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * dddd, MMMM dd yyyy :Thursday, August 17 2000\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * ddd, MMM d &#34;&#39;&#34;yy :Thu, Aug 17 &#39;00\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * dddd, MMMM dd :Thursday, August 17\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * M\/yy :8\/00\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   * dd-MM-yy :17-08-00\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"cm\">   *\/<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\">   <span class=\"p\">}<\/span>\n<\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"p\">}<\/span>\n<\/span><\/span><\/code><\/pre><\/div><p>C# DateTime formats<\/p>"},{"title":"Demo WebJob Azure - CRON expressions","link":"https:\/\/rmauro.dev\/demo-webjob-azure-cron-expressions\/","pubDate":"Fri, 31 May 2019 15:39:35 -0400","guid":"https:\/\/rmauro.dev\/demo-webjob-azure-cron-expressions\/","description":"<h1 id=\"cron-expressions\" class=\"relative group\">CRON expressions <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#cron-expressions\" aria-label=\"Anchor\">#<\/a><\/span><\/h1><p>Azure Functions uses the NCronTab library to interpret CRON expressions. A CRON expression includes six fields:<\/p>\n<p><code>{second} {minute} {hour} {day} {month} {day-of-week}<\/code><\/p>\n<p>Each field can have one of the following types of values:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\"> Type                           Example          When triggered\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> A specific value               0 5 * * * *      at hh:05:00 where hh is every hour \n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 (once an hour)\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> All values (*)                 0 * 5 * * *      at 5:mm:00 every day, where mm is \n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 every minute of the hour (60 times \n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 a day)\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> A range (- operator)           5-7 * * * * *    at hh:mm:05,hh:mm:06, and hh:mm:07 \n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 where hh:mm is every minute of every\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 hour (3 times a minute)\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> A set of values (, operator)   5,8,10 * * * * * at hh:mm:05, hh:mm:08, and hh:mm:10\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 where hh:mm is every minute of every\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 hour (3 times a minute)\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> An interval value (\/ operator) 0 *\/5 * * * *    at hh:05:00, hh:10:00, hh:15:00, and \n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 so on through hh:55:00 where hh is\n<\/span><\/span><span class=\"line\"><span class=\"cl\">                                                 every hour (12 times an hour)\n<\/span><\/span><\/code><\/pre><\/div><p>Refs.:<\/p>"},{"title":"Enable Azure Disk Encryption though az-cli","link":"https:\/\/rmauro.dev\/enable-azure-disk-encryption-though-az-cli\/","pubDate":"Mon, 27 May 2019 19:04:34 -0400","guid":"https:\/\/rmauro.dev\/enable-azure-disk-encryption-though-az-cli\/","description":"<h6 id=\"create-azure-key-vault-service\" class=\"relative group\">Create Azure Key Vault service <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#create-azure-key-vault-service\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az keyvault create \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --name &#34;kvDemo006&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --resource-group &#34;demo001&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --location centralUS \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --enabled-for-disk-encryption True\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"enable-disk-encryption-on-vm\" class=\"relative group\">Enable disk encryption on VM <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#enable-disk-encryption-on-vm\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az vm encryption enable \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --resource-group &#34;kvDemo006&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --name &#34;devUScWeb003&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --disk-encryption-keyvault &#34;demo006&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --volume-type &#34;all&#34;\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"show-disk-encryption\" class=\"relative group\">Show disk encryption <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#show-disk-encryption\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">az vm encryption show \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --resource-group &#34;demo006&#34; \\\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> --name &#34;devUScWeb003&#34;`\n<\/span><\/span><\/code><\/pre><\/div>"},{"title":"Create Azure VM though PowerShell","link":"https:\/\/rmauro.dev\/create-azure-vm-though-powershell\/","pubDate":"Mon, 27 May 2019 18:56:17 -0400","guid":"https:\/\/rmauro.dev\/create-azure-vm-though-powershell\/","description":"<p>Go to <a href=\"https:\/\/shell.azure.com\" target=\"_blank\" rel=\"noreferrer\">https:\/\/shell.azure.com<\/a> and enter the following commands.<\/p>\n<h6 id=\"azure-available-locations\" class=\"relative group\">Azure available locations. <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#azure-available-locations\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">Get-AzureRmLocation | Format-Table\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"azure-resource-groups-available-in-the-subscription\" class=\"relative group\">Azure Resource Groups available in the subscription. <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#azure-resource-groups-available-in-the-subscription\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">Get-AzureRmResourceGroup | select ResourceGroupName\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"setting-up-the-local-variables\" class=\"relative group\">Setting up the local variables. <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#setting-up-the-local-variables\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">$VMLocalAdminUser = &#34;myAdminUser&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VMLocalAdminSecurePassword = ConvertTo-SecureString &#34;MyStrongPassword@123456789&#34; -AsPlainText -Force\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$LocationName = &#34;centralus&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ResourceGroupName = &#34;demo001PS&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$ComputerName = &#34;MyVM&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VMName = &#34;devUScWeb002&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VMSize = &#34;Standard_DS3&#34;\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$NICName = &#34;devUScWeb002-ip&#34;\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"creating-the-resource-group\" class=\"relative group\">Creating the Resource Group <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-resource-group\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">New-AzureRmResourceGroup -Name $ResourceGroupName -Location $LocationName\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"creating-the-virtual-network\" class=\"relative group\">Creating the Virtual Network <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-virtual-network\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">$virtualNetwork = New-AzVirtualNetwork `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -ResourceGroupName $ResourceGroupName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -Location $LocationName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -Name $VMName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -AddressPrefix 10.0.0.0\/16\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$subnetConfig = Add-AzVirtualNetworkSubnetConfig `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -Name default `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -AddressPrefix 10.0.0.0\/24 `\n<\/span><\/span><span class=\"line\"><span class=\"cl\">  -VirtualNetwork $virtualNetwork\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$virtualNetwork | Set-AzVirtualNetwork\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$nic = New-AzureRmNetworkInterface `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Name &#34;NIC1&#34; `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -ResourceGroupName $ResourceGroupName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Location $LocationName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -SubnetId $virtualNetwork.Subnets[0].Id `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -IpConfigurationName &#34;IPConfig1&#34; `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -DnsServer &#34;8.8.8.8&#34;, &#34;8.8.4.4&#34;\n<\/span><\/span><\/code><\/pre><\/div><h6 id=\"creating-the-virtual-machine\" class=\"relative group\">Creating the Virtual Machine <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#creating-the-virtual-machine\" aria-label=\"Anchor\">#<\/a><\/span><\/h6><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-fallback\" data-lang=\"fallback\"><span class=\"line\"><span class=\"cl\">$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword)\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VirtualMachine = New-AzureRmVMConfig `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -VMName $VMName -VMSize $VMSize\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VirtualMachine = Set-AzureRmVMOperatingSystem `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -VM $VirtualMachine `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Windows `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -ComputerName $ComputerName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Credential $Credential `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -ProvisionVMAgent -EnableAutoUpdate\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VirtualMachine = Add-AzureRmVMNetworkInterface `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -VM $VirtualMachine `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Id $NIC.Id\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$VirtualMachine = Set-AzureRmVMSourceImage `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -VM $VirtualMachine `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -PublisherName &#39;MicrosoftWindowsServer&#39; `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Offer &#39;WindowsServer&#39; `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Skus &#39;2012-R2-Datacenter&#39; `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Version latest\n<\/span><\/span><span class=\"line\"><span class=\"cl\">\n<\/span><\/span><span class=\"line\"><span class=\"cl\">$job = New-AzureRmVM `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -ResourceGroupName $ResourceGroupName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -Location $LocationName `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -VM $VirtualMachine `\n<\/span><\/span><span class=\"line\"><span class=\"cl\"> -AsJob\n<\/span><\/span><\/code><\/pre><\/div><p>The -AsJob option creates the VM in the background. You can continue to the next step.<\/p>"},{"title":"HSTS - What's it and how to enable it in IIS","link":"https:\/\/rmauro.dev\/hsts-definition-and-how-to-enable-it-in-iis\/","pubDate":"Wed, 09 Aug 2017 14:10:00 -0400","guid":"https:\/\/rmauro.dev\/hsts-definition-and-how-to-enable-it-in-iis\/","description":"<h3 id=\"hsts-whats-it\" class=\"relative group\">HSTS, what&rsquo;s it? <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#hsts-whats-it\" aria-label=\"Anchor\">#<\/a><\/span><\/h3><p>Definition from wikipedia:<\/p>\n<blockquote>\n<p>HTTP Strict Transport Security (HSTS) is a web security policy mechanism which helps to protect websites against protocol downgrade attacks and cookie hijacking. It allows web servers to declare that web browsers (or other complying user agents) should only interact with it using secure HTTPS connections,[1] and never via the insecure HTTP protocol. HSTS is an IETF standards track protocol and is specified in RFC 6797.`<\/p>"},{"title":"Libraries.io - A Library of frameworks #tip","link":"https:\/\/rmauro.dev\/libraries-io-a-library-of-frameworks-tip\/","pubDate":"Thu, 19 Jan 2017 10:27:55 -0500","guid":"https:\/\/rmauro.dev\/libraries-io-a-library-of-frameworks-tip\/","description":"<p>Theses days I was trying to find the latest version of some framework I was using. Searching on web I finally found this website <a href=\"https:\/\/libraries.io\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/libraries.io\/<\/a>.<\/p>\n<p>This nice and complete website has informations about almost every library\/framework you know.<\/p>\n<p>Take a look, share <a href=\"https:\/\/libraries.io\/\" target=\"_blank\" rel=\"noreferrer\">https:\/\/libraries.io\/<\/a><\/p>"},{"title":"How to migrate .Net Core 1.0 to 1.1","link":"https:\/\/rmauro.dev\/how-to-migrate-asp-net-core-1-0-to-1-1\/","pubDate":"Tue, 03 Jan 2017 19:40:41 -0500","guid":"https:\/\/rmauro.dev\/how-to-migrate-asp-net-core-1-0-to-1-1\/","description":"<p>Hi guys!<\/p>\n<p>In this post I&rsquo;ll show how to migrate a .Net project from 1.0 to 1.1 (current the last version) using Visual Studio.<\/p>\n<h2 id=\"preparing-the-solution\" class=\"relative group\">Preparing the solution <span class=\"absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100\"><a class=\"group-hover:text-primary-300 dark:group-hover:text-neutral-700\" style=\"text-decoration-line: none !important;\" href=\"#preparing-the-solution\" aria-label=\"Anchor\">#<\/a><\/span><\/h2><p>Let&rsquo;s starting by creating our starting project.<\/p>\n<p>In Visual Studio go to <code>File -&gt; New Project<\/code> then choose the template <code>ASP.NET Core Web Application (.NET Core)<\/code><\/p>\n<p>Enter the name &ldquo;SampleProject&rdquo; then click OK.<\/p>"}]}}