Snippets Collections
sync && echo 3 > /proc/sys/vm/drop_caches
// for india currency ruppes
  commaSeparatedNumber: (number) => {
    return (
      number
        ?.toString()
        ?.replaceAll(",", "")
        // ?.replace(/(\.\d{2})\d*/, "$1,")
        ?.replace(/(\d)(?=(\d\d)+\d$)/g, "$1,")
    );
  },

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

    );
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/setting-apache-http-server_deploying-different-types-of-servers

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

wget https://dl.google.com/go/go1.21.0.linux-amd64.tar.gz
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/polyfills.es.js";
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">
    <img
     src=${window.location.origin + "/indiafirst-color.png"}
      alt=""
      class="h-[110px] w-[130px]"
    />
  </div>
  <div class="w-full mb-4 mt-2 h-20 font-semibold text-[38px] text-center">
    Future Wealth Creation Report
  </div>
</div>
  `;

  const date = new Date();
  const doc = new jsPDF();
  doc.setFontSize(12);
  doc.setProperties({
    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) {
      pdf.save(
        `Wealth Creation Calculator Report_${
          date.getDate() +
          "-" +
          (date.getMonth() + 1) +
          "-" +
          date.getFullYear() 
        }.pdf`
      );
    },
    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 https://github.com/actions/runner/releases/download/v2.291.1/actions-runner-linux-x64-2.291.1.tar.gz# 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
$ ./config.sh --url https://github.com/TousssaintThomas/wren.v1.0.0 --token AB7YEM2R2HZDVVBJ3VEFFLLCSI5U6# Last step, run it!
$ ./run.sh
# 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 kfc-copypaste-api.the-lion.com --staple-ocsp -m josuedjh456@gmail.com --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
# Zsh
1. zsh: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
2. Oh My Zsh: https://github.com/ohmyzsh/ohmyzsh
3. Powerlevel10k: https://github.com/romkatv/powerlevel10k

	// Don't forget to set the theme and install the fonts
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

	// Execute this to configure the theme
	p10k configure

# Plugins:
// One Dark colour theme
  https://github.com/one-dark/iterm-one-dark-theme

// Look at history of previous commands used:-
  https://github.com/junegunn/fzf

// Command line auto suggestions:-
  https://github.com/zsh-users/zsh-autosuggestions
  
// Quick switch to directories
  https://github.com/agkozak/zsh-z
  
// Found these on this blog post https://udaraw.com/iterm-plugins
# Create a ".desktop" file in "/usr/share/applications" with following content

[Desktop Entry]
Name=NameOfApplication
Exec=/path/to/your/script
Icon=/path/to/image/to/use/as/icon.png
Terminal=false
Type=Application
curl -fsSL https://deb.nodesource.com/setup_current.x | 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
star

Wed Dec 27 2023 01:56:11 GMT+0000 (Coordinated Universal Time)

#ubuntu
star

Wed Dec 27 2023 01:51:52 GMT+0000 (Coordinated Universal Time)

#ubuntu
star

Thu Dec 14 2023 17:59:53 GMT+0000 (Coordinated Universal Time) https://ubuntu.pkgs.org/22.04/ubuntu-main-arm64/python3-hamcrest_2.0.2-2_all.deb.html

#ubuntu #commands
star

Fri Sep 08 2023 16:59:55 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/16037165/displaying-a-number-in-indian-format-using-javascript

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

Tue Sep 05 2023 15:02:43 GMT+0000 (Coordinated Universal Time) https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/setting-apache-http-server_deploying-different-types-of-servers

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

Sat Sep 02 2023 12:08:22 GMT+0000 (Coordinated Universal Time)

#ubuntu #linux #go #golang
star

Tue Aug 22 2023 14:39:19 GMT+0000 (Coordinated Universal Time) https://www.npmjs.com/package/jspdf

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

Tue Aug 22 2023 04:55:11 GMT+0000 (Coordinated Universal Time)

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

Tue Jul 18 2023 20:16:00 GMT+0000 (Coordinated Universal Time)

#ubuntu #linux #repo #location
star

Sun Jul 09 2023 01:19:29 GMT+0000 (Coordinated Universal Time)

#ubuntu #wifi #wifiblock
star

Sat Dec 03 2022 18:21:51 GMT+0000 (Coordinated Universal Time) https://smallbusiness.chron.com/forgot-server-login-password-ubuntu-81716.html

#ubuntu #linux
star

Tue Oct 04 2022 13:49:00 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/40779/how-do-i-install-a-deb-file-via-the-command-line

#ubuntu #linux #deb #install
star

Sat May 28 2022 21:19:29 GMT+0000 (Coordinated Universal Time) http://manpages.ubuntu.com/manpages/bionic/man8/mbpfan.8.html

#ubuntu #linux #mbpfan
star

Sat May 28 2022 14:42:18 GMT+0000 (Coordinated Universal Time) https://github.com/TousssaintThomas/wren.v1.0.0/settings/actions/runners/new?arch=x64&os=linux

#bash #linux #ubuntu
star

Sun May 15 2022 17:04:29 GMT+0000 (Coordinated Universal Time)

#ubuntu #linux #bash #sariohara
star

Mon Apr 11 2022 14:11:19 GMT+0000 (Coordinated Universal Time)

#linux #ubuntu #nginx
star

Mon Apr 11 2022 13:41:23 GMT+0000 (Coordinated Universal Time)

#linux #ubuntu #nginx
star

Tue Mar 15 2022 04:10:40 GMT+0000 (Coordinated Universal Time)

#ubuntu #bash #ssh
star

Tue Mar 15 2022 03:32:29 GMT+0000 (Coordinated Universal Time) https://serverfault.com/questions/854208/ssh-suddenly-returning-invalid-format

#ubuntu #bash #ssh
star

Mon Feb 14 2022 07:24:44 GMT+0000 (Coordinated Universal Time) https://medium.com/ruralscript/install-and-setuppostgresql-on-ubuntu-amazon-ec2-5d1af79b4fca

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

Fri Feb 11 2022 23:22:04 GMT+0000 (Coordinated Universal Time)

#url #zsh #ohmyzsh #terminal #ubuntu #git #shell #bash
star

Tue Jun 08 2021 08:36:37 GMT+0000 (Coordinated Universal Time) https://www.computerwissen.de/linux/distributionen/ubuntu/ubuntu-programme/so-erstellen-sie-einen-eigenen-starter/

#ubuntu #scripts #gui
star

Sun Apr 18 2021 16:35:19 GMT+0000 (Coordinated Universal Time)

#ubuntu #bash #linux
star

Sun Dec 06 2020 21:15:55 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/761706/ubuntu-15-10-and-16-04-keep-freezing-randomly

#bash #ubuntu
star

Sun Nov 29 2020 16:44:07 GMT+0000 (Coordinated Universal Time) https://forums.docker.com/t/start-a-gui-application-as-root-in-a-ubuntu-container/17069

#bash #docker #ubuntu
star

Fri Dec 27 2019 13:19:35 GMT+0000 (Coordinated Universal Time) https://dev.to/codeluggage/today-i-wrote-a-handy-little-snippet-to-easily-access-ubuntu-from-windows-in-wsl2-19l

#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