How Do You Troubleshoot the Java Error “class … is public, should be declared in a file named foobar.java”?

Problem scenario
You copied a Java program from the Internet.  You named the file foobar.java.  You try to compile it (e.g., with "javac foobar.java"), but you get this error:

foobar.java:6: error: class ContInt is public, should be declared in a file named ContInt.java
public class ContInt
       ^
1 error

What do you do?

Solution
Rename foobar.java to be ContInt.java.

A List of RESTful API Books

API Management: An Architect's Guide to Developing and Managing APIs for Your Organization by Brajesh De
APIs: A Strategy Guide: Creating Channels with Application Programming Interfaces by Daniel Jacobson, Greg Brail and Dan Woods
ASP.NET Web API: Build RESTful web applications and services on the .NET framework by Joydip Kanjilal
Build APIs You Won't Hate: Everyone and their dog wants an API, so you should probably learn how to build them by Phil Sturgeon
Building a RESTful Web Service with Spring by Ludovic Dewailly
Building RESTful Python Web Services by Gaston C. Hillar
Client-Server Web Apps with JavaScript and Java: Rich, Scalable, and RESTful by Casimir Saternos
Developing Web Apps with Haskell and Yesod: Safety-Driven Web Development by Michael Snoyman
Diving into ASP.NET WebAPI: Learn REST services in .Net : A Practical Approach by Akhil Mittal
Go Programming Blueprints - Solving Development Challenges with Golang by Mat Ryer  
Grails in Action by Peter Ledbrook and Glen Smith
Introduction to JavaScript Object Notation: A To-the-Point Guide to JSON by Lindsay Bassett  
Professional Java for Web Applications by Nicholas S. Williams  
Pro RESTful APIs: Design, Build and Integrate with REST, JSON, XML and JAX-RS by Sanjay Patni
Rails 4 in Action: Revised Edition of Rails 3 in Action by Ryan Bigg, Yehuda Katz, Steve Klabnik and Rebecca Skinner
REST: Advanced Research Topics and Practical Applications by Cesare Pautasso, Erik Wilde and Rosa Alarcon
The REST API Design Handbook by George Reese
REST API Design Control & Management: DevOp Series by Alasdair Gilchrist
REST API Design Rulebook: Designing Consistent RESTful Web Service Interfaces by Mark Masse
RESTful API Design (API-University Series) (Volume 3) by Matthias Biehl
RESTful Java Patterns and Best Practices by Bhakti Mehta
RESTful Java Web Services - Second Edition by Purushothaman Jobinesh
RESTful Java Web Services Security by Rene Enriquez and Andres Salazar C.
RESTful Java with JAX-RS 2.0: Designing and Developing Distributed Web Services by Bill Burke
RESTful Rails Development: Building Open Applications and Services by Silvia Puglisi
RESTful Web API Design with Node.JS - Second Edition by Valentin Bojinov
RESTful Web API Handbook by Michael Bohner
RESTful Web Clients: Enabling Reuse Through Hypermedia by Mike Amundsen
RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity by Subbu Allamaraju
RESTFul Web Service Development with Jersey 2.x by Han Sun
RESTful Web Services with Dropwizard by Alexandros Dallas
RESTful Web Services with Scala by Jos Dirksen
RESTful Web APIs: Services for a Changing World by Leonard Richardson, Mike Amundsen and Sam Ruby
REST in Practice: Hypermedia and Systems Architecture by Jim Webber, Savas Parastatidis and Ian Robinson
Restlet in Action: Developing RESTful web APIs in Java by Jerome Louvel , Thierry Templier and Thierry Boileau
Scalatra in Action by Dave Hrycyszyn, Stefan Ollinger and Ross A. Baker 
Understanding RESTful Web Services by Van Nguyen

What Do You Do If You Run an Ansible Command and You Receive an Error “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e”?

Problem scenario
You run an Ansible command.  But you get an error like this:

" UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e
-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56:"

What should you do?

Solution
On the Ansible control server find the ansible.cfg file (find / -name ansible.cfg).  If you not using Mac OS, this stanza should not be in your ansible.cfg file:

control_path = ~/.ssh/ansible-ssh-%%C

Comment out the above stanza if you are using Ansible on Linux (e.g., Linux SUSE or a RedHat or Debian derivative).  Then run your ansible command.  The problem should be fixed.  

The root cause is that "~/.ssh/ansible-ssh-%%C" is appropriate for MacOS deployments of Ansible and not regular Linux.

