In the examples below we show useful javascript ES6 examples which are very valuable Including: Array Loop and Slice Regular expression, replaces all blanks & special characters Object Keys & Values Object Map Math Sign Palindrom example Every & Some Array map elements Array Foreach loop map, filter, find reverse String balanceParser example //////Loop and […]
Yearly Archives: 2021
SEO Meta Title and Description are basics and MUST HAVE settings for your website. For adding those you must put below between <header> </header> tags in your HTML page like the codes I put for my website: <head> <title>Tips for Programming, Sysadmin, GIS, SEO | Full Stack Logs </title> <meta name=”description” content=”Full Stack […]
In the example below we show how to call Post API using Axios asynchronously in React functional component. We utilise “useState” for creating a state variable pass its value to the post request: import React, { useState } from “react”; import axios from “axios”; const PostCreate = () => { const [title, setTitle] […]
For creating Http Get or Http Post Server using Nodejs (Not consuming Get or Post) Follow instructions below: First Create a Nodejs project by running: npm init -y Then install express and body-parser dependencies by running npm i express body-parser Now create and edit the index.js file and add below code […]
For installing and serving R Shiny Server behind Nginx reverse proxy we first install it by: sudo apt-get install r-base sudo su – \ -c “R -e \”install.packages(‘shiny’, repos=’https://cran.rstudio.com/’)\”” sudo apt-get install gdebi-core sudo gdebi shiny-server-1.5.16.958-amd64.deb Before installing some R Shiney packages we should install: sudo apt-get install libssl-dev libcurl4-openssl-dev Then we can install R […]
For installing and serving Konga behind Nginx reverse proxy we first clone the project and install npm modules and run : git clone https://github.com/pantsel/konga.git cd konga npm i npm run start It is time to add the reverse proxy in Nginx as below: sudo vim /etc/nginx/nginx.conf server { location […]
For serving React app behind reverse proxy such as Nginx or Apache We first create an application using create-react-app Create a react app using npx like: npx create-react-app portal Then install serve node package like: npm install -g serve Then you need to update the package.json and add two lines below (assume we want to […]
For installing SSL certificate for Nginx in Ubuntu you need to have two files: SSL crt file and SSL private key file and then put inside the server section in nginx.conf like the example below: sudo vim /etc/nginx/nginx.conf server { listen 443 ssl; ssl_certificate /PATH_TO_SSL_CRT_FILE.crt; ssl_certificate_key /PATH_TO_SSL_PRIVATE.key; server_tokens off; root /var/www; server_name www.yourdomain.com; client_max_body_size […]
First you need to run below commands: sudo touch /etc/authbind/byport/80 sudo chmod 500 /etc/authbind/byport/80 sudo chown tomcat8 /etc/authbind/byport/80 Then you need to add AUTHBIND=yes in /etc/default/tomcat8 Here you can change the JAVA_HOME & JAVA_OPTS: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 JAVA_OPTS=”-Djava.awt.headless=true -XX:+UseConcMarkSweepGC -Xms512m -Xmx4G -XX:PermSize=512M -Dorg.owasp.esapi.resources=/var/lib/tomcat8/webapps/ROOT/WEB-INF/classes/ESAPI.properties” AUTHBIND=yes Then you need to change […]
Assuming the Geoserver war file is running inside tomcat in port 7000 like: localhost:7000/geoserver Also a valid SSL certificate has configured in NGINX. First you need to change Tomcat port and add proxyPort in server.xml : sudo vim /etc/tomcat8/server.xml Then search for “Connector port” and change the port number and also proxyPort to […]