Enable Serial Terminal on Debain using Grub Configuration (Grub2)

Edit /etc/default/grub, enter:

# vi /etc/default/grub

Append / modify as follows:

GRUB_CMDLINE_LINUX='console=tty0 console=ttyS0,19200n8'
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"

Save and close the file. Next run the following command to generate a grub2 config file /boot/grub/grub.cfg :

# update-grub

Ref:
https://www.cyberciti.biz/faq/howto-setup-serial-console-on-debian-linux/

Share

Add serial console boot for Opensuse 15.5

While it works with UEFI boot using “legacy BIOS” the serial console works after grub has prompted the boot menu. But this might be too late e.g. in special cases like encrypted disk where grub needs to request the password.

KVM Guest has already been changed for serial support as outlined below in /etc/default/grub:

change to:

GRUB_TERMINAL="gfxterm serial"

add following line after theme definition:

GRUB_SERIAL_COMMAND="serial --unit=0 --speed=9600 --parity=no"
add console=ttyS0 to GRUB_CMDLINE_LINUX_DEFAULT

To apply changes run:

update-bootloader --refresh

Accessing console works:

virsh console --safe --force <guest_name>;
Share

Serial Terminal Configuration in RHEL Distribution

Serial Terminal Configuration in RHEL 7

Add, or update if already present, the following lines to /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

GRUB_CMDLINE_LINUX_DEFAULT applies this configuration only to the default menu entry, use GRUB_CMDLINE_LINUX to apply it to all the menu entries.
NOTE: each line type above should only appear once within the /etc/default/grub file. If the line already exists, then just modify it rather than add a second copy of same. That is, only one GRUB_CMDLINE_LINUX_DEFAULT line should exist in the file, etc.

Rebuild the /boot/grub2/grub.cfg file by running the grub2-mkconfig -o command as follows:

On BIOS-based machines: ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
On UEFI-based machines: ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Red Hat Enterprise Linux 8

Read more

Share

Preparing Cloud-Init Templates

The first step is to prepare your VM. Basically you can use any VM. Simply install the Cloud-Init packages inside the VM that you want to prepare. On Debian/Ubuntu based systems this is as simple as:

apt-get install cloud-init

This command is not intended to be executed on the Proxmox VE host, but only inside the VM.

Already many distributions provide ready-to-use Cloud-Init images (provided as .qcow2 files), so alternatively you can simply download and import such images. For the following example, we will use the cloud image provided by Ubuntu at https://cloud-images.ubuntu.com.

# download the image
wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
# create a new VM with VirtIO SCSI controller
qm create 9000 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci
# import the downloaded disk to the local-lvm storage, attaching it as a SCSI drive
qm set 9000 --scsi0 local-lvm:0,import-from=/path/to/bionic-server-cloudimg-amd64.img

Ubuntu Cloud-Init images require the virtio-scsi-pci controller type for SCSI drives.

The next step is to configure a CD-ROM drive, which will be used to pass the Cloud-Init data to the VM.

Read more

Share

Install qemu-guest-agent on Opensuse 15.5

Add repository and install manually

For openSUSE Tumbleweed run the following as root:

zypper addrepo https://download.opensuse.org/repositories/Virtualization/openSUSE_Tumbleweed/Virtualization.repo
zypper refresh
zypper install qemu-guest-agent

For 15.6 run the following as root:

zypper addrepo https://download.opensuse.org/repositories/Virtualization/15.6/Virtualization.repo
zypper refresh
zypper install qemu-guest-agent

For 15.5 run the following as root:

zypper addrepo https://download.opensuse.org/repositories/Virtualization/15.5/Virtualization.repo
zypper refresh
zypper install qemu-guest-agent
Share

Install wkhtmltopdf on Debian 11

1. Install prerequisites: Install wget (if not already installed):

# sudo apt update
# sudo apt install wget

2. Install wkhtmltopdf on Debian 11

The links below contain the latest releases as of 10/25/2022. Please double check GitHub for the latest available release: https://github.com/wkhtmltopdf/packaging/releases/latest

# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
# sudo apt install ./wkhtmltox*bullseye_amd64.deb

Check that the version installed is what you were expecting:

# wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)
Share

Install nano on Windows

I’m a bit fascinated with nano editor and since I spend most of the time on linux terminal- it becomes my first choice over vi editor 🙂

Long story short, you can install it on windows in 2 methods-

Method-1: Windows Command Prompt

You can just easily install Nano via WinGet, which is Windows’ package manager if you’re on Windows 10 or later. Open command prompt as admin and type this in:

winget install GNU.Nano

Method-2: Windows Powershell

Install Chocolatey using Powershell:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Run choco install -y nano.
Run nano: nano.

Alternately, if you already have git installed, just run C:\Program Files\Git\usr\bin\nano.exe

Ref:
https://superuser.com/questions/1493801/how-to-install-the-nano-cli-editor-on-windows-10

Share

Zimbra delete e-mails from deferred queue

Problem

How to delete e-mails from deferred queue sent by a particular account?

Solution

1) This command will show the queue id of messages sent by “sender@domain.com”. Check it is deleting correct queue id.

Run as root:

# /opt/zimbra/common/sbin/postqueue -p | egrep -v '^ *\(|-Queue ID-' | awk 'BEGIN { RS = "" } { if ($7 == "sender@domain.com") print $1} '

2) Once it will confirm, delete email sent by “sender@domain.com”

Run as root:

# /opt/zimbra/common/sbin/postqueue -p |egrep -v '^ *\(|-Queue ID-' | awk 'BEGIN { RS = "" } { if ($7 == "sender@domain.com") print $1} '| tr -d '*!'| /opt/zimbra/common/sbin/postsuper -d -

Note: Replace “sender@domain.com” with actual sender e-mail address.

Read more

Share

Install and Setup TIG Stack on Ubuntu 20.04

In this tutorial, we are going to learn how to install and setup TIG Stack on Ubuntu 20.04.

TIG stack is a group of powerful open-source monitoring tools, Telegraf, InfluxDB and Grafana where;

  • Telegraf is an open-source server agent for collecting and sending metrics and events from databases, systems, and IoT sensors.
  • InfluxDB is an open-source time series database and provides datastore for metrics, events, and real-time analytics.
  • Grafana is a data visualization and monitoring tool and supports time series datastores such as Graphite, InfluxDB, Prometheus, Elasticsearch.

TIG stack can be used for monitoring system metrics such as memory, disk, logged in users, system load, swap usage, system uptime, system processes. 

Installing and Setup TIG Stack on Ubuntu 20.04

In order to install TIG stack, you need to install and setup each individual component of the stack, Telegraf, InfluxDB, Grafana.

Run System Update
To begin with, ensure that your system packages are up-to-date;

apt update
apt upgrade

Install Telegraf on Ubuntu 20.04

You can install Telegraf on Ubuntu 20.04 either by downloading the DEB package file or directly from the InfluxData repos.

Install Telegraf using DEB Package File

To install Telegraf using the DEB binary, grab the binary installer from the InfluxData downloads page. You can simply obtain the link to binary installer and pull it with wget;

wget https://dl.influxdata.com/telegraf/releases/telegraf_1.14.3-1_amd64.deb

Once you have the binary downloaded, you can install it as follows

Read more

Share