vorbereitungen unter debian


 ./reboot-to-writable-mode.sh

#### Python
apt install -y python3-pip python3-venv python3-dev libffi-dev


### Memcached
sudo apt install -y memcached
sudo systemctl enable memcached.service
sudo systemctl restart memcached.service


### Mosquitto
sudo apt install -y mosquitto mosquitto-clients

sudo bash -c "cat > /etc/mosquitto/mosquitto.conf" <<'EOT'
listener 1883 0.0.0.0
protocol mqtt
allow_anonymous true
persistence true
persistence_location /mnt/usb1/mosquitto/
persistent_client_expiration 2m
include_dir /etc/mosquitto/conf.d
EOT

cp -a /var/lib/mosquitto /mnt/usb1/

sudo systemctl enable mosquitto.service
sudo systemctl restart mosquitto.service

##############################
mDNS Discovery für MQTT

sudo apt install -y avahi-daemon
sudo bash -c "cat > /etc/avahi/services/mqtt.service" <<'EOT'
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">MQTT on %h</name>
  <service>
   <type>_mqtt._tcp</type>
   <port>1883</port>
  </service>
</service-group>
EOT

sudo systemctl enable avahi-daemon
sudo systemctl restart avahi-daemo

adduser --system --group --home /mnt/usb1/riego --shell /bin/bash riego
chown -R riego.riego /mnt/usb1/riego
chmod 2775 /mnt/usb1/riego

Login as riego:
su --login riego

cd /mnt/usb1/riego
rm -rf .venv
python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip && chmod -R g+w .venv/ && echo "source .venv/bin/activate" >/mnt/usb1/riego/.profile
curl https://sh.rustup.rs -sSf | sh

pip install riego
exit
sh /mnt/usb1/riego/.venv/bin/setup_riego_service.sh









VSC-Windows-Development:

python3 -m venv .venv
.venv\scripts\activate
pip install pylint
pip install pep8
pip install -r requirements_dev.txt

code .
Extension "Python von Microsoft" installieren
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned


VSC-Mac-Development:

python3 -m venv .venv
source .venv/scripts/activate
pip install pylint
pip install pep8
pip install -r requirements_dev.txt

code .
Extension "Python von Microsoft" installieren




