Categories
Linux Mastering Development

dhcrelay problem?

dhcpd reply not getting to final client. Background: House network: 107.nn.164.89 – to internet 192.168.100.0/24 – house local lan1 192.168.1.254/30 – gateway to mancave Mancave: 192.168.1.253/30 – gateway to house 192.168.200.254/24 – mancave local lan1 mancave dhcrelay sends requests to dhcp server running on house lan1 ( which also listens on 1.254/30 ) house dhcp […]

Categories
Linux Mastering Development Ubuntu

Server is broken after do-release-upgrade from 18 to 19

I had a (headless) server running 18.04LTS. On it ran some standard software: Apache, Docker, SSH, etc. I ran do-release-upgrade and after a seemingly normal set of questions and actions, a reboot was required. After the reboot, I lost all connection to it. Sites didn’t load, SSH timed out. Ubuntu 19.10 is installed, but nothing […]

Categories
Mastering Development

Props is always undefined when using with react router, on every page

I’m using react-router-dom and Link to pass props to other components, I intend to use these props on my /details route. However I can’t seem to define the props, I’ve checked other questions and I’m using: <Link to=}> to no avail: Home.js // this will be the home page that lists all the available leads […]

Categories
Mastering Development

How to serve a Nodejs & Express app using Phusion Passanger

I have a node & express app that is currently hosted on a shared hosting. I would like to run and manage the app using Phusion Passenger. My hosting account supports nodejs applications managed by Passenger which i have never used before. The server code generated when setting up the Node app is the basic […]

Categories
Mastering Development

SMS Sending Function not works in PHP

I am trying to make sms sending functions in php but it not works from my ends error = env function I can use file_get_contents but this is not good idea to achieve this. I want to learn through bugs and mistakes. So stackoverflow is best for me as I believe. Please now let me […]

Categories
Mastering Development

Testing of Nested React components using React-Test-Renderer

I have a pure React-Redux application and it is working as expected. The App.js import React, { useEffect } from “react”; import { useDispatch } from “react-redux”; import { Router, Route, Switch, Redirect } from “react-router-dom”; import history from “../history”; import LandingPage from “./home/LandingPage”; import { displayModules } from “../actions”; import Cart from “./home/Cart”; const […]

Categories
Mastering Development

react route how to import local scss file only apply to one js file?

In one React app with React Router, for each route component, I would like to have one local scss file only apply to this file. For below example, about.js imported about.scss, what I want to have is: about.scss override the global style in app.scss only in about.js. However, it overrode everything in the app app.js […]

Categories
Mastering Development

How to find a route between two stations in PROLOG

Sorry, I know this question comes up a lot but I’ve done so much research and I just can’t figure out how to solve this problem. I have represented a tube map in PROLOG and need to write a predicate that returns all routes between two stations. I know I need to use recursion and […]

Categories
Mastering Development

How to generate nested JSON object in T-SQL?

I have below data against below query ;WITH result (id, name, rootId, Level) AS ( SELECT id, name, RootId, 0 as Level FROM Navigations WHERE RootId= 0 UNION ALL SELECT t.id, t.Name, t.RootId, r.Level + 1 FROM Navigations t INNER JOIN result r ON r.id = t.RootId ) SELECT * FROM result order by Level […]

Categories
Development

React and hooks – Getting TypeError: Object(…) is not a function

I’m using Mapbox to try to render various coordinates from a local JSON file. However, I’m receiving the error TypeError: Object(…) is not a function. I’ve looked up some info on what could be causing it (e.g. earlier versions of react won’t work with hooks), but since it’s pretty vague I don’t know how to […]