<?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 Zayden Rahman on Medium]]></title>
        <description><![CDATA[Stories by Zayden Rahman on Medium]]></description>
        <link>https://medium.com/@professorlinux?source=rss-4a3c4df38c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WGelX5AdwSlpzpN7TIreTA.jpeg</url>
            <title>Stories by Zayden Rahman on Medium</title>
            <link>https://medium.com/@professorlinux?source=rss-4a3c4df38c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:43:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@professorlinux/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[An extremely interesting fact about Linux troubleshooting is the "Magic SysRq Key”]]></title>
            <link>https://medium.com/@professorlinux/an-extremely-interesting-fact-about-linux-troubleshooting-is-the-magic-sysrq-key-506ce314e0bd?source=rss-4a3c4df38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/506ce314e0bd</guid>
            <dc:creator><![CDATA[Zayden Rahman]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 04:21:32 GMT</pubDate>
            <atom:updated>2024-10-06T04:21:32.829Z</atom:updated>
            <content:encoded><![CDATA[<p>An extremely interesting fact about Linux troubleshooting is the &quot;Magic SysRq Key”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*OtXt2z1A5FV7yxYNU4Jd1g.jpeg" /></figure><p>It is a powerful, lesser-known feature that can be used to recover a system when it’s completely frozen or unresponsive.</p><p>The Magic SysRq Key provides direct access to kernel-level commands, allowing you to perform low-level actions like rebooting, killing processes, or even safely syncing and unmounting disks without needing to rely on the regular user-space tools that might be inaccessible when the system is hung.</p><p>How It Works:</p><p>The Magic SysRq Key is triggered by pressing Alt + SysRq (or Print Screen) followed by a specific command key. For example:</p><p>r – Switch the keyboard to raw mode.</p><p>e – Send the terminate signal to all processes, effectively shutting them down safely.</p><p>i – Immediately kill all processes (which can help recover from a severe system freeze).</p><p>s – Sync all mounted file systems (safeguarding data before a forced reboot).</p><p>b – Reboot the system immediately, without syncing or unmounting.</p><p>Why This Is Useful:</p><p>In normal situations, when a system freezes, users might have to forcefully power off their machine, which risks data corruption. With the Magic SysRq Key, even when most things are non-responsive, you can safely manage processes, save work, and avoid hard reboots, which can lead to fewer filesystem errors or lost data.</p><p>Practical Example:</p><p>Let’s say your Linux system has frozen, and you can&#39;t interact with it in any meaningful way. You can perform a safe reboot using this sequence:</p><p>1. Press Alt + SysRq + s to sync disks.</p><p>2. Press Alt + SysRq + e to terminate processes.</p><p>3. Press Alt + SysRq + b to reboot the machine.</p><p>This key combination works at the kernel level, bypassing normal user-space operations, making it an indispensable tool for advanced troubleshooting in emergency situations.</p><p>Pro Tip:</p><p>To check if Magic SysRq is enabled on your system, run:</p><p>cat /proc/sys/kernel/sysrq</p><p>If it&#39;s set to 1, it&#39;s enabled. If not, you can enable it with:</p><p>echo &quot;1&quot; &gt; /proc/sys/kernel/sysrq</p><p>https://en.wikipedia.org/wiki/Magic_SysRq_key</p><p>This makes the Magic SysRq Key a hidden gem in Linux troubleshooting that can prevent the need for a hard reboot and protect your data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=506ce314e0bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Namespaces in Linux: A Technical Exploration]]></title>
            <link>https://medium.com/@professorlinux/namespaces-in-linux-a-technical-exploration-4de5945f8533?source=rss-4a3c4df38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4de5945f8533</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[namespaces]]></category>
            <dc:creator><![CDATA[Zayden Rahman]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 01:44:15 GMT</pubDate>
            <atom:updated>2024-03-31T01:45:45.643Z</atom:updated>
            <content:encoded><![CDATA[<h4>Abstract</h4><p>Linux namespaces are a pivotal feature of the Linux kernel that enable the partitioning of kernel resources in such a way that one set of processes sees one set of resources while another set of processes sees a different set of resources. This concept is fundamental to implementing containerization, providing process isolation, and enhancing system security and efficiency. This paper delves into the technical underpinnings of namespaces, their categorization, practical applications, and the implications for modern computing paradigms such as virtualization and cloud computing.</p><h4>Introduction</h4><p>Introduced incrementally starting with Linux kernel version 2.4.19, namespaces have become a cornerstone in Linux system architecture, allowing for the isolation and encapsulation of application environments. By segregating system resources, namespaces facilitate a level of virtualization that enables each process or group of processes to operate within a seemingly independent instance of the global system environment.</p><h4>Technical Overview of Namespaces</h4><p>Namespaces abstract global system resources in such a way that processes within each namespace are unaware of resources outside their namespace. Linux supports several types of namespaces, each designed to isolate a specific set of system resources:</p><ul><li><strong>Mount (mnt)</strong>: Isolates filesystem mount points, enabling each set of processes to have its own set of visible filesystems.</li><li><strong>Process ID (pid)</strong>: Ensures processes in different pid namespaces see distinct sets of process IDs.</li><li><strong>Network (net)</strong>: Provides isolation of network interfaces, IP addresses, ports, and routing tables.</li><li><strong>Interprocess Communication (ipc)</strong>: Separates interprocess communication resources.</li><li><strong>UTS (uts)</strong>: Allows a single system to appear to have different host and domain names to different processes.</li><li><strong>User ID (user)</strong>: Enables the mapping of user IDs between the namespace and the underlying system, effectively allowing users inside namespaces to have different privileges.</li><li><strong>Control Group (cgroup)</strong>: Although not initially included, later versions of the kernel added cgroup namespaces to provide isolation of cgroup roots.</li></ul><p><strong>Example: Creating a New Network Namespace</strong></p><p>A practical application of namespaces can be illustrated through the creation of a new network namespace, effectively segregating network interfaces and configurations:</p><pre>ip netns add isolated_net</pre><p>This command creates a new network namespace named isolated_net. Processes can then be started within this namespace with a separate network stack, independent from the default network namespace.</p><h4>Applications and Implications</h4><p>Namespaces are instrumental in containerization technologies like Docker and Kubernetes, where they provide the foundational isolation that makes containers lightweight and efficient. Beyond containerization, namespaces enhance security by limiting the scope of system resources a process can access, thereby reducing the potential impact of malicious or compromised processes.</p><h4>Challenges and Future Directions</h4><p>While namespaces offer significant advantages, they also present challenges, particularly in terms of complexity in management and potential security considerations related to namespace escaping. Future directions in the development of namespaces are likely to focus on simplifying management, enhancing security, and integrating namespaces more deeply with other system components for even greater flexibility and control.</p><h4>Summary</h4><p>Linux namespaces represent a transformative approach to resource isolation and process management, enabling a more secure, efficient, and manageable computing environment. As the cornerstone of containerization and an enabler of various virtualization paradigms, namespaces underscore the Linux kernel’s adaptability to the evolving demands of modern computing.</p><h4>References</h4><ul><li>Linux Kernel Documentation. “Namespaces in operation.” <a href="https://man7.org/linux/man-pages/man7/namespaces.7.html">https://man7.org/linux/man-pages/man7/namespaces.7.html</a></li><li>B. Gregg. “Linux Namespaces.” <a href="http://brendangregg.com/blog/2016-02-01/linux-container-internals.html">http://brendangregg.com/blog/2016-02-01/linux-container-internals.html</a></li><li>R. Love. “Linux System Programming: Talking Directly to the Kernel and C Library.” O’Reilly Media, 2013.</li></ul><p>This technical exploration provides an in-depth look at namespaces in the Linux kernel, elucidating their architecture, types, and practical applications in the realms of containerization, virtualization, and beyond.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4de5945f8533" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control Groups (cgro]]></title>
            <link>https://medium.com/@professorlinux/control-groups-cgro-b1cc495fb6d5?source=rss-4a3c4df38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1cc495fb6d5</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cgroup]]></category>
            <category><![CDATA[unix]]></category>
            <dc:creator><![CDATA[Zayden Rahman]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 01:37:40 GMT</pubDate>
            <atom:updated>2024-04-09T09:22:55.930Z</atom:updated>
            <content:encoded><![CDATA[<h3>Control Groups</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*NaNrgAVU290Rb-S6.png" /></figure><h3>Abstract</h3><p>Control Groups (cgroups) represent a fundamental mechanism within the UNIX-like operating systems, specifically the Linux kernel, designed to limit, account for, and isolate the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes. Introduced in the Linux kernel 2.6.24, cgroups facilitate the implementation of resource management policies by enabling fine-grained allocation and prioritization of system resources among user-defined groups of tasks. This paper delves into the architecture, functionality, and application domains of cgroups, highlighting their significance in operating system design, particularly in the realms of containerization, system performance optimization, and ensuring system stability and security.</p><h3>Introduction</h3><p>The inception of cgroups addressed a critical need for an efficient and flexible resource management tool in Linux, motivated by the demands of multi-user environments and the emerging technology of containers. By grouping processes hierarchically and allocating resources among these groups, cgroups empower system administrators and applications to enforce policies that guarantee and limit resource usage. This capability underpins the operation of containerization technologies like Docker and Kubernetes, making cgroups a cornerstone of modern cloud computing infrastructure.</p><h3>Cgroups Architecture and Functionality</h3><p>Cgroups implement a hierarchical structure where each node in the tree represents a different set of tasks (processes) and the resources allocated to them. This hierarchical model allows inheritance and overrides of control policies, providing both flexibility and granularity in resource management.</p><p><strong>Key Components of Cgroups:</strong></p><ul><li><strong>Cgroup Hierarchies</strong>: A tree structure where each node can be configured with various subsystems controlling different resources.</li><li><strong>Subsystems (Controllers)</strong>: Dedicated kernel modules that manage specific types of resources, such as cpu, memory, blkio, and others.</li><li><strong>Tasks</strong>: Processes attached to cgroups. Each task in the Linux system is a member of one cgroup for each subsystem.</li></ul><p><strong>Functionality:</strong></p><ul><li><strong>Resource Limitation</strong>: Cgroups can set hard limits on how much of a given resource a group can consume.</li><li><strong>Prioritization</strong>: Adjusting the relative priorities of processes or groups of processes for accessing certain resources.</li><li><strong>Accounting</strong>: Monitoring the resource usage of different groups, which is crucial for billing and system analysis.</li><li><strong>Control</strong>: Starting, pausing, or stopping groups of processes based on system administrator commands or automated policies.</li></ul><h3>Application Domains</h3><p>Cgroups are instrumental in various areas of system administration and computing:</p><ul><li><strong>Containerization</strong>: Provides the resource isolation and management capabilities required for secure and efficient container operation.</li><li><strong>Cloud Computing</strong>: Enables multi-tenancy and resource allocation in cloud environments, ensuring that applications and users can coexist on the same physical infrastructure without interference.</li><li><strong>Performance Tuning</strong>: Facilitates the optimization of system performance by controlling resource allocation among competing processes or services.</li><li><strong>Security</strong>: Enhances system security by limiting the potential impact of rogue processes or containing the damage from compromised services.</li></ul><h3>Challenges and Limitations</h3><p>While cgroups offer powerful mechanisms for resource control, their complexity and the intricacies of configuring hierarchical policies present operational challenges. Additionally, the effectiveness of cgroups can be limited by the underlying hardware capabilities and the potential for resource contention among subsystems.</p><h3>Summary</h3><p>Cgroups represent a sophisticated tool in the Linux kernel for managing system resources in a granular and flexible manner. By enabling the precise allocation, monitoring, and control of resources among process groups, cgroups play a pivotal role in optimizing system performance, ensuring fairness, and enabling technologies like containers and cloud computing. As computing environments continue to evolve, the principles and mechanisms of cgroups will undoubtedly influence future directions in operating system design and resource management.</p><h3>References</h3><ol><li>Linux Kernel Documentation. Control Groups. <a href="https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt">https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt</a></li><li>G. Fournier, “Resource Management at Scale: Lessons Learned from Linux,” Proceedings of the ACM Symposium on Cloud Computing, 2019.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1cc495fb6d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Importance of Bash Scripting and Linux Skills in a Datacenter Environment]]></title>
            <link>https://medium.com/@professorlinux/the-importance-of-bash-scripting-and-linux-skills-in-a-datacenter-environment-ce0094a4edd0?source=rss-4a3c4df38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0094a4edd0</guid>
            <dc:creator><![CDATA[Zayden Rahman]]></dc:creator>
            <pubDate>Tue, 09 May 2023 15:30:31 GMT</pubDate>
            <atom:updated>2023-05-09T15:30:31.525Z</atom:updated>
            <content:encoded><![CDATA[<p>In a datacenter environment, having a strong foundation in Bash scripting and Linux is crucial for effectively managing and maintaining servers and network infrastructure. While automation tools like SDN and Ansible can simplify many tasks, there are still situations where custom scripts or tools are needed, and having a deep understanding of Bash scripting and Linux can greatly enhance your abilities as a system administrator or engineer.</p><p>Part 1: Bash Scripting in a Datacenter Environment</p><p>Bash scripting is the process of writing scripts in the Bash shell language to automate tasks or perform system administration tasks. Bash scripts can be used for tasks such as backups, system maintenance, and application deployment. They can save time and increase efficiency, and can help ensure consistency and accuracy in your work.</p><p>One of the main benefits of Bash scripting is that it allows you to automate repetitive tasks. For example, if you need to perform a specific task on multiple servers, you can write a Bash script to automate that task and execute it on all servers at once. This can save you and your team a lot of time and effort, and help ensure consistency and accuracy in your work.</p><p>Bash scripting can also help with system configuration and management. For example, you can write a Bash script to configure system settings or install and configure software on multiple servers. This can be especially helpful when deploying new servers or updating existing ones.</p><p>Part 2: Understanding Linux in a Datacenter Environment</p><p>In a datacenter environment, understanding Linux is crucial for effective management and troubleshooting of servers and network infrastructure. Linux skills include managing users and permissions, configuring network settings, and using command-line tools to monitor and manage system resources.</p><p>Linux skills can help with system maintenance, performance optimization, and security. For example, if a server is experiencing performance issues, Linux skills can be used to diagnose the problem and optimize system settings to improve performance. Similarly, Linux skills can be used to secure servers and network infrastructure by configuring firewalls, implementing encryption, and setting up secure authentication methods.</p><p>Part 3: The Role of Networking Equipment in a Datacenter Environment</p><p>Networking equipment such as switches and routers are critical components of a datacenter environment, and understanding how they work is important for effective management and troubleshooting. Common networking equipment used in datacenters includes Juniper and Cisco devices.</p><p>Skills in configuring switches and routers, managing network security, and troubleshooting network issues can be valuable in a datacenter environment. For example, if a switch is not functioning properly, understanding how to troubleshoot the issue and reconfigure the switch can be crucial for restoring network connectivity.</p><p>Bash scripting and Linux skills are highly valuable in a datacenter environment. They can help automate tasks, improve efficiency, and enhance security and performance. Even with automation tools like SDN and Ansible, having a deep understanding of Bash scripting and Linux can greatly enhance your abilities as a system administrator or engineer, and can be highly transferable to other Linux-based systems and environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0094a4edd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Bash Scripting to Filter and Display Relevant Device Information on Linux]]></title>
            <link>https://medium.com/@professorlinux/how-to-use-bash-scripting-to-filter-and-display-relevant-device-information-on-linux-227c68d97dd4?source=rss-4a3c4df38c------2</link>
            <guid isPermaLink="false">https://medium.com/p/227c68d97dd4</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Zayden Rahman]]></dc:creator>
            <pubDate>Mon, 08 May 2023 20:24:44 GMT</pubDate>
            <atom:updated>2023-05-08T20:24:44.180Z</atom:updated>
            <content:encoded><![CDATA[<p>As a Linux engineer, I often need to work with block devices like hard drives, solid-state drives, and NVMe drives. The lsblk command is a powerful tool for displaying information about block devices on Linux systems, but it can be difficult to extract only the information that is relevant to a particular task. In this article, I&#39;ll show you how to use Bash scripting to filter and display relevant device information using the lsblk command.</p><p>To get started, let’s create a Bash script that will display relevant information about SAS, hard drives, and NVMe drives. Here’s the script:</p><pre># Get the output of the &quot;lsblk&quot; command and filter it to show only relevant devices<br>lsblk_output=$(lsblk -d -o NAME,MODEL,SIZE,ROTA | grep -E &#39;sd[a-z]|hd[a-z]|nvme[0-9]n[0-9]&#39; | sort)</pre><pre># Print a header for the output<br>printf &quot;%-10s %-20s %-10s %-5s\n&quot; &quot;DEVICE&quot; &quot;MODEL&quot; &quot;SIZE&quot; &quot;TYPE&quot;<br>printf &quot;%-10s %-20s %-10s %-5s\n&quot; &quot;------&quot; &quot;-----&quot; &quot;----&quot; &quot;----&quot;</pre><pre># Loop through each line of the output and print relevant information for SAS, hard drives, and NVMe drives<br>while read -r line; do<br>  device=$(echo &quot;$line&quot; | awk &#39;{print $1}&#39;)<br>  model=$(echo &quot;$line&quot; | awk &#39;{print $2}&#39;)<br>  size=$(echo &quot;$line&quot; | awk &#39;{print $3}&#39;)<br>  is_rotational=$(echo &quot;$line&quot; | awk &#39;{print $4}&#39;)<br>  <br>  if [ &quot;$is_rotational&quot; = &quot;1&quot; ]; then<br>    printf &quot;%-10s %-20s %-10s %-5s\n&quot; &quot;$device&quot; &quot;$model&quot; &quot;$size&quot; &quot;SAS/HD&quot;<br>  else<br>    printf &quot;%-10s %-20s %-10s %-5s\n&quot; &quot;$device&quot; &quot;$model&quot; &quot;$size&quot; &quot;NVMe&quot;<br>  fi<br>done &lt;&lt;&lt; &quot;$lsblk_output&quot;</pre><p>Let’s break down how this script works. First, the lsblk command is used to get a list of all block devices on the system. The output is then filtered to show only SAS, hard drive, and NVMe devices using grep, and sorted using sort. The filtered output is then stored in the lsblk_output variable.</p><p>Next, a header is printed using the printf command to specify the column headers for the DEVICE, MODEL, SIZE, and TYPE columns.</p><p>Finally, a while loop is used to read each line of the lsblk_output variable and extract relevant information for SAS, hard drives, and NVMe drives using the awk command. Depending on whether a drive is rotational or not, the script prints the device information with a SAS/HD or NVMe type.</p><p>This script is a useful tool for quickly and easily filtering and displaying relevant device information on Linux systems. You can modify the regular expression passed to grep to include additional types of devices, or modify the output formatting in printf to display additional information.</p><p>The lsblk command, combined with Bash scripting, provides a powerful and flexible way to work with block devices on Linux systems. I hope this article has been helpful in demonstrating how to use Bash scripting to filter and display relevant device information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=227c68d97dd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>