How Do You Use Flask as a RESTful Endpoint on an Ubuntu Server?

Problem scenario
You want to deploy Flask to test it out.  You also want a RESTful endpoint on an Ubuntu Linux server.  How do you do this?

Solution
1.  Install Flask.  Run these five commands:

sudo apt-get -y update
sudo apt-get -y install python python-pip 
sudo pip install –upgrade pip setuptools
sudo apt-get -y install python3-dev virtualenv python3-venv
pip install flask

2. 

How Do You Troubleshoot a cronjob That Indirectly Uses Linux Programs (e.g., Executables)?

Problem scenario
You have a Python script that runs successfully when your user runs it.  You have a *nix crontab that calls this Python script at a scheduled time.  The script mostly works, but one part fails when the crontab launches it (automatically).  This problem does not happen when it has been run manually.

The part that fails involves a Linux command via a Python subprocess.check_output() invocation in the program. 

Is Python a Strongly-Typed Language?

Question
Some programming languages adhere to a discipline known as being “strongly typed.”  This attribute governs variable assignments.  Is Python a strongly-typed language?

Answer
Technically, yes it is.  Some interviewers for jobs involving Python may ask this question and expect you to say “no it is not.”

Detailed Explanation
In software development there are many people who have used Python and found its variables to be “dynamically typed” and not “statically typed.” 

How Do You Install Java Version 8 on a Windows 64 Bit Server with PowerShell?

Problem scenario
You need to install Java version 8 on a Windows 64 bit server.  How do you do this with PowerShell?

Solution
1.  Open PowerShell ISE as Administrator.

2.  Run this script:

#  This is a modified version of PowerShell code taken from this site:
#  https://skarlso.github.io/2015/06/30/powershell-can-also-be-nice-or-installing-java-silently-and-waiting/

$JDK_VER=”1u151″
$JDK_FULL_VER=”8u151-b12″
$JDK_PATH=”1.8.0_151″
$source86 = “http://download.oracle.com/otn-pub/java/jdk/$JDK_FULL_VER/jdk-$JDK_VER-windows-i586.exe”
$source64 = “http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230542_2f38c3b165be4555a1fa6e98c45e0808”
$destination86 = “C:\Program Files (x86)\$JDK_VER-x86.exe”
$destination64 = “C:\Program Files (x86)\$JDK_VER-x64.exe”
$client = new-object System.Net.WebClient
$cookie = “oraclelicense=accept-securebackup-cookie”
$client.Headers.Add([System.Net.HttpRequestHeader]::Cookie,

How Do You Control, Manage, List, Upload and Download Files to and from S3 without Using the GUI?

Problem scenario
You are using a Debian distribution of Linux.  You want to upload and download files to S3 without using the GUI.  You want to be able to automate processes with scripts that interact with S3 from your Ubuntu Linux server.  How do you do this?

Solution
The procedures have two parts after you have the prerequisites met.

Prerequisites
i.

What Is the Difference between Erasure Coding and Negative Coding?

Question
Erasure coding versus negative coding: what is the difference?

Answer
In the verbose output of a Hadoop or mapred job, you may have seen “INFO mapreduce.JobResourceUploader: Disabling Erasure Coding for path:”

Erasure coding is a fault-tolerant storage mechanism.  Like replication the usable capacity of the disks participating in such a mechanism is not fully utilized as in a RAID 0 configuration. 

Are There Similarities or Differences between Negative Coding and Throw-away Prototyping?

Question
What is the difference between negative coding and throw-away prototyping?

Answer
“Plan to throw one away…” -Frederick P. Brooks, Jr. (Taken from page 266 of The Mythical Man-Month).

Both negative coding and throw-away prototyping involve eliminating lines of code.  But this is the only similarity they have.  Negative coding is contrasted from throw-away prototyping in that the former is a good practice for production systems and long-term use whereas the latter is designed to be temporary. 

How Do You Write a Tic-Tac-Toe Game in Python?

Updated on 9/17/19 to support version 2 and version 3 of Python

Arguably the oldest video games was a variation of Tic-tac-toe.  To read more about this, see this link.  Many English-speaking countries outside the U.S. refer to the game as Noughts and Crosses (according to Wikipedia). 

In the U.S., November 11th is the day America observes Veteran’s Day

How Do You Create a Chef Recipe to Install Java on Linux Chef-Client Nodes?

Problem scenario
You have Linux servers that need Java 1.8 installed on them.  How do you write a Chef recipe to deploy Java?

Solution
Prerequisite
This solution requires that the Chef server must have access to GitHub.  If you want to install Chef server, see this posting.  If you want to install Chef client, see this posting