Categories
Mastering Development System & Network

Get an email notification when my cron fails with non zero exit code – Crontab

I have scheduled a script take_backup.sh in crontab like so 00 19 * * * bash /home/test/take_backup.sh > /home/test/backup.log 2>&1 || mail -s “Backup failed, check attached logs” someone@gmail.com < /home/test/backup.log The requirement is to only send an email notification with the logs attached when the cron fails with a non zero exit code. I […]

Categories
Mastering Development System & Network

ALB writing to 2 postgre sql instances

I have nginx and postgre sql running on the same ec2 instance. It serves a rails app that reads and writes data on that db. I would like to have 2 instances behind an ALB service to distribute load and ensure availability. What should I do to ensure data is consistent across the 2 instances?

Categories
Mastering Development System & Network

Preventing Script Injection from ISP (Proxy Analyzer) through VPN

I’m using Sophos SSL VPN Client. But I’m using BSNL ISP. Whenever I connect my VPN and browse any HTTP non-secured websites ADS gets injected into the JS script file. But when I disconnect a VPN and browse any non-secured websites. Script injection doesn’t happen and ADS won’t display But my question is how does […]

Categories
Mastering Development System & Network

Exim + Dovecot sending or receiving an email occurs the error: Unknown user

I’m running a mail server with CentOS 7 + Exim 4.92 + Dovecot 2.2.36 and RoundCubeMail as web interface, and have the following problem: when I send to or receive from emails which is not admin@ or info@ or dev@ etc. I have the following error: 2020-04-05 05:37:52 H=mail.mydomain.com (IP) [IP] sender verify fail for […]

Categories
Mastering Development System & Network

unusual high cpu usage by php-cgi and mysql

Since several days ago I’ve been seeing unusual high CPU usage of my VPS, it jumped from avg 2% to 80%+, along with high outbound traffic and low inbound traffic and very high Disk I/O as well. With top command I see most of the usage was caused by php-cgi7.3, there are 2 or 3 […]

Categories
Mastering Development System & Network

Cannot build image container with Podman because of runtime error with invalid memory address

Dockerfile: FROM vault:latest RUN apk –no-cache add \ perl-utils Command I use: podman build -t vaultplugin vaultplugin.Dockerfile The error I am getting: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x12d10aa] goroutine 1 [running]: github.com/containers/buildah/imagebuildah.BuildDockerfiles(0x1bad1e0, 0xc0000b4018, 0x1bd5580, 0xc0002ed7a0, 0xc000642ac0, 0x3d, 0x0, 0x0, 0x0, 0x0, …) vendor/github.com/containers/buildah/imagebuildah/build.go:204 +0xd9a […]

Categories
Mastering Development System & Network

What does this OpenVPN client level 11 verb output tell us about the SSH connection hangs/stalls we are experiencing?

Overview After setting up OpenVPN, we are able to connect over SSH (e.g. to 10.8.0.9), but the SSH connection hangs/stalls, usually after about 2-minutes. The SSH connection is from Ubuntu 18 on WSL to Ubuntu 18 on Digital Ocean. What have we tried? Many suggest this is an MTU problem, and we have adjusted the […]

Categories
Mastering Development System & Network

LVM2 vgreduce bad disk

I have a removable disk in my CentOS8, but I can’t reduce the volume group: [root@server 5]# vgs WARNING: Couldn’t find device with uuid fdM2vn-7Ai6-Pxj6-sd4G-a1HQ-Kknf-Jet9wg. WARNING: VG cl is missing PV fdM2vn-7Ai6-Pxj6-sd4G-a1HQ-Kknf-Jet9wg. WARNING: Couldn’t find all devices for LV cl/root while checking used and assumed devices. VG #PV #LV #SN Attr VSize VFree cl 2 […]

Categories
Mastering Development System & Network

nginx. How to log ssl errors without blowing up the server logs

I have a web site, that is visited by many different mobile devices and embedded devices. Quite often I encounter the issue, that some devices cannot connect. The reasons can be: the device doesn’t recognize an certain CA the device is too old and would require an oder protocol TLS1.1 the device requires an outdated […]

Categories
Mastering Development System & Network

a stop job is running for /nfs – server will not shut down

I have an nfs mount on my base system, which, is targeted at a VM on that host. When shutting down the system, the VM went down first and and my base system was stuck trying to unmount the disk: [ *** ] A stop job is running for /nfs (3min 10s / 3min 31s) […]