How Do You Get JavaScript to Present in a Web Browser?

Problem scenario
You have a .js file on your desktop or on a web server. You want to have the code execute and present itself nicely (not just see the raw code) in a web browser. How do you do this?

Solution
You must use the .html extension. You must have

<html</html

tags. Here is an example. Name this file contint.html and place it on your desktop,

How Do You Get to the Small Windows (aka Widgets) in WordPress?

Problem scenario
You recently migrated to WordPress. There are small windows of text on the left or right side of your blog. They are not posts. You do not know how to modify them. What should you do to modify them or add advertisement banners to your website?

Solution
These sidebar text rectangles are called “Footers” in WordPress. To modify them,

How Do You Programmatically Search Hyperlinks on a Given Webpage?

Problem scenario
You have a web page that you access from the front-end (e.g., a web browser). You want to see if there is a hyperlink on the page that goes to a certain URL. You know the web page and the URL, but you are not sure if a hyperlink on the website has such a link. What should you do?

Solution
Use the curl command.

What Should You Do when the Apache Mesos Web UI Keeps Refreshing and Sending a Pop-up “Failed to connect to …:5050”?

Problem scenario
You deployed Apache Mesos. The web UI is having problems. You see the error “Failed to connect to x.x.x.x:5050.” What should you do?

Solution

  1. Go to the back-end of the Apache Mesos server. Run this command: sudo systemctl stop mesos-master
  2. sudo find / -name mesos-master.sh
  3. Change directory into the parent of the “bin” directory that houses the mesos-master.sh as found above.

How Do You Delete Browser Data from Chrome when Your First Attempt Failed?

Problem scenario
In Chrome you deleted browsing data including cookies and autofill form data. You closed the browser and reopen it, but old URLs still show up. What should you do?

Solution
Go to History -Clear browsing data -and go to “Time Range” (the drop down menu). Choose “All time” and then go to “Clear data”.

How Do You Get curl to Work when the Web Page is Working?

Problem scenario
You can download a file with Lynx and wget. But curl is not working. What should you do?

Solution
First, try to curl the web page without redirecting the output. If the curl command creates a file, it does not necessarily give you an accurate depiction. You may want to examine the file with a text editor. What you see without redirecting the output to a file (that is allowing the output to echo to the screen) may provide a clue.

When Does the DNS Server Override the /etc/hosts File for FQDN or Domain Name Resolution?

Problem scenario
You notice that on some Linux servers the /etc/hosts file controls the resolution of hostnames and on other servers the DNS server overrides the /etc/hosts file. Which has precedence in DNS resolution, /etc/hosts or the DNS server on the network?

Answer
It depends. The /etc/nsswitch.conf file will decide. There is a “hosts” stanza. This setting will have the DNS server override the /etc/hosts file:

hosts:dns files

This setting will have the /etc/hosts file take precedence for name resolution:

hosts:files dns

To get the hostname,

How Do You Get a PHP Program to Invoke a Python Program via Browsing a Website?

Problem scenario
You want Debian/Ubuntu Linux to support a website. You want a Python program to run every time a web page is downloaded. How do you get a PHP program to invoke a Python program on Debian/Ubuntu Linux?

Solution

Prerequisites
i. This assumes you have Apache2 and PHP installed. If you need assistance run this: sudo apt -y install apache2 php
ii.