Aditya Chatterjee's Blog, page 104

March 17, 2022

time command in Linux

When executing commands in Linux, we may want to know how long it takes or how much of the system resources the command uses. In such cases, we use the time command that comes before the command to be executed. We also use this command to estimate the run time of algorithms for optimization purposes.

Table of contents.Introduction.Introduction.Syntax.Usage.Summary.References.Introduction.

In Linux, to use the time command, we can either provide the whole path as we shall see shortly, or...

 •  0 comments  •  flag
Share on Twitter
Published on March 17, 2022 13:54

Python script to control cursor

In this article, we have explored how to develop a Python script to control cursor and stimulate actions like clicking, scrolling, click and drag.

Table of contents:

Introduction to PyAutoGuiDetermine the screen resolutionMoving the mouse cursorGetting the current position of mouse cursorClick the mouse cursorScrolling the mouse cursorClick and drag the mouse cursorIntroduction to PyAutoGui

PyAutoGui is a Python module for automation with the Graphical User Interface (GUI). It can be us...

 •  0 comments  •  flag
Share on Twitter
Published on March 17, 2022 13:43

sleep command in Linux

In Linux, the sleep command is used to delay scripts for a specified time. It can also be used in the terminal to execute commands at a certain pace.

Table of contents.Introduction.Syntax.Commands.Summary.References.Introduction.

The sleep command delays execution of shell scripts and commands for a specified. This could be minutes, seconds, hours, or even days. In this article, we learn about this command through various examples.

Syntax.

We usually write sleep commands in the following...

 •  0 comments  •  flag
Share on Twitter
Published on March 17, 2022 03:17

wait command in Linux

We use the wait command to wait for processes/jobs to change their state in Linux. This command waits for a process to change its status and then it returns the exit status.

Table of contents.Introduction.Syntax.Command parameters.Waiting for a single process.Waiting for multiple processes.Waiting for all processes.Waiting for a single jobSummary.References.Introduction.

In Linux, we use the wait command to wait for a process to terminate then print its exit status. This is very usef...

 •  0 comments  •  flag
Share on Twitter
Published on March 17, 2022 00:50

March 15, 2022

expr command in Linux

In Linux, the expr command evaluates an expression passed to it and returns the corresponding value. We usually use it for basic arithmetic such as addition, subtraction, modulo operations, division, multiplication. We also use expr command to evaluate expressions.

Table of contents.Introduction.Syntax.Basic arithmetic.Comparisons.String operations.Summary.References.Introduction.

The expr command, as the name suggests, is used to evaluate expressions in the bash terminal and also in s...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 14:06

locate command in Linux

We use the locate command to find files in Linux, unlike the find command that searches the entire file system, this command uses a local database to search for the file passed as an argument.

Table of contents.Introduction.Installation.Syntax.Commands.Summary.References.Introduction.

In Linux, we use the locate command to find files bypassing their names as arguments to the command.

Another Linux utility for finding files and directories in Linux is the find command.

The difference bet...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 14:01

Sending file/ attachment in Gmail using Python

In this article, we have explained the idea of using Python to send file/ attachment in Gmail with a complete Python implementation example.

Table of contents:

Introduction to SMTP and MIMEGenerate App password in GoogleEmail config file setupDifference between sending a text email vs sending an attachmentExample of an email headerImplementation in PythonIntroduction to SMTP and MIME

The application level protocol, Simple Mail Transfer Protocol (SMTP), handles message service over TCP/IP...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 13:46

Python script to scroll on a webpage

In this article, we will develop a Python script to scroll on a webpage and stimulate real usage behavior. We will use Selenium and ChromeDriver.

0. Introduction

Controlling your computer to scroll down webpages is a key feature in automation scenarios of web development.

In most cases, people would apply this feature in:

The automation of conducting webpage tests;Web-scraping for gathering data from certain websites. (Beware of legal issues when scraping data!)

This article aims at getting p...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 09:48

Python Script to Open Webpage and Login

In this article, we will be going over all the steps to prepare you to be able to open a webpage and log in using Python and some third-party applications. This is for developers at any level I will be going in-depth so everyone can fully understand this process.

Table of contentsSetting up your workspaceDownloading The necessary ToolsHow to hide our passwordsReviewing ImportsBrief Part About Web ScrapingWriting the ScriptRunning The Program!1. Setting up Your Workspace

First things fi...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 09:12

System Design of Spotify

In this article, we have explained the System Design of Spotify, a leading audio streaming platform in depth.

ContentsIntroductionSpotify RequirementsSoftware ArchitecturesSystem Design of SpotifyConclusion1. Introduction

This article covers how apps like Spotify are designed to scale to large userbases.

Section 2 defines the requirements Spotify would need to fulfill for its userbase.

Section 3 discusses modern day architectures to implement large scale applications. We discuss two comm...

 •  0 comments  •  flag
Share on Twitter
Published on March 15, 2022 02:57