Snippets Collections
// for india currency ruppes
  commaSeparatedNumber: (number) => {
    return (
        ?.replaceAll(",", "")
        // ?.replace(/(\.\d{2})\d*/, "$1,")
        ?.replace(/(\d)(?=(\d\d)+\d$)/g, "$1,")

// for us currency ruppes 
  commaSeparatedNumber: (number) => {
    return (
        ?.replaceAll(",", "")
        // ?.replace(/(\.\d{2})\d*/, "$1,")
           ?.replace(/(\d)(?=(\d{3})+\b)/g, "$1,")


Install ModSecurity on CentOS 7

1. Enter the following into a terminal window:
sudo yum install mod_security

If prompted, pres y and hit Enter to allow the process to complete.
2. Restart the Apache service:

sudo systemctl restart httpd.service
3. Check the software version (should be 2.8.0 or later):

yum info mod_security
Step: 3 Configure ModSecurity

Upon installation, ModSecurity is set to log events according to default rules. You’ll need to edit the configuration file to adjust the rules to detect and block traffic.

The default configuration file is /etc/modsecurity/modsecurity.conf-recommended.
1. Copy and rename the file:
sudo cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf

2. Next, change the ModSecurity detection mode. First, move into the /etc/modsecurity folder:
sudo cd /etc/modsecurity

3. Open the configuration file in a text editor (we will be using nano):
sudo nano modsecurity.conf
Now after installation 

Add this line in httpd.conf (full path-> /etc/httpd/conf/httpd.conf)
SecRuleEngine on
SecServerSignature " "
ServerSignature On
ServerTokens Prod

sudo tar -xvf go1.21.0.linux-amd64.tar.gz
sudo mv go /usr/local
sudo ln -s /usr/local/go/bin/* /usr/bin
rm go1.21.0.linux-amd64.tar.gz
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
import { jsPDF } from "jspdf";
import "jspdf/dist/";
import { regex } from "./constant";

const htmlPdfConverter = (basicDetails, inputs) => {
  const pdfHeading = `
  <div class="h-full w-full text-dream_vacation block justify-center items-end">
  <div class="w-full flex justify-end h-full">
     src=${window.location.origin + "/indiafirst-color.png"}
      class="h-[110px] w-[130px]"
  <div class="w-full mb-4 mt-2 h-20 font-semibold text-[38px] text-center">
    Future Wealth Creation Report

  const date = new Date();
  const doc = new jsPDF();
    title: "Future Wealth Creation Report",
    subject: "Future Wealth Creation Report",
    author: "India first life",
    keywords: "generated, javascript, web 2.0, ajax",
    creator: "India first life"

  doc.html(pdfHeading, {
    useCORS: true,
    pageSplit: true,
    callback: function (pdf) {
        `Wealth Creation Calculator Report_${
          date.getDate() +
          "-" +
          (date.getMonth() + 1) +
          "-" +
    margin: [10, 10, 10, 10],
    autoPaging: "text",
    x: 0,
    y: 0,
    width: 195,
    windowWidth: 900
  return true;

export default htmlPdfConverter;
For react build deployment - put buli in (/var/www/html) folder
PORT 80 - is for http ip access link (comment it out in httpd.conf file)
PORT 443 is for HTTPS ip access link 

For redirection reload "404 error" issues-

1) Change httpd.conf file in (/etc/httpd/conf)and in .htaccess build folder (/var/www/html). 

2) Note: This two files should contain the same below code i.e.-> 

RewriteEngine On
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^ index.html [QSA,L]

3) Note:  in document root "/var/www/html" change AllowOverride to All.

After this re-run the Apache server command - apachectl restart
copy build to var/www/html

/usr/share/httpd/noindex  .... 

local -> fpts to srv.arcosunix (buil import)

cd in build folder (cmd prmpt) -> command -[    cp -rv * /var/www/html/     ]  (this will override/copy new build)


if on restart if apache didn't restart then 

delete  indiafirstlife-ssl.conf     (path -  /etc/httpd/conf.d)

then apache will work 

commentd on line 87 on  vi /etc/httpd/conf.d/ssl.conf
mbpfan is a daemon that uses input from coretemp module and sets the fan speed  using  the
applesmc  module.   This  enhanced version assumes any number of processors and fans (max.10), and it is distro- and kernel-independent.

# Download
# Create a folder
$ mkdir actions-runner && cd actions-runner
# Download the latest runner package
$ curl -o actions-runner-linux-x64-2.291.1.tar.gz -L Optional: Validate the hash
$ echo "1bde3f2baf514adda5f8cf2ce531edd2f6be52ed84b9b6733bf43006d36dcd4c  actions-runner-linux-x64-2.291.1.tar.gz" | shasum -a 256 -c
# Extract the installer
$ tar xzf ./actions-runner-linux-x64-2.291.1.tar.gz
# Configure
# Create the runner and start the configuration experience
$ ./ --url --token AB7YEM2R2HZDVVBJ3VEFFLLCSI5U6# Last step, run it!
$ ./
# Using your self-hosted runner
# Use this YAML in your workflow file for each job
# runs-on: self-hosted
sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y; clear;
certbot certonly --standalone -d --staple-ocsp -m --agree-tos
grep -inRsH "Text to be searched" apps/
ssh -i mykeypair_openssh.ppk <user>@<host ip>
# with port
ssh -i mykeypair_openssh.ppk <user>@<host ip> -P 50055
puttygen ~/.ssh/my.ppk -O private-openssh -o ~/.ssh/my_openssh.ppk
# Create a ".desktop" file in "/usr/share/applications" with following content

[Desktop Entry]
curl -fsSL | sudo -E bash -
sudo apt-get install -y nodejs
sudo nano /etc/default/grub

# There is a line in that: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (like this), replace with: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
# Save it (CTRL+O)

sudo update-grub
sudo reboot
ip addr | grep eth0 | grep inet | awk '{print $2}' | awk -F '/' '{print $1}' | awk '{printf "%s:3000", $0}' | clip.exe

Fri Sep 08 2023 16:59:55 GMT+0000 (UTC)

#react.js #javascript #ubuntu #apache #linux #var/www/htm

Tue Sep 05 2023 15:02:43 GMT+0000 (UTC)

#react.js #javascript #ubuntu #apache #linux #var/www/htm

Tue Aug 22 2023 14:39:19 GMT+0000 (UTC)

#react.js #javascript #ubuntu #apache #linux #var/www/htm

Tue Jul 18 2023 20:16:00 GMT+0000 (UTC)

#ubuntu #linux #repo #location

Sat Dec 03 2022 18:21:51 GMT+0000 (UTC)

#ubuntu #linux

Tue Oct 04 2022 13:49:00 GMT+0000 (UTC)

#ubuntu #linux #deb #install

Sat May 28 2022 21:19:29 GMT+0000 (UTC)

#ubuntu #linux #mbpfan

Sat May 28 2022 14:42:18 GMT+0000 (UTC)

#bash #linux #ubuntu

Sun May 15 2022 17:04:29 GMT+0000 (UTC)

#ubuntu #linux #bash #sariohara

Mon Apr 11 2022 14:11:19 GMT+0000 (UTC)

#linux #ubuntu #nginx

Mon Apr 11 2022 13:41:23 GMT+0000 (UTC)

#linux #ubuntu #nginx

Tue Mar 15 2022 04:10:40 GMT+0000 (UTC)

#ubuntu #bash #ssh

Tue Mar 15 2022 03:32:29 GMT+0000 (UTC)

#ubuntu #bash #ssh

Mon Feb 14 2022 07:24:44 GMT+0000 (UTC)

#ec2 #postgres #setup-postgres-on-ec2 #ubuntu

Tue Jun 08 2021 08:36:37 GMT+0000 (UTC)

#ubuntu #scripts #gui

Sun Apr 18 2021 16:35:19 GMT+0000 (UTC)

#ubuntu #bash #linux

Sun Dec 06 2020 21:15:55 GMT+0000 (UTC)

#bash #ubuntu

Sun Nov 29 2020 16:44:07 GMT+0000 (UTC)

#bash #docker #ubuntu

Fri Dec 27 2019 13:19:35 GMT+0000 (UTC)

#commandline #interesting #windows #ubuntu #linux

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension