Snippets Collections
// 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

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
;MainWP Requriement - cURL timeout
default_socket_timeout = 300
;END MainWP Requriement
### Normal redirect from path to path ###

RewriteRule ^source/path$   /target/path [R=301,L]


### Redirect from query parameters ###

# For every path
RewriteCond %{QUERY_STRING} ^id=1&lang=de&newsid=30&subcat=8$
RewriteRule ^(.*)$   /target/path [R=301,L]

# Only for specific source path (here /index.php)
RewriteCond %{QUERY_STRING} ^lang=de&id=1$
RewriteRule ^index\.php$   /target/path [R=301,L]

# To purge the query parameters, add a ? at the end of the target path.
# The target path from the previous example would then be "/target/path?"
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.component.google.drive;

import java.util.HashMap;
import java.util.Map;

import com.google.api.services.drive.model.Comment;
import com.google.api.services.drive.model.File;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.google.drive.internal.DriveCommentsApiMethod;
import org.apache.camel.component.google.drive.internal.DriveFilesApiMethod;
import org.apache.camel.component.google.drive.internal.GoogleDriveApiCollection;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Test class for com.google.api.services.drive.Drive$Comments APIs.
 */
public class DriveCommentsIntegrationTest extends AbstractGoogleDriveTestSupport {

    private static final Logger LOG = LoggerFactory.getLogger(DriveCommentsIntegrationTest.class);
    private static final String PATH_PREFIX = GoogleDriveApiCollection.getCollection().getApiName(DriveCommentsApiMethod.class).getName();
    
    @Test
    public void testComment() throws Exception {
        // 1. create test file
        File testFile = uploadTestFile();
        String fileId = testFile.getId();
        
        // 2. comment on that file
        Map<String, Object> headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelGoogleDrive.fileId", fileId);
        // parameter type is com.google.api.services.drive.model.Comment
        com.google.api.services.drive.model.Comment comment = new com.google.api.services.drive.model.Comment();
        comment.setContent("Camel rocks!");
        headers.put("CamelGoogleDrive.content", comment);

        requestBodyAndHeaders("direct://INSERT", null, headers);

        // 3. get a list of comments on the file
        // using String message body for single parameter "fileId"
        com.google.api.services.drive.model.CommentList result1 = requestBody("direct://LIST", fileId);

        assertNotNull(result1.get("items"));
        LOG.debug("list: " + result1);
        
        Comment comment2 = result1.getItems().get(0);
        
        // 4. now try and get that comment 
        headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelGoogleDrive.fileId", fileId);
        // parameter type is String
        headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());

        final com.google.api.services.drive.model.Comment result3 = requestBodyAndHeaders("direct://GET", null, headers);

        assertNotNull("get result", result3);
        
        // 5. delete the comment
        
        headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelGoogleDrive.fileId", fileId);
        // parameter type is String
        headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());

        requestBodyAndHeaders("direct://DELETE", null, headers);

        // 6. ensure the comment is gone
        
        headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelGoogleDrive.fileId", fileId);
        // parameter type is String
        headers.put("CamelGoogleDrive.commentId", comment2.getCommentId());

        try {
            final com.google.api.services.drive.model.Comment result4 = requestBodyAndHeaders("direct://GET", null, headers);
            assertTrue("Should have thrown an exception.", false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                // test route for delete
                from("direct://DELETE")
                    .to("google-drive://" + PATH_PREFIX + "/delete");

                // test route for get
                from("direct://GET")
                    .to("google-drive://" + PATH_PREFIX + "/get");

                // test route for insert
                from("direct://INSERT")
                    .to("google-drive://" + PATH_PREFIX + "/insert");

                // test route for list
                from("direct://LIST")
                    .to("google-drive://" + PATH_PREFIX + "/list?inBody=fileId");

                // test route for patch
                from("direct://PATCH")
                    .to("google-drive://" + PATH_PREFIX + "/patch");

                // test route for update
                from("direct://UPDATE")
                    .to("google-drive://" + PATH_PREFIX + "/update");
                
                // just used to upload file for test
                from("direct://INSERT_1")
                    .to("google-drive://" + GoogleDriveApiCollection.getCollection().getApiName(DriveFilesApiMethod.class).getName() + "/insert");

            }
        };
    }
}




 



 
#force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
#!/bin/sh
set -e
 
echo "Deploying application ..."
 
# Enter maintenance mode
(php artisan down --message 'The app is being (quickly!) updated. Please try again in a minute.') || true
    # Update codebase
    git fetch origin deploy
    git reset --hard origin/deploy
 
    # Install dependencies based on lock file
    composer install --no-interaction --prefer-dist --optimize-autoloader
 
    # Migrate database
    php artisan migrate --force
 
    # Note: If you're using queue workers, this is the place to restart them.
    # ...
 
    # Clear cache
    php artisan optimize
 
    # Reload PHP to update opcache
    echo "" | sudo -S service php7.4-fpm reload
# Exit maintenance mode
php artisan up
 
echo "Application deployed!"
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
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

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

Thu Jun 08 2023 14:34:22 GMT+0000 (Coordinated Universal Time)

#wordpress #config #nginx #apache #php
star

Wed Jan 25 2023 12:23:27 GMT+0000 (Coordinated Universal Time) https://simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/

#server #apache
star

Sat Oct 29 2022 17:10:20 GMT+0000 (Coordinated Universal Time) https://www.javatips.net/api/camel-master/components/camel-google-drive/src/test/java/org/apache/camel/component/google/drive/DriveCommentsIntegrationTest.java

#apachecamel google drive #apache #camel #google #drive
star

Tue Sep 20 2022 13:04:20 GMT+0000 (Coordinated Universal Time)

#apache #htaccess
star

Sun Jun 26 2022 08:40:16 GMT+0000 (Coordinated Universal Time)

#php #laravel #bash #apache #server
star

Wed Jun 08 2022 06:41:17 GMT+0000 (Coordinated Universal Time)

#apache
star

Fri Apr 22 2022 17:12:36 GMT+0000 (Coordinated Universal Time) https://www.ssls.com/knowledgebase/how-to-install-an-ssl-certificate-on-apache/?gclid

#bash #ssl #linux #apache #certificates

Save snippets that work with our extensions

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