What Is The Most Important Exercise in Weight Training?

Question
In the context of weight lifting (or resistance training), what single exercise is the most important?

Answer
The squat (according to page 7 of Starting Strength). Page 19 says "There is simply no other exercise, and certainly no machine, that produces the level of central nervous system activity, improved balance and coordination, skeletal loading and bone density enhancement, muscular stimulation and growth, connective tissue stress and strength, psychological demand and toughness, and overall systemic conditioning than the correctly performed full squat."

The power clean could be more important according to Bill Starr (in The Strongest Shall Survive: Strength Training for Football, based on what page 177 of Starting Strength says).

With long hours at the keyboard, your lower back may need strengthening. Squats can contribute to a strong lower back. We think more than one exercise is necessary to healthfully and safely enable long hours of sitting.

How Do You Troubleshoot SSH Connection Timed Out?

Problem scenario
You are trying to use SSH, but you get a "connection timed out" error. What should you do?

Possible solution #1
Can you try to ping the hostname or IP address? Are you connected to a necessary VPN? Perhaps the endpoint is down or not reachable from the network you are on.

Possible solution #2
Is there a router that was recently configured? Has a firewall rule been turned on? Is there an email about such a maintenance window or configuration change that you forgot about? Can you use the nmap command to see if port 22 is open to the destination?

Possible solution #3
Run the command again with the -v flag. This will provide more verbose output to show the underlying problem.

Does a “Sell Short” Button Do What a Regular “Sell” Button Would Do?

Problem scenario
You are trying to sell a stock. You see an option for "Sell Short", but no "Sell" button. You want to do a regular sell as a trade. You don't want to try to "short" a stock. What should you do?

Possible Solution
It is good to be observant because a "Sell Short" option is different from a regular sale of stock. Are you in the right account? Sometimes the regular "sell" button is not available because you are in a different account. Did your online brokerage account set up more than one account? Are you trying to sell more shares of the stock than you currently own? Check the quantity of the stock and the stock's symbol. You may have confused a detail such as the account number, the quantity of the stock, or the stock's symbol.

What Do You Do when You Cannot Send an Email due To “Error when communicating with server”?

Problem scenario
You have a web-based email account, and you cannot send an email. You cannot save a draft of the email. You get "Error when communicating with server" in red. What should you do?

Solution
Delete the images/graphics of the original email or in your message. This usually happens when the sender had graphic intensive content, and you are trying to respond.

Use just text -- not HTML. Delete pictures etc. If you can delete the original message, that may be best. Now try to send or save the draft.

How Do You Troubleshoot a Linux Script Not Redirecting the Output to a File?

Problem scenario
You have a Bash script with a task that is supposed to redirect the output to a file. The command produces output when you manually run it. But the output is not getting to the file. What could be wrong?

Possible Solution
If the output of the automation has a message and the OS is Linux, the command may or may not work. The output can make it seem like the is working, but really the command is not working. Can you manually run the command and then run a subsequent command of echo $? with no quotes? If the echo $? returns a 0, then it is output (and the previous command worked). If it returns a non-zero, the output you see is an error message (and the previous command failed).

Here is an example. This command

ls nameOfFile.txt > destination.log

would not send anything to destination.log if the nameOfFile.txt was not in the current working directory. Yes, you would see output. But since the file wasn't there, the "ls nameOfFile.txt" command failed.

This would redirect the output or the error or both:

ls foobar > destination.log 2>&1

How Do You Run Snyk Scans as Part of Azure DevOps Pipelines?

