ShellHacks
42 subscribers
167 links
www.ShellHacks.com | Command-Line Tips & Tricks
Download Telegram
🌐 MikroTik: Set Static IP for DHCP Client

By default, MikroTik distributes dynamic IP addresses and other network settings to all clients using the Dynamic Host Configuration Protocol (DHCP) protocol.

Sometimes you need to configure your MikroTik router so that a certain device gets the same static IP address every time it connects to the network.

This note shows how to set the static IP address for a MikroTik's DHCP client from a command-line (terminal) or Winbox/Webfig.

πŸ“– Continue Reading
πŸ‘3
🌐 MikroTik: Static DNS Entry

A MikroTik router has a basic Domain Name System (DNS) server that allows to create static DNS entries.

This feature allows you to add your own entries to the MikroTik's DNS server, which will be returned on requests with a higher priority.

This can be useful if, for example, you want to access some of your local devices by domain names instead of IP addresses, or if you want to redirect some outgoing DNS requests.

From this note you will find out how to create the static DNS entry on the MikroTik router from a command-line (terminal) or Winbox/Webfig.

πŸ“– Continue Reading
🌐 MikroTik: DNS Servers Setup

Usually an Internet Service Provider (ISP) automatically provides its own Domain Name System (DNS) servers to its users.

However, in some cases it may be required to use a private or public DNS servers.

A MikroTik can be configured to use different DNS servers than those provided by your ISP by default.

This note shows how to setup the DNS servers on the MikroTik router from a command-line (terminal) or Winbox/Webfig.

πŸ“– Continue Reading
🌐 MikroTik: DNS over HTTPS (DoH) Server | CloudFlare

Starting from RouterOS version v6.47, it is possible to use DNS over HTTPS (DoH) on MikroTik devices.

With DoH, DNS queries and responses are encrypted within the HTTPS protocol session and are sent over port 443 (just like the normal HTTPS web traffic), that hides the name resolution requests from an Internet Service Provider (ISP) and from anyone listening on intermediary networks.

Below you will find how to setup a CloudFlare's DoH server on the MikroTik router from a command-line (terminal) or Winbox/Webfig.

πŸ“– Continue Reading
🌐 Transmission Daemon: Access GUI by Domain Name

If you try to access a headless Transmission daemon's GUI by a domain name or server's hostname, i.e. http://<domainName>:9091/transmission/web/, by default you will receive the error as follows:

Connection Failed
Could not connect to the server. You may need to reload the page to reconnect.

At the same time, you may still be able to access Transmission by IP, i.e. http://<ipAddress>:9091/transmission/web/ without getting any errors.

πŸ“– Continue Reading
πŸ‘2
🌐 IPTables: Reset Counters

iptables counts packets and bytes of all network traffic that passes through it.

To list the packet and byte counters, execute the iptables -L command with the -v option.

By default, the iptables counters are reset after a system reboot, but you can also reset them manually using the -Z option and this note shows some examples how to do this.

πŸ“– Continue Reading
πŸ‘2
🌐 Transmission: Missing β€œChoose Files” Button on Mobile UI

There is an issue with displaying of a "Choose Files" button on a mobile web interface in some versions of a Transmission client.

If you open the Transmission web interface from a desktop, you will be able to see the "Choose Files" button used for uploading .torrent files, but if you open it from a mobile device, the "Choose Files" button may be missing.

This short note shows how to solve the issue with the missing "Choose Files" button on the Transmission's mobile web interface.

πŸ“– Continue Reading
πŸ‘2
🌐 Raspberry Pi: No Sound – HDMI | Bluetooth | Audio Jack

If your Raspberry Pi sound has suddenly stopped working through HDMI, bluetooth or audio jack after an update, this could be caused by the PulseAudio package that is generally not stable on Raspberry Pi OS (ex. Raspbian).

To fix the issue with the non-working sound on the Raspberry Pi you can try to uninstall the PulseAudio package and this short note shows how to do this.

πŸ“– Continue Reading
πŸ‘2
🌐 MikroTik: WPS Button – Where & How To Push?

WiFi Protected Setup (WPS) feature lets to connect WiFi devices (e.g. wireless printers) to a router's secure WiFi network without selecting a network name (SSID) and entering a password.

Wireless MikroTik routers support the WPS feature and are supplied with either physical or virtual WPS button.

This short note shows how to find and push the WPS button on the MikroTik router from a command-line (terminal) or Winbox/Webfig interface.

πŸ“– Continue Reading
πŸ‘2
🌐 Gmail: Reply With Attachment

When you "Reply" or "Replay to all" in Gmail to an email with attachments, by default, these attachments are not included automatically in the reply like they are during email forwarding.

