MongoDB is a popular NoSQL database that is designed to scale out and to be developer-friendly. For macOS users, one of the simplest methods to install MongoDB is using Homebrew, a popular package manager. This article provides a step-by-step guide on how to do just that. Prerequisites macOS: Ensure you’re running a supported version of macOS. Most modern versions should work without any issues. Homebrew: If you don’t have Homebrew installed on your macOS, you will need to install it. If you’re not sure, you can check by typing `brew` in your terminal. If it’s not installed, you’ll receive a…
Author: Rahul
MySQL, a robust and widely-used open-source relational database management system, is a cornerstone for many applications, particularly those involving web services. This comprehensive guide will help you install MySQL 8.0 on CentOS 7 or CentOS 6, ensuring a successful setup for your development or production environment. Prerequisites A CentOS 7 or CentOS 6 server Root or sudo privileges Basic familiarity with Linux terminal commands Step 1: System Update Keeping your system updated is crucial for security and compatibility. Begin by updating your system’s packages: sudo yum update This command refreshes your package index and updates all your system packages to…
Angular is an frameworks, libraries, assets, and utilities. It keeps track of all the components and checks regularly for their updates. This tutorial will help you to install the Angular CLI tool on CentOS 8/7/6 and RHEL 8/7/6 Linux operating systems. Step 1 – Install Node.js First of all, you need to install node.js on your system. Use the following set of commands to configure node.js yum repository in your CentOS system and install it. curl -sL https://rpm.nodesource.com/setup_20.x | sudo -E bash – sudo yum install nodejs Make sure you have successfully installed node.js and NPM on your system node…
Cron jobs are automated scripts that are essential in system administration and are prevalent in Unix-like operating systems. They allow system administrators and developers to schedule tasks (jobs) to run at specific times. This can be incredibly useful for tasks such as database maintenance, system updates, and data backup. This article will take a deep dive into how to schedule a cron job specifically for the last day of the month, an operation that might seem simple at first but can be surprisingly nuanced. Understanding Cron Before we delve into scheduling cron jobs, it’s crucial to understand what cron is…
This tutorial will help you to check if a string contains any substring in PHP programming language. For example, you want to run a specific line of code only if an input string contains another substring in it. Here is a sample PHP programme, which will evaluate to true because the main string $str contains the substring ‘TecAdmin’ in it. This will print “true”.
1 2 3 4 5 6 7 | <?php $str = 'Welcome to Tecadmin'; if (strpos($str, 'Tecadmin') !== false) { echo 'true'; } ?> |
Another PHP program will evaluate to false because the main string $str doesn’t contains the substring ‘Hello’ in it. This will nothing print.
1 2 3 4 5 6 7 8 | <?php $str = 'Welcome to Tecadmin'; $substr = "Hello"; if (strpos($str, $substr) !== false) { echo 'true'; } ?> |
This tutorial will help you to install and secure Apache web server on Ubuntu 18.04 LTS Linux operating system. Prerequsities SSH access to Ubuntu 18.04 SUDO privilege Install Apache on Ubuntu 18.04 First of all, Login to your Ubuntu 18.04 system via SSH and update the Apt cache. Then install Apache2 HTTP server packages as following: sudo apt update sudo apt install apache2 To install most latest version of Apache use the following PPA. sudo add-apt-repository ppa:ondrej/apache2 sudo apt update sudo apt install apache2 Manage Apache Service Apache service is managed with systemctl command line. After installation, use the following…
A string is a sequence of characters. In Python, strings are ordered sequences of character data, and thus can be indexed in this language. Python does not support a character type, but these are treated as strings of length one, also considered as a substring. A common question in most programming interviews is about reversing a string in Python. Unlike C++, Java, or other languages, Python provides in-built functions and easy-to-use methods to perform this, allowing developers to perform this task in several ways. In this article, we’ll go over a few of the most common techniques for reversing a…
AnyDesk is a popular remote desktop application that allows users to access and control another computer from anywhere in the world. It offers fast performance, high-quality graphics, and an easy-to-use interface. This guide will walk you through the process of installing AnyDesk on a Fedora Linux distribution. Prerequisites: A system running Fedora desktop system. Sudo or root access to the system. Step-by-step Installation Guide: 1. Update your system Before installing any new software, it’s always a good practice to update your system. Open a terminal and enter the following command: sudo dnf update -y 2. Download the AnyDesk RPM package…
Python, a general-purpose language with a clean syntax, is a great tool for automating tasks like counting the number of lines in a file. This is useful when you need to analyze large text files, data logs, or code bases. In this article, we will discuss how to create a Python program that can count the number of lines in a file. Before we start, ensure that you have Python installed on your computer. As of my knowledge inn July 2023, the most recent stable version of Python is 3.11. However, any version after Python 3 should work fine for…
Database design is the organization of data. A good database design makes it successful. Its recommended to follow a good pattern for the table names and their columns. In some cases, you may be required to rename a column name of the table to maintain a proper architecture and naming pattern. The sp_rename stored procedure is used to rename a column name in a table in MSSQL server database. Syntax: The syntax of the sp_rename stored procedure is: sp_rename ‘TableName.[OldColumnName]’ , ‘[NewColumnName]’, ‘COLUMN’ Caution: Changing any part of an object name could break scripts and stored procedures. Make sure to…
