Problem scenario
You want to see if the immutable flag is set on a file. What do you do?
Solution
Run this command: sudo apt -y install e2fsprogs
A Technical I.T./DevOps Blog
Problem scenario
You want to see if the immutable flag is set on a file. What do you do?
Solution
Run this command: sudo apt -y install e2fsprogs
Problem scenario
You get "command not found" when you try to run "chattr". What should you do?
Solution
Run this command: sudo apt -y install e2fsprogs
Question
Ping is a common diagnostic tool in networking technology. It is essentially an echo request to confirm an IP address is up and accessible. Where does the term ping come from?
Answer
The acronym for "packet inter-network groper" seems like it is a backronym for the trademarked table tennis game which involves a lightweight ball being returned in the opposite direction that it was sent. It seems that the history was based on one half of the ping-pong game (where a ball is returned after it is sent). According to TechTarget however, the ping command's etymology is onomatopoeic and based on submarine technology. See this TechTarget page for more information.
Problem scenario
How do you find files on a Linux server that consume more than one gigabyte of space?
Solution
Run this command: sudo find / -size +1G -type f -print
Problem scenario
Docker Hub is a public registry for containers. Does OpenShift support something like this? You know they have the OpenShift Container Registry -- but this is private to a given OpenShift instance. Red Hat owns OpenShift. Is there a public registry supported by Red Hat?
Answer
Yes. It is called Quay.io. If you want a brief overview of it, see this external posting.
Problem scenario
You know the kubectl version that is running on your client machine. How do you determine the version that your Kubernetes master node is running?
Solution
From the client machine, run this command: kubectl version | grep Server
Problem scenario
You want to create a CMK in Amazon web servers. What do you do?
Solution
Use Secrets Manager with Amazon's Key Management Service.
1. Log into the AWS console.
2. Go to "Key Management Service"
3. Click on "Create key"
4. Enter an "Alias". Normally you won't click on the "Advanced options" unless you have a special reason. Click "Next".
5. Respond to the prompts and click "Next" until you get to the end. You will be given the opportunity to configure the key to have certain Amazon roles administrative permissions and key usage permissions.
The key administrators will be able to administer the key itself to other users/roles. The users of the key will be able to encrypt and decrypt based on the key. If you want to create your own Amazon roles, see this posting.
6. Click "Finish"
Problem scenario
You have a .zip file, on your Linux server, that you want to uncompress. You do not have unzip installed on your machine. What should you do?
Possible Solution #1
Install unzip. If you are using a Debian/Ubuntu distribution of Linux, run this: sudo apt -y install unzip
Possible Solution #2
You could use WinSCP to download the file to your Windows workstation. Then you could extract the files on the Windows workstation. Then you could transfer the uncompressed files back over.
Problem scenario
You want to use custom modules (e.g., .py files that will be called by another Python program). You are trying to figure out which location(s) the Python interpreter will look for such modules. How do you determine the directory where Python will look when it uses the "import" key word?
Solution
Run these three commands (the first is a Bash command and the other two are Python):
python
import sys
print(sys.path)
Problem scenario
You are automating a Linux infrastructure task with Python using subprocess calls. You get this error "subprocess.CalledProcessError: Command '…' returned non-zero exit status 1", what should you do?
Solution
Run the Linux command without Python. Then run echo $? to determine the exit code. If you see a 1, that means Python notices this command is not considered to have run successfully. The solution should be to break down the processing into atomic Python commands. Try to use Python as much as possible for whatever you were doing. Make sure the Linux command returns an exit code of 0 every time the command is run.
Use the env > /path/to/analyze.txt command. When Python runs, the env variables will be different from the commands you interactively run. Therefore the contents of the env command should help you.