Tag: Code
-
Using the RouterOS API to Bulk Reboot MikroTik Router Devices Remotely
Managing network devices can sometimes require direct intervention, such as remotely rebooting a router. In this guide, we’ll explore how to use the RouterOS API to accomplish this task efficiently and securely. By the end, you’ll have a clear understanding of the steps needed to connect to a RouterOS device, send a reboot command, and… Read more…
-
Run Remote Commands with SSH and Certificate Authentication on Linux / macOS Terminal
1. Ensure SSH Key-Based Authentication Is Set Up Before proceeding, make sure you have SSH key-based authentication set up between your local machine and the remote server: By default, this creates the keys in ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key). You can use ssh-copy-id: Or, manually append the public key to the ~/.ssh/authorized_keys file… Read more…
-
Resolving ping6 Issues on macOS with Multiple Network Interfaces
When using macOS with both Ethernet and Wi-Fi enabled, you might encounter issues with the ping6 command failing to receive packets unless you explicitly specify a network interface. For instance, running ping6 dns.google may yield no response, but ping6 dns.google -I en1 works correctly. This problem is primarily caused by the system’s inability to determine… Read more…
-
Batch Unlock BitLocker Drives Using Windows PowerShell
Source Code to Batch Unlock BitLocker Drives Environment: Windows Server 2022, Windows 11, Windows 10 Devices: Physical internal hard drives, USB drives, and physical hard drives mounted on RAID cards, HBA cards, or SATA expansion cards. All drives must use the same BitLocker password. Save the code below to a file named: MountBitLockerDisk.ps1 Save the… Read more…
-
Drawing a Christmas Tree with C Language
Merry Christmas ! Drawing a Christmas tree in C can be achieved by printing a character pattern to the console. Below is a simple C program example that uses * and space characters to print a Christmas tree Explanation: Colorful Christmas Tree in C with Random Ornaments Explanation: Example Output: The tree will appear with… Read more…
-
Different Use Cases of Bash and EXP (Expect)
What Bash can do, Expect can also achieve; but what Expect can do, Bash may not necessarily be able to accomplish. In system administration and automation tasks, bash and EXP (the command from the Expect tool) are two powerful utilities. While both are used in the command-line environment to execute tasks, they serve distinct purposes… Read more…
-
Using LFTP and Dynamic Variables to Backup Files to a Remote FTP Server
This article provides a simple guide for using LFTP, a powerful command-line FTP client, to automate file backups to a remote FTP server. We will leverage dynamic variables like date and time to create unique backup directories and filenames. What is LFTP? LFTP is a robust command-line tool that supports a wide range of features,… Read more…
-
How to Sort Files by Size in Multilevel Directories in Linux / macOS
Managing files on Linux often involves identifying the largest files within a directory and its subdirectories, particularly when disk space is at a premium. This article explains how to search for files in Linux and sort them by size, with the largest files appearing first. We’ll explore a few efficient command-line methods to achieve this.… Read more…
-
Creating a Simple Dashboard Panel for Managing an Nginx Server on Windows
Creating a Simple Dashboard Panel for Managing an Nginx Server on Windows You should modify the path of your NGINX installation in the script by specifying the exact path to the NGINX executable. This is especially useful on Windows, where NGINX is typically not added to the system PATH by default. Save the code below… Read more…