ShellHacks
42 subscribers
167 links
www.ShellHacks.com | Command-Line Tips & Tricks
Download Telegram
🌐 [SOLVED] Node had taints, that the pod didn’t tolerate

Kubernetes (K8s) has a feature, that allows to mark (taint) a Node, so that no Pods can be scheduled on it, unless a Pod explicitly tolerates the taint.

If you try to deploy the Pod that doesn't tolerate any of the K8s Nodes' taints, you will get an error as follows:

0/5 nodes are available: 1 node(s) had taint {node-role.node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 node(s) had taint {dedicated: agents}, that the pod didn't tolerate, 2 node(s) had taint {dedicated: controllers}, that the pod didn't tolerate.

To tolerate the K8s Nodes' taints, it is required to specify a toleration for the Pod in the PodSpec, and below I will show the examples of how to do this.

πŸ“– Continue Reading
🌐 Install ArgoCD CLI on Windows

An ArgoCD CLI is the official command-line interface for an ArgoCD.

It can be used to interact with the ArgoCD API server and manage ArgoCD applications.

In this post I will show how to download and install the latest stable version of the ArgoCD CLI on Windows through a graphical user interface (GUI), or using a command-line prompt (CMD) or PowerShell.

πŸ“– Continue Reading
🌐 GitHub: Download Latest Release Link

A GitHub's release feature allows to provide links to download specific versions of a published software.

However, if you need to download the latest version of a package, you will have to update the version number in the URL each time a new release is made.

This post shows how to make a direct link to download the latest release of a file from an asset on GitHub.

πŸ“– Continue Reading
🌐 MikroTik: OpenVPN Server Setup

Configuring an OpenVPN server on a MikroTik router can be a complex task, especially for beginners with limited experience in networking.

Below you will find how to setup the OpenVPN server on your MikroTik router from a command-line (terminal) quickly and easily, and how to connect to it using an OpenVPN client.

πŸ“– Continue Reading
🌐 Bing Chat: How To Access in Microsoft Edge

Bing Chat is an artificial intelligence (AI) chatbot developed by Microsoft and released in 2023.

The current version of Bing Chat is based on the GPT-4 large language model (LLM) created by OpenAI.

Bing Chat is free to use and available to the public as a built-in feature of Microsoft Edge.

This note shows how to access Bing Chat in Microsoft Edge.

πŸ“– Continue Reading
🌐 Kubectl Autocomplete in PowerShell

A kubectl autocomplete is a feature that helps to complete kubectl commands or filenames automatically by pressing the β†Ή Tab key.

This feature can be enabled in Windows PowerShell by invoking a simple kubectl completion powershell command.

Though this way it will be enabled temporary for the current session only.

To enable the kubectl autocomplete feature permanently it is required to add some commands to your Powershell $PROFILE file and this post shows how to do this.

πŸ“– Continue Reading
🌐 [SOLVED] PowerShell: Running scripts is disabled on this system

While trying to run a PowerShell script you may get an error message that says "cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170."

This error message is due to the default execution policy set by PowerShell, that determines whether PowerShell scripts can be run on a system.

By default, the execution policy is set to Restricted, which means that PowerShell scripts cannot be run.

To fix this error message, it is required to change the execution policy to RemoteSigned and this post shows how to do this.

πŸ“– Continue Reading
🌐 WHOIS Command on Windows – PowerShell & CMD

In Linux, a whois command is used to lookup information about domains or IP addresses.

But if you try to run the whois command on Windows from PowerShell or command prompt (CMD), you will receive one of the errors below:

'whois' is not recognized as an internal or external command,
operable program or batch file.
- or -
whois : The term 'whois' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

This post shows how to install the whois command on Windows and make it available in PowerShell and CMD.

πŸ“– Continue Reading
🌐 Install Kubectx & Kubens on Windows

kubectx and kubens are two command-line tools that can help to manage Kubernetes clusters and namespaces more efficiently.

kubectx is used for switching between Kubernetes contexts (clusters) faster, while kubens is used for switching between Kubernetes namespaces more easily.

This post shows how to install kubectx and kubens on Windows so they can be used from PowerShell or Command Prompt (CMD).

πŸ“– Continue Reading
🌐 Kubectl: Port-Forward to Service – Kubernetes

kubectl port-forward is a Kubernetes command that allows to access internal cluster resources from outside the cluster.

It tunnels the traffic from a specified port on a localhost to the specified port on the specified Pod.

The kubectl port-forward command is useful for troubleshooting issues, setting up services locally without exposing them, and debugging applications within the cluster.

This post shows the examples of how to use the kubectl port-forward command to access the internal cluster resources from the locathost.

πŸ“– Continue Reading
🌐 Dig Without Cache

dig can return cached responses because it caches the results of previous queries to improve performance.

For the same reason the cache responses can come from the configured name servers.

This is useful when you are querying the same domain multiple times, but it can be problematic when you need to check if a change you made to a DNS record has propagated.

Luckily, the dig command can be forced to resolve without using cache and this post demonstrates how to do this.

πŸ“– Continue Reading
πŸ‘1
🌐 Windows: Measure Command Execution Time in PowerShell

The time command in Linux and Unix-like operating systems is used to determine how long a specific command or script will take to run.

In Windows PowerShell there is a built-in Measure-Command, that can be considered as the Linux time command equivalent.

This short post shows how to use the Measure-Command in PowerShell to evaluate the processing time taken by different commands, scripts or programs in their execution.

πŸ“– Continue Reading
🌐 Kubectl: Delete All Pods in Namespace

Pods in Kubernetes (K8s) can be deleted by using a simple kubectl delete pod command.

If there are multiple Pods in a namespace and you want to delete them all, this also can be done using the appropriate kubectl command.

This short post shows how to delete all Pods in a specific namespace using the kubectl command.

πŸ“– Continue Reading
🌐 MikroTik: Get Default Configuration

There can be many reasons why you need to get the default configuration of your MikroTik router.

One of them is to compare the current settings with the default ones, while troubleshooting some issues.

This short post shows how to print the default MikroTik configuration.

πŸ“– Continue Reading
🌐 MikroTik: Block Internet Access by IP/MAC

More and more smart devices with an Internet connectivity are appearing in our homes.

If you don't want your smart socket, robot vacuum cleaner or IP camera to leak your personal data, you can block these devices from accessing the Internet by their IP/MAC addresses.

In this post I will show you how to block an Internet access by IP/MAC using a MikroTik router.

πŸ“– Continue Reading
🌐 MikroTik: Simple Guest WiFi Setup on hAP ax³ (WifiWave2)

MikroTik routers with WiFi, like hAP axΒ³ with wifiwave2 package, give the ability to create a "guest WiFi network".

The guest WiFi gives clients access to the Internet, but isolates them from your main network, so they can't see and don't have ability to access any of your devices on it.

For example, to improve the security, you can put all your IoT devices on the guest WiFi network, so if one of them is hacked, the attacker won't be able to get access to the devices on the main network.

This post shows how to perform a quick setup of the simple guest WiFi network on MikroTik hAP axΒ³ with wifiwave2 package.

πŸ“– Continue Reading
🌐 cmd.EXE Keeps Popping Up [SOLVED]

Many Windows users are encountering a problem of a cmd.EXE window of a command prompt that seems to be opens randomly and closes so quickly, that you don't have time to do anything with it.

If you are also facing the black cmd.EXE window that keeps popping up and disappearing, most of all it is caused by some automatic task that is launching it.

This note shows how to identify and disable a scheduled task that causes cmd.EXE to keep popping up.

πŸ“– Continue Reading
🌐 Synology NAS: First Time Installation & Setup Guide

A fist time installation and initial setup of a Synology NAS is actually a quite easy process.

After unboxing your Synology NAS, ensure that it comes with one AC power cord + adapter and, at least, one RJ-45 LAN cable.

The basic Synology NAS configuration implies installation of hard drives, Synology's operating system and creation of RAID/volume where you will actually store all the packages and files.

This post provides a simple and easy to follow step-by-step beginner’s guide for setting up the Sinology NAS using the Sinology DiskStation DS1522+ as an example.

πŸ“– Continue Reading
πŸ‘1
🌐 PowerShell: Get Command Help (–help/-h/?) [SOLVED]

The help command is a special command that is used to provide more information on another commands.

In Windows PowerShell the help command can be called at any time to learn more about a command’s usage and syntax, like the available options and how to structure the command to use these options.

However, at first, it may not be so obvious how to actually call the help command in PowerShell and this short post can help with this.

πŸ“– Continue Reading
πŸ‘1
🌐 Windows: PowerShell `Tail`, & `Head` Equivalents

The tail and head are two of the most commonly used commands for displaying the contents of a file in Linux.

Windows PowerShell, in its turn, also has equivalents of the Linux tail and head commands.

From this short post you will learn how to use the equivalents of the tail and head commands in Windows PowerShell and how to dynamically print a file's contents, i.e. follow it like using tail -f.

πŸ“– Continue Reading
πŸ‘1