The ASPState database is used by Microsoft’s ASP.NET Session State Service to store session data. By default, session state service stores its data in an in-memory cache. If you want to persist session data across multiple web servers in a web farm or you want to recover session data in case of application crashes or restarts, you should consider storing your session state in an ASPState database in SQL Server. Prerequisites A version of SQL Server (2008 or later). The ASP.NET Session State Service should be installed on your server. This service comes with ASP.NET and is installed automatically when…
Author: Rahul
We can use an internal field separator (IFS) variable to parse an array. Let’s use an example script, where first we define a string with colon-separated. Then we will use IFS to separate values based on a delimiter.
1 2 3 4 5 6 7 8 9 | #!/usr/bin/env bash STR="orange:grapes:banana:apple" #String with names IFS=';' read -ra NAMES <<< "$STR" #Convert string to array #Print all names from array for i in "${NAMES[@]}"; do echo $i done |
Let’s execute this script and check for results. ./myscript.sh Output: orange grapes banana apple
Command SNAME=$(basename “$(test -L “$0” && readlink “$0” || echo “$0″)”) While running a bash script using Linux terminal the script name can also passed as argument at $0. but if we are using full path of script to execute, it will show full path as results when print value of $0. So use above command will exactly provide only script name. It also handle if you are running any bash script using symbolic link. Example: Create a script named test.sh and add following content in script. #!/bin/bash SNAME=$(basename “$(test -L “$0” && readlink “$0” || echo “$0″)”) echo “Your…
MX records in DNS are used to route emails to correct mail servers and properly send to correct destination server. If you are using Google apps account for hosting email accounts on Google servers for your domains, then you need to add following MX records in your domains DNS configuration. Google Apps MX Records: @ IN MX 1 ASPMX.L.GOOGLE.COM @ IN MX 5 ALT1.ASPMX.L.GOOGLE.COM @ IN MX 5 ALT2.ASPMX.L.GOOGLE.COM @ IN MX 10 ALT3.ASPMX.L.GOOGLE.COM @ IN MX 10 ALT4.ASPMX.L.GOOGLE.COM
Generally Ubuntu users used Synaptic Package Manager for GUI and apt package manager for command line for installing packages. But not all latest application’s provides pre compiled packages for system, In that case you need to compile it using source code for installing application on your system. This article will help you for installing packages using source archive on Ubuntu systems. Prerequisites Before working with the compilation of source package, First we need to prepare our system with requirements for compilation. $ sudo apt-get install apt-file autoconf build-essential checkinstall Extract Source Package Firstly download the source archive on your system…
Command: md5sum myfile.php > myfile.php.md5 Above command will generate md5 checksum of file myfile.php and store in file myfile.php.md5. myfile.php.md5 can be used to verify integrity of file anytime. Generate MD5: If we want to generate md5sum of a file named index.php. Use the following command to do it and store generated md5 value of file in index.php.md5 file. # md5sum index.php > index.php.md5 Verify MD5: Now in future we can use index.php.md5 to verify integrity of file using following command. This command will show output as OK or FAILD. # md5sum -c index.php.md5
Linux, much like any other operating system, relies on processes for its operations. Occasionally, these processes may become unresponsive or consume excessive system resources, necessitating their termination. The following article presents a detailed guide on how to kill a process by its name in Linux, a crucial skill for Linux users and administrators alike. What is a Process? Before we dive in, it’s crucial to understand what a process is. A process, in the simplest terms, is an instance of a program in execution. Each process has a unique identifier called a Process ID (PID), which the operating system uses…
We can easily get values passed in url query string using JavaScript or jQuery. Here is an simple examples of getting query string values with JavaScript. To do this create a function like getParamValuesByName and add one of example codes given below. In the below examples function getParamValuesByName() will parse the query string values and returned matching values based on there named passed as parameter. Example 1: <script type=”text/javascript”> function getParamValuesByName (querystring) { var qstring = window.location.href.slice(window.location.href.indexOf(‘?’) + 1).split(‘&’); for (var i = 0; i < qstring.length; i++) { var urlparam = qstring[i].split('='); if (urlparam[0] == querystring) { return urlparam[1];…
This tutorial will help you to redirect a webpage to another webpage using JavaScript. Here are 3 examples of redirecting webpage to another with JavaScript. Example 1: We can redirect user to other page using window.location.replace in JavaScript. window.location.replace has pretty similar to an HTTP redirect.
1 | window.location.replace("https://example.com"); |
Example 2: It is better to use window.location.href in place of window.location.replace, because replace() function does not put the originating page in the session history.
1 | window.location.href = "https://example.com"; |
Example 3: We can also simply redirect to any internal website page using window.location.
1 | window.location.href = "/other-page/"; |
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…