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

The JavaScript indexOf() method search for the substring in string and returns the position of the first occurrence of a specified substring. If substring not found, it returns -1. So you can use JavaScript IndexOf() method to check if a string contains substring in it. In this tutorial we will also provides example to use JavaScript includes() and search() methods to find substring in another string. In a comparison of all 3 methods describes below, indexOf() can be better due to its speed of execution. If no speed matters, you can use any of the following methods. Using indexOf() Method…

Read More

Command: echo <password> | passwd –stdin <username> Example: Use the following command to change password of user jack in a shell script. For example we are using string password as password. echo “password” | passwd –stdin jack Assigning User Input Password: Use the following commands to input password from user and assign to user jack. read -p “Enter Password for User jack: ” pwd echo $pwd | passwd –stdin jack Also we can prompt password twice from user to make confirmation that user has memorize it correctly. Use the following commands to input password twic from user and assign to…

Read More

Command: while true;do echo “Press CTRL+C to Exit”; done Example 1: Some times we are required to execute some commands or processes continuously until stop it forcefully or conditionally. The following example of while loop will run continuously until stopped forcefully using ctrl + c. while true do echo “Press CTRL+C to Exit” done Example 2: We can also use colon “:” in place of “true” with while loop for creating infinite loop in bash script. while : do echo “Press CTRL+C to Exit” done Stopping Loop on Condition: In case we need to terminate an infinite while loop on…

Read More

Sometimes you may be required to count total lines in a file in Unix/Linux systems. This tutorial helps you with multiple methods to count the number of lines in a file in a Linux system via the command line. Count lines with wc Command The wc command is the “word counter” for the Unix/Linux systems. This is a widely used command among Linux users for counting the lines in a file. It is also useful for counting words and characters in a file. Open a terminal and type command to count lines: wc -l myfile.txt You can also count the…

Read More

All the groups except the primary group are called the secondary groups of Users, for whom they belong. Generally, the primary group is created at the time of user-created with the same name. You can also assign a user to other groups to inherit their group permissions. Syntax The gpasswd command uses the following syntax for removing a user from group. gpasswd –delete USER GROUP Change USER with your actual user name and GROUP with named of group from which you want to delete user. Example Use the following command to remove user jack from sudo group. gpasswd -d jack…

Read More

Secondary groups are the groups that users added after the creations. The primary groups are created during the user creation process. In order to the permissions, there is no difference between them. This quick tutorial helps you to add an existing user to a secondary group in Linux via the command line. Example Use the usermod command-line tool to assign a user to a secondary group. Here you can define multiple group names separate them by a comma. The following command will add jack to sudo group. usermod -a -G sudo jack To make sure, check the entry in /etc/group…

Read More

After installing a new Tomcat server, there will be no user created by default to access Administrator and Manager web interfaces. After completing the installation set up Tomcat Admin and Manager user accounts and set their passwords. You can also visit our following articles about installing Tomcat on Linux systems. How to Change Tomcat Administrator Password To create user account edit conf/tomcat-users.xml file in editor and copy below configuration inside the <tomcat-users>…</tomcat-users> tags.

How to Change Tomcat Manager Password

As per the above configuration user manager only can access the manager web interface but the admin can access…

Read More
IDE

Brackets is a lightweight, modern, powerful text editor for web developers to edit source codes. It is also available for Linux systems. It has lots of features which you must love to use. This article will help you for installing Brackets Text editor on Ubuntu and Debian systems using apt-get or ppa. Features Provides in-line editing of source. Provides provides live preview for various browser. Brackets work with preprocessors in a whole new way. It provides improved typing performance with code hints. Install Brackets on Ubuntu Brackets Text Editor PPA is maintained by the webupd8 team for Ubuntu installations. Use…

Read More

A “tar.bz2” file is a type of compressed file created using the Unix/Linux tar command coupled with the bzip2 compression method. This format is especially useful for combining and shrinking large files or file collections into a more manageable and transferable single file. To make such an archive, one employs the tar command to gather multiple files or directories into one archive, and then applies the bzip2 algorithm to reduce the archive’s size. This produces a file with the extension .tar.bz2, which can be decompressed using the tar command and the -j option. This tutorial offers guidance on: Decompressing a…

Read More
PHP

Phalcon is a high performance Php framework with MVC support. Its is very useful framework for developing dynamic applications rapidly. This article will help you install and enable Phalcon php framework in CentOS, Redhat and Fedora Systems. Install Required Packages To start with Phalcon Project, we first need to setup a running LAMP server. If you have already running LAMP stack skip this step else use followings commands to setup lamp stack. Install Apache # yum –enablerepo=remi,epel install httpd Install MySQL # yum –enablerepo=remi,epel install mysql-server # service mysqld start # /usr/bin/mysql_secure_installation Install PHP # yum –enablerepo=remi,epel install php php-mysql…

Read More