When you deploy an application in a Kubernetes cluster, you usually set some labels on the Pods e.g. app=my-app. These labels can be used as a wildcard for selecting a group of Pods for deletion. This short note shows how to perform a wildcard deletion of Pods in Kubernetes.
Sublime Text: Enable Spell Check
A Sublime Text can check spelling out of the box and uses Hunspell spell checker for this, that is also used by LibreOffice, OpenOffice.org, Mozilla Firefox, Thunderbird, Google Chrome etc. By default, the spell checking feature in the Sublime Text it is disabled. This short note shows how to enable the spell checking in the […]
Kubernetes: Get Node Events
Kubernetes events are automatically created when other resources have state changes, errors or other messages that should be broadcasted to the system. These events (logs) are very helpful for debugging issues in a Kubernetes cluster. In this note i will show how to get events from a specific Node in the Kubernetes cluster using the […]
Kubectl: Get Pods on Node
A Pod is a group of one or more containers with shared storage, network and lifecycle and is the basic deployable unit in Kubernetes. Each Pod is scheduled on the same Node, and remains there until termination or deletion. In this note i will show how to get Pods running on a specific Node using […]
Linux: Find Files by Name & Grep Contents
The Linux find command can be used for searching files and directories and performing subsequent operations on them. If you use the find command to recursively search for some files and then pipe the result to the grep command, by doing this you will actually parse the file paths/names but not their contents. This short […]
Jenkins: List All Jobs – Groovy Script
The easiest way to get a list of all Jenkins jobs is by executing an appropriate Groovy script using a Jenkins script console feature. This note shows two examples of Groovy scripts for listing the Jenkins jobs. The first script simply prints the list of all Jenkins jobs while the second one additionally lets you […]
Umount: Force – Target | Device is Busy
An umount command is used to unmount a device/partition by specifying the path to the directory where it has been mounted. Sometimes, when you run the umount command you may receive the “target is busy” or “device is busy” errors indicating that there is some process that is using the mounted filesystem or the remote […]
IP2Host: Get Hostname from IP – Command Line
A reverse name resolution zone file is used to translate an IP address in a particular namespace into a fully qualified domain name (FQDN). If this file has been configured on a name server, it becomes possible to find a hostname from an IP address. This note shows how to get a hostname from an […]
Kubectl: Set Default Namespace – Kubernetes
Out of the box, there is a Namespace called ‘default‘ in a Kubernetes cluster. By default, the kubectl command interacts with this ‘default‘ Namespace, but it can be changed to any other Namespace. In this note i will show how to set the default Namespace in Kubernetes.
Screen: Rename Session
A named screen session can be started by using the screen -S <sessionName> command. If you start a simple screen session, by default, it will be named as something like 55355.pts-0.hostname. No matter how the screen session has been started, it can be easily renamed at any time. This short note shows how to rename […]