What Are Some Ways to Prevent XSS Attacks with a Web Page That Uses JavaScript?

Problem scenario
You know that cross-site scripting (aka XSS) attacks are a big concern in today’s world. OWASP places XSS security risks as the seventh biggest web application risk as of June 2020. What are some techniques to stop such attacks from happening when designing a website that uses JavaScript?

Possible Solution #1
Have the HTML and JavaScript validate and escape regularly throughout the code.

How Do You Get WordPress Preview Postings to Show “>> Read more…”?

Problem scenario
You are using WordPress to host your website. Some post previews show a hyperlink “Read more…” but others have no hyperlink. Some post previews (e.g., when you search the website for a pattern) are not updating. Older versions of the post are previewing. How do you get the “Read more…” hyperlink to show in the preview and how do you get the post to be up-to-date?

How Do You Find the Underlying Component in AWS for a Given URL Endpoint?

Problem scenario
You have been given a URL endpoint that is supported by some AWS service or services. How do you find out what the underlying service is?

Solution

  1. Determine the IP address. Ping the hostname. If you have a URL like this, https://acme.com/path/to/file.html, extract the domain name; you can deduce it is acme in the example. Open a command terminal and ping acme.

How Do You Troubleshoot Craft CMS Not Presenting Its Website After the Installation?

Problem scenario
You installed CraftCMS. But there is no port activity on port 80. You want to go to the front-end now. You cannot get to it via a web browser. What do you do?

Solution
Is there a firewall or public cloud security group (e.g., an Azure Network Security Group) blocking traffic to the public IP address over port 80?

How Do You Get to the Nice HTML Presented Installation Web Page for Craft CMS?

Problem scenario
You are trying to install Craft CMS, but when you go to the web browser, you see this:

HTTP 503 – Service Unavailable – craft\web\ServiceUnavailableHttpException
in /var/www/html/craft/vendor/craftcms/cms/src/web/Application.php
537538539540541542543544545546547548549550551552553554555
$actionSegs = $request-getActionSegments();
if (isset($actionSegs[0]) && $actionSegs[0] === ‘install’) {
return $this-_processActionRequest($request);
}
}

// Should they be accessing the installer?
if (!$isInstalled) {
if (!$isCpRequest) {
throw new ServiceUnavailableHttpException();
}

// Redirect to the installer if Dev Mode is enabled
if (YII_DEBUG) {
$url = UrlHelper::url(‘install’); …

How Do You Troubleshoot the Error “ModuleNotFoundError: No module named ‘flask'”?

Problem scenario
You are running a Python program or running a command from the Python 3 interpreter. You get this error:

Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘flask’

What should you do to use Flask with Python 3?

Solution
Prerequisite
You need to have pip3 installed.

How Do You Install Django on a CentOS/RHEL/Fedora server?

Problem scenario
You want to install Django and have it working for browsing from a desktop workstation. You do not want to leverage Django’s API functionality. How do you install and configure Django from scratch?

Prerequisite
pip3 is probably installed. If you are not sure, you could run this: sudo find / -name pip3

You must have pip or pip3 installed.