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..

Virtualenv is a tool used to create an isolated Python environment. This environment has its own installation directories and environment. This doesn’t share libraries with other environments. It is very helpful for the application required separate environments on the same server. The Virtualenv is the easiest and recommended way to configure a custom Python environment. This tutorial will help you to how to create a virtual environment for your Python application and use this. Prerequisites You must have the following packages installed on your system. Python 3 PIP Install Virtualenv with Python 3 You must have Python 3 and PIP…

Read More

You can easily pass command line arguments to a Python script. In this tutorial, we will help you to read the command line arguments in a Python script. Below is the sample Python script, which reads the command line arguments and print details. Create a sample script like script.py and copy the below content.

Then execute the above script with command line parameters. python script.py first 2 third 4.5 You will see the results below. The first argument is always the script itself. Output Total number of arguments: 5 Argument List: [‘script.py’, ‘first’, ‘2’, ‘third’, ‘4.5’] First argument: script.py…

Read More

Default let’s encrypt SSL certificates are issued for 90 days only. After this, you need to renew your SSL certificates. Let’s Encrypt allows the SSL renewal before 30 days of expiration. You can perform the renewal manually or configure auto-renewal using crontab. This tutorial will help you to auto-renew Let’s Encrypt SSL certificates automatically. The certbot script will take care of certificate renewal before expiration. How to Renew Let’s Encrypt SSL Certbot command-line utility provides users the option to renew SSL certificates before expiration. Before running the actual renewal process, you can do a dry run to verify that certbot…

Read More

This tutorial will help you to find files created or modified within X days. Here X means any number. Using the find command you can also search which is created or modified within X minutes. 1. Search files created/modified within 30 days Use this command to search all files created or modified within 30 days in /var/backup directory. Find provides the option -mtime to define number of days. find /var/backup -type f -mtime +30 You can also search file created within 60 minutes (1 hour) using -mmin optiopn. find /var/backup -type f -mmin +60 2. Search files with specific extension…

Read More

Cloudflare is a content delivery network service that acts as a reverse proxy. It is widely used by websites to serve content through Cloudflare’s global network. When the website traffic is routed through Cloudflare, the backend servers logged the Cloudflare IP address instead of the original visitor IP address. This tutorial will help you to enable Apache mod_cloudflare module on a Ubuntu system. Which will log the original visitor IP address to logs. Install mod_cloudflare for Apache Cloudflare provides an official module for the Apache server to capture real IP addresses. You need to enable the PPA of the Cloudflare…

Read More

Most of the Web/API services providers are shifting their environments to TLS 1.2 or greater. So to consume their services via PHP applications, you also need to force your application to use TLS 1.2 during making a connection. This tutorial will help you, how to use TLS 1.2 with PHP cURL. Using TLS 1.2 with PHP CURL Forcefully You can add the following code to your curl requests to use TLS 1.2. Use 6 as the value of CURLOPT_SSLVERSION forces cURL to use TLS 1.2. Below is the sample code to force use tls 1.2 with php curl:

For…

Read More

The howsmyssl.com website provides you the option to test the TLS version used by your browser or PHP script. Put the below PHP script on your website document root and access it in a web browser. This will return the TLS version used by your script to connect the remote application.

I have written this in a tls_test.php script and then accessed in a web browser. The result shows the PHP is using TLS 1.2. If your application is using lower version by default, then you can force PHP to use TLS 1.2 with cURL using this tutorial.

Read More

Angular CLI (Command Line Interface) is an essential tool in modern web development, particularly for developers working with the Angular framework. It streamlines the process of initiating, developing, testing, and deploying Angular applications. This tutorial is written for users operating on macOS, a popular platform among web developers due to its robust performance and developer-friendly environment. 1. Prerequisites Let’s start the installation of Node.js on your macOS system using Homebrew. So first update the Homebrew package manager index. Then you can install Node.js package in your MacOS system using the following command: brew update brew install node You have successfully…

Read More

JSON, which stands for JavaScript Object Notation, is a way computers use to share and store information that’s easy for people to read and write. Even though it’s simple and useful, JSON doesn’t let you add comments directly in the data, which can make it hard for people working together to understand what each part of the data is supposed to do. In this article, we’re going to talk about how you can add notes and explanations to your JSON files in different ways, so your projects can be clearer and everyone can work better together. Understanding the JSON Format…

Read More

This tutorial will help you to find files created or modified before X days. Here X means any number (eg: 1,2 or 30). Using find command you can also search which is created or modified before X minutes. 1. Search files created/modified before 30 days Use this command to search all files created or modified before 30 days in /var/backup directory. Find provides the option -mtime to define number of days. find /var/backup -type f -mtime -30 You can also search file created before 30 minutes using -mmin optiopn. find /var/backup -type f -mmin -30 2. Search files with specific…

Read More