How Do You Find the Web UI of a GitLab Server on Your Network?

Problem scenario
You inherited a GitLab server on your network to manage. You want to find the front end of the URL. What should you do?

Solution
Find the external IP address. Log into the back-end. If it has access to the internet, run this command: curl icanhazip.com

If you have no access to the internet, run this command: ip addr show

Use the IP addresses exhaustively in a web browser with a port in this fashion (where ppp should be replaced with the port number you want to try): http://x.x.x.x:pppp

The port number may be one to five numbers long.

…

What Type of Linux File Has Permissions That Are Symbolized with a “c”?

Problem scenario
You run this command: sudo ls -lh /dev

You see output like this:

crw-rw—- 1 root tty 7, 131 Dec 23 19:20 vcsa3
crw-rw—- 1 root tty 7, 132 Dec 23 19:20 vcsa4
crw-rw—- 1 root tty 7, 133 Dec 23 19:20 vcsa5
crw-rw—- 1 root tty 7, 134 Dec 23 19:20 vcsa6

You want to know if the “c” is a link to another file or something else.

…

How Do You Get Molecule Commands to Work when You Get “Unable to contact the Docker daemon”?

Problem scenario
When in virtualenv you try to run a Molecule command. But you get this message:

ERROR: Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon

What should you do?

Solution
1. Exit virtualenv. Run this command: deactivate

2. Go back into virtualenv (e.g., run a command like this source my_env/bin/activate).

…

How Do You Get JavaScript to Present in a Web Browser?

Problem scenario
You have a .js file on your desktop or on a web server. You want to have the code execute and present itself nicely (not just see the raw code) in a web browser. How do you do this?

Solution
You must use the .html extension. You must have

<html</html

tags. Here is an example. Name this file contint.html and place it on your desktop,

…

How Do You Use awk for String Replacement of Lines where the Word to Be Replaced Is in the Same Position?

Problem scenario
You want to substitute the nth word of a given line. How do you use awk to accomplish this?

Solution
Let’s assume the lines that you want to modify are in goodfile.txt. To replace the fourth item in the string with “new string”, run this command:

cat goodfile.txt | awk ‘{ print $1 ” ” $2 ” ” $3 ” new string ” $5 ” ” $6 }’

…

How Do You Troubleshoot a Bash Script Copied from the Internet?

You have one of the following two problems:

Problem scenario #1
Your GCP startup-script is not working. You do not know why. What should you do?

OR

Problem scenario #2
A bash script is not working. It stops executing after a certain line. There are few clues as to what is wrong.

Solution
Did you copy the script from a webpage?

…

How Do You Get the “Up” Arrow to Show a Previous Command in Linux?

Problem scenario
When you press the up arrow on the keyboard you see ” ^[[A”. You want to see the previous command that was entered. How do you enable history at the command line?

Solution
Root cause: The /etc/passwd file has an entry like this:

cooluser:x:1001:1002::/home/cooluser:

(This could be caused if you created the user quickly with a useradd command.)

Procedures

Run this command: sudo cat /etc/passwd | grep $(whoami)

Do you see a /bin/bash at the end?

…