How to Save sed Output Directly to a File
You have 3 options here:
I needed this when doing bulk find-and-replace across config files in a deployment script. The -i option is the most common …
In-depth guides, insights, and best practices for modern software engineering
You have 3 options here:
I needed this when doing bulk find-and-replace across config files in a deployment script. The -i option is the most common …
If you have a BigNumber when using web3, then you can convert this to a regular Javascript Number using the ethers library as follows: …
Write a function that when given a number >= 0, returns an Array of ascending length subarrays.
pyramid(0) => [ ]
pyramid(1) => …
Read Article →
Your job is to create a calculator which evaluates expressions in Reverse Polish notation.
For example expression 5 1 2 + 4 * + 3 - …
If you need to declare a global variable in React, then you can do the following:
Create a file called config.js
module.exports = global.config = { …
Read Article →
An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of …
Read Article →The main idea is to count all the occurring characters in a string. If you have a string like aba, then the result should be {'a': 2, …
Use the following code block to get started:
function GetCount() {
const [count, setCount] = useState(1);
const incrementCounter = () => { …
Read Article →
If you would like to disable the text selection highlighting that is enabled by default on all browsers, then you can do this:
user-select: none;
If …
Read Article →You will have a list of rationals in the form:
lst = [ [numer_1, denom_1] , ... , [numer_n, denom_n] ]
where all numbers are positive …
Read Article →In your source account create a customer-managed policy:
{
"Version": "2012-10-17",
"Statement": [
{ …
Read Article →
If you need to recursively find all symbolic links in a directory tree on a Mac, then you have a couple of options.
You could be trying to find them …
Read Article →You can follow the steps below to install App Mesh on AWS EKS (Kubernetes).
curl -o pre_upgrade_check.sh …
Read Article →
If you have tried to delete a Kubernetes namespace, and it has been hanging in ‘deleting’ for hours on end, it’s likely that you have …
Read Article →So you’ve run a deployment and tried to check the pods and there’s nothing there!
kubectl get pods
Next step is to see what’s …
Read Article →If you get the following error:
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/ao/xxx.git' …
Read Article →
If you need to force a redeploy of a deployment in Kubernetes, then you can use the rollout feature.
You may have an image that has been updated, but …
Read Article →If you are trying to print() to the console/stdout in your Flask app, but nothing is happening, then you just need to flush your prints, as follows: …
If you need to restart a deployment in Kubernetes, perhaps because you would like to force a cycle of pods, then you can do the following:
I have a parent directory containing multiple sub-directories. Each of these child directories is a different application and contains a Dockerfile.
I …
Read Article →If you could like to a create a Horizontal Pod Autoscaler (hpa) in Kubernetes, then you could run the following:
If you …
Read Article →If you would like to test hpa, Horizontal Pod Autoscaling, or throw some chaos at a specific deployment in Kubernetes, then you could run a Load …
If you would like to deploy a Metrics Server in Kubernetes, then you first need to create a namespace for it to live it, followed by installing the …
Read Article →eksctl dramatically simplifies the creation of AWS EKS clusters, by providing a simple command-line interface.
You can …
Read Article →