Problem scenario
You know that many sources recommend you scan IaC code as part of modern security recommended practices. (Page 293 of Terraform: Up & Running, 2nd Edition by Yevgeniy Brikman (O'Reilly), Copyright 2019, 978-1-492-04690-5 recommends using Snyk.) You tried to create a new pipeline in Azure DevOps. You tried to add a Snyk task. But you were not able to. Why in Azure DevOps do you not see a Snyk option for a task to add to a pipeline?

Solution
Root cause
You have not installed the Visual Studio Marketplace Item for Snyk yet.

Procedures

  1. Log into the Azure Portal.
  2. Go here: https://marketplace.visualstudio.com/items?itemName=Snyk.snyk-security-scan
  3. Click "Get it free"
  4. Choose your Azure DevOps organization. Click "Install".
  5. Click "Proceed to Organization"
  6. Now you can run Snyk scans as tasks in your pipelines.

How Do You Troubleshoot “‘configure’ was unable to find any version of the GTK libraries on your system.”?

Problem scenario
You are running the "configure" script on a RHEL server. You get this error:

"'configure' was unable to find any version of the GTK libraries on your system."

What should you do?

Solution
Run this:

sudo yum -y install gtk2-devel

What Are Common Use Cases of Daemonsets in Kubernetes?

Question
DaemonSets will bypass the scheduler and deploy to nodes that are designated as "unschedulable"; however you can use a DaemonSet to deploy to a subset of all the nodes (according to page 109 of Kubernetes in Action). In the real world, what are daemonsets used for in Kubernetes?

Answer

  • Monitoring of pods/nodes (such as Prometheus Node Exporter, New Relic, collectd, or a Datadog agent)
  • Centralized logging of pods/nodes (Splunk, Fluentd, or logstash)
  • To enable storage to be accessible for the node
  • Enabling recommended-security on nodes to authenticate with AWS. (This was taken from https://github.com/jtblin/kube2iam.)

References
https://www.bmc.com/blogs/kubernetes-daemonset/
https://cloud.google.com/kubernetes-engine/docs/concepts/daemonset
https://medium.com/kubernetes-tutorials/a-guide-to-kubernetes-daemonsets-6db7920ad140

How Do You Parse a String in Bash?

Problem scenario
You want to count the number of "(" (open parens) in a string. How do you parse a string in Bash?

Solution
Remember to use awk. The -F flag can allow you to designate a character to count and the NF flag can count the occurrences.

echo "continualintegration" | awk -F "o" '{print NF-1}'

echo "c(ntinua((lintegrati(n" | awk -F "(" '{print NF-1}'

You may also want to see this posting parse an array.

What is Knowledge of Merging Strategies in the Context of Git?

Question
What are different merging strategies in the context of Git?

Possible Answers
"...branches are completely useless unless you merge them…" - Linus Torvalds

A branch is a set of files associated with a code base usually in a collection known as a repository. Atlassian says "[b]ranching is a feature available in most modern version control systems...", and a merge is "[a] process that unifies the work done in two branches..." (as quoted from here.)

A build, release, or DevOps engineer or software developer will use code versioning tools. Merging, to reconcile different branches, can be managed by technical configurations of code versioning systems as well as enterprise procedures that may govern teammates usage of such systems.

There are multiple types of merging that happen in version control systems behind-the-scenes. Depending on how they are coded, they can use line-based, text-based, static semantic, and syntactic merging.* This article does not focus on the development of your own code version control system; this article focuses on being a user of such a software product and the strategies for branching and merging.

The develop branch (like a feature branch) collects and receives changes to the code base. At some point, this branch will be merged with the main branch.

There are different merge policies that a given code versioning system can be configured to support. For example, Azure DevOps Repos, Atlassian BitBucket, Git, etc. have built-in configurations to handle conflict reconciliation or prevent conflicts from happening.

Squash merges eliminate the history of the changes to files, and give you just the result of the changes. Microsoft's website says "[a] simple way to think about this is that squash merge gives you just the file changes, and a regular merge gives you the file changes and the commit history."

Some development teams are discouraged from a procedural perspective from doing squash merges, but your CVS may allow them to happen. Squash merging is strongly discouraged in part because of the benefits of doing diffs (examining the differences in code that was checked in if a bug was discovered). (This previous sentence was derived from a Medium.com posting.)

A merge of branches preserves the history of changes in the most recently modified branch whereas rebase undoes recent changes to make one branch identical to the source branch. (The source of this is https://betterprogramming.pub/differences-between-git-merge-and-rebase-and-why-you-should-care-ae41d96237b6.)

Rebase involves removing zero or more changes in a codebase's branch (often on a client) to make it like a repository's source branch version (often remotely in the central repository), whereas merge involves receiving and reconciling two different branches. see this StackOverflow posting.

It is hard to discretely list all possible merging strategies. In the context of using Git, there are numerous options to merging code. There are built-in options that software repositories have (e.g., for BitBucket) called "merge strategies" that are different from human techniques and policies to merge code. In theory the term "strategy" could refer to either.

Merge commits have two or more parent commits (according to this external site).

Squash commits have a non-merge commit on the target branch (according to Atlassian's website).

Rebase involves having a remote branch's changes supercede any conflicts with the local branch you are working on. (Your local repo's files can be overwritten if you rebase.)

Fast-forward merges involve a merge commit if the source branch is older than the target branch otherwise the target branch gets updated with the changes on the source branch. (The source of this is this external site.)

To learn about recursive, resolve and octopus merge strategies, see this posting. To learn more about Git merging strategies in general, see these postings:

The influential book Continuous Delivery recommends adopting a consistent merge strategy (on page 408), but this is achievable with enabling/using rebasing, fast-forward merges, squash commits, and merge commits regularly.

Sometimes changes are merged to a Git repo that were not from a branch in the repo. The term "promiscuous integration" refers to pulling from different forks of the "same" repository (according to page 81 of Continuous Delivery).

Branching strategies are closely related to merging strategies. You may want to see this posting. Trunk-based development deals with few to no branches; when you use it you would often commit code to one branch and not merge code.


* To learn more about the behind-the-scenes merging strategies, read the following:

To learn about them you could read pages 367 through 369 of Elements of Programming Interviews in python.

Text-based merging does not take into account syntax, semantics or inconsequential changes; thus failures are reported as "conflicts" are detected when there are no significant changes. (This previous sentence was paraphrased from page 368 of Elements of Programming Interviews in python.)

To learn more about line-based merging, see this article.

To learn more about semantic merging, see this PDF or page 22 of this PDF.

To learn more about syntactic merging, see page 20 of of this PDF.

Generally, there are ways of preventing conflicts, reconciling conflicts asynchronously, or addressing conflicts in someone's absence. Certain practices that support this are the following: 1) not committing binary files (as the resulting merge will be unusable or the code versioning system will use too much space). 2) Making meaningful commit messages (such as a link to a Jira or ServiceNow ticket). 3) Setting up email notification when a branch has been updated. Some individuals will want to know if there is activity on a certain branch.

For more recommendations on how to govern the code versioning system, see this.