How Do You Do a Code Review?

Question
How do you do a code review?

Answer
Look for consistency in style (adherence to a style guide), functionality, and ensure unit tests and end-to-end tests were performed. Keep an eye out for security issues or maintainability issues. Deploying the code should be straightforward or well documented.

Page 307 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O'Reilly), Copyright 2019, 978-1-492-04690-5 says code reviews should have 1) written documentation (on how to use the code and why it was written that way) 2) example code 3) code documentation.

Be respectful to the coder when requesting changes.

To learn more, see these postings:

https://google.github.io/eng-practices/review/reviewer/
https://medium.com/palantir/code-review-best-practices-19e02780015f
https://stackoverflow.blog/2019/09/30/how-to-make-good-code-reviews-better/
https://www.perforce.com/blog/qac/9-best-practices-for-code-review
https://www.infoq.com/articles/practices-better-code-reviews/

What is a VirtualHost in Apache Web Server?

Problem scenario
You do not think that Apache web server does virtualization (like a hypervisor). But you see the term Virtual Host when you read about Apache web server configurations. What is a VirtualHost in the context of Apache web server?

Solution

"Apache Virtual Hosts A.K.A Virtual Host(Vhost) are used to run more than one web site(domain) using a single IP address. " (This was taken from https://dasunhegoda.com/what-how-to-apache-virtual-host/444/.)

Apache web server usually publishes a directory of files to be presentable to a web browser. When there is more than one domain and those other domains are mapped to different directories, they are virtual hosts.

'Each domain or individual site — known as a “virtual host” — that is configured using Apache will direct the visitor to a specific directory holding that site’s information.' (This was taken from https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04.)

Virtual Hosts are not the same as hypervisor virtualization.

Why Is a Linux File Getting a Different Group Name and Not The Group of the User That Created The File?

Problem scenario
A Linux user creates a file in a directory and no other manual commands are run. The file is associated with a group that is not the group of the user. What could be the reason?

Answer
The directory had a command like this run:

sudo chgrp group2 /path/to/directory

Then the set GID bit was configured. The chmod 2755 /path/to/directory command would set the GID bit because of the "2" in the numeric notation.

Subsequent files in this directory will get the group "group2".

(This was taken from page 268 of The Linux Bible.)

What is a Git Tag?

Question
You have heard of git tags. What are they?

Answer
A Git tag is a pointer to a commit in Git (according to page 129 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O'Reilly), Copyright 2019, 978-1-492-04690-5).
To create names for these tags, we recommend using semantic versioning as described http://semver.org (because page 129 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O'Reilly), Copyright 2019, 978-1-492-04690-5 recommends it). "Typically, people use this functionality [Git tagging] to mark release points (v1.0, v2.0 and so on)." (This quote was taken from https://git-scm.com/book/en/v2/Git-Basics-Tagging.)

To run "git tag" commands, you can find examples like these on https://git-scm.com/book/en/v2/Git-Basics-Tagging:

git tag -a v1.4 -m "my version 1.4"
git tag -l "v1.8.5*"

What is a group_var or Group Variable in Ansible?

Question
You have heard of Group Variables in Ansible. What are they?

Answer
They are like global variables assigned in a modular way (like Ansible roles). They are ideal when you have Ansible playbooks that run against many different servers. Rather than have a regular variable in a playbook, group variables are taken from a group_vars/ directory. To read more about them, see this posting.

To use them, see this posting: How Do You Get Variables That Are Assigned a Value in an Ansible Playbook (i.e., a .yaml file) to Be Assigned from a Different File?

How Do You Configure Snyk’s Threshold Level in Azure DevOps Pipelines?

Problem scenario
You are troubleshooting a pipeline in Azure DevOps. You look at the task's log output. You see a security-threshold flag in a CLI with the value of "low", "medium", "high" or "critical" that you think is incorrect or discrepant with another setting. How do you get the flag to be set to the security threshold level of your choice?

Background
The ultimate Snyk command that is run (or commands that are run) is (or are) created from various underlying settings, YAML files, or tasks. The setting you choose will filter events at and above that security threshold level. There are different places to configure the threshold (e.g., with custom tasks, variables or multiple Snyk tasks).

Possible solution #1
Look at each Snyk task in your pipeline in the GUI. Does it have a "Testing severity threshold" drop down? Be sure to check every Snyk task. Make sure the drop down is set to what you want. Here is an example:

Possible solution #2
Check your pipeline's Variables tab. Maybe a variable is being injected in the composition step of a Snyk command. Is there a variable set to "low", "medium", "high" or "critical"?

Possible solution #3
Look at the YAML files of your Snyk tasks. You may be able to deduce what needs to change.

You may want to view this link for more information:
https://github.com/snyk/snyk-azure-pipelines-task

How Do You Get a Memory Dump of a Specific Process in Windows?

Problem scenario
You want to generate and retrieve a memory dump of a specific process on a Windows server. How to you take or get a memory dump of a given process?

Solution
1. Launch Task Manager as Administrator. Search for Task Manager and right click it and go to "Run as Administrator"

2. Go to "Create dump file"

3. You'll see a window that says "Dumping process" and that the file has been created. The window should say the exact location. The file will be a .DMP file.

(These directions were tested on Windows Server 2019 Datacenter. They should work for other versions of Windows too.)

How Do You Get the Internet and/or NIC on Your Windows Workstation to Work?

Problem scenario
You rebooted your Windows laptop. You are not getting any network. The internet is unreachable. The NIC's lights are off. What should you do?

Possible Solution #1
Use WiFi. Completely bypass your network interface port.

Possible Solution #2
1. Reboot your computer.
2. Press Esc to enter the Startup Menu.
3. Go to F10 BIOS Setup.
4. When prompted "Log in as guest user?", choose "Yes".
5. Go to the Advanced tab at the top
6. Go down to "Boot Options"
7. Make sure the "PXE Internal IPV6 NIC Boot" option is checked.
8. Exit and save the changes when prompted.
9. Reboot.
(You may need to boot once to "Notebook Ethernet IPv6" in the timed splash screen "Express Boot Options" -- even if it is just for 5 seconds and there is no indication such a boot was successful; you just reboot after seeing the text message about "PXE Internal IPv6 Nic Boot" for five seconds.)