How Page Load Time Affects with JavaScript

Ali
Ali
Updated on 03-Jan-2020 07:15:01

485 Views

Page load time gets affected with JavaScript files and code. If you are not optimizing JavaScript files then the page load time will increase, which shouldn’t happen. Minify the JavaScript code to decrease the page load time.Also, cache JavaScript file for better results. For better performance, use inline and external JavaScript properly. Try to use external JavaScript file if you want to add the same script in multiple pages.External scriptsThe browser stores the external script once it is downloaded for the first time. If it is to be referenced again, then no additional download is needed.This reduces download time and ... Read More

Convert DOS Newline (CRLF) to Unix Newline (LF) in a Bash Script

Pradeep Elance
Updated on 03-Jan-2020 07:12:22

2K+ Views

When we transfer files between Windows and Unix systems, often we come across with issue relating to the end of line character. This is because the EOL character in windows is not recognized as a EOL character in Unix. SO to fix this issue when a file is transferred from Windows to Unix we need to follow one of the below methods.Using dos2unixThe dos2unix command is used to convert the EOL character of windows platform to Unix platform. Most of the Unix system comes with this command pre-installed. Below we see how we can convert the file itself or save ... Read More

C Program for Activity Selection Problem

sudhir sharma
Updated on 03-Jan-2020 07:08:44

6K+ Views

The activity selection problem is a problem in which we are given a set of activities with their starting and finishing times. And we need to find all those activities that a person can do performing the single activity at a time.The greedy algorithm is appointed in this problem to select the next activity that is to be performed. Let’s first understand the greedy algorithm.Greedy Algorithm is an algorithm that tries to find the solution to a problem by finding the solution step by step. For selecting the next step, the algorithm also selected the step that seems to be ... Read More

C++ Program for Subset Sum using Backtracking

sudhir sharma
Updated on 03-Jan-2020 07:05:07

12K+ Views

Backtracking is a technique to solve dynamic programming problems. It works by going step by step and rejects those paths that do not lead to a solution and trackback (moves back ) to the previous position.In the subset sum problem, we have to find the subset of a set is such a way that the element of this subset-sum up to a given number K. All the elements of the set are positive and unique (no duplicate elements are present).For this, we will create subsets and check if their sum is equal to the given number k. Let's see a ... Read More

Search and Remove Directories Recursively on Linux

Pradeep Elance
Updated on 03-Jan-2020 07:02:23

519 Views

Removing directories is a regular process for anyone working on Unix systems.But sometimes we also need to find the directories first and then decide to delete it. One hurdle in deleting the files is to do a recursive deleting because by default Unix systems do not allow deleting of a directory if it is not empty. So in this article we will see how to find and remove directories recursively.Using find and execThe below command first searches for the required directory using the find command then executes the ‘rm’ command to recursively remove the directory using the recursive option as ... Read More

Binomial Random Variables in C++

sudhir sharma
Updated on 03-Jan-2020 07:01:33

469 Views

Random variables are those variables that are an outcome of the outcomes of a process that has the probability of giving rise to multiple outcomes. For example, The variable denoting head or tail as an outcome on tossing a coin is a random variable.A binomial random variable is a special type of random variable whose value is related to an event that has a fixed probability of an outcome in an event.There are certain properties that are possessed by a binomial random variable that makes it special. These are a must for a variable to become a binomial random variable ... Read More

Re-run Last Executed Commands in Linux

Pradeep Elance
Updated on 03-Jan-2020 06:59:07

325 Views

Re-running commands in the command line is a regular task which all of us go through when working on the Unix systems. In the below article we will see various ways how we can rerun the commands we have already executed this helps save time and it helps reasoning longer commands easily without retyping them.Before we get into how to re-execute previous command let's see how we can look at the list of all the commands. There is a command call history which lists down all the executed command for a specific time period configured by the system. Below is ... Read More

Force User to Change Password at Next Login in Linux

Pradeep Elance
Updated on 03-Jan-2020 06:57:07

675 Views

Because of security concerns, the users in a system are required to update their passwords regularly. In this article we will see how we can force an user to change their password when they login to the system next time.List the usersFirst lets have a look at the users available in the system.$ cut -d: -f1 /etc/passwdRunning the above code gives us the following result −mail news uucp proxy www-data backup list … Ubuntu uname1Check user DetailsNext we check the settings for users current password system configuration.$ sudo chage -l uname1 [sudo] password for ubuntu:Running the above code gives us ... Read More

Find User Account Info and Login Details in Linux

Pradeep Elance
Updated on 03-Jan-2020 06:54:25

5K+ Views

For the sysadmins, it is routine to monitor user details like who are active and who are not, who logged in in last 2 days, which users belong to a given group etc etc. To help these requirements, Linux provides below list of commands which can be used to gather various types of information about the users.id CommandIt gives the id details of users including the group id along with the secondary group IDs and names of a user choosen by the system. But you also ask for a specific user’sdeatils by giving the userid value in the command.ubuntu@ubuntu:~$ id ... Read More

Find Linux Server Geographic Location in Terminal

Pradeep Elance
Updated on 03-Jan-2020 06:52:37

4K+ Views

For purpose of security, cyber-crime investigation, government compliance or just for curiosity we might ned to track the geographical location of a Linux server in the internet or at least the location of the server which diverts the internet traffic to the server we are interested in. It involves getting the I.P address of the server and using some third party services offered in the web, to map that I.P address to get the location. In this article we will see the steps to achieve that.Step 1 − Install curl jqThe curl package will make the http requests to the ... Read More

Advertisements