linux

All posts tagged linux by Linux Bash
  • Posted on
    Featured Image
    Learn how to change Apache's default port from 80 to 8080 on Linux, enhancing flexibility for handling multiple websites, firewall configurations, and restrictive network policies. This guide details Apache installation, configuration adjustments, firewall rule modifications, and testing the new setup to ensure effective management of network traffic and security.
  • Posted on
    Featured Image
    Learn vital Apache server management skills on Linux with `a2ensite` and `a2dissite` tools. These commands aid in enabling and disabling websites by managing symbolic links between Apache's configuration directories. Mastering these can streamline web management tasks, optimize server functions, and ensure efficient site availability management.
  • Posted on
    Featured Image
    This guide explains setting up name-based virtual hosts on Linux using Apache, allowing multiple websites to operate from a single IP address. Steps include editing Apache configuration files, configuring and enabling new virtual hosts, and restarting Apache for changes to take effect. Troubleshooting tips and further resources are also provided, ensuring effective web hosting management.
  • Posted on
    Featured Image
    Discover how to install Apache with PHP support using `libapache2-mod-php` on Linux. This beginner-friendly guide covers system updates, Apache installation, PHP integration, and securing your setup to enable a smooth and secure environment for hosting dynamic web content. Follow simple, detailed steps for a hassle-free Apache PHP server configuration.
  • Posted on
    Featured Image
    Learn how to configure Apache to automatically start on Linux system boot using `systemctl`, part of the `systemd` service manager. After installing Apache, enable it for startup with specific `systemctl` commands tailored to your Linux distribution, ensuring your web server operates seamlessly post-boot.
  • Posted on
    Featured Image
    The article examines the versatile roles of the hyphen "-" in Linux Bash, illustrating its use in command options, file handling, and data redirection. It explains how hyphens modify command behaviors, represent standard input/output in redirection, and act as placeholders in file descriptors and data streams. Examples and a Bash script highlight its practical applications in enhancing command functionality and script efficiency in Linux.
  • Posted on
    Featured Image
    Learn how to make a self-extracting Bash script with an embedded TAR archive, enhancing software distribution and deployment. This convenient method packs both script and data into a single file, streamlines installation, and supports automated deployments. Key steps include creating a TAR, appending it to a script for extraction, and setting script execution rights. Ideal for simplifying end-user setups and automating backups.
  • Posted on
    Featured Image
    The article explains the use of `getent passwd` to manage UID/GID mappings in Linux containers, underlining its relevance for permission control when interacting with external resources. `getent`, which fetches user details from the `passwd` database, is vital for resolving file permission conflicts across container boundaries. The guide includes a bash script to demonstrate fetching user details via UID, aiding administrators in effective permission management.
  • Posted on
    Featured Image
    `scriptreplay` is a utility in Linux that replays recorded terminal sessions with accurate timing, utilizing a session transcript and a timing file created by the `script` command. It is useful for educational purposes, demonstrations, and debugging by replicating exact user interactions in the terminal. To record and replay sessions, specific commands are executed to capture and reproduce the terminal activities precisely.
  • Posted on
    Featured Image
    The article provides a guide on creating a Linux daemon that can resist termination by the `SIGHUP` signal, typically sent when a session logs out. It details the use of `nohup` and `disown` commands to prevent daemons from ending with the session. Starting with `nohup` to ignore hangup signals and appending `&` for background execution, followed by `disown` to eliminate the job from the shell's job table, ensures the daemon persists post-logout, ideal for continuous system tasks.
  • Posted on
    Featured Image
    The article explores using Bash co-processes and netcat (nc) to set up a real-time, bidirectional chat system. It details how co-processes facilitate asynchronous command execution that interacts seamlessly with the main script. By using `nc`, it explains setting up connection points for the chat, and employing the `coproc` command to manage simultaneous message exchanges effectively, enhancing scripting capabilities in Linux.
  • Posted on
    Featured Image
    The blog article describes using the Bash command `yes | tr \n x` to generate an infinite string until memory overload. It breaks down the `yes` command which repetitively outputs 'y', and the `tr` command which replaces newlines with 'x', forming a continuous 'yx' output. It emphasizes understanding the impact on system resources and includes a sample script for safely demonstrating the command without crashing the system.
  • Posted on
    Featured Image
    The article explains how to automate the process of pairing Bluetooth devices using the `bluetoothctl` command on Linux in a non-interactive manner. This approach is especially useful in environments such as IoT systems where manual setup is impractical. The blog gives a sample script detailing how to power on Bluetooth, establish a pairing agent, pair and connect to a device via its MAC address, and then exit `bluetoothctl`. This method enhances efficiency in device setup and maintenance.
  • Posted on
    Featured Image
    `evtest` is a command-line utility in Linux that captures input from devices like keyboards, bypassing graphical environments such as X11 or Wayland. It operates directly with `/dev/input` directory, allowing it to work without a GUI. Installation is straightforward via package repositories, and use requires listing devices and running `evtest` with a device path. It's highly useful for diagnostics and debugging in Linux, offering real-time feedback and a way to monitor raw keyboard inputs efficiently.
  • Posted on
    Featured Image
    The article provides a comprehensive guide on controlling fan speeds in Linux using `lm-sensors` and `pwmconfig`. It explains the installation, setup, and use of these tools to monitor and adjust fan speeds based on system temperatures, thus preventing hardware damage due to overheating. The guide also highlights the risks of improper configurations and emphasizes careful monitoring.
  • Posted on
    Featured Image
    This article explains how to utilize `i2c-tools` for managing I2C devices on Linux systems. It begins with an introduction to the importance of `i2c-tools` for debugging I2C buses and devices, followed by installation guidelines across various Linux distributions. The piece details procedures for detecting I2C buses and devices, and demonstrates reading and writing to I2C devices using `i2cget` and `i2cset`. An example script is provided, illustrating how to read temperature from a sensor and configure a register, underscoring the tools' ease and efficiency for embedded system management.
  • Posted on
    Featured Image
    Learn how to adjust screen backlight brightness in Linux using `/sys/class/backlight/`. This guide covers accessing backlight settings via the sysfs filesystem, checking and setting brightness levels through command line commands like `cat` and `echo`, and includes a practical Bash script for user-friendly adjustment, ensuring safe and effective power management.
  • Posted on
    Featured Image
    The blog article delves into using the Linux `dd` command for managing input/output operations on serial ports like `/dev/ttyUSB0`. Originally for data copying and conversion, `dd` can efficiently handle reading from and writing to serial devices once they are configured using `stty` for specific settings such as baud rate and parity. It includes commands for setting up and executing these operations, with additional examples for continuous reading and file transfers to a serial device, underscoring `dd`'s versatility in direct hardware interactions.
  • Posted on
    Featured Image
    The blog delves into controlling GPIO pins in Linux via the `sysfs` interface, explaining its use in user space for simple file operations on pins. Steps covered include exporting the pin, setting its direction, and manipulating its state. The guide includes examples like LED control and a script for blinking an LED, highlighting the ease and effectiveness of `sysfs` for basic hardware interfacing.
  • Posted on
    Featured Image
    The article explains how to monitor CPU temperature in Linux using `/sys/class/thermal/thermal_zone*/temp`. It covers accessing CPU temperature files, identifying relevant thermal zones, and provides a Bash script for continuous temperature monitoring. Emphasizing the importance of this process for system stability and hardware safety, the article is a resource for ensuring optimal performance and longevity of Linux systems.
  • Posted on
    Featured Image
    The article delves into advanced Bash debugging with `shopt -s extdebug` and `declare -ft`, tools that enhance script debugging by enabling detailed function tracing and execution flow tracking. It includes practical examples showing how these tools help in troubleshooting and improving script performance, making them indispensable for Bash developers.