Sunday, 23 November 2025

What happens first when Linux server is started?

The Linux boot process is a meticulously orchestrated sequence of events that transforms a powered-off machine into a fully operational system. For system administrators, developers, and enthusiasts, understanding this process is critical for troubleshooting, optimizing performance, and securing infrastructure. In this comprehensive guide, we’ll dissect every stage of the Linux boot process, from the moment you press the power button to the user login prompt. We’ll explore modern components like UEFI, initramfs, and systemd, and provide practical examples to solidify your understanding.

Table of Contents

  1. Introduction: Why Understanding the Boot Process Matters
  2. Stage 1: Power-On Self-Test (POST)
  3. Stage 2: UEFI/BIOS Initialization
  4. Stage 3: Bootloader (GRUB2) Execution
  5. Stage 4: Kernel Initialization and initramfs
  6. Stage 5: systemd – The Modern Init System
  7. Stage 6: Targets, Services, and Dependency Management
  8. Stage 7: User Login and Session Management
  9. Troubleshooting Boot Issues
Read more »

Labels:

Saturday, 22 November 2025

Exploring Grafana: Powerful Visualization for Multiple Use Cases


Grafana has emerged as a vital open-source platform widely utilized for creating powerful dashboards, visualizing data, and efficiently monitoring complex systems. Grafana’s flexibility, extensive integration capabilities, and robust visualization features have made it an indispensable tool for developers, IT administrators, data scientists, and DevOps professionals alike. In this in-depth exploration, we’ll uncover numerous use cases for Grafana, illustrating how it addresses a variety of needs across multiple sectors.

What is Grafana?

Grafana is an open-source analytics and monitoring solution known for its interactive and visually appealing dashboards. It supports a broad array of data sources, from traditional relational databases to real-time monitoring tools such as Prometheus, Elasticsearch, InfluxDB, and cloud services. Its interactive visualizations and intuitive user interface simplify understanding and analyzing complex datasets.

Read more »

Labels:

Thursday, 20 November 2025

Exiting Loops in Perl: last Instead of break


In Perl, if you’re looking to exit a loop prematurely, you might reach for a break statement similar to other programming languages. However, Perl does not use break. Instead, Perl provides the last statement to exit loop constructs.

Why Doesn’t break Work in Perl?

In Perl, break is not a recognized keyword for exiting loops. If you try to use break while use strict; is enabled, you’ll encounter an error because Perl interprets it as a bareword (an undeclared subroutine or variable). Here’s what typically goes wrong:

for my $entry (@array) {
    if ($entry eq "text") {
        break;  # Incorrect! Perl doesn't recognize 'break'
    }
}
Read more »

Labels:

Wednesday, 19 November 2025

How to Iterate Over a Range of Numbers Defined by Variables in Bash

When working with Bash, iterating over a range of numbers is common in scripting. One might naturally reach for brace expansion (e.g., {1..5}) when the range is hardcoded, but things get a bit trickier when the range is defined by variables. In this blog post, we’ll explore different ways to iterate over a range of numbers when the endpoints are determined by variables.

Read more »

Labels:

Tuesday, 18 November 2025

How to Run a Local Shell Script on a Remote Machine via SSH

If you want to run a local shell script on a remote machine using SSH, there are several ways to achieve this depending on whether you’re using a Windows or Unix-based system. Here’s a guide for both environments:

For Unix-Based Systems (Linux/macOS)

You can use ssh to execute a local shell script on a remote machine without needing to copy the script over. The command works by sending the script via standard input to be executed on the remote server:

ssh user@MachineB 'bash -s' < local_script.sh
Read more »

Labels:

Saturday, 15 November 2025

Removing Duplicates from an Array in Perl

When working with arrays in Perl, you might encounter situations where you need to remove duplicate elements. Perl, with its versatile data structures, offers several ways to accomplish this task. Let’s explore different approaches to remove duplicates from an array, demonstrating the flexibility and power of Perl.

Approach 1: Using a Hash to Filter Unique Elements

One of the simplest and most efficient ways to remove duplicates from an array is by using a hash. Hashes in Perl inherently prevent duplicate keys, which makes them ideal for this task.

Read more »

Labels:

Wednesday, 12 November 2025

Developing an Asset Tracking System in ServiceNow

Asset management is a critical component of IT operations, ensuring that an organization’s assets are accounted for, deployed, maintained, and disposed of when necessary. ServiceNow offers robust capabilities for managing these assets. In this post, we’ll walk through how to develop a custom asset tracking system on ServiceNow to help streamline the asset management process.

Objective

Our goal is to create a custom application on ServiceNow that automates asset tracking, from procurement to disposal, and provides real-time visibility into asset status and location.

Step 1: Setting Up Your Environment

First, ensure you have access to a ServiceNow developer instance. You can obtain a free developer instance from the ServiceNow Developer Program, which includes all the tools and resources needed for building applications.

Step 2: Creating the Asset Tracking Application

  1. Launch ServiceNow Studio: Access the Studio from your ServiceNow dashboard by typing ‘Studio’ in the left-hand filter navigator.

  2. Create a New Application:

    • Click on ‘Create Application’.
    • Fill in the application details:
      • Name: Advanced Asset Tracking
      • Description: Automate and manage your asset tracking efficiently.
      • Application Scope: Ensure to specify a new scope for this application.

Step 3: Designing the Database Structure

  1. Create Tables:

    • Define a new table named Asset Register.
    • Add relevant fields such as Asset ID, Asset Type, Purchase Date, Status, Current User, and Location.
  2. Set Up Relationships:

    • Establish relationships between Asset Register and other existing ServiceNow tables like User table to link assets to current users or departments.

Step 4: Implementing Business Logic

  1. Business Rules:
    • Create a business rule to automatically update the Status field when an asset is checked out or checked in.
    • Script Example:
      (function executeRule(current, previous) {
          // This rule triggers when the 'Location' field changes
          if (current.Location != previous.Location) {
              if (current.Location == 'Storage') {
                  current.Status = 'In Stock';
              } else {
                  current.Status = 'Checked Out';
              }
              gs.addInfoMessage('Asset status updated to ' + current.Status);
          }
      })();
      

Step 5: Workflow Automation

  1. Create Workflows:
    • Develop a workflow to automate notifications when an asset’s status changes, such as when it is due for maintenance or replacement.
    • Use the workflow editor to drag and drop workflow elements like notifications, approvals, and conditions.

Step 6: User Interface and User Experience

  1. Customize Forms and Views:
    • Design user-friendly forms for asset entry and updates.
    • Customize views for different users, like IT staff and department heads, to provide relevant information tailored to their needs.

Step 7: Testing and Quality Assurance

  1. Conduct Thorough Testing:
    • Test all aspects of the application, including form submissions, workflow triggers, and business rules.
    • Ensure that notifications are sent correctly and that data integrity is maintained.

Step 8: Deployment and Training

  1. Deploy Your Application:

    • Move the application from development to the production environment.
    • Ensure all configurations and customizations are correctly transferred.
  2. Train End Users:

    • Organize training sessions for different user groups to ensure they are familiar with how to use the new system effectively.

By following these steps, you can develop a comprehensive asset tracking system within ServiceNow that not only enhances the efficiency of asset management processes but also improves visibility and control over organizational assets. This custom application will help ensure that assets are utilized optimally, reducing the total cost of ownership and supporting better investment decisions.

Labels: