Raspberry Pi video switcher

Switching a looped video to another video when a GPIO pin is pushed Assuming we have two videos, vid1 and vid2. We want to loop file1 and then when the GPIO button is pushed, we play vid2 to completion, then switch back to vid1. Here is some code to do that. #!/usr/bin/python3 from gpiozero import LED, Button from time import sleep from datetime import datetime from subprocess import Popen from signal import pause from os import system import os button1 = Button(10) vid1="home.
Read more →

Elasticsearch 6 backups via snapshots for CentOS 7.0

Elasticsearch 6.2 backups on CentOS 7/RHEL 7 I need to run Elasticsearch 6.2 and upgrade to Elasticsearch 7.11, making snapshots at each stage (prior to 6.8 upgrade and 7.11). In order to install ES 6.2.2, this was downloaded and built from a zipfile as the RPM format is incompatible with newer rpm releases. This method might not be a complete as installing a package from the repo, The problem I had was with the path.
Read more →

K3S NFS Root howto

Using K3S and Raspberry Pi Network booting (no SD Cards). Due to NFS not supporting overlayfs in all kernels (yet), if you want to run K3S for NFS booting Pis, there is an install option you need to add INSTALL_K3S_EXEC="–snapshotter=native" to the install process. Here is a quick description of the problem and my setup in case this is of any use. Description of the problem. Installing K3S on Network boot Raspberry Pi 3/4 Booting the Raspberry Pi cmdline.
Read more →

Raspberrypi_nfsboot

Booting a Raspberry Pi from SD card, root filesystem is NFS Other documentation has recommended the following line dwc_otg.lpm_enable=0 console=tty1 root=/dev/nfs nfsroot=192.168.1.23:/data/raspbian_nfs/2020_06,tcp,rw,vers=3 ip=dhcp rootfstype=nfs elevator=deadline rootwait This kernel panicked for me each time due to the rootfstype=nfs, so after some digging, I used: console=tty1 root=/dev/nfs nfsroot=192.168.1.23:/data/raspbian_nfs/2020_06,vers=3 rw ip=dhcp rootwait elevator=deadline On the NFS server, /etc/exports contains: /data/raspbian_nfs/2020_06 192.168.1.0/24(no_root_squash,rw,async,no_subtree_check,insecure) /data/raspbian_nfs/2020_06 is populated using:

mount 192.168.1.23:/data/raspbian_nfs/2020_06 /mnt # rsync -Phax –numeric-ids / /mnt/data/raspbian_nfs/2020_06 The /etc/dhcp/dhcpd.

Read more →

Mysql_max_connections

Calculating the Max connections in MySQL programmatically in one pass Sometimes you need to calculate the percentage of the maximum number of MySQL connections that are being used at any one time. Here is a piece of SQL that I’m using: MariaDB [(none)]> SELECT VARIABLE_VALUE INTO @maxconn FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME="MAX_CONNECTIONS"; SELECT COUNT(1) INTO @currentconn FROM INFORMATION_SCHEMA.PROCESSLIST; SELECT (@currentconn/@maxconn)*100 AS "% Connections used"; +——————–+ | % Connections used | +——————–+ | 3.
Read more →