To include the original email attachments in the reply you can click on "Forward" and then type in all recipients back, but this is not the most efficient way.

In this note i will show the easiest way of how to "Reply" or "Replay to all" on the email in Gmail and keep the original attachments.

πŸ“– Continue Reading
🌐 Install Kubectl on Ubuntu, CentOS, Amazon Linux

kubectl is an official Kubernetes command-line tool, used to run commands on Kubernetes clusters.

As kubectl is distributed as a standalone binary it can be easily downloaded from official sources and installed on any Linux system, including Ubuntu.

In this post I will show you how to download and install the latest stable version of kubectl on Ubuntu, although similar steps can be performed on any Linux system including CentOS, Amazon Linux, Debian, Linux Mint, etc.

πŸ“– Continue Reading
🌐 Kubectl: Force Delete Pod | Namespace | Deployment

Pods, Namespaces, Deployments, Services and any other Kubernetes (K8s) resources can be deleted simply by using the kubectl delete command.

However, you may want to force the deletion, especially if some Pod or Namespace got stuck in a "Terminating" or "Unknown" state.

This post shows how to forcefully delete K8s resources using a kubectl command.

πŸ“– Continue Reading
🌐 Install Kubectl on Windows

A kubectl is an official Kubernetes command-line tool, used to run commands on Kubernetes clusters.

As the kubectl is distributed as a standalone binary it can be easily downloaded from official sources and installed on Windows.

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

πŸ“– Continue Reading
🌐 ArgoCD: Unable To Delete Application with Finalizers

While trying to delete an ArgoCD application through a user interface (UI) you may receive an error as follows:

Unable to delete application: error patching application with finalizers: Application.argoproj.io "<appName>" is invalid: metadata.finalizers: Forbidden: no new finalizers can be added if the object is being deleted, found new finalizers []string{"resources-finalizer.argocd.argoproj.io"} .

To force the deletion of the ArgoCD application that is stuck, you can either use an argocd or kubectl commands as showing in the post below.

πŸ“– Continue Reading
🌐 ArgoCD: FATA[0005] Unauthenticated? Login! [SOLVED]

While trying to communicate with an ArgoCD server over a command-line interface (CLI), you may receive an error as follows: "FATA[0005] rpc error: code = Unauthenticated desc invalid session: signature is invalid".

This error usually occurs when you have forgotten to login to the ArgoCD server.

This short post shows how to resolve the ArgoCD's "FATA[0005] Unauthenticated" error.

πŸ“– Continue Reading
🌐 ArgoCD: β€œx509: certificate signed by unknown authority”

In an ArgoCD's user interface (UI), if you select a connection method "VIA HTTPS" and try to add a private repository, despite the fact that you'll get a message "Successfully updated <repoURL> repository", the actual repository connection status may be marked as ❌ Failed.

The reason of this may be in a self-signed certificate, or a certificate signed by a custom Certificate Authority (CA).

This post shows how to fix the "x509: certificate signed by unknown authority" error while adding the private repository in ArgoCD.

πŸ“– Continue Reading
πŸ‘1
🌐 EnvSubst: Examples – Replace Environment Variables

Credentials or any other sensitive data should never be stored in configuration files (e.g. Terraform, Dockerfile, Kubernetes YAML files, etc.) and of course should never be committed to Git repositories.

Much better practice is to set some placeholders inside such files, and when needed, replace them with values from your environment variables, that can be done, for example, using a envsubst command.

In this post you will find how to install the envsubst command and examples of how to use it to replace environment variables in the files.

πŸ“– Continue Reading
🌐 MikroTik: Version, Uptime, CPU, RAM & Disk Usage

If you wonder how to check a routerOS version number or uptime of a MikroTik device, this can be easily done from a command-line interface (terminal) or using Winbox/Winfig.

The information about the MikroTik's version, uptime, as well as CPU, RAM (memory) and disk usage is located under the βš™οΈ "System" &rarr; "Resources" menu.

πŸ“– Continue Reading
🌐 Kubectl: Connect to Cluster from Windows

A kubectl is the official Kubernetes command-line tool used to connect to and execute commands on Kubernetes clusters.

As the kubectl executable can be installed on Windows, it can also be used to connect to the remote Kubernetes clusters from Windows machines.

This post shows how to connect to the remote Kubernetes clusters using the kubectl command from Windows.

πŸ“– Continue Reading
🌐 ArgoCD: Use Upsert Flag to Force Update

In ArgoCD, if you try to add/update some object that already exists, you my receive an error as follows:

Unable to connect repository: existing repository spec is different; use upsert flag to force update.

If you try to create/update an existent application, cluster or any other object you will receive the similar error.

πŸ“– Continue Reading