How To Create IP Addresses On a Linux Server without Corresponding NICs

If you do not want to create new interfaces, just new IP addresses, use these commands:

ip addr add 33.33.33.38/28 brd + dev eth0
ip addr add 33.33.33.39/28 brd + dev eth0
ip addr add 33.33.33.40/28 brd + dev eth0

# Replace the IP addresses and subnet masks as you desire.

The IP addresses will go away upon rebooting.  You may want multiple IP addresses on new “semi-virtual” interfaces on a Linux server. 

 » Read more..

Troubleshooting DSC for Configuration Management (Problem and Solution)

Background:  DSC is a toolkit of PowerShell cmdlets that enable you to do configuration management.  It can allow you to do CM tasks with Windows and Linux machines (https://msdn.microsoft.com/en-us/powershell/dsc/LnxGettingStarted).

Problem/Scenario:  You are trying to use this PowerShell command (e.g., to test your Desired State Configuration tool):

Enter-PSSession -ComputerName goodServer -Credential jdoe

# where goodServer is a Windows server on the network and jdoe is a local user account on the goodServer machine.

 » Read more..

What does the I.T. term “bootstrap” mean?

Bootstrap

Definition 1 (transitive verb) of bootstrap:  To turn on a computer so that the operating system is completely functional.  Source:  The fifth definition of “bootstrap” in Dictionary.com is specific to “computers.” 

Definition 2 (transitive verb) of bootstrap:  To intentionally initiate multiple subprocesses (especially a primarily automatic sequence of often incremental subprocesses), as in a batch execution, from a single file or action.

Examples of definition 2: 
“Between the advent of handy tools,

 » Read more..

How Do You Troubleshoot the Docker problem “Error response from daemon: Cannot start container”?

Problem scenario
Sometimes you try to start a Docker container but there is a problem.  For example you try:
docker start <containerID
But you receive this: “Error response from daemon: Cannot start container <containerID: failed to create endpoint <nameon network bridge: ip tables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 80 -j DNAT –to-destination x.x.x.x:80 ! -i docker0: iptables: No chain/target/match by that name.”

Solution
cd /var/lib/docker/network/files/
ls -lh /tmp/forposterity
mkdir /tmp/backupdir
mv /var/lib/docker/network/files/ /tmp/backupdir
systemctl restart docker
 #change this command depending on your distribution and version of Linux to restart Docker services

 » Read more..

How To Port Forward (redirect traffic destined for an IP address to a specific port)

Scenario:  On a Linux server, it can be useful to send traffic destined to a certain IP address to a different port on the server.  The listening service could be unique insofar as its port number has been designated.  The listening service could be a Docker container or a guest virtual machine.
Method:  iptables -t nat -A PREROUTING -i eth3 -p tcp –dport 80 -j DNAT –to 91.91.91.91:81
Explanation: 

 » Read more..

Saving a Docker Image and Using It On A Different Server

Problem Scenario
Sometimes the “docker save” command does not work as you would expect.  You run the command on a Docker host, but it does not work.  You might even try the -o flag or the –output=/tmp/destinationFileName.tar option.  But the response may be an surprising error “Cowardly refusing to save to a terminal. Use the -o flag or redirect.”  You want to copy a Docker image from one machine to another computer but problems get in your way. 

 » Read more..

How To Import A Copy of An Existing GitLab project

Problem scenario:  You want to copy a GitLab project from one instance of GitLab to a new instance of GitLab.  The Git repository you want to copy to a new GitLab server is not presented via the git://, http://, nor https:// protocols.    

Prerequisites:  You have root access to the back end of the server with the GitLab.

Method of Solution:
1) 

 » Read more..

How To Enter the Web UI of Gitlab CE without Setting Up Its Backend Email

Problem scenario:  When you bring up the web UI for GitLab CE (Community Edition) for the first time, you are prompted to enter a new password twice.  This password will be for the admin@example.com username.  If someone else set it up and failed to provide you with the username, and the back end email has not been configured, follow these directions.
Prerequisite:  You must have root access.
Solution: 

 » Read more..

Having Two Docker Containers Share A Directory on the Host

Goal: You want two Docker containers to use the same file share on the Docker server from time to time.  

Problem/Error blocking goal:  In a Docker container, when you try to change directories to a directory that is on the Docker host (e.g., the docker container was created with the –volume flag), and you get an error “bash: cd <directoryname> permission denied,” you have to run two commands to fix it. 

 » Read more..

How To Fix a Docker Container That Is Giving An Error ‘exec “bash”: executable file not found in $PATH’

Normally you can enter a Docker container with this command:
docker exec -it <containerIDbash
It is possible you receive an error that says ‘exec “bash”: executable file not found in $PATH’
The root cause could be related to insufficient disk space on the Docker host.  Delete files or otherwise make room (e.g., add disk space).  Then stop the container with this command: docker stop <containerID
Finally,

 » Read more..