Cluster Info Get clusters 1kubectl config get-clusters Get cluster info. 1kubectl cluster-info 2Kubernetes master is running at https://172.17.0.58:8443 Contexts A context is a cluster, namespace and user. Get a list of contexts. 1kubectl config get-contexts Get the current context. 1kubectl config current-context …
Read MoreMinikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster. Installation of Minikube on Ubuntu 1curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube 2sudo cp minikube /usr/local/bin && rm …
Read MoreUser management useradd [USERNAME] - Add new user useradd -G [GROUPNAME][username]- Add new user in group passwd [USERNAME] - User account is locked until you set a password with the passwd command usermod -a -G [GROUPNAME][username] - Add user in group userdel [USERNAME] - Remove the existing user cat /etc/passwd | …
Read MoreCrontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times Commands crontab -e - Edit your crontab file, or create one if it doesn’t already exist. crontab -l - Display your crontab file. crontab -r - Remove your crontab file. crontab -v - Display the last time you …
Read Morebasic 'find file' commands 1find / -name foo.txt -type f -print # full command 2find / -name foo.txt -type f # -print isn't necessary 3find / -name foo.txt # don't have to specify "type==file" 4find . -name foo.txt # search under the current dir 5find . -name "foo.*" # wildcard 6find . -name …
Read MoreOptions Description -c This prints only a count of the lines that match a pattern -h Display the matched lines, but do not display the filenames. -i Ignores, case for matching -l Displays list of a filenames only. -n Display the matched lines and their line numbers. -v This prints out all the lines that do not matches …
Read MoreShebang On Linux, a shebang #! is a special line at the beginning of a script that tells the operating system which interpreter to use when executing the script. This line, also known as a “sharp-exclamation”, “sha-bang”, “hash-bang”, or “pound-bang”, is the first line of a dash and starts with #! followed by the path …
Read MorePresented below is an illustrative shell script for managing MySQL databases. This script facilitates the creation of databases and the establishment of users with customized access permissions. Please feel free to utilize this script wherever it may be required. Example 1#!/bin/bash 2# VARIABLES 3# 4_bold=$(tput bold) …
Read MoreProvided below is an example script designed to dynamically back up a MySQL database hosted within a Docker environment. The backup is subsequently pushed to an AWS S3 bucket. Feel free to utilize this script for your database backup requirements. MySQL Backup and Push to S3 Bucket 1#!/bin/bash 2 …
Read MoreBelow is an example of a shell script designed to manage users in Linux. This script includes various functionalities such as creating new users, listing existing users, resetting passwords, locking/unlocking users, backing up user data, deleting users, and more. Feel free to review and utilize this script as needed. …
Read More