Author: Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Sometimes the shell scripts are required to run as the root user to perform some tasks with administrator privileges. Generally, that tasks can be achieved with the Sudo commands. If in some cases you still need to force the user to run the script as the root user, you can add code to your script to check if the script is running with the root user or not. Check if a shell script running as root user Add the following code at beginning of the shell script to check if the script is running as the root user. If the…

Read More

The use of the YYYY-MM-DD date format in shell scripting is highly beneficial for ensuring consistency, clarity, and sorting efficiency in scripts that handle dates. This article will explore the advantages of this format and provide practical examples of its implementation in shell scripts. Introduction In shell scripting, managing dates effectively is crucial for tasks such as logging, scheduling, and data manipulation. The ISO 8601 standard, which specifies YYYY-MM-DD as the date format, is widely recognized for its clarity and unambiguity. This format is particularly useful in shell scripts due to its straightforwardness and universality. Benefits of YYYY-MM-DD Format Sorting…

Read More

Boolean variables are an essential part of programming, as they represent true or false values and are often used to control the flow of a script. In shell scripting, boolean variables are used to make decisions, control loops, and manage conditional execution. This article provides a comprehensive guide to declaring and using boolean variables in different shells, such as Bash, Zsh, and Ksh. We will also explore common use cases for boolean variables in shell scripts, share tips and best practices for working with boolean variables, and provide examples of boolean variable usage in real-world shell scripts. Introduction In shell…

Read More
GIT

Git is a powerful version control system that is widely used by software developers. One of the key features of Git is the ability to create and manage multiple branches within a single repository. In this article, we will take a step-by-step approach to explain the process of creating Git branches. Step 1: Understanding Git Branches Before we dive into creating Git branches, it is important to understand what branches are and why they are used. A Git branch is essentially a separate line of development within a Git repository. It allows you to work on different parts of your…

Read More

Cron is an incredibly useful tool in the Linux operating system. It allows users to schedule tasks, also known as jobs, to run automatically at specific times or dates. While it is designed to schedule tasks to run at least once per minute, there are techniques you can use to run tasks every 30 seconds. This article provides a deep dive into understanding how to manipulate cron jobs in such a way to run tasks on a more frequent schedule. What is a Cron Job? The term “cron” comes from the Greek word “Chronos”, which means time. In Linux, cron…

Read More

With the latest version of Ubuntu 22.04 and Debian 11, users start getting a warning message during the GPG key import that “Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))”. The apt-key stores the key file in /etc/apt/trusted.gpg or /etc/apt/trusted.gpg.d. In that case, a single key is also trusted for other repositories configured on your system. That creates security issues for the repositories on your systems. To overcome this issue, Ubuntu 22.04 and Debian 11 prompted to manage OpenPGP as keyring files. Even if this is a warning message, you can continue to use apt-key, but…

Read More

The default CORS policy doesn’t allow S3 content to other origins, even if the repository is public or hosting a static website. To allow the resources accessible to other domains, you need to update the S3 buckets CORS policy. Set Up CORS in S3 Buckets You can quickly enable cross-origin resource sharing (CORS) on your Amazon S3 buckets, with the following steps: Log into the AWS Management Console. Select S3 under the Services Select your S3 bucket. Go to the Permissions tab. Click Edit the Cross-origin resource sharing (CORS) section. Paste the below JSON content in editor:

Click Save…

Read More

You can use phpMyAdmin to manage your MySQL databases on a VPS. It’s an excellent tool for browsing, editing, creating, and dropping tables, as well as modifying columns and data. You don’t need to SSH into remote machines or load up some new terminal window to execute a few SQL queries every time you want to run some database queries. Instead, you can use a program like phpMyAdmin and keep everything in one place. This blog will show you how to install and set up phpMyAdmin on Ubuntu 22.04 server. Step 1 – Install Apache and PHP We are assuming…

Read More

Random strings are used for various purposes in software development. For example, they can be used to code user IDs, generate passwords, and construct tokens in applications. If you’re developing a JavaScript-based program that needs random strings — or any other type of pseudo-random data — then this article is for you! You see, generating random characters (or strings) is easy with the right tools and techniques. Luckily, this article covers exactly that. Let’s get started… Why do we need random strings? Random strings are used to construct tokens, user IDs, and passwords in software. Let’s say you want to…

Read More

There are several macOS versions (also known as OS X or Mac OS X) and codenames of those releases. Apple recently launched macOS Mojave, the latest version of its desktop operating system. Starting with Mac OS X 10.7 Lion in 2011, Apple has been updating its operating system annually with new codenames and revisions of the same code name. In this article, you can learn about all macOS versions and their codenames from 2005 to the present day. What is macOS? macOS is an operating system by Apple that powers Mac computers. It’s available in two major versions: macOS Sierra…

Read More