Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository. Use the command line below to remove the directory named test_dir from the current directory. git rm -r test_dir Then commit and push to apply changes in the local and remote repository. git commit -m “Removed test directory” git push origin master # Change ‘master’ with your branch name All done, The test_dir has been removed from the local as well…
Author: Rahul
Setting the proper file permission for any web application is an important part of web hosting. In this tutorial, you will learn how to change file permissions on folder and sub-folders recursively in a single command. As you know, In Linux everything is treated as a file. A folder is also known as directory file denoted by ‘d’ in the permission section. The below command will set the owner to www-data and group-owner to ubuntu for all files and directories and subdirectories. sudo chown -R www-data:ubuntu /var/www/html Use the chmod command to change the permissions for all files, directories, and…
This tutorial will help you to install Dovecot on Ubuntu systems. Dovecot package provides service for POP/IMAP protocols. With these protocols, you can access emails accounts from remote clients. Step 1 – Install Dovecot on Ubuntu Dovecot packages are available under default Ubuntu repositories. You can install Dovecot on Ubuntu by running a single command. Open a terminal and execute below command: sudo apt install dovecot Step 2 – Configure Dovecot Dovecot is a service used for providing POP/POP3s and IMAP/IMAPs protocols. POP/IMAP protocols are used for fetching emails from email accounts. Edit dovecot configuration file and search for below…
An array is a container of multiple values of similar types. After initializing an array, how can you empty it? This tutorial will help you to empty an Array in JavaScript language. Empty Array in JavaScript Use the following syntax to empty an Array. Here myArray is the name of Array. myArray = []; The above code will create an Array named myArray with no content. If the myArray already exists, will lose all the existing elements. You can also set the length to 0 to make it empty. myArray.length = 0
Python is a powerful and versatile programming language that is widely used in various applications, from web development to data analysis. In this article, we’ll explore how to write a Python program that lists all files in a specified directory. This operation can be quite useful in several contexts, such as when you need to organize files, analyze directory content, or perform batch operations on multiple files. Prerequisites Before we start, ensure that you have Python installed on your system. You can download the latest version of Python from the official website (https://www.python.org/). As of the last update of this…
Question – How do I check If a String contains another substring in Java? In our previous article, you learned to compare two strings in Java programming language. This tutorial will help you to check if the main string contains another substring in it. Syntax
1 2 | str1.contains(str2) // Case sensitive str1.toLowerCase().contains(str2.toLowerCase()) // Ignore case |
Example 1 – Check with Case Sensitive This will be case sensitive check. As per the below example, Welcome is different than welcome as we know java is a case sensitive programming language.
1 2 3 4 | String str1 = "Hi, Welcome to TecAdmin"; str1.contains("Welcome") //Return True str1.contains("welcome") //Return false (due to case sensitive) |
Example 2 – Check with Ignoring Case Using this string will be checked with ignoring the case. The function change…
Laravel is an popular framework built on PHP programming language. You can find Laravel installation tutorials here. In this tutorial, you will learn options to find version of preinstalled Laravel applications. There are two ways available to find the version of the Laravel application installed on any system. You can either find it by running a command. If you face any issue with the command line, you can check the Laravel version in the files. 1. Command to find Laravel Version Artisan is a powerful command-line interface included with Laravel. Open the command line terminal on your system. Navigate to…
First of all, make sure Apache deflate module is enabled on your system. The below command will enable the deflate module for in Apache on Debian based systems. This tutorial has been tested on Ubuntu 18.04. sudo a2enmod deflate Then edit the module configuration file in your favorite text editor. sudo vim /etc/apache2/mods-enabled/deflate.conf Then add “AddOutputFilterByType DEFLATE application/json” in the deflate module configuration file.
1 2 3 4 5 6 7 8 9 | <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/json </IfModule> </IfModule> |
Save your file and restart Apache2 service to apply new settings. systemctl restart apache2.service All done.
Java, a versatile and widely-used programming language, is fundamental in the world of software development. Among its many capabilities, Java allows programmers to manipulate and display the current date and time, a crucial feature in various applications. This guide is tailored for beginners, easing you into the process of retrieving the current date and time in Java. Introduction to Date and Time in Java Java provides several classes in its API to handle date and time. Prior to Java 8, the most commonly used classes were java.util.Date and java.util.Calendar. However, Java 8 introduced a new Date-Time API under the java.time…
Virtualenv is a useful tool to create an isolated environment for your Python application. This environment has its own installation directories and environment to keep it separate from other Python application. This doesn’t share libraries with other environments. 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 2 application and use this. Prerequisites You must have the following packages installed on your system. Python 2.7 PIP Install Virtualenv with Python 2 You must have Python 2 and PIP installed on…