<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Varun on Medium]]></title>
        <description><![CDATA[Stories by Varun on Medium]]></description>
        <link>https://medium.com/@varun2-6?source=rss-10a21f7596da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QZ0Os5770XPUgwpgupWbgg.jpeg</url>
            <title>Stories by Varun on Medium</title>
            <link>https://medium.com/@varun2-6?source=rss-10a21f7596da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:29:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@varun2-6/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HOW TO BYPASS A CORPORATE FIREWALL (LEGALLY) WITH HAPROXY]]></title>
            <link>https://varun2-6.medium.com/how-to-bypass-a-corporate-firewall-legally-with-haproxy-55748cffb312?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/55748cffb312</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 20:21:12 GMT</pubDate>
            <atom:updated>2025-09-18T05:25:16.097Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To Bypass a Corporate Firewall (Legally) With HAPROXY</h3><blockquote>THE PROBLEM — Upgraded my VM instance. New IP assigned. Edge device behind corporate firewall lost connection to the VM as the old IP was whitelisted. Firewall change request: 3 weeks. Service down: NOW!</blockquote><ul><li>The Challenge<br>- Firewall: Only allows ports 80/443<br>- App service: Runs on custom port (blocked)<br>- On VM : Port 443 is used for HTTPS by Nginx, and port 80 by docker.<br>- Old IP: Gone forever :(</li><li>The Insight<br>-Port 443 was allowed outbound from the edge device on customer network. HTTPS and raw TCP are distinguishable.<br>- Browsers send SNI headers<br>- Edge devices send raw TCP</li></ul><blockquote><em>The good new is that HAProxy can tell them apart! So I can route requests from my edge device to VM on port 443 and nginx can use 8443 internally for HTTPS</em></blockquote><ul><li>The Solution Arch<br>Edge Device → Old_IP:custom_port<br> ↓ [iptables]<br>New_IP:443<br> ↓ [HAProxy]<br> ├── Has SNI → Nginx:8443 → Web App<br> └── No SNI → Edge device app data:custom_port</li></ul><p>The implementation is as follows</p><p>1. HAProxy Config (Port Detection):</p><p>sudo nano /etc/haproxy/haproxy.cfg</p><pre>frontend port443_frontend<br> bind *:443<br> mode tcp<br> tcp-request inspect-delay 5s<br> <br> # Sniff the traffic<br> acl is_ssl req.ssl_hello_type 1<br> acl has_sni req.ssl_sni -m found<br> <br> # Smart routing<br> use_backend web_backend if is_ssl has_sni<br> default_backend streaming_backend</pre><p>2. Nginx (Move to 8443):</p><p>sudo nano /etc/nginx/nginx.conf</p><pre>listen 8443 ssl; # was 443</pre><p>3. Edge Device (iptables redirect):</p><pre>sudo iptables -t nat -A OUTPUT -d OLD_IP -p tcp - dport CUSTOM_PORT \<br> -j DNAT - to-destination NEW_IP:443</pre><p>4. Restart services:</p><pre>sudo service nginx restart<br>sudo service haproxy restart </pre><p>Why is it legal you ask?<br>✓ Uses approved port 443<br>✓ All traffic encrypted<br>✓ Fully logged and auditable<br>✓ IT approved<br>✓ Temporary until proper fix</p><p>Results<br>- Service restored: 3 hours<br>- Firewall changes avoided: 1<br>- Time saved: 3 weeks<br>- Clients affected: 0</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55748cffb312" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comprehensive System Monitoring]]></title>
            <link>https://varun2-6.medium.com/comprehensive-system-monitoring-6bf99955ef18?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bf99955ef18</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Mon, 12 Aug 2024 09:01:31 GMT</pubDate>
            <atom:updated>2024-08-12T18:43:17.226Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>The title describes a straightforward script below, designed to log various critical metrics on your Ubuntu-based system effectively</strong></blockquote><p><strong>Functionalities:</strong></p><ol><li><strong>Temperature and System Utilization Monitoring:</strong><br> — Logs CPU and GPU temperatures.<br> — Tracks CPU utilization, RAM usage, and per-core CPU utilization.<br> — Logs metrics every 2 seconds.</li><li><strong>Network Usage Monitoring:</strong><br> — Logs network usage statistics using the ifstat command.<br> — Records data every 5 seconds.</li><li><strong>Docker Container Monitoring:</strong><br> — Logs CPU and memory usage of all running Docker containers.<br> — Records data every 10 seconds.</li><li><strong>File and Directory Change Monitoring:</strong><br> — Monitors file and directory changes in a specified path.<br> — Logs changes (created, modified, deleted) once every 10 minutes.</li><li><strong>User Login Monitoring:</strong><br> — Logs the current users logged into the system using the who command.<br> — Records data every minute.</li><li><strong>System Logs Parsing:</strong><br> — Parses /var/log/syslog for error patterns.<br> — Logs any matches found every hour.</li><li><strong>Disk Usage Monitoring:</strong><br> — Logs disk usage statistics for each partition.<br> — Includes percentage used, used GB, remaining GB, and total GB.<br> — Issues warnings if disk usage exceeds 90%.<br> — Logs every 5 minutes.</li><li><strong>Kernel Error Monitoring:</strong><br> — Parses /var/log/kern.log for kernel errors.<br> — Logs any matches found every minute.</li><li><strong>Reboot Times Logging:</strong><br> — Logs the times of the last system reboots.<br> — Records data every hour.</li><li><strong>Cache Memory Monitoring:</strong><br> — Logs the amount of cache memory used by the system.<br> — Records data every 5 minutes.</li><li><strong>SSD Health Monitoring with smartctl:</strong><br> — Automatically detects the SSD device.<br> — Runs smartctl -a on the detected SSD to monitor its health.<br> — Logs the output every 30 seconds.</li><li><strong>Generate NVIDIA Bug Reports</strong><br> — Runs nvidia bug report script to obtain the tar file for further debugging.</li><li><strong>Integrate OpenVAS to run periodic vuln scans</strong><br>— OpenVAS integration to generate reports</li></ol><h4>Dependencies:</h4><pre>sudo apt install smartmontools ifstat -y<br><br>sudo apt install python3-pip<br><br>pip3 install psutil pytz watchdog</pre><pre>import subprocess<br>import time<br>import datetime<br>import psutil<br>import logging<br>from logging.handlers import RotatingFileHandler<br>import pytz<br>import threading<br>import re<br>from watchdog.observers import Observer<br>from watchdog.events import FileSystemEventHandler<br><br># Log config<br>LOG_MAX_SIZE = 10 * 1024 * 1024  # 10 MB for general monitoring logs<br>LOG_BACKUP_COUNT = 10<br><br># Set the timezone to UTC<br>utc = pytz.timezone(&#39;UTC&#39;)<br><br>def generate_nvidia_bug_report(logger):<br>    try:<br>        while True:<br>            # Run the NVIDIA bug report tool<br>            result = subprocess.run([&#39;nvidia-bug-report.sh&#39;], capture_output=True, text=True)<br>            if result.returncode == 0:<br>                logger.info(&quot;NVIDIA bug report generated successfully.&quot;)<br>                # Save or process the bug report output as needed<br>            else:<br>                logger.error(f&quot;Failed to generate NVIDIA bug report: {result.stderr}&quot;)<br>    except Exception as e:<br>        logger.error(f&quot;Exception while generating NVIDIA bug report: {str(e)}&quot;)<br>    <br>    time.sleep(30)<br><br># Setup logging function<br>def setup_logging(log_filename):<br>    logger = logging.getLogger(log_filename)<br>    logger.setLevel(logging.INFO)<br>    handler = RotatingFileHandler(log_filename, maxBytes=LOG_MAX_SIZE, backupCount=LOG_BACKUP_COUNT)<br>    formatter = logging.Formatter(&#39;%(asctime)s - %(message)s&#39;)<br>    handler.setFormatter(formatter)<br>    logger.addHandler(handler)<br>    return logger<br><br> # Auto-detect SSD and run smartctl<br>def detect_ssd_and_log_smartctl(smartctl_logger):<br>    while True:<br>        # Detect the mounted SSD<br>        ssd_path = None<br>        for disk in psutil.disk_partitions(all=False):<br>            if &#39;nvme&#39; in disk.device or &#39;sd&#39; in disk.device:<br>                ssd_path = disk.device.replace(&#39;/dev/&#39;, &#39;&#39;)<br>                break<br><br>        if ssd_path:<br>            try:<br>                # Run smartctl command<br>                timestamp = datetime.datetime.now(utc).strftime(&quot;%Y-%m-%d %H:%M:%S UTC&quot;)<br>                result = subprocess.run([&#39;smartctl&#39;, &#39;-a&#39;, f&#39;/dev/{ssd_path}&#39;], capture_output=True, text=True)<br>                <br>                if result.returncode == 0:<br>                    smartctl_logger.info(f&quot;Timestamp: {timestamp}\n{result.stdout}&quot;)<br>                    print(f&quot;Logged smartctl data for {ssd_path} at {timestamp}&quot;)<br>                else:<br>                    error_message = f&quot;Error running smartctl for {ssd_path}: {result.stderr}&quot;<br>                    smartctl_logger.error(error_message)<br>                    print(error_message)<br><br>            except Exception as e:<br>                error_message = f&quot;Exception occurred while running smartctl for {ssd_path}: {e}&quot;<br>                smartctl_logger.error(error_message)<br>                print(error_message)<br>        else:<br>            smartctl_logger.warning(&quot;No SSD detected.&quot;)<br>            print(&quot;No SSD detected.&quot;)<br>        time.sleep(30)  <br><br># Log temperatures and system utilization<br>def log_temperatures(temp_logger):<br>    while True:<br>        try:<br>            cpu_temp_output = subprocess.check_output([&quot;sensors&quot;], text=True)<br><br>            # Modify the command according to your nvidia GPU<br>            gpu_temp_output = subprocess.check_output([&quot;nvidia-smi&quot;, &quot;--query-gpu=temperature.gpu&quot;, &quot;--format=csv,noheader,nounits&quot;], text=True)<br><br>            # Get CPU utilization<br>            cpu_utilization = psutil.cpu_percent(interval=1)<br>            <br>            # Get RAM utilization<br>            ram_utilization = psutil.virtual_memory().percent<br>            <br>            # Get CPU core utilization<br>            cpu_cores_utilization = psutil.cpu_percent(interval=1, percpu=True)<br><br>            timestamp = datetime.datetime.utcnow().strftime(&quot;%Y-%m-%d %H:%M:%S UTC&quot;)<br>        <br>            temp_logger.info(f&quot;Timestamp UTC: {timestamp}&quot;)<br>            temp_logger.info(f&quot;CPU Temp: {cpu_temp_output.strip()}, GPU Temp: {gpu_temp_output.strip()}, CPU Utilization: {cpu_utilization}%, RAM Utilization: {ram_utilization}%, CPU Core Utilization: {cpu_cores_utilization}&quot;)<br><br>            print(f&quot;Temperature and system metrics logged at {timestamp}&quot;)<br><br>        except subprocess.CalledProcessError as e:<br>            print(f&quot;Error: {e}&quot;)<br>            temp_logger.error(f&quot;Error: {e}&quot;)<br>        time.sleep(60)<br><br># Log network monitoring data<br>def log_network_usage(net_logger):<br>    while True:<br>        try:<br>            timestamp = datetime.datetime.now(utc).strftime(&quot;%Y-%m-%d %H:%M:%S UTC&quot;)<br>            <br>            log_message = f&quot;Timestamp: {timestamp}&quot;<br>            print(log_message)   <br>            net_logger.info(log_message)    <br>            <br>            # Run ifstat for 1 sec and log the output<br>            result = subprocess.run([&#39;ifstat&#39;, &#39;30&#39;, &#39;1&#39;], capture_output=True, text=True)<br>            if result.returncode == 0:<br>                # Process and log the ifstat output<br>                for line in result.stdout.splitlines()[0:]:<br>                    log_message = f&quot;[{timestamp}] {line}&quot;<br>                    print(log_message) <br>                    net_logger.info(log_message)    <br>            else:<br>                error_message = f&quot;Error: {result.stderr}&quot;<br>                print(error_message)   <br>                net_logger.error(error_message)  <br>        except Exception as e:<br>            exception_message = f&quot;Exception occurred: {e}&quot;<br>            print(exception_message)   <br>            net_logger.error(exception_message)  <br>        time.sleep(60)  <br><br># Log Docker container stats<br>def log_docker_stats(docker_logger):<br>    while True:<br>        try:<br>            # Get the current timestamp in UTC<br>            timestamp = datetime.datetime.now(utc).strftime(&quot;%Y-%m-%d %H:%M:%S UTC&quot;)<br>            <br>            # Run docker stats command<br>            result = subprocess.run([&#39;docker&#39;, &#39;stats&#39;, &#39;--no-stream&#39;, &#39;--format&#39;, &#39;&quot;{{.Name}}: CPU={{.CPUPerc}} MEM={{.MemUsage}}&quot;&#39;], capture_output=True, text=True)<br>            if result.returncode == 0:<br>                # Process and log the docker stats output<br>                for line in result.stdout.splitlines():<br>                    log_message = f&quot;[{timestamp}] {line}&quot;<br>                    print(log_message)   <br>                    docker_logger.info(log_message)    <br>            else:<br>                error_message = f&quot;Error: {result.stderr}&quot;<br>                print(error_message)   <br>                docker_logger.error(error_message)   <br>        except Exception as e:<br>            exception_message = f&quot;Exception occurred: {e}&quot;<br>            print(exception_message)   <br>            docker_logger.error(exception_message)   <br>        time.sleep(60)<br><br># Monitor file/directory changes<br>class ChangeHandler(FileSystemEventHandler):<br>    def __init__(self, file_logger):<br>        self.file_logger = file_logger<br><br>    def on_modified(self, event):<br>        self.file_logger.info(f&quot;File modified: {event.src_path}&quot;)<br><br>    def on_created(self, event):<br>        self.file_logger.info(f&quot;File created: {event.src_path}&quot;)<br><br>    def on_deleted(self, event):<br>        self.file_logger.info(f&quot;File deleted: {event.src_path}&quot;)<br><br>def monitor_file_changes(path, file_logger):<br>    while True:<br>        event_handler = ChangeHandler(file_logger)<br>        observer = Observer()<br>        observer.schedule(event_handler, path, recursive=True)<br>        observer.start()<br>        time.sleep(1)  # Monitor for a short period to catch changes<br>        observer.stop()<br>        observer.join()<br>        time.sleep(60) <br><br># Log users and who are logged in<br>def log_logged_in_users(user_logger):<br>    while True:<br>        try:<br>            timestamp = datetime.datetime.now(utc).strftime(&quot;%Y-%m-%d %H:%M:%S UTC&quot;)<br>            who_output = subprocess.check_output([&#39;who&#39;], text=True)<br>            user_logger.info(f&quot;Timestamp: {timestamp}\nUsers logged in:\n{who_output}&quot;)<br>            print(f&quot;Logged in users logged at {timestamp}&quot;)<br>        except subprocess.CalledProcessError as e:<br>            user_logger.error(f&quot;Error: {e}&quot;)<br>        time.sleep(60) <br><br># Parse system logs for errors<br>def parse_system_logs(log_file, logger):<br>    error_patterns = [r&#39;error&#39;, r&#39;fail&#39;, r&#39;critical&#39;]  # Add more patterns as needed<br>    compiled_patterns = [re.compile(pat, re.IGNORECASE) for pat in error_patterns]<br><br>    with open(log_file, &#39;r&#39;) as f:<br>        for line in f:<br>            if any(pat.search(line) for pat in compiled_patterns):<br>                logger.info(f&quot;Log match found: {line.strip()}&quot;)<br>                time.sleep(30)<br><br>def log_system_logs(log_logger):<br>    while True:<br>        try:<br>            parse_system_logs(&#39;/var/log/syslog&#39;, log_logger)<br>        except Exception as e:<br>            log_logger.error(f&quot;Error parsing system logs: {e}&quot;)<br><br># Log disk usage<br>def monitor_disk_usage(disk_logger, threshold=90):<br>    while True:<br>        for part in psutil.disk_partitions():<br>            usage = psutil.disk_usage(part.mountpoint)<br>            total_gb = usage.total / (1024 ** 3)<br>            free_gb = usage.free / (1024 ** 3)<br>            used_gb = total_gb - free_gb<br>            disk_logger.info(f&quot;Disk usage on {part.mountpoint}: {usage.percent}% used, {used_gb:.2f} GB used, {free_gb:.2f} GB remaining out of {total_gb:.2f} GB total&quot;)<br>            if usage.percent &gt;= threshold:<br>                disk_logger.warning(f&quot;Disk usage alert on {part.mountpoint}: {usage.percent}% used, {used_gb:.2f} GB used, {free_gb:.2f} GB remaining out of {total_gb:.2f} GB total&quot;)<br>        time.sleep(300) <br><br># Log kernel errors from kern.log<br>def log_kernel_errors(kernel_logger):<br>    while True:<br>        try:<br>            parse_system_logs(&#39;/var/log/kern.log&#39;, kernel_logger)<br>        except Exception as e:<br>            kernel_logger.error(f&quot;Error parsing kernel logs: {e}&quot;)<br>        time.sleep(60)<br><br># Log last reboot times<br>def log_last_reboot_times(reboot_logger):<br>    while True:<br>        try:<br>            last_reboot_output = subprocess.check_output([&#39;last&#39;, &#39;reboot&#39;], text=True)<br>            reboot_logger.info(f&quot;Last reboots:\n{last_reboot_output}&quot;)<br>            print(&quot;Reboot times logged&quot;)<br>        except subprocess.CalledProcessError as e:<br>            reboot_logger.error(f&quot;Error: {e}&quot;)<br>        time.sleep(3600)<br><br># Log cache memory status<br>def log_cache_memory_status(cache_logger):<br>    while True:<br>        try:<br>            mem_info = psutil.virtual_memory()<br>            cache_logger.info(f&quot;Cache memory: {mem_info.cached / 1024 / 1024} MB&quot;)<br>        except Exception as e:<br>            cache_logger.error(f&quot;Error fetching cache memory status: {e}&quot;)<br>        time.sleep(300)<br><br>if __name__ == &quot;__main__&quot;:<br><br>    # Setup individual loggers for each task<br>    temp_logger = setup_logging(&#39;temperature.log&#39;)<br>    net_logger = setup_logging(&#39;network.log&#39;)<br>    docker_logger = setup_logging(&#39;docker.log&#39;)<br>    file_logger = setup_logging(&#39;file_changes.log&#39;)<br>    user_logger = setup_logging(&#39;user_logins.log&#39;)<br>    sys_log_logger = setup_logging(&#39;system_logs.log&#39;)<br>    disk_logger = setup_logging(&#39;disk_usage.log&#39;)<br>    kernel_logger = setup_logging(&#39;kernel_errors.log&#39;)<br>    reboot_logger = setup_logging(&#39;reboot_times.log&#39;)<br>    cache_logger = setup_logging(&#39;cache_memory.log&#39;)<br>    smartctl_logger = setup_logging(&#39;smartctl.log&#39;)<br>    nvidia_logger = setup_logging(&#39;nvidia_bug.log&#39;)<br><br>    # Setup threads<br>    threads = []<br><br>    # Example task initialization and thread starting<br>    tasks = [<br>        (&quot;docker.log&quot;, 10, log_docker_stats, &#39;Detailed Docker Monitoring&#39;),<br>        (&quot;temperature.log&quot;, 10, log_temperatures, &#39;Temperature Monitoring&#39;),<br>        (&quot;network.log&quot;, 10, log_network_usage, &#39;Network Monitoring&#39;),<br>        (&quot;file_changes.log&quot;, 10, monitor_file_changes, &#39;File Change Monitoring&#39;),<br>        (&quot;user_logins.log&quot;, 10, log_logged_in_users, &#39;User Login Monitoring&#39;),<br>        (&quot;system_logs.log&quot;, 10, log_system_logs, &#39;System Log Parsing&#39;),<br>        (&quot;disk_usage.log&quot;, 10, monitor_disk_usage, &#39;Disk Usage Monitoring&#39;),<br>        (&quot;kernel_errors.log&quot;, 10, log_kernel_errors, &#39;Kernel Error Monitoring&#39;),<br>        (&quot;reboot_times.log&quot;, 10, log_last_reboot_times, &#39;Reboot Times Logging&#39;),<br>        (&quot;cache_memory.log&quot;, 10, log_cache_memory_status, &#39;Cache Memory Status&#39;),<br>        (&quot;smartctl.log&quot;, 10, detect_ssd_and_log_smartctl, &#39;SSD SMART Monitoring&#39;),<br>        (&quot;nvidia_bug.log&quot;, 10, generate_nvidia_bug_report, &#39;Generate nvidia bug report&#39;)<br>    ]<br><br>    for log_filename, interval, function, description in tasks:<br>        logger = setup_logging(log_filename)<br>        if description == &#39;File Change Monitoring&#39;:<br>            thread = threading.Thread(target=function, args=(&#39;.&#39;, logger))<br>        else:<br>            thread = threading.Thread(target=function, args=(logger,))<br>        threads.append(thread)<br><br><br>    for thread in threads:<br>        thread.start()<br><br>    for thread in threads:<br>        thread.join()</pre><p>You can also add a function for a custom API to help you get this data out of the system and monitor it remotely.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf99955ef18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A straightforward guide to setting up and using Nvidia Container Builder (CB) to build and push…]]></title>
            <link>https://varun2-6.medium.com/a-straightforward-guide-to-setting-up-and-using-nvidia-container-builder-cb-to-build-and-push-d0933fe39428?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0933fe39428</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Fri, 12 Jul 2024 13:00:47 GMT</pubDate>
            <atom:updated>2024-07-12T13:01:05.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>A straightforward guide to setting up and using Nvidia Container Builder (CB) to build and push custom Docker images for multi-architecture systems</h3><p>This guide will assist users in setting up CB, testing a sample build for x86 or aarch64, and pushing the final image to their own custom registry. The main advantage of CB is that users can build GPU-based aarch64 images on dGPUs, significantly reducing build time. Additionally, CB eliminates the need for maintaining separate Dockerfiles for different architectures, as it is managed by a single YML config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*YbTjFZhTDDwQiD8YsQDoRg.png" /></figure><h4>Step 1: Install NGC CLI (Optional but recommended if you are working with base images from NGC)</h4><p>Click on the following link and select your host system type <a href="https://org.ngc.nvidia.com/setup/installers/cli">https://org.ngc.nvidia.com/setup/installers/cli</a>. For example if you have an x86–64 Linux based system, you can follow the steps given at the end of the same page.</p><pre>wget --content-disposition https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/3.44.0/files/ngccli_linux.zip -O ngccli_linux.zip &amp;&amp; unzip ngccli_linux.zip</pre><pre>find ngc-cli/ -type f -exec md5sum {} + | LC_ALL=C sort | md5sum -c ngc-cli.md5</pre><pre>sha256sum ngccli_linux.zip</pre><pre>chmod u+x ngc-cli/ngc</pre><pre>echo &quot;export PATH=\&quot;\$PATH:$(pwd)/ngc-cli\&quot;&quot; &gt;&gt; ~/.bash_profile &amp;&amp; source ~/.bash_profile</pre><pre>ngc config set</pre><p>The last command prompts you to enter an API key that you can obtain from <a href="https://ngc.nvidia.com/setup/api-key">https://ngc.nvidia.com/setup/api-key</a>. Once this is done, you’re ready to setup CB and Graph Compos.</p><h4>Step 2: Setup CB and Graph Compose</h4><p><strong><em>Install Docker</em></strong><em> (Assuming a Linux system)</em></p><pre>sudo apt-get update<br><br>sudo apt-get install ca-certificates curl<br><br>sudo install -m 0755 -d /etc/apt/keyrings<br><br>sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc<br><br>sudo chmod a+r /etc/apt/keyrings/docker.asc<br><br>echo \<br>  &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \<br>  $(. /etc/os-release &amp;&amp; echo &quot;$VERSION_CODENAME&quot;) stable&quot; | \<br>  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br><br>sudo apt-get update<br><br>sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><p><strong><em>Install Graph Compose </em></strong><em>(Assuming a Linux system)</em></p><p>Visit link <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/resources/gxf_and_gc">https://catalog.ngc.nvidia.com/orgs/nvidia/resources/gxf_and_gc</a> and download the graph compose deb file as well as the graph compose runtime file, and run the following commands</p><pre>sudo apt install libyaml-cpp-dev</pre><pre>sudo dpkg -i graph_composer-runtime-4.0.0_x86_64.deb</pre><pre>sudo dpkg -i graph_composer-4.0.0_x86_64.deb</pre><h4>Step 3: Run CB and Graph Compose</h4><p><em>Open a terminal tab and run the following command to initialise GXF</em></p><pre>gxf_server</pre><p>Create a config.yml based on what application you want to run as a container and build the docker image. Sample attached below which helps you run a simple TF application in case you want to test and play around with the .yml file params.</p><pre>---<br>target: x86   # optional, can be used during multi-arch build<br>unique_stage: newtestvarun  # required, name must be unique<br># base_image is required<br>base_image: &quot;nvcr.io/nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04&quot;<br>stage_model: clean_stage # Optional<br><br># Install custom packages<br>apt_deps:<br>- curl<br>- ca-certificates<br>- tar<br>- python3<br>- python3-pip<br>- libboost-all-dev<br><br># Install pip3 packages<br>pip3_deps:<br>- PyYAML&gt;=5.4.1<br>- numpy<br>- tensorflow<br><br># Copy local files to image<br>local_copy_files:<br>- src: &quot;/home/varun-personal/cont_build/test_app.py&quot;<br>  dst: &quot;/root/test_app.py&quot;<br><br># Clean up operations<br>custom_runs:<br>- &quot;apt autoremove &amp;&amp; ln -s /opt/nvidia/cuda/samples /samples&quot;<br><br># Specify WORKDIR<br>work_folder: /workspace/test/<br><br># Specify ENV variables<br>env_list:<br>  PATH: &quot;/opt/nvidia/cuda/bin:$PATH&quot;<br>  LD_LIBRARY_PATH: &quot;/opt/nvidia/cuda/lib64:$LD_LIBRARY_PATH&quot;<br><br># Specify ENTRYPOINT if needed<br>entrypoint: [&quot;python3&quot;, &quot;/root/test_app.py&quot;]<br><br># Container builder configuration<br>container_builder: main  # name<br><br># Docker build options<br>docker_build:<br>  image_name: testregistry.registry.com:5000/gpu_test_app:latest<br>  no_cache: true<br>  squash: false<br><br># Docker push to registry / cloud<br>docker_push:<br>  - url: &quot;testregistry.registry.com:5000/gpu_test_app:latest&quot;<br>    username: test<br>    password: testpassword</pre><p>Information on each of the above parameters is given here <a href="https://resources.nvidia.com/en-us-deepstream-get-started-with-graph-composer/">https://resources.nvidia.com/en-us-deepstream-get-started-with-graph-composer/</a></p><p>Build your image using the command below</p><pre>container_builder build -c config.yml -d x86</pre><p>Also you would need to make sure your registry details in the yml file are correct in order to push the image. Hope this was helpful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0933fe39428" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A short note on ‘The Killing’ — Season 1 and 2]]></title>
            <link>https://varun2-6.medium.com/a-short-note-on-the-killing-season-1-and-2-a8be6503d2be?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8be6503d2be</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Tue, 18 Jun 2024 10:26:30 GMT</pubDate>
            <atom:updated>2024-06-18T16:02:54.640Z</atom:updated>
            <content:encoded><![CDATA[<h3>A short note on ‘The Killing’ — Season 1 and 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBpgkyhJ8w7XZ48uHG407g.jpeg" /></figure><p>The Killing is a four season TV series produced by AMC in 2011. Officially declared as a ‘drama’, I’d place this as either a crime thriller, or a slow burn crime drama. Alternatively, I’d say the first two seasons of the show is a tale of heartbreak and gut-wrenching despair.</p><p>Set in Seattle, the story follows the murder of a high school student named Rosie Larsen. What typifies the murder investigation is the strange circumstance in which Rosie’s body was found — submerged in the trunk of a car at the bottom of a lake. The investigation is lead by Detective Stephen Holder and Detective Sarah Linden. In the following sections I’ll speak about what season 1 and season 2 brings to the table, drawbacks if any, as well as the relationship between the two lead detectives. No spoilers are mentioned in this post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*Rc-CBUtVpTnfNRM14aeQgg.jpeg" /></figure><p>The first half of Season 1’s primary focus was to enable suspect elimination via alibi’s. The transition towards a more fundamental, well accentuated story-line involving other aspects such as the personal lives of the victim’s family, the mayoral disputes between the two candidates contesting for mayoral elections in Seattle, underscores and sets the narrative hinting at a deeper layer to Rosie’s death rather than a straightforward ‘grudge’ killing. The first season also makes sure to highlight character flaws and personalities of each and every character, adding to the mystery. Interwoven narratives makes this season top notch except for the last two episodes. I found that the last two episodes were rushed, not a lot of attention to detail was provided, and certain aspects of what the climax was reaching to, was forced upon the viewers. It could have been more meticulously written and executed in a slower fashion, to make sure that the show’s slow burn theme was satisfied.</p><p>Season 2 was noticeably faster-paced, which was essential for plot development. Maintaining the slow burn pace from Season 1 would not have worked, especially given the cliffhanger ending of the first season. No complaints here, The writing in season 2, particularly in terms of how the detectives navigate through internal politics, conduct investigations and deal with their own graveyard of secrets — was blended into each episode exceptionally well. There are multiple twists in season 2, which encourages the viewers to try and connect the dots. Season 2 is an archetype of how crime thrillers should be written and directed. The dark, brooding atmosphere, the eerie sense of hidden motives, the portrayal of grief and heartbreak, and the depiction of how people process different emotions during a crisis is immaculately handled by the writers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1c9FVXwAGPC9wacAOql4eg.jpeg" /></figure><p>Detective Sarah Linden and Detective Stephen Holder (in the picture above) have some of the best written personality traits one could ask for, considering their experience in the force (even though Holder was initially part of a different task force). Their relationship starts off hostile, as Linden prefers to work alone and does not trust Holder’s abilities. One of the best subplots in the entire series is the character progression and how they realize that they are each other’s ‘Ride or Die’ — a journey brilliantly depicted. Subtle emotional moments, behind-the-back actions, and the growing mutual respect between them enhance the narrative. Their evolving partnership is not only compelling but also adds depth to the story-line, making their bond one of the highlights of the series. Actually thinking back on this, I would place my bets on the show’s success to be derailed if not for the partnership between Linden and Holder — based on the points mentioned above. To me, this was the reason for 70% of it’s acclaim.</p><p>Overall, I would suggest going into this show deeply invested, appreciating the top-quality acting, and progression towards one of the best climaxes you could ever expect in a who-dun-it type of slow burn thriller. The final moments of the last episode in season 2 left me broken — primarily because of the profound impact of the characters’ journeys and the emotional weight carried throughout the series, and finally — the revelation of how and why Rosie was killed, which is unlike anything you would have ever seen before.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8be6503d2be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Nvidia Deepstream 6.2 on a local K3s cluster — Part I]]></title>
            <link>https://varun2-6.medium.com/running-nvidia-deepstream-6-2-on-a-local-k3s-cluster-part-i-7c5ce5718951?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c5ce5718951</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Mon, 19 Feb 2024 17:22:22 GMT</pubDate>
            <atom:updated>2024-11-14T11:34:56.251Z</atom:updated>
            <content:encoded><![CDATA[<h3>Running Nvidia Deepstream 6.2 on a local K3s node — Part I</h3><p>Hey folks, this guide will help you setup kubernetes, go through a simple yaml file, and run nvidia deepstream’s sample application leveraging the GPU inside a k3s pod. There’s also a section to help understand how config maps are implemented in the cluster.</p><blockquote>Setup K3s and install Nvidia device plugin</blockquote><pre>curl -sfL https://get.k3s.io | sh -<br><br>kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.13.0/nvidia-device-plugin.yml<br><br>cat &lt;&lt;EOF | kubectl apply -f -<br>apiVersion: v1<br>kind: Namespace<br>metadata:<br>  name: gpu-operator<br>---<br>apiVersion: helm.cattle.io/v1<br>kind: HelmChart<br>metadata:<br>  name: nvidiagpu<br>  namespace: gpu-operator<br>spec:<br>  chart: gpu-operator<br>  repo: https://helm.ngc.nvidia.com/nvidia<br>EOF<br><br>service k3s restart</pre><blockquote>Check if GPU access is present</blockquote><pre>sudo kubectl get node -o json | jq &#39;.items[0].status.capacity&#39;</pre><blockquote>Create a directory to store your yaml files and other resources (good practice)</blockquote><pre>mkdir -p ~/Documents/DS_K3s</pre><blockquote>Create a deployment yaml file, let’s call it ds-demo.yaml</blockquote><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: demo-ds-deployment<br>  labels:<br>    app: demo-app<br>spec:<br>  hostNetwork: true  <br>  restartPolicy: Always  <br>  runtimeClassName: nvidia<br>  containers:<br>    - name: demo-stream<br>      image: nvcr.io/nvidia/deepstream:6.2-samples<br>      imagePullPolicy: IfNotPresent <br>      tty: true<br>      securityContext:<br>        privileged: true  <br>      env:<br>        - name: DISPLAY<br>          value: &quot;$DISPLAY&quot; <br>        - name: NVIDIA_VISIBLE_DEVICES<br>          value: all<br>        - name: NVIDIA_DRIVER_CAPABILITIES<br>          value: all<br>      resources:<br>        limits:<br>          nvidia.com/gpu: 1<br>      command: [ &quot;/bin/bash&quot;, &quot;-c&quot;, &quot;--&quot; ]<br>      args: [ &quot;while true; do sleep 3600; done;&quot; ]<br>      volumeMounts:<br>      - mountPath: /tmp/.X11-unix/<br>        name: x11<br>      - mountPath: /opt/demo.txt<br>        subPath: config.txt<br>        name: demo-configmap</pre><blockquote>Check status of your k3s node</blockquote><pre>kubectl get nodes</pre><blockquote>Create a configMap from a file, this will be mounted to the container. For the sake of this guide, i’ll be creating a demo.txt file which is nothing but a deepstream 6.2 sample config file which we’ll use to run our pod later.</blockquote><pre>[application]<br>enable-perf-measurement=1<br>perf-measurement-interval-sec=5<br>#gie-kitti-output-dir=streamscl<br><br>[tiled-display]<br>enable=1<br>rows=2<br>columns=2<br>width=1280<br>height=720<br>gpu-id=0<br>#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform<br>#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla<br>#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla<br>#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla<br>#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson<br>nvbuf-memory-type=0<br><br>[source0]<br>enable=1<br>#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP<br>type=3<br>uri=file://../../streams/sample_1080p_h264.mp4<br>num-sources=4<br>#drop-frame-interval=2<br>gpu-id=0<br># (0): memtype_device   - Memory type Device<br># (1): memtype_pinned   - Memory type Host Pinned<br># (2): memtype_unified  - Memory type Unified<br>cudadec-memtype=0<br><br>[sink0]<br>enable=1<br>#Type - 1=FakeSink 2=EglSink/nv3dsink (Jetson only) 3=File<br>type=1<br>sync=1<br>source-id=0<br>gpu-id=0<br>nvbuf-memory-type=0<br><br>[sink1]<br>enable=0<br>#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming<br>type=3<br>#1=mp4 2=mkv<br>container=1<br>#1=h264 2=h265<br>codec=1<br>#encoder type 0=Hardware 1=Software<br>enc-type=0<br>sync=0<br>#iframeinterval=10<br>bitrate=2000000<br>#H264 Profile - 0=Baseline 2=Main 4=High<br>#H265 Profile - 0=Main 1=Main10<br>profile=0<br>output-file=out.mp4<br>source-id=0<br><br>[sink2]<br>enable=0<br>#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming<br>type=4<br>#1=h264 2=h265<br>codec=1<br>#encoder type 0=Hardware 1=Software<br>enc-type=0<br>sync=0<br>#iframeinterval=10<br>bitrate=400000<br>#H264 Profile - 0=Baseline 2=Main 4=High<br>#H265 Profile - 0=Main 1=Main10<br>profile=0<br># set below properties in case of RTSPStreaming<br>rtsp-port=8554<br>udp-port=5400<br><br>[osd]<br>enable=1<br>gpu-id=0<br>border-width=1<br>text-size=15<br>text-color=1;1;1;1;<br>text-bg-color=0.3;0.3;0.3;1<br>font=Serif<br>show-clock=0<br>clock-x-offset=800<br>clock-y-offset=820<br>clock-text-size=12<br>clock-color=1;0;0;0<br>nvbuf-memory-type=0<br><br>[streammux]<br>gpu-id=0<br>##Boolean property to inform muxer that sources are live<br>live-source=0<br>buffer-pool-size=4<br>batch-size=4<br>##time out in usec, to wait after the first buffer is available<br>##to push the batch even if the complete batch is not formed<br>batched-push-timeout=40000<br>## Set muxer output width and height<br>width=1920<br>height=1080<br>##Enable to maintain aspect ratio wrt source, and allow black borders, works<br>##along with width, height properties<br>enable-padding=0<br>nvbuf-memory-type=0<br>## If set to TRUE, system timestamp will be attached as ntp timestamp<br>## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached<br># attach-sys-ts-as-ntp=1<br><br># config-file property is mandatory for any gie section.<br># Other properties are optional and if set will override the properties set in<br># the infer config file.<br>[primary-gie]<br>enable=1<br>gpu-id=0<br>model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b4_gpu0_int8.engine<br>batch-size=4<br>#Required by the app for OSD, not a plugin property<br>bbox-border-color0=1;0;0;1<br>bbox-border-color1=0;1;1;1<br>bbox-border-color2=0;0;1;1<br>bbox-border-color3=0;1;0;1<br>interval=0<br>gie-unique-id=1<br>nvbuf-memory-type=0<br>config-file=config_infer_primary.txt<br><br>[tracker]<br>enable=1<br># For NvDCF and NvDeepSORT tracker, tracker-width and tracker-height must be a multiple of 32, respectively<br>tracker-width=640<br>tracker-height=384<br>ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so<br># ll-config-file required to set different tracker types<br># ll-config-file=config_tracker_IOU.yml<br># ll-config-file=config_tracker_NvSORT.yml<br>ll-config-file=config_tracker_NvDCF_perf.yml<br># ll-config-file=config_tracker_NvDCF_accuracy.yml<br># ll-config-file=config_tracker_NvDeepSORT.yml<br>gpu-id=0<br>enable-batch-process=1<br>enable-past-frame=1<br>display-tracking-id=1<br><br>[secondary-gie0]<br>enable=1<br>model-engine-file=../../models/Secondary_VehicleTypes/resnet18.caffemodel_b16_gpu0_int8.engine<br>gpu-id=0<br>batch-size=16<br>gie-unique-id=4<br>operate-on-gie-id=1<br>operate-on-class-ids=0;<br>config-file=config_infer_secondary_vehicletypes.txt<br><br>[secondary-gie1]<br>enable=1<br>model-engine-file=../../models/Secondary_CarColor/resnet18.caffemodel_b16_gpu0_int8.engine<br>batch-size=16<br>gpu-id=0<br>gie-unique-id=5<br>operate-on-gie-id=1<br>operate-on-class-ids=0;<br>config-file=config_infer_secondary_carcolor.txt<br><br>[secondary-gie2]<br>enable=1<br>model-engine-file=../../models/Secondary_CarMake/resnet18.caffemodel_b16_gpu0_int8.engine<br>batch-size=16<br>gpu-id=0<br>gie-unique-id=6<br>operate-on-gie-id=1<br>operate-on-class-ids=0;<br>config-file=config_infer_secondary_carmake.txt<br><br>[tests]<br>file-loop=0</pre><pre>kubectl create configmap demo-configmap --from-file=config.txt=/home/iw/demo.txt</pre><blockquote>Create a pod</blockquote><pre>kubectl apply -f ds.yaml</pre><blockquote>Check status of your pod</blockquote><pre>kubectl get pods</pre><blockquote>NOTE : If your pod is stuck in a CrashLoopBackoff or any other error state, get more information using the following command</blockquote><pre>kubectl describe pod pod_name</pre><blockquote>Exec into the pod to verify configMap files</blockquote><pre>kubectl exec -it pod_name -- bash </pre><pre>cat /opt/demo.txt</pre><blockquote>To edit the configMap, you can use the following command which opens a default text editor</blockquote><pre>kubectl edit cm demo-configmap</pre><blockquote>Run the sample app</blockquote><pre>kubectl exec -ti demo-ds-deployment-c8ff9556b-ltlzw -- bash -c &quot;cd /opt/nvidia/deepstream/deepstream-6.2/sources/apps/sample_apps &amp;&amp; deepstream-app -c /opt/nvidia/deepstream/deepstream-6.2/samples/configs/deepstream-app/source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt&quot;</pre><p>You can also run the sample app using the mounted demo.txt config file. The changed command would be as follows</p><pre>kubectl exec -ti demo-ds-deployment-c8ff9556b-ltlzw -- bash -c &quot;cd /opt/nvidia/deepstream/deepstream-6.2/sources/apps/sample_apps &amp;&amp; deepstream-app -c /opt/demo.txt&quot;</pre><p>That’s all for now! Stay tuned for Part II</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c5ce5718951" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BIOS — Secure Boot Setup on Dual / Single Boot machines]]></title>
            <link>https://varun2-6.medium.com/bios-secure-boot-setup-on-dual-single-boot-machines-594e1e758db7?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/594e1e758db7</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Thu, 08 Feb 2024 10:54:04 GMT</pubDate>
            <atom:updated>2024-02-09T03:45:31.377Z</atom:updated>
            <content:encoded><![CDATA[<h3>BIOS — Secure Boot Setup on Dual / Single Boot machines</h3><p>Secure Boot, a feature present in the BIOS menu of most systems, mandates that all system-level drivers must be “signed” or approved as authentic software. While this ensures the integrity of the system, it poses a challenge for Ubuntu users who may need unsigned drivers for components like wireless cards, video cards, or specialized hardware. These unsigned drivers, crucial for proper functionality, won’t load when Secure Boot is enabled. To address this, users must obtain signed versions of each driver to enable their smooth operation.</p><p>An easy fix would be to disable secure boot, but this would cause issues in loading windows. In addition, if you’re working as a part of an Org which needs secure boot to be enable as a part of security requirements, we’d need to enroll keys to make sure the user is authentic and is installing drivers / packages after getting it “signed” using a key.</p><p>There are a few simple steps / commands below that can help achieve this :</p><ul><li>Install mokutil</li></ul><pre>sudo apt install -y mokutil</pre><ul><li>Check secure boot state</li></ul><pre>sudo mokutil --sb-state</pre><ul><li>Disable validation</li></ul><pre>sudo mokutil --disable-validation</pre><p>The above command asks you to enter a password that will be used later.</p><ul><li>Reboot the system</li></ul><pre>sudo reboot</pre><ul><li>You’ll be introduced a blue screen once the machine reboots, click on ‘Change Secure Boot state’ option and disable it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4D9zf-qFSxH1S52xLcVyQ.jpeg" /></figure><ul><li>Enter different characters of your password (which was set during sudo mokutil — disable-validation) as prompted</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bOljPpY548IAE2rU0GIGng.jpeg" /></figure><ul><li>Once the above steps are done, the machine will reboot and then you can Install drivers / packages that you need, for example I will be installing Nvidia drivers</li></ul><pre>sudo apt install -y nvidia-driver-535</pre><ul><li>Do not panic when you get the below prompt, it will ask you to enter a password. You can set the same password as set earlier.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*yVFS71IzGxY9JtWhlBC0EQ.png" /></figure><ul><li>Once the package(s) are installed, enable validation and reboot</li></ul><pre>sudo mokutil --enable-validation</pre><ul><li>Reboot the machine again.</li></ul><pre>sudo reboot</pre><ul><li>On the blue screen, click Enroll MOK, and then ‘View Key’ and reboot</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HPRYPNT1sSzqQ4ltnqG1g.jpeg" /></figure><ul><li>After the system reboots, you can see your Nvidia drivers loaded using :</li></ul><pre>nvidia-smi</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=594e1e758db7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delve deeper into Rust Cohle’s mind]]></title>
            <link>https://varun2-6.medium.com/delve-deeper-into-rust-cohles-mind-2fcbf943dde7?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fcbf943dde7</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 19:04:52 GMT</pubDate>
            <atom:updated>2024-01-31T16:55:28.925Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Rust Cohle</strong>, played by Matthew McConaughey in the series ‘True Detective,’ is arguably one of the best-written characters in 21st-century cinema. The depth of his character is evident in the portrayal where there’s a type of sadness in Rust that is far greater than what an average individual can comprehend. He’s artistic about life, but more so in a cynical way. This is mainly owing to his inner suffering — the death of his young daughter in a car accident. As the show progresses, we are introduced more to his pessimistic outlook towards life, leading him to often idealize the notion that human emotions and consciousness are ‘nature’s mistake.’ Rust doesn’t believe in closure. He thinks that nothing is ever ‘over’; we go on into an eternal loop, with almost identical events and circumstances to be experienced over and over again — fancifully called ‘eternal return.’ He accepts this belief wholeheartedly, and hence exemplifying eternal suffering, which should ideally end in mankind’s extinction. This makes it quite hard for Rust to form a connection with any human he meets. It’s quite unclear if Rust’s state of mind was similar before his daughter’s death or if it has pieces of it etched into his subconscious already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*31SBAoBblJT5R3_AUQ_mlg@2x.jpeg" /></figure><p>I‘d like to share a theory that might explain why Rust has these pessimistic views on certain aspects. I think he’s probably constantly trying to mask and channel his suffering into such views, knowing that the pain of losing his daughter is too taxing and is something he might never gain control over. If existence in general, doesn’t matter, then just maybe, his daughter was saved from an eternal return into this ‘programmed and miserable world.’ There’s an aspect to Rust’s philosophy which I personally find fundamentally wrong. Rust believes that although he performs heroic deeds such as solving crimes and putting criminals away, there’s no actual purpose to this since he believes these crimes will eternally return. Rust is smart enough to know that some of his ideals are results of coping mechanisms, and that he shields himself from getting emotionally connected to whatever he does, all the while knowing that there are long-term (good) consequences to his work. A stonewall example of this is the fact that he pursued the case for 17 years and eventually got to the bottom of it, providing himself with closure and possibly saving countless lives. By no means is Rust’s character a good example of a pessimistic soul or a portrayal of someone with nihilistic views. His beliefs are flawed, but beautifully conditioned and the coexistence of his existential doubts and his commitment to making a difference is what makes Rust Cohle possibly the best written character of all time.</p><p>Before we reach the end of my short but Lovecraftian-type analysis of Rust Cohle’s character, I’d like to mention a few things about Matthew McConaughey’s performance. I was awestruck at how well he was able to convey his inner demons and suffering through his eyes and mannerisms. A simple shot of him having dinner was an indication of the depth of pain, sorrow, and existential weight, which is conveyed with a single glance. Hence, Matthew McConaughey’s performance in “True Detective” is nothing short of mesmerizing. The subtlety and nuance he brings to the character elevate the viewing experience to a haunting score. This is particularly exemplary because Rust Cohle’s character has multiple layers, begging the question of how Matthew slowly peels off layer by layer, aiding the character’s complex emotional landscape. Finally, I believe that Rust’s character emphasizes the fact that pain doesn’t necessarily make us better, but it sure does make us profound.</p><p>I strongly believe that the first season of True Detective is by far the greatest crime thriller piece ever made / written / directed. It’s a slow burner but doesn’t fail to captivate the viewers in an incredibly engrossing narrative. Every scene in the car with conversations between Marty and Cohle shows us how different their characters fundamentally are, and the exchange of ideas and ideals help the viewers really connect with the characters and notice subtle character development as the show progresses. The cinematography is eerie, with a blue/ gray tint, leading up to one of the best climaxes and conclusions ever portrayed on television.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fcbf943dde7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick note on the mini series called ‘The Outsider’]]></title>
            <link>https://varun2-6.medium.com/a-quick-note-on-the-mini-series-called-the-outsider-cf018259aca9?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf018259aca9</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 19:37:25 GMT</pubDate>
            <atom:updated>2024-01-31T16:58:14.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*R_dbOxyMwVmkJFuUwM643Q@2x.jpeg" /></figure><p>Based on a Stephen king novel, it’s easily one of the best adaptations ever made. The story follows what seems to be an open and shut murder case but evidence uncovered over a short duration says otherwise. I would suggest going into this without any expectations and postulations. Please refrain from watching the trailer as well. What initially seems to be a crime thriller, suddenly takes divergence into a completely different realm, keeping you hooked right from the first episode. There’s an atmosphere of eerie, psychological trauma, unsettling events which is quite idiosyncratic to anything you’ve ever seen.</p><p>What really caught my eye in this mini series, is it’s ability to touch on topics related to psychological trauma. We’ve repeatedly seen movies or shows which delve into such topics without much substance. It’s often only used to advance the plot. But the outsider does an exemplary job at portraying how differently a human mind can work especially while making important decisions, based on what sort of trauma they have experienced in the past. This aspect is shown to the audience in the eyes of three disparate characters. Furthermore, the series skillfully underscores blurred lines between reality and the supernatural, adding an intriguing layer that enhances the psychological depth of each character, leaving the viewers captivated by the enigmatic forces at play — a big picture sort of view.</p><p>Without spoiling much of the plot, I would suggest watching this mini series alone, in a slightly dark abode. It’s a slow burner initially, but the plot advances quickly during the course of the investigation. A small piece of advice I would like to give is that the viewers pay attention to each characters’ state of mind at the beginning, and try to notice subtle shifts in terms of their ideologies through the course of the show.</p><p>It’s when you begin to realise how delicate our minds are, that’s when you prohibit a lot of things entering / affecting your thoughts, that would otherwise take a huge toll on your mind, especially over time. “Dreams are messages”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf018259aca9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ubuntu 20.04 — A short guide to network routes and metrics]]></title>
            <link>https://varun2-6.medium.com/ubuntu-20-04-a-short-guide-to-network-routes-and-metrics-df096a7d3ba?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/df096a7d3ba</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 09:22:16 GMT</pubDate>
            <atom:updated>2021-06-13T10:26:20.201Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ubuntu 20.04 — A short guide to network routes and metrics</h3><p>Setting static IP’s on Ubuntu based systems can be tricky. Especially if there are multiple interfaces involved. Here is a short guide to ensure that we do not lose network connectivity. This guide is based on Ubuntu 20.04.</p><ul><li>Check the interface which needs a static IP assigned using:</li></ul><blockquote>ifconfig</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*aqkQ1FI_Z2iZgHDBjSgcVw.png" /></figure><p>In this case, we need to assign an IP to enp4s0</p><ul><li>Open the network configuration file using:</li></ul><blockquote>sudo nano /etc/netplan/01-network-manager-all.yaml</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*8Lz4o2UpWeVVXlZSmp5vjg.png" /></figure><p>Next, add the static IP, Gateway, Subnet mask to the particular interface name (Eg: enp4s0)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*yepKoHyaKJu7DA950EOCxA.png" /></figure><p>Now, suppose we have multiple network interfaces, and would like our internet access to be only through the above <em>enp4s0</em> interface, we need to set a route-metric parameter as follows. The final yaml file should look something like this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*LH2QItICKEWJCVdPqqKEIA.png" /></figure><p>Finally, a <em>sudo netplan apply</em> would apply the changes!</p><p>PS : Lower the metric value, higher the priority of that particular interface / route.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df096a7d3ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The story of Christian Eriksen]]></title>
            <link>https://varun2-6.medium.com/a-few-questions-the-story-of-christian-eriksen-ef2c4998e153?source=rss-10a21f7596da------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef2c4998e153</guid>
            <dc:creator><![CDATA[Varun]]></dc:creator>
            <pubDate>Sat, 12 Jun 2021 19:19:29 GMT</pubDate>
            <atom:updated>2021-08-02T16:12:47.984Z</atom:updated>
            <content:encoded><![CDATA[<p>Christian Eriksen from Denmark collapsed on the pitch during a Euro 2021 match between Denmark and Finland on live television due to a cardiac arrest. Paramount to saving Eriksen’s life was well-trained and well-equipped, swift medical care.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*NpCmvlcbFVEqoLTNh2cSBw@2x.jpeg" /></figure><p>This is especially disheartening, since football fans all over the world have been watching him play for a number of years. He has got us through tough times, and is an incredible player as well as a person. A day when the whole footballing community stands together. A few pictures of his teammates as well as his wife crying before he received medical attention is heartbreaking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*JTQ6QrDcVS6u1EKZdVu3zQ@2x.jpeg" /></figure><p>An update from the medical centre was that Christian FaceTimed his teammates urging them to resume playing, and assuring the world that he is OK and on the path to recovery.</p><p>A callous behaviour was noted from the TV sponsors and broadcasters who, without regard to the injured continued broadcast and included pictures and videos of his distressed family as well. Something has to change here. In fact, a LOT of things have to change – and this warrants a separate post.</p><p>The extremely worrying part about this is the fact that, though athletes are monitored continuously during training, through cardiograms, blood pressure monitors, and heart rate sensors, etc, such situations aren’t identified earlier most of the times.</p><p>On the contrary, there have also been instances where heart related issues are identified in athletes and they’ve had to retire as a result of that.</p><p>I’m no medical expert but would like to know what the gap is, between identifiable and sudden situations such as this, and if at all they are anticipatable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*9FoVtnyz2TF-5iOM3I-pjg@2x.jpeg" /></figure><p>Most importantly, this unfortunate incident shows the strength, compassion and sportiveness of the footballing community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef2c4998e153" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>