Kubernetes Tolerations

Kubernetes tolerations are a way of allowing pods to be scheduled on nodes that have taints, which are markers that repel pods by default. Tolerations let you control which pods can run on which nodes, based on the pod’s requirements and the node’s characteristics.

What are Kubernetes tolerations?#

Kubernetes tolerations are a pod property that allow a pod to be scheduled on a node with a matching taint. Taints are the opposite of node affinity, which is a way of attracting pods to a set of nodes. Taints are applied to nodes and act as a repelling barrier against new pods. Tainted nodes will only accept pods that have been marked with a corresponding toleration.

How to erase line in files containing string recursively in Linux

find . -name "*.md" -type f -exec sed -i '/line of text/d' {} \;

This command uses find to locate all .md files in the current directory and its subdirectories recursively. The -exec option is used to execute the sed command on each file found. The {} is replaced by the name of each file found, and the \; is used to terminate the -exec option.

The sed command removes any line containing the string “line of text” from each file found.

How to install PhantomJS on Ubuntu 22.10

PhantomJS is a headless web browser for automating web page interactions.

To install PhantomJS on Ubuntu 22.10, you can follow these steps:

  • Update your system packages with sudo apt update && sudo apt upgrade
  • Install the required packages with sudo apt install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
  • Download the PhantomJS binary file from its official website with wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
  • Extract the file to /usr/local/share/ with sudo tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/
  • Create a symbolic link to the binary file with sudo ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
  • Verify the installation with phantomjs --version

How to delete all files containing string in Linux

find -type f -name '*string*' -delete

This command will delete all files whose filenames contain the string string. The * character is a wildcard that matches any number of characters. The -type f option tells find to only look for files, not directories. The -delete option tells find to delete the files it finds.

How to Resolve "Cannot Unregister the Machine While It Is Locked" Error in Vagrant

When working with Vagrant, a tool for building and managing virtual environments, you may encounter an error message that reads “Cannot unregister the machine while it is locked.” This is often accompanied by a block of error messages and command output, as shown below:

vagrant destroy
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Destroying VM and associated drives…
There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox.
...
VBoxManage: error: Cannot unregister the machine 'CnC_default_1643660523119_45689' while it is locked
...

This error is usually thrown when attempting to destroy a Vagrant virtual machine (VM) using the vagrant destroy command. It signifies that the virtual machine is in a locked state, preventing it from being unregistered and deleted.

How To Install PHP (7.4, 7.3 & 5.6) on Debian 9 Stretch

Prerequisites#

Login to your Debian 9 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.

ssh root@debian9

Run below commands to upgrade the current packages to the latest version.

sudo apt update 
sudo apt upgrade

Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system.