Categories
CMS Magento Mastering Development

Edit/modify Google Analytics code from core module, not working – Magento 2.4.1

I want to edit the default Google Analytics code from the core module Magento_GoogleAnalytics, that is build in Magento 2.4.1. I want to add the line; setTimeout("ga(‘send’,’event’,’Profitable Engagement’,’time on page more than 30 seconds’)",30000); Therefore I copied the file to /app/design/frontend/theme/theme/Magento_GoogleAnalytics/web/js/google-analytics.js With the following entire js code, see below. But for some reason that does […]

Categories
Mastering Development

How to run this tsduck shell command containing quotes with subprocess.run in Python

Here is the command as written in the tsduck manual: tsp -I dvb -a 1 @ts1028.txt \ -P svremove -s AlJazeeraEnglish \ -P merge "tsp -I dvb -a 0 @ts1022.txt -P zap TV5MondeEurope" \ -P analyze -i 30 -o merged.txt \ -O dektec @modulation.txt Here is my version: import sys import subprocess mod_values = { […]

Categories
Mastering Development System & Network

redirect /my-service requests to custom port on nginx

I’m trying to set up a nginx image that redirects requests depending on a url to a service port. I’m using docker-compose and this is my docker-compose.yml: version: ‘3.3’ services: nginx: image: nginx:latest build: . container_name: nginx depends_on: – service-1 ports: – "80:80" service-1: image: dockerhub/image:latest container_name: service-1 ports: – "8080:8080" restart: on-failure The dockerfile […]

Categories
Mastering Development System & Network

nginx docker proxy reverse not displaying custom html page

I’m trying to setup a reverse proxy docker image which displays a custom static page on path "/" and proxies the incoming request to other services, but it’s not working. This is my nginx.config: server { listen 80 default_server; listen [::]:80 default_server; server_name localhost; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; […]

Categories
Mastering Development

family tree in SWI PROLOG

there is some error with the grandma , cousin, brother, uncle rules i tried so many rules but still could not find the correct one it returns false , please helpppppppppp /*rules*/ male(james). male(charles). male(william). female(megan). male(george). female(catherine). female(diana). female(elizabith). parent(james, charles). parent(james, elizabeth). parent(charles, catherine). parent(charles, william). parent(charles, megan). parent(elizabeth, diana). parent(diana, george). /*rules*/ […]

Categories
Raspberry Pi User Help

pip install fbprophet

Can the facebook time series algorithm called prophet be installed on a rasp pi? It requires pystan (I think its Cython) and my B+ pi upgraded to Buster fails on the install with pip Im also noticing the RAM requirements maybe not enough for the B+ which I only think has 1 gig of RAM. […]

Categories
Mastering Development System & Network

How to redirect Node.js app to HTTPS using nginx?

I have a Node app on port 3000 and I am trying to figure out how to redirect it to https so that it can be accessed at https://localhost:3000/ instead of http://localhost:3000. The setup I currently have redirects http to https, but gives me a ‘502 Bad Gateway Error’ and does not show my app. […]

Categories
Mastering Development System & Network

Running nginx as a non-root user on Dockerfile

I have created the following Dockerfile to use a non-root user for my Nginx service. However, when I ran the docker image that I have created and look at my docker logs i get the following error. 2020-10-14T11:52:04.831656127Z nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2020-10-14T11:52:04.831687644Z 2020/10/14 11:52:04 […]

Categories
Mastering Development System & Network

chmod: changing permissions of ‘/home/nginxx’: Operation not permitted

When i am running the following dockefile, I get the Operation not permitted error. i am trying to create a new user instead of using the root user. What am i doing wrong in my dockerfile? USER root RUN mkdir /home/nginx WORKDIR /home/nginxx RUN microdnf –setopt=tsflags=nodocs install -y nginx procps shadow-utils net-tools ca-certificates dirmngr gnupg […]

Categories
Database Development

Decrease Data IO operation on query to lower the DTU cost on Azure

We have a FunctionApp in Azure that triggers on a timer and does some DB operations every 5 minutes. These operation are taking a very long time to complete. When I run the same query on my computer with the same data in the DB the query executes in about 2 seconds. On Azure it […]