Problem scenario: Yum commands to install packages are not working. When you use "yum install coolpackage" you get an error like this:
' http://mirror.centos.org/altarch/7/os/i386/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error" Trying other mirror. https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.dockerproject.org; Unknown error" Trying other mirror.
... One of the configured repositories failed (Docker Repository), ...
failure: repodata/repomd.xml from dockerrepo: [Errno 256] No more mirrors to try. https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: yum.dockerproject.org; Unknown error" '
You cannot use curl or wget properly. You try this command (with no quotes): "curl http://www.google.com"
But you get this error: "curl: (6) Could not resolve host: www.google.com; Unknown error"
What do you do?
Root cause: DNS resolution is not working for your Internet connectivity. You must configure a DNS server for your network interface.
Solution 1. cd /etc/sysconfig/network-scripts
2. Backup the interface file that governs the IP address with the default gateway. If you are not sure which file this is, follow these directions. For a standard CentOS 7.x server, the file will be ifcfg-enp0s3 file. Once this file is backed up, modify the original one.
3. Make sure these two stanzas exist in the file that governs the default gateway:
DNS1=8.8.8.8 DNS2=8.8.4.4
For example, the last four lines of this file /etc/sysconfig/network-scripts/ifcfg-enp0s3 may look like this:
Question When did automation become a division or a department in a business? When did the term automation start to be used regularly?
Answer A competitive market will push companies to be competitive. With the conclusion of World War 2, America transitioned to a peace time economy. Detroit stopped producing large numbers of tanks and started producing large numbers of cars. 1947 was the year Ford created its automation department (www.assemblymag.com). The first recorded use of the word automation was in the last half-decade of the 1940s (Dictionary.com).
Problem scenario: You are using RHEL 7.x via AWS. You want to install Kubernetes. What do you do?
Solution 1. Log into the Linux server as ec2-user. Then run this command: sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
2. Create this file: /etc/yum.repos.d/kubernetes.repo 3. Have this be the content of the file (with the first line being "[kubernetes]" and the last line ending in "...rpm-package-key.gpg":
Problem scenario You want to deploy a Kubernetes cluster in AWS. You have an Ubuntu server (e.g., with a nano flavor in AWS or a minimally powered Azure instance). It has no software packages installed on it (e.g., it does not have Docker or Kubernetes). How do you deploy Kubernetes in AWS?
Solution Warning: This will automatically create EC2 servers in you AWS account behind the scenes. It will cost money to do this. The conjure-up program uses Juju and will create multiple machines of the medium flavor. Your AWS account will be billed if you follow these directions.
1. Log into an Ubuntu server using Putty. (This machine does not have to be in AWS. The machine does not need much RAM or more than one vCPU.) Maximize the Putty window.
2.a. As a regular user (the user cannot be root here), enter this command: sudo snap install conjure-up --classic 2.b. Run this command (and follow the subsequent interactive prompts): juju add-credential aws 2.c. Run this command: conjure-up kubernetes 2.d. If you get prompted from the "conjure-up kubernetes" command, choose "y".
3.a. At the menu of choices, choose "Kubernetes core." 3.b. For "Where would you like to deploy?" choose "AWS" and press enter. 3.c. To the next prompt for credentials, choose the appropriate one.
4. Choose "Deploy New Self-Hosted Controller." Do NOT choose Juju-as-a-Service (JaaS) Managed controller.
5. 'For the "Network Plugin" option, choose flannel.'
6. Enter the password for the ubuntu user at the prompt for a "sudo" password.
7. When prompted, choose "DEPLOY". (This will deploy all seven remaining items.) When you see "Juju Controller is initializing. Please wait." You may observe a delay on the step that says "Attempting to connect to x.x.x.x:22" You may want to make sure your Ubuntu server is in a security group that accepts inbound connections to the IP address x.x.x.x.
8. The next steps may take 30 minutes. You may want to monitor progress by watching two things. First you may want keep an eye on your Putty session to your Ubuntu virtual server. For example, it will look like this:
You do not need to be logged into the AWS console. If you are logged into the AWS console with your web browser, you may also want to refresh your "Instances" dashboard to watch the EC2 machines being created. Depending on which AWS region you chose, you may need to change the region. You will probably see a message that says "Your big software is deployed, press the (Q) key to exit." Press the "q" key. You may be prompted "Do you want to quit?", choose "yes".
9.a. If your Putty session to your Ubuntu server prompts you, choose "Run" to "Download the kubectl client program to your local host." If you did this, choose "Run" again to the prompt about "kubectl get nodes" etc.
9.b. You may just see "Your deployment is now complete." You will see a message about your deployment being complete. You can go to the URLs (via a web browser) as they are listed. If you do, you will be prompted for credentials. To find these credentials, go to the Putty session and press "Enter" to quit.
(Instead of seeing that your deployment is complete, you may see a message about a problem with the installation. This may or may not be ignorable. Copy the path(s) to any relevant logs. You may want to review them. You may be able to proceed as if nothing was wrong. You may not see the URL you need. If that is the case, step 9c may help you.)
Then run this command: kubectl config view The results of this command will give you credentials for the "admin" user for the web UI (aka Kubernetes dashboard).
9.c. The URL in the above command's results is for the APIs. You'll see various API options (for future RESTful development etc.) if you go to it. From the command prompt of the Linux server from which you set up Kubernetes with, run this command to find the URL of the dashboard of the newly deployed Kubernetes cluster:
kubectl config view | grep server | awk '{print $2"/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/"}'
The resulting URL from the command above is for the real GUI dashboard. Go to the URL via a web browser and if you are prompted to upload a kube config file for authentication, clicking "Skip" may work for testing in a non-production environment.
10. Remember to delete those new AWS EC2 instances or your bill will be higher than you expected.
Problem scenario: When trying to compile a C++ program (e.g., $ gcc hello.cpp), you receive this error: "gcc: error trying to exec 'cc1plus': execvp: No such file or directory"
What do you do?
Solution Install gcc-c++. For a RedHat distribution of Linux, use this command:
Problem scenario: You want to use Oracle VirtualBox or some other hosted hypervisor with your HP Probook laptop. You need "Virtualization Technology (VTx)" enabled. How do you do this?
Solution
1. Boot up. When you see the "HP" splash screen (a blue image with a black background), press F10.
2. At the prompt, "Log in as a Guest User" choose "Yes." (This step may be crucial to your success.)
3. Go to the Advanced tab.
4. Go to "device Configurations"
5. Check the box for "Virtualization Technology (VTx)"
6. Click Save.
7. Exit and save the changes whenever you are prompted.
Problem scenario: Using the C programming language, you want to write a program that produces a file (we'll call it contint.txt) that has the following content:
1 2 3 4 5 6 7 8 9 a b c d e f
Solution Overview of the approach: Hexadecimal numbers use base 16. So "a" is the equivalent of 10, and "f" is the equivalent of 15. You want to use "%x" parameter associated with the fprintf function to convert regular (base 10) integers into their hexadecimal equivalents.
1. Create this file (we'll call it contint.c):
#include<stdio.h>
int main() { FILE *contintptr; int x;
contintptr=fopen("contint.txt", "w");
if (!contintptr) return 1;
for (x=1; x<=15; x++) fprintf(contintptr,"%x\n", x); //the "%x" translates the variable into a hexadecimal.
fclose(contintptr);
return 0; } //end of file
2. Compile it with this command:
gcc contint.c
3. Run the compiled binary: ./a.out
4. You are done. View contint.txt for your output.
Problem scenario You are trying to establish a connection with a username and password to a Postgres database using PHP. You have a PHP file like this:
Every time you run this above file, we'll call foo.php, you get an error. You run this:
php foo.php
But this results in an error like this:
'PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user "contint" in /tmp/contint.php on line 7 Error : Unable to open database'
Your pg_hba.conf file has a stanza like this:
host all all 127.0.0.1/32 md5
You therefore think that because you are passing a username and password, the authentication should be successful. The database's owner is the role (or username) that you are using. You restarted Postgresql services. Why do you keep getting this error?
Solution Look in the /var/lib/pgsql/data/pg_hba.conf file. You may find this stanza above the stanza with the "md5":
host all all 127.0.0.1/32 ident
Comment out the above line with "ident" using a # at the far left. Try running the PHP script again.
The news below is focused on the legal issues of computing, intellectual property (copyrights, patents and trademarks), science and technology. The external links are to reputable websites.