How to send email via gmail raspian buster
sudo apt-get install msmtp msmtp-mta mailutils
following
and/or
sudo gedit /etc/apt/sources.list-add following line to the bottom of the file and save
deb http://http.debian.net/debian jessie-backports mainYou will encounter signature errors, to
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -
sudo apt-get update-Install PHP, and MySQL server. You will be prompted to set a MySQL password
sudo apt-get install php5 mysql-server php-pear php5-mysql php5-gd- Then install zoneminder using the software center of Raspbian
sudo apt-get install zoneminder
CREATE TABLE `Logs` (
DROP TABLE IF EXISTS `Logs`;
mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.*
to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload
sudo chmod 740 /etc/zm/zm.conf
sudo chown root:www-data /etc/zm/zm.conf
sudo systemctl enable zoneminder.service
sudo adduser www-data video
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf
sudo a2enmod cgi
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo chown -R www-data:www-data /usr/share/zoneminder/
sudo systemctl enable zoneminder
sudo service zoneminder start
sudo nano /etc/php5/apache2/php.ini
sudo service apache2 reload
sudo apt-get install gstreamer1.0-tools
sudo sh -c 'echo deb http://vontaene.de/raspbian-updates/ . main >> /etc/apt/sources.list'add the missing key for this repo
gpg --recv-keys 0C667A3Eupdate your machine
gpg -a --export 0C667A3E | sudo apt-key add -
sudo apt-get updateInstall all necessary OPENMAX plugins for gstreamer
sudo apt-get -y upgrade
sudo apt-get install libgstreamer1.0-0 liborc-0.4-0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-alsa gstreamer1.0-omx gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-x libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0done
install sudo apt-get python-pipbased on on http://stackoverflow.com/questions/36962260/batch-upload-videos-to-youtube-via-command-line-python
#!/bin/bashrun the script as cron every nite
# Ugly script to generate AVI files for youtube from zoneminder events
# Change the followingvariables to accomodate your install and where you want the videos exported, there are more links in the code to check
events_dir=/var/cache/zoneminder/events/
THEDATE=$(date --date="today" +%Y-%m-%d)
MYTITLE="KompostNutzer-Gaselstr-$THEDATE"
#cd $events_dir
# If you don't want the ENTIRE server's events and just want the latest week's worth
# then just add something like -mtime -7 before the "-print" part. That's what I did later so I could have a weekly cron job.
find $events_dir -name "*-capture.jpg" -mtime -1 -print > /home/pi/temp/unsortedallevents.txt
sort -n /home/pi/temp/unsortedallevents.txt > /home/pi/temp/allevents.txt
filename='/home/pi/temp/allevents.txt'
echo Start copying files ....
cd temp/
aa=0
while read p; do
# echo $p
cp $p `printf "%04d" $aa`.jpg; aa=$(($aa+1))
done < $filename
echo Start creating vid files .... grab a coffee
#gsttramer create movie
gst-launch-1.0 multifilesrc location=%04d.jpg index=1 caps="image/jpeg,framerate=24/1" ! jpegdec ! omxh264enc ! avimux ! filesink location=daily.avi
#upload
youtube-upload --title=$MYTITLE daily.avi
cd
#sleep 10
rm /home/pi/temp/*.jpg
rm /home/pi/temp/*.avi
rm /home/pi/temp/allevents.txt
rm /home/pi/temp/unsortedallevents.txt
exit
apt-get install html-xml-utils
#/bin/bash
echo Checking if USB Cam is still running.....
cd /home/pi/temp/
#extracting last 10min of syslog
sed -n "/^$(date --date='10 minutes ago' '+%b %_d %H:%M')/,\$p" /var/log/syslog
> last10min.txt
#if usb cam is not working..simply reboot.
if grep -q "Failed to start capture stream: Broken pipe" last10min.txt ; ##note
the space after the string you are searching for
then
echo "Cam not working" ; echo "restarted zoneminder due to broken pipe of USBCAM
" | mail -s "zm restarted" david.oesch@gmail.com ; sleep 10m ; rm last10min.txt
; /sbin/reboot
else
echo "Cam working"
fi
#if usb cam is not working..simply reboot.
if grep -q "Failed to set video format: Device or resource busy" last10min.txt ;
##note the space after the string you are searching for
then
echo "Cam not working" ; echo "restarted zoneminder due to Device busy" | mail -
s "zm restarted" david.oesch@gmail.com ; sleep 10m ; rm last10min.txt ; /sbin/re
boot
else
echo "Cam working"; rm last10min.txt
fi
exit
wget http://www.risacher.org/sunwait/sunwait-20041208.tar.gz
tar xvzf sunwait-20041208.tar.gz
cd sunwait-20041208/
ls
make
sudo cp sunwait /usr/local/bin
# vi /etc/init.d/mystartup.sh
#!/bin/bash
/usr/local/bin/sunwait civ down -1:00:00 46.90860N 7.41549E; /usr/sbin/service zoneminder stop
# chmod +x /etc/init.d/mystartup.shiv)Make sure this script get executed every time Debian Linux system boot up/comes up:
# update-rc.d mystartup.sh defaults 100
UUID="822482F72482ED8B" /media/Pladde ntfs-3g defaults,auto,uid=1000,gid=1000,umask=000 0 0
#!/bin/bash
URL="${1}"
FILEmp3="${URL##*\/}"
FILEwav="${FILEmp3%%.*}.wav"
FILE3="${FILEwav%%.*}.mp3"
WDIR="$(mktemp -d "/tmp/rtpdump.XXXXXX")"
trap 'rm -rf "${WDIR}"' EXIT INT HUP
rtmpdump -r ${URL} -o ${WDIR}/${FILEmp3}
mplayer ${WDIR}/${FILEmp3} -ao pcm:file=${FILEwav}
avconv -i $FILEwav "$FILE3"
rm $FILEwav
sudo modprobe snd_bcm2835sudo amixer cset numid=3 1
update-rc.d vlc defaults