Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Mukul Latiyan
Page 15 of 37
What's the difference between nohup and ampersand (&) on Linux?
nohup and the ampersand (&) are both used to run processes in the background on Linux, but they serve different purposes and behave differently when the terminal session ends. The Ampersand (&) Operator The & operator runs a command in the background, allowing you to continue using the terminal while the process executes. However, the process is still attached to the terminal session. command & Example sleep 100 & [1] 12345 The output shows the job number [1] and process ID 12345. The process runs in the ...
Read MoreWhere can I set environment variables that crontab will use?
Environment variables are typically set in shell configuration files like .bash_profile, .bashrc (Ubuntu), or .zshrc (macOS). However, crontab runs in a minimal environment and doesn't automatically load these shell configuration files, making environment variables unavailable to cron jobs. Understanding the Problem Let's examine a typical shell configuration file with environment variables − immukul@192 dir1 % cat ~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$PATH:/usr/local/node/bin export GOROOT=/usr/local/go export GOPATH=/Users/immukul/go_projects These variables work perfectly in a normal terminal session − echo $GOROOT /usr/local/go However, when you create a cron job, these variables ...
Read MoreHow to Run a Command Multiple Times in Linux?
There are scenarios where you would want to run a particular command for N number of times. In normal programming, this can be done with the help of loop constructs available in that programming language. In Linux bash, we have loops and other methods to repeat commands N number of times efficiently. In this tutorial, we will explore different bash techniques that allow us to run a certain command multiple times using loops, functions, and command-line utilities. Creating and Running Bash Scripts Before exploring the methods, let's understand how to create and execute bash scripts. On Linux ...
Read MoreHow to Repeat Your Last Command in Linux?
Linux terminal allows us to execute a variety of commands, and often we need to repeat a previously executed command. There are several efficient methods to recall and re-execute the last command without retyping it completely. For demonstration purposes, let's assume we previously ran the command ls -ltr and now want to repeat it using various methods available in Linux. Using Arrow Keys The most basic approach is to press the UP arrow key on your keyboard. This retrieves the last command from your command history, allowing you to press Enter to execute it again or modify ...
Read MoreHow to Find Out File Types in Linux
In Linux operating systems, everything is treated as a file. Understanding file types is crucial for system administration and file management. In UNIX systems, there are seven standard file types − Regular files − Contains data, text, or program instructions Directory files − Contains lists of other files and directories Symbolic link files − Points to another file or directory Character special files − Represents devices that transfer data character by character Block special files − Represents devices that transfer data in blocks Socket files − Used for inter-process communication FIFO (Named Pipe) files − Used for communication ...
Read MoreAdvanced DOM Manipulation Techniques with JavaScript
In web development, dynamic and interactive web pages are essential to engage users and provide a seamless browsing experience. JavaScript plays a crucial role in manipulating the Document Object Model (DOM) to create, modify, and delete HTML elements dynamically. In this article, we will explore advanced DOM manipulation techniques using JavaScript, enabling you to take your web development skills to the next level with practical examples and comprehensive theory. Understanding the DOM The DOM represents the structure of an HTML document as a tree-like structure, where each HTML element is a node. JavaScript allows us to interact ...
Read MoreHow to Build a REST API with Fastify?
Fastify is a high-performance web framework designed for Node.js backend development. Known for its lightweight architecture and impressive speed, Fastify positions itself as a faster alternative to popular frameworks like Express, Koa, and Hapi. What sets Fastify apart is its plugin-centric architecture—everything is treated as a plugin, allowing for better modularity and code reusability. This approach enables developers to encapsulate functionality and distribute it across projects efficiently. In this tutorial, we will explore how to build a complete REST API with Fastify, covering: Creating a basic Fastify server Defining API routes with proper controllers Implementing schema ...
Read MoreHow to Bundle up JavaScript Files using Rollup.js?
In this tutorial, we will understand how to use Rollup.js to bundle JavaScript files. Before we do that, the first step is to get familiar with the JavaScript module bundler called Rollup, which compiles files from multiple sources into a single bundle. Rollup is similar to webpack and Browserify. It is more popular than many other bundlers because of its ability to keep files small even after bundling them into a single unit. There are multiple features that Rollup brings to the table, some of them are mentioned below − Development is easier to manage when you ...
Read MoreHow to Scrape a Website using Puppeteer.js?
Web scraping is one of the best ways to automate the process of data collection from the web. A web scraper, often called a "crawler, " surfs the web and extracts data from selected pages. This automation is much easier than manually extracting data from different web pages and provides a solution when websites don't offer APIs for data access. In this tutorial, we will create a web scraper in Node.js using Puppeteer.js to extract book information from a sample website. What is Puppeteer.js? Puppeteer is a Node.js library that provides a high-level API to control Chrome ...
Read MoreWorking with Excel Files using Excel.js
Excel.js is a powerful Node.js library for reading, manipulating, and writing Excel files. It supports both XLSX and CSV formats, making it ideal for data processing applications. Installation To install Excel.js in your Node.js project, run the following command: npm install exceljs Once installed, you can start working with Excel files programmatically. All examples in this tutorial work with XLSX (Open XML Spreadsheet) files. Working with Excel Cells The getCell() method allows you to access individual cells by reference or coordinates. Here's how to read cell values: const Excel = ...
Read More