change precompiled bins from tar to tar.gz. Add script to install mjpg streamer

This commit is contained in:
Ilia Korshunov 2025-06-24 23:09:28 +03:00
parent 874662fbd8
commit b4238ead85
8 changed files with 55 additions and 3 deletions

View File

@ -15,6 +15,7 @@ while True:
splitted = line.split(":")[1].split("->")
key = base64.b64decode(splitted[0]).decode()
value = base64.b64decode(splitted[1]).decode()
print(key, value)
if key.startswith("namespace_webcams"):
webcams = True
newValue = base64.b64encode(b"entries=1").decode()

22
adds/setRuLanguage.py Normal file
View File

@ -0,0 +1,22 @@
import base64
file = open("moonraker.db", "r")
result = []
while True:
line = file.readline()
if not line:
break
splitted = line.split(":")[1].split("->")
key = base64.b64decode(splitted[0]).decode()
value = base64.b64decode(splitted[1]).decode()
if key.startswith("uiSettings"):
newValue = base64.b64encode(value.replace('"locale": "zh-CN"', '"locale": "ru-RU"').encode()).decode()
fullNewStr = f"+16,{len(newValue)}:{splitted[0]}->{newValue}\n"
result.append(fullNewStr)
else:
result.append(line)
file.close()
file = open("moonraker_updated.db", "w")
file.write("".join(result))
file.close()

5
adds/start_ffmpeg.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
sudo nginx -s reload
sudo mkdir /tmp/timelapse
sudo /mjpgstreamer/mjpg_streamer -i "/mjpgstreamer/plugins/input_uvc/input_uvc.so -d /dev/video0 -r 1280x720 -f 5" -o "/mjpgstreamer/plugins/output_http/output_http.so -n -p 8080"

BIN
bins/mjpgstreamer.tar.gz Normal file

Binary file not shown.

Binary file not shown.

BIN
bins/tgBot.tar.xz Normal file

Binary file not shown.

24
installMjpgStreamer.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "You must provide your printerIp"
exit 1
fi
cat << EOF | chroot /server/tmp /bin/bash
cd /
wget https://github.com/pjandro/fbS1Scripts/raw/refs/heads/main/bins/mjpgstreamer.tar.gz
tar xfvp mjpgstreamer.tar.gz
rm mjpgstreamer.tar.gz
sync
mv start_ffmpeg.sh start_ffmpeg.sh_back
wget https://raw.githubusercontent.com/pjandro/fbS1Scripts/refs/heads/main/adds/start_ffmpeg.sh
chmod +x ./start_ffmpeg.sh
cd /tmp
/home/gem/moonraker-env/bin/python3 /home/gem/moonraker/scripts/dbtool.py backup /home/gem/printer_data/database moonraker.db
wget https://raw.githubusercontent.com/pjandro/fbS1Scripts/refs/heads/main/adds/changeCameraSettings.py
/home/gem/moonraker-env/bin/python3 changeCameraSettings.py $1
rm moonraker.db
/home/gem/moonraker-env/bin/python3 /home/gem/moonraker/scripts/dbtool.py restore /home/gem/printer_data/database moonraker_updated.db
rm moonraker_updated.db
rm changeCameraSettings.py
EOF
sync && sleep 2 && reboot

View File

@ -6,9 +6,9 @@ fi
cat << EOF | chroot /server/tmp /bin/bash
apt install python3-virtualenv automake libtool libwebp-dev
cd /home/gem
wget https://github.com/pjandro/fbS1Scripts/raw/refs/heads/main/bins/tgBot.tar
tar xfvp tgBot.tar
rm tgBot.tar
wget https://github.com/pjandro/fbS1Scripts/raw/refs/heads/main/bins/tgBot.tar.gz
tar xfvp tgBot.tar.gz
rm tgBot.tar.gz
sync
sleep 2
cp /home/gem/moonraker-telegram-bot/scripts/base_install_template /home/gem/printer_data/config/telegram-bot.cfg