Just my blog
Blog about everything, mostly about tech stuff I made. Here is the list of stuff I'm using at my blog. Feel free to ask me about implementations.
- Mobaxterm SSH RDP FTP...
- Thunderbird Email client
- Filezilla FTP client/server
- Nirsoft Win utils
- Sysinternals Win utils
- Pi-Hole AD block by DNS
- NUT UPS manager
- Rpi MON Raspberry monitoring
- Free CAD 3D modelling
- Free Commander Far-like filemanager
- Bitwarden Password manager
- Django web framework
- celery multi-tasking
- celery-beat Celery + Django
- celery-results Celery + Django
- Pillow Python image lib
- wsgi mod Apache + Python
- requests best in WEB requests
- openpyxl make Excell docs
- p4python Perforce + Python
- paramiko SSH + Python
- pyvmomi ESXi Vcenter + Python
I'm using these libraries so you can ask me about them.
Raspberry 5 test-to-speech using Piper
How to make your Raspberry 5 talking with python lib Piper?
I wanted to make my Raspberry tell me about power outages and air alerts near my location.
The setup is pretty simple and described ar the repo:
I didn't want to waste my time making yet another Python venv and that's why I've chosen a simple binary mode.
Setup
Now about the setup:
- Raspberry 5.
- USB sound card with 3.5 jack.
- USB-powered speaker with a 3.5 jack.
Sound
CMD to change the volume programmatically:
amixer set Master 80% >> /dev/null
Sound devices and controls
You may have a problem with playing generated WAV files and making voice directly. So you need to choose devices for a different output.
To list devices run:
# List devices
aplay -L
# I only have USB card:
hw:CARD=Audio,DEV=0
USB Audio, USB Audio
Direct hardware device without any conversions
plughw:CARD=Audio,DEV=0
USB Audio, USB Audio
Hardware device with all software conversions
sysdefault:CARD=Audio
USB Audio, …
Installing NUT - Network Ups Tool Notifications and emails
Installing NUT - Network Ups Tool Notifications and emails
Notifications and email
Just a simple work log of installing NUT and configuring email notifications from it.
- Start here: Installing NUT
Simple
Go to file:
sudo vi /etc/nut/upsmon.conf
# Email script for NOTIFYCMD
# Simple
NOTIFYCMD "/etc/nut/notifycmd.sh"
# Notification events
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC
Simple notification script
sudo vi /etc/nut/notifycmd.sh
#!/bin/bash
EMAIL='to@YOYR_EMAIL.com'
echo -e "Subject: UPS ALERT Basic: $NOTIFYTYPE\n\nUPS: $UPSNAME\r\nAlert type: $NOTIFYTYPE\n\n\nThis is a basic notification!" | msmtp $EMAIL
# Change group to nut
sudo chown :nut /etc/nut/notifycmd.sh
# Add execution
sudo chmod 774 /etc/nut/notifycmd.sh
# Restart the NUT services
sudo systemctl restart nut-server.service
sudo systemctl restart nut-driver.service
sudo systemctl restart nut-monitor.service
Extra notification script by Scheduler
Installing NUT - Network Ups Tool
Install and use Network Ups Tool - an open source Uninterruptible Power Supply software
- UPS with connected devices:
- LG TV
- Soundbar
- NUC as a media centre (with NUT monitor for Windows)
- RPi5 as brain unit with NUT, Pi-Hole and DHCP.
- TP-Link Router.
In case of a power-loss event, PRi will notify me via email, NUC will power off on its own, TV can be powered off manually.
Powered-off TV and soundbar are neglectable in total power usage on battery, so I have about 1,5 to 2 hours of running Raspberry 5 and TP-Link to keep my internet on.