How Do You Create a New User on a Windows 2016 Server with PowerShell?

Problem scenario
You want to use PowerShell to create a local user on the server.  What command do you run to do this?

Solution
1.  Open PowerShell as Administrator.  
2.  Run this (but replace "jane" with the username you want):   New-localuser -Name jane
# respond to the pop-up GUI with a password that is reasonably strong.

How Does the Dictionary Definition of Automation Relate to Software GUI Automation?

Question
How does the dictionary definition of automation relate to software GUI automation?

Answer
The most common definition (and first-listed) of the word automation on Dictionary.com's website is "the technique, method, or system of operating or controlling a process by highly automatic means, as by electronic devices, reducing human intervention to a minimum."  Attended and unattended robotic process automation solutions can greatly enhance productivity and reduce the likelihood of errors.  To learn more about RPA see this posting that defines it or this posting that gives insight into when it should be used.

How Do You Select More RAM to Purchase for Your Desktop and Know the Difference between DDR3 and DDR4 RAM?

Problem scenario
You want to buy more RAM for your desktop computer.  You find it is frequently memory constrained (e.g., when you look at the Task Manager if it is running Windows or use the top utility from a Linux command prompt.  What should you do?

Solution
Know the difference between DDR3 and DDR4 RAM.  If you want to read an article about the difference between DDR3 and DDR4 RAM, see this link

DDR4 RAM costs more.  Here is a link to DDR4 RAM if you want to buy some.  For buying more affordable DDR3 RAM, see this link.

Beware, many motherboards support either DDR3 or DDR4.  Only a few can support either.  Even then the slots themselves are dedicated to either DDR3 or DDR4; one slot can support only one type (DDR3 or DDR4) however.

Aside from the type DDR3 and DDR4, attributes of RAM that should affect the purchasing consideration include the bus speed (measured in Mhz) and the size of the RAM (measured in GB).  You want your memory to perform well for the price that you pay.

A List of VMware vSphere Books

Automating vSphere with VMware vCenter Orchestrator (VMware Press Technology) by Cody Bunch
Building Blocks: vSphere 6.0 and vCenter 6.0 by Tom Burge  and Calvin Kohler-Katz
Cloud Computing, A Practical Approach by Toby Velte,  Anthony Velte  and Robert Elsenpeter
Critical VMware Mistakes You Should Avoid by Larry Loucks  and Rajen Guendoo
Disaster Recovery using VMware vSphere Replication and vCenter Site Recovery Manager - Second Edition by Abhilash G B
Enterprise Java Applications Architecture on VMware by Emad Benjamin
IBM System Storage N Series With Vmware Vsphere 5 by IBM Redbooks
It Architect: Foundation in the Art of Infrastructure Design: A Practical Guide for It Architects by Vcdx-001, John Yani Arrasjid
Learning PowerCLI by Robert van den Nieuwendijk
Learning PowerCLI - Second Edition by Robert van den Nieuwendijk        
Learning Veeam® Backup and Replication for VMware vSphere by Christian Mohn
Learning VMware vSphere by Abhilash G B  and Rebecca Fitzhugh
Managing and Optimizing VMware vSphere Deployments (IT Best Practices) by Sean Crookston  and  Harley Stagner
Mastering PowerCLI by Sajal Debnath
Mastering VMware vSphere 5 by Scott Lowe
Mastering VMware vSphere 5.5 by Scott Lowe , Nick Marshall, Forbes Guthrie, Matt Liebowitz  and Josh Atwell
Mastering VMware vSphere 6 by Nick Marshall, Scott Lowe , Grant Orchard  and Josh Atwell
Mastering VMware vSphere Storage by Victor Wu and Eagle Huang
Maximum vSphere: Tips, How-Tos, and Best Practices for Working with VMware vSphere 4 by Eric Siebert  and Simon Seagrave
Networking for VMware Administrators (VMware Press Technology)  by Christopher Wahl  and Steve Pantol
PowerCLI Cookbook by Philip Sellers
PowerCLI Essentials by Chris Halverson
Storage Design and Implementation in vSphere 6: A Technology Deep Dive (2nd Edition) (VMware Press Technology)  by Mostafa Khalil
Storage Implementation in vSphere 5.0 (VMware Press) by Mostafa Khalil
Study Blast VMware Certified Professional - Datacenter Virtualization VCP5-DV Study Guide: VM Ware VCP-510 (VCP5-DV - VCP5-DCV) by Matt Satori
Troubleshooting vSphere Storage  by Mike Preston
VCA-DCV VMware Certified Associate on vSphere Study Guide: VCAD-510  by Robert Schmidt  and Dane Charlton
VCA/VCP6-DCV on VMware vSphere 6 All-In-One Exam Guide (Exams 1V0-601 & 2V0-621) by Tim Garlick
VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: Exam VCP-550 by Brian Atkinson
VCP5 VMware Certified Professional on vSphere 5 Study Guide: Exam VCP-510 by Brian Atkinson
VCP6-DCV Official Cert Guide (Exam #2V0-621) (3rd Edition) (VMware Press Certification) by John A. Davis, Steve Baca and Owen Thomas
VCP6-NV Official Cert Guide (Exam #2V0-641) (VMware Press Certification) by Elver Sena Sosa
VCP6-DCV: VMware Certified Professional-Data Center Virtualization on vSphere 6 Study Guide: 2V0-621 by Wiley
VCP VMware Certified Professional on vSphere 4 Study Guide: Exam VCP-410 by Brian Perry, Chris Huss  and Jeantet Fields
Virtualization Changes Everything: Storage Strategies for VMware vSphere & Cloud Computing  by Vaughn Stewart  and Michael Slisinger
Virtualization Essentials by Matthew Portnoy
Virtualization Security: Protecting Virtualized Environments by Dave Shackleford
Virtualizing and Tuning Large Scale Java Platforms (VMware Press Technology) by Emad Benjamin
Virtualizing Microsoft Business Critical Applications on VMware vSphere (VMware Press Technology) by Matt Liebowitz  and Alexander Fontana
Virtualizing Oracle Databases on vSphere (VMware Press Technology) by Kannan Mani and Don Sullivan
Virtualizing SQL Server with VMware: Doing IT Right (VMware Press Technology) by Michael Corey, Jeff Szastak  and  Michael Webster
VMware Cookbook: A Real-World Guide to Effective VMware Use  by Ryan Troy and Matthew Helmke
VMware NSX for vSphere Essentials: A practical guide to implementing Network Virtualization (VMware Press Technology) by Anthony Burke, Andreas la Quiante and Neil Moore
VMware Software-Defined Storage: A Design Guide to the Policy-Driven, Software-Defined Storage Era  by Martin Hosken
VMware vSphere 4 Implementation by Mike Laverick
VMware vSphere 5 Clustering Technical Deepdive by Duncan Epping  and Frank Denneman
VMware vSphere 5.1 Clustering Deepdive (Volume 1) by Duncan Epping  and Frank Denneman
VMware vSphere 5.1 Cookbook by Abhilash GB
VMware vSphere 5.5 Cookbook by Abhilash G B
VMware vSphere 5.5 Essentials by Kunal Kumar  and Christian Stankowic
VMware vSphere 5.x Datacenter Design Cookbook by Hersey Cartwright
VMware vSphere 5® Building a Virtual Datacenter (VMware Press Technology) by Eric Maille and René-Francois Mennecier
VMware vSphere 6.X Datacenter Design Cookbook - Second Edition by Hersey Cartwright
VMware vSphere and Virtual Infrastructure Security: Securing the Virtual Environment by Edward Haletky
VMware vSphere Datastore Clustering - Quick Guide by Ronan Smyth
VMware vSphere Design by Forbes Guthrie, Scott Lowe  and Kendrick Coleman
VMware vSphere Design Essentials by Puthiyavan Udayakumar
VMware vSphere ESXi Installation Guide by Ronan Smyth
VMware vSphere For Dummies by Daniel Mitchell  and Tom Keegan
VMware vSphere Performance: Designing CPU, Memory, Storage, and Networking for Performance-Intensive Workloads by Matt Liebowitz, Christopher Kusek  and Rynardt Spies
VMware vSphere PowerCLI Reference: Automating vSphere Administration by Luc Dekens , Alan Renouf, Glenn Sizemore, Arnim van Lieshout  and  Jonathan Medd
VMware vSphere PowerCLI Reference: Automating vSphere Administration by Luc Dekens, Jonathan Medd, Glenn Sizemore, Brian Graf, Andrew Sullivan and Matt Boren
VMware vSphere Resource Management Essentials by Jonathan Frappier
VMware vSphere Security Hardening Guide by Ronan Smyth
VMware vSphere Troubleshooting by Muhammad Zeeshan Munir
vSphere 6 Foundations Exam Official Cert Guide (Exam #2V0-620): VMware Certified Professional 6 (VMware Press) by Bill Ferguson
VMware VI and vSphere SDK: Managing the VMware Infrastructure and vSphere by Steve Jin
vSphere Design Best Practices by Brian Bolander  and Christopher Kusek
vSphere 4.0 Quick Start Guide: Shortcuts down the path of Virtualization by Duncan Epping, Alan Renouf, Bernie Baker, Thomas Bryant  and Stuart Radnidge
vSphere Design Pocketbook 2.0: Blog Sized Design Considerations for Your Software Designed Data Center by Frank Denneman
vSphere High Performance Cookbook by Prasenjit Sarkar
vSphere High Performance Cookbook - Second Edition by Christopher Kusek Bio and Kevin Elder
vSphere High Performance Essentials by Christian Stankowic
vSphere Security Cookbook by Mike Greer
vSphere Virtual Machine Management by Rebecca Fitzhugh

How Can Variables Be Carried across Multiple PHP Pages (Not Just Immediate Subsequent Pages)?

Problem scenario
You want to pass variables from user input and have them carry across multiple pages.  You may or may not want the immediate subsequent page to use the variables.  You want pages (.php files) after several clicks of navigation (two pages or more) to employ the variables that were read in or calculated via PHP pages.

You are using session_set() and/or session_start() but they are not working.  Your $_SESSION['variablename'] usage is not working as you expect.  What do you do to have global variables so you can take in user input from one page and have pages two pages away use those variables?

Solution
Use session_start() above any HTML code on the page after the "Submit" button was clicked.  That is, on a page that has the $_POST['varname'] available, use the session_start() PHP function before any HTML code.  Do not use session_set() for a modern version of PHP.  Here are three pages below that can work as an illustration.  To use them, you'll put them all in the same directory.  The first one will read in user input.  The second page acts as an intermediate page.  The third page (arrived to by clicking a button on the second page), has access to the global variables which are the user input.

1.  one.php should have the following content:

<html>
<body>
<h2> Welcome to page 1.  Enter your credentials here.</h2>
<form action="two.php" method="post">
UserName: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit">
</form>

</body>
</html>

2.  two.php should have the following content:

<?php
   session_start();
   $_SESSION['username'] = $_POST['username'];
   $_SESSION['password'] = $_POST['password'];
?>
<html>
<body>
<h2> Welcome to page 2.  Click submit to proceed to the third page.  </h2>
<form action="three.php" method="post">
<input type="submit">
</form>

</body>
</html>

3.  three.php should have the following content:

<?php
   session_start();
   echo "The username you entered on the first page was ";
   echo $_SESSION['username'];
   echo ".";
   echo "\n";
   echo "This proves the variable is global.";
   $var1 = $_SESSION['username'];  //This is a suggestion for PHP coding.
?>

4.  Go to http://x.x.x.x/one.php and enter any username and password you like.  Make sure the username is not blank.  Click "Submit query."  Click "Submit query" again.

How Do You Quickly Install Several Python Packages Such as Pycrypto and Paramiko on RedHat Linux?

Problem scenario
How do you install pycrypto, paramiko and the several related packages without copying several individual packages on a RedHat Linux server?

Background
It can be tedious getting the different dependencies of python packages installed.  By downloading various .tar.gz files, you have to unpack them, then run a series of "python setup.py ..." commands. While it is not advisable to install more packages than are strictly necessary, there are some benefits to doing it (e.g., having these features available to you).

Solution
Install pip, Ansible and other packages.  Run these commands as root:

yum -y update
yum -y install java gcc python-openssl openssl-devel openssl
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip install ansible

How Do You Install Java on an AWS Instance of RHEL?

Problem scenario
You are using RedHat Enterprise Linux 7.x in AWS.  How do you install Java?

Possible Solution #1
Use this posting as it is preferred. Below is an alternative.

Possible Solution #2
This will install Java 1.8.x.

1. Create a file named java.sh with this as the content:

yum -y install java-1.8.0-openjdk*
JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk
echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' >> ~/.bashrc
source ~/.bashrc
sudo -s
sudo -s source /etc/environment

2.  Run this command: sudo -s source java.sh

3.  You are done.  To test, you can run java -version and echo $JAVA_HOME. If you are having network issues, you may want to view this posting.