python subprocess not finding command in cron.

I had a script that when I run as my user – it could find all commands.  This was in a Fedora environment. The solution was to wrap it in shell like this   [jon2allen@jons-bad-ass-fedora-server-37 python]$ cat run_news.sh #!/bin/bash source /home/jon2allen/.bashrc python3 /home/jon2allen/python/news1_test.py sourcing the .bashrc The command has several subprocess shell.  before I sourced .bashrc – yt-dlp could not […]

Creating a new NAT network in virt-manager

I created a new network – called virbr1 <network connections=”1″> <name>virbr1</name> <uuid>a4ca0fc9-06e7-4ad6-8fad-e8b1865a6877</uuid> <forward mode=”nat”> <nat> <port start=”1024″ end=”65535″/> </nat> </forward> <bridge name=”virbr1″ stp=”on” delay=”0″/> <mac address=”52:54:00:b7:af:d0″/> <domain name=”virbr1″/> <ip address=”192.168.100.1″ netmask=”255.255.255.0″> <dhcp> <range start=”192.168.100.128″ end=”192.168.100.254″/> </dhcp> </ip> </network>allow virbr0<br />allow br0<br />allow virbr1 Note: in order to add a network with virt-manager gui one must run as root. When I connected a VM to this […]

Fedora 37 server – cron email notification not working

So, you got email working.  However, when cronie or crond is running you see no email. journalctl -f shows the script executing, but nothing in email. answer is check that crond has “inotify” message.   If crond is started without an active mailserver MTA – it needs to be restarted. r 04 19:46:01 jons-bad-ass-fedora-server-37 CROND[3012]: (jon2allen) CMD (/home/jon2allen/every_two.sh) Apr 04 19:46:01 […]

VirtManager/KVM – Security Driver Module not available.

I had a problem with a VM image I created with Gnome boxes.  It had SELinux enabled. I was able to get around it by taking out this line in the XML.  You can do this in VirtManager. It was the last entry   </video> <redirdev bus=”usb” type=”spicevmc”> <address type=”usb” bus=”0″ port=”3″/> </redirdev> <redirdev bus=”usb” type=”spicevmc”> <address type=”usb” bus=”0″ port=”4″/> […]

FreeBSD – increasing size of root disk with KVM/QEMU

Here is how to to increase the size of the disk for FreeBSD. I am using FreeBSD 12.3 here running inside a Fedora Linux.  Here are some starting requirements One needs to have qcow2 type disk. the virtual machine must be shutdown No snapshots against the virtual machine So, I cloned out the machine to test: [jon2allen@fedora Downloads]$ ll freebsd*.qcow2 […]

Find command – listing last modify path with full dir

Some examples of this command from Linux Debian and FreeBSD   Here is how to do this with GNU Linux – %p gives full path name   user1@f1-google-joniowa:~$ find . -name “weather_obs.log” -printf “%p\t%TY-%Tm-%Td\n” ./test27/weather_obs/weather_obs.log 2023-05-16 ./test26/weather_obs/weather_obs.log 2022-12-08 ./test28/weather_obs/weather_obs.log 2023-02-28 ./test25/weather_obs/weather_obs.log 2022-08-18 ./python/weather_obs/weather_obs.log 2021-05-24 ./test24/weather_obs/weather_obs.log 2022-11-22 Here is a bsd version –   uses exec   [user1@freebsd12_3 ~]$ find . -name […]

finding files and using tar for backup.

The most common solution is to use find with xargs to backup Something like this: find /var/www/html/ -type f -name my*.csv -print0 | xargs -0 tar cfvzP /backupdir/backupfile The more files you have, especially over 1000 – this will produce weird results.  Number of files in the archive doesn’t match the output of the find xargs will split the input […]

Updating Jessie Debian in 2022

I had this old Virtual machine running Jessie.  Turnkey Linux/Debian root@TurnkeyLamp apt/sources.list.d$ uname -a Linux TurnkeyLamp 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux In order to update add check-valid-until=no to the archive Debian repository deb http://archive.turnkeylinux.org/debian jessie main deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie contrib # deb http://httpredir.debian.org/debian jessie non-free Stack exchange link