CentOS 7 Stuck at the dracut Emergency Prompt and Would Not Boot

centos7 dracut initqueue timeout and could not boot

At some point, somewhere around when I updated the CentOS7 kernel, it stopped booting properly. When it boots, it gets stuck showing this screen and goes no further Copy Wrning: /dev/centos_web/root does not exist Warning: /dev/mapper/centos_web-root does not exist Generating "/run/initramfs/sosreport.txt" Entering emergency mode. Exit the shell to continue. Type "journalctl" to view system logs. You might want to save "/run/initramfs/sosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report. dracut:/# I figured that something grub-related had probably broken or been misconfigured when the kernel was updated, so I googled it [Read More]

Esc Stopped Working in Vim

Vim esc key not working

I first hit a case where the Esc key did nothing while editing with Vim in the web console of a guest OS on ESXi. I could not leave insert mode, and of course the other keybindings did not work either. I looked around the web in case others had seen the same thing. [Read More]
Vim 

Extracting IP Addresses from a Log File with grep and sort

Find ip address in logfile.

Log files come in all kinds of formats, so you will not necessarily get the same result; treat this as a rough reference only. This time I extract the IP addresses of my own subnet from a dnsmasq log file The dnsmasq log Copy Jan 25 05:45:04 dnsmasq[1]: query[A] firestore.googleapis.com from 192.168.1.43 Jan 25 05:45:04 dnsmasq[1]: cached firestore.googleapis.com is 142.250.196.106 Jan 25 05:45:04 dnsmasq[1]: query[AAAA] firestore.googleapis.com from 192.168.1.43 Jan 25 05:45:04 dnsmasq[1]: cached firestore.googleapis.com is 2404:6800:4004:827::200a Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 65.21.35.75 Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 136.243.9.187 Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 141.95.40.123 Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 51.255.232.90 Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 95.216.77.130 Jan 25 05:45:04 dnsmasq[1]: reply easylist-downloads.adblockplus.org is 95.217.32.92 Jan 25 05:45:05 dnsmasq[1]: query[A] firestore.googleapis.com from 192.168.1.43 Jan 25 05:45:05 dnsmasq[1]: cached firestore.googleapis.com is 142.250.196.106 Jan 25 05:45:05 dnsmasq[1]: query[AAAA] firestore.googleapis.com from 192.168.1.43 - Extracting only the IP addresses From all of this, extract only the IP addresses in the form 192.168.1.* [Read More]

Upgrading Debian 10 buster to Debian 11 bullseye

How to upgrade Debian 10 to 11

I have written about Debian upgrades several times, but the update procedure differs subtly from version to version, so it ends up being a separate article every time. This time it is the update procedure from Debian10 (buster) to 11 (bullseye). Checking Copy $ cat /etc/debian_version 10.11 Updating packages Copy $ sudo apt update $ sudo apt upgrade $ sudo apt dist-upgrade $ sudo apt autoremove Updating the source list (from buster to bullseye) There are changes, so be careful: it will not go well if you only change sources.list from buster to bullseye the way you used to. [Read More]

Overriding the LDAP Login Shell on Debian and CentOS Clients

override LDAP login shell

There are cases where, on a particular LDAP client machine, you want to use a different shell rather than the one defined on the LDAP server (bash) This is possible by configuring the Linux (Debian/CentOS) client to override the shell Debian11(bullseye) Add the following to /etc/libnss-ldap.conf (look up the path to the shell beforehand) Copy nss_override_attribute_value loginShell /usr/bin/zsh Flush the nscd cache Copy # nscd -i passwd nscd CentOS8 Add the following to /etc/nslcd.conf [Read More]

Hardening a Docker Mail Server on Sakura VPS

Enabling SpamAssassin, ClamAV, Fail2ban, Postgrey and Let's Encrypt in docker-mailserver

This is a follow-up to Building a mail server with Sakura VPS + Docker + Freenom , in which I tighten up the security a little If the server from last time is running under docker, stop it Copy $ docker-compose down Closing imap and submission In the previous article I confirmed that imaps and smtps communication works, so I close imap and submission docker-compose.yml (only the changed parts are shown) [Read More]

Building a Docker Mail Server on a Sakura VPS with a Freenom Domain

MailServer(Postfix+Dovecot) on Docker by VPS

TL;DR I tried building a mail server with Docker on a Sakura VPS I will skip registering a domain on Freenom and how to use Cloudflare Linux(Debian10) Docker is assumed to be already installed A domain name has been obtained from Freenom and registered in a DNS such as Cloudflare Freenom : example.com (fictitious name) Sakura VPS: 11.22.33.44 (fictitious IP) For this server build I referred to the sites below [Read More]

Sending Mail Through Gmail's SMTP Server with msmtp

How to Configure Gmail SMTP in msmtp

I want to install msmtp on Debian10 and send mail through Gmail’s SMTP server msmtp On hosts that only send mail I used to use sSMTP a lot, but on Debian10 there is no ssmtp package. The replacement for it is msmtp Installing msmtp Copy # apt install msmtp msmtp-mta Configuration There is no configuration file in /etc, so copy the sample Copy # cp /usr/share/doc/msmtp/examples/msmtprc-system.example /etc/msmtprc Incidentally, for a per-user configuration it is [Read More]

Why Scripts in /etc/cron.weekly Do Not Run on Debian

Scripts placed in /etc/cron.weekly on Debian do not run

Running on debian10(Buster), I had placed a backup script (backup.sh) under /etc/cron.weekly/, but apparently it was not running. Of course I had given it execute permission, and I had confirmed it works when run manually. Checking my other machines, it turned out that it works without any problem on CentOS while none of them run on Debian. Looking into it, according to run-parts(8), it seems that extensions containing a dot, such as .sh or .pl, do not run [Read More]

Why remi-php Updates Fail with yum on CentOS 7

Repository priority with enablerepo on a yum update

Once again, an error caused by dependencies during a CentOS yum update The situation On CentOS7, php7.x has already been installed from the remi repository The symptom An error during yum update Copy # sudo yum update —enablerepo=remi-php73 エラー: パッケージ: php-pecl-zip-1.18.2-1.el7.remi.5.4.x86_64 (remi) 要求: php(zend-abi) = 20100525-64 インストール: php-common-7.3.0-1.el7.remi.x86_64 (@remi-php73) php(zend-abi) = 20180731-64 利用可能: php-common-5.4.16-48.el7.x86_64 (base) php(zend-abi) = 20100525-64 利用可能: php-common-5.4.45-18.el7.remi.x86_64 (remi) php(zend-abi) = 20100525-64 エラー: パッケージ: php-pecl-zip-1.18.2-1.el7.remi.5.4.x86_64 (remi) 要求: php(api) = 20100412-64 インストール: php-common-7.3.0-1.el7.remi.x86_64 (@remi-php73) php(api) = 20180731-64 利用可能: php-common-5.4.16-48.el7.x86_64 (base) php(api) = 20100412-64 利用可能: php-common-5.4.45-18.el7.remi.x86_64 (remi) php(api) = 20100412-64 問題を回避するために --skip-broken を用いることができます。 Using --skip-broken does not work either [Read More]