How Do You Troubleshoot an s3cmd Error About “.s3cfg: None”?

Problem scenario
You are trying to run an s3cmd command (e.g., s3cmd ls), but it is not working.  You run an s3cmd command and you get this:

ERROR: /home/jdoe/.s3cfg: None
ERROR: Configuration file not available.
ERROR: Consider using –configure parameter to create one.

What do you do?

Possible Solution #1
1.  sudo find / -name .s3cfg
2. 

How Do You Install a Pythonic Implementation of Apache Thrift?

Problem
You want thriftpy installed to deploy Apache Parquet.  How do you install thriftpy?

Solution
Prerequisite

Install pip.  If you need assistance, click on the link according to your distribution of Linux:
CentOS/RHEL/Fedora (most newer versions)
RHEL 6.x
Debian/Ubuntu
SUSE

Procedure
Run this command:  pip install thriftpy

How Do You Use Python to Process (and Thereby Clean) a Flat File That Is a List of Email Addresses with Extraneous Symbols?

Problem scenario
You have an input file (.txt) that is a list of email addresses.  The file is guaranteed to have one of the following: one or more spaces between each email address or there is certainly a new line between the each email address.  Beyond that there can be one or two commas after the email address.  There could also be one or two semicolons after the email address. 

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 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.

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 Write a Python Program That Can Run Linux Bash Commands?

Problem scenario
You want to use Python to run Linux commands.  You have been told to not use the “import os” for this task.  You want to manipulate the text and output of Bash commands for sophisticated processing and automation with Python.  How can a Python program run Bash commands?

Solution
Use “from subprocess import check_output” as the first line.  Then encapsulate the Bash command inside double quotes,

How Do You Troubleshoot the Problem “ImportError: Entry Point (‘console_scripts’, ‘Parquet’) Not Found”?

Problem scenario
You are trying to run Apache Parquet commands.  But each command gives this error:

Traceback (most recent call last):
  File “/usr/local/bin/parquet”, line 11, in <module>
    load_entry_point(‘parquet==1.2’, ‘console_scripts’, ‘parquet’)()
  File “/home/ubuntu/.local/lib/python2.7/site-packages/pkg_resources/__init__.py”, line 570, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File “/home/ubuntu/.local/lib/python2.7/site-packages/pkg_resources/__init__.py”, line 2750, in load_entry_point
    raise ImportError(“Entry point %r not found” % ((group, name),))
ImportError: Entry point (‘console_scripts’,