Shutdown Proxmox VM using CLI

If you’re looking to shut down a virtual machine running on a Proxmox Virtual Environment (PVE), you can use the Proxmox command-line interface (CLI) to accomplish this task quite effectively. The command for shutting down a VM in Proxmox is qm shutdown, followed by the ID of the virtual machine you’d like to shut down. Here’s how to do it:

  1. Access the Server: First, log in to your Proxmox server via SSH.

How to count number of words in a pdf file from Linux cli

Using pdftotext:#

  1. Installation:

    • If it’s not installed, you’ll need to install the poppler-utils package which includes pdftotext.
    sudo apt install poppler-utils

    or

    yum install poppler-utils

    depending on your distribution.

  2. Usage:

    • Once installed, you can convert a PDF to text and then count the words as follows:
    pdftotext input.pdf - | wc -w

    Here, input.pdf is your source PDF file, and wc -w counts the number of words. The - in pdftotext specifies that the output should be sent to stdout, which is then piped into wc.

How to avoid other pods from being scheduled on your node in Kubernetes

Kubernetes is a powerful platform for managing containerized applications across a cluster of nodes. However, sometimes you may want to have more control over which pods are scheduled on which nodes, for various reasons such as performance, security, or cost.

What are taints and tolerations?#

Taints and tolerations are a feature of Kubernetes that allow you to mark nodes with certain attributes or conditions, and then specify which pods can or cannot be scheduled on those nodes based on those attributes or conditions. Taints are applied to nodes, and tolerations are applied to pods.

Fix casks with `depends_on` that reference pre-Mavericks

If you get an error of the type Error: Cask 'hex-fiend-beta' definition is invalid: invalid 'depends_on macos' value: ":lion", where hex-fiend-beta can be any cask name, and :lion any macOS release name, run the following command:

/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g'

This will remove all depends_on macos references of installed casks.

How to run VLC player as root user

sed -i 's/geteuid/getppid/' /usr/bin/vlc

Explanation: The initialization script check if the UID is equals to zero. Zero is reserved for the root user. Using sed to replace geteuid for getppid fools the initialization script because it is always > 0.

While running the VLC as root is not recommended, it works. Be aware of the risks and obviously do not do it for production environments.