Category Archives: IT Stuff

Simple Raspberry Pi RTSP stream Dashboard

So, you have a Raspberry Pi and want to use it as a dashboard to display a rtsp stream without having to install a full desktop environment.  This is useful if you want to display security camera streams etc without requiring a full desktop environment or window manager.  This way it keeps your solution simple and lightweight.

Parts needed

  • – Raspberry Pi
  • – Screen

Setup your Pi

You can install the raspberry pi OS lite edition.  Once that is up and running you need to update it:

sudo apt update && sudo apt upgrade -y

Next, install the required packages:

sudo apt install -y xserver-xorg ffmpeg

Now reboot:

sudo reboot

Once that is installed, create a service file in /etc/systemd/system/ :

sudo nano /etc/systemd/system/stream.service

and paste the following:

[Unit] 
Description=RTSP Stream to attached Screen with ffplay 
After=multi-user.target rescue.service rescue.target display-manager.service 

[Service]
Type=simple 
User=1000 # User UID to run service under
Group=1000 # Group GID to run service under
ExecStart=/usr/bin/ffplay -autoexit -rtsp_transport tcp -sync video -fflags nobuffer -framedrop  -i rtsp://hotname:port
Environment="XDG_RUNTIME_DIR=/run/user/1000" #change 1000 to the user above
Restart=always 
RestartSec=20 

[Install] 
WantedBy=multi-user.target

Once that file is saved, run the following commands

Sudo systemctl daemon-reload
sudo systemctl enable stream.service
sudo systemctl start stream.service

That’s it.  All going well your RTSP stream should now automatically come up at boot.  Enjoy

Hardware Watchdog on Linux Machines

On any modern Linux operating system that uses systemd you can configure systemd to interact with the hardware watchdog on your behalf, rather than doing it with watchdog service (apt install watchdog) or using a separate user-space daemon.

To enable the builtin systemd hardware watchdog, edit the following file:

 sudo nano /etc/systemd/system.conf

uncomment and set the following values

RuntimeWatchdogSec=10 
RebootWatchdogSec=2min 
WatchdogDevice=/dev/watchdog0

The first entry RuntimeWatchdogSec enables the systemd watchdog, RebootWatchdogSec sets the wait time after boot to start feeding the watchdog and WatchdogDevice is the hardware device to be fed.

Most modern hardware has a watchdog timer including Rapsberry Pis and most Intel chips beyond generation 7.

A bit more on the built-in systemd watchdog..

Systemd’s watchdog can be mainly used for 3 different actions:

  • hardware reset (leveraging the CPU hardware watchdog exposed at /dev/watchdog). This is enabled by the RuntimeWatchdogSec= option in /etc/systemd/system.conf
  • application reset, as long as this is foreseen in the systemd unit definition (see below service example)
  • system reset as a fallback measure in response to multiple unsuccessful application resets. Also defined in the systemd unit

example unit file:

[Unit]
Description=My Little Daemon
Documentation=man:mylittled(8)

[Service]
ExecStart=/usr/bin/mylittled
WatchdogSec=30s
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4
StartLimitAction=reboot-force

The example is taken from: http://0pointer.de/blog/projects/watchdog.html, which gives a pretty complete overview of what and how you can use the watchdog service.

 

 

 

 

Fusermount3 error with rclone

Some distributions do not name the fusermount directory as fusermount3 which rclone needs in certain circumstances (mounting as daemon).  To fix this, create a simlink to the fusermount directory in path

sudo ln -s /bin/fusermount /bin/fusermount3

Thats it, rclone will now mount without a fuse error.  you may need to alter the origin location in your environment to reflect where fusermount lives.

QNAP TS-231: configure autorun.sh

Here are some notes for setting up an autorun script on my QNAP TS-231:

Connect via ssh and issue the following commands to mount the partition where the configuration resides:

ubiattach -m  6  -d  2 
/ bin / mount  -t ubifs ubi2:config / tmp / config

Edit the autorun.sh file:

vi  / tmp / config / autorun.sh

Assign execute permissions and unmount the configuration partition:

chmod + x /tmp/config/autorun.sh umount / tmp / config 
ubidetach -m  6

Enable autorun.sh to start automatically from the web interface by going to “Control Panel / System / Hardware / General” and enable the “Run user-defined processes during startup” checkbox:

Source: https://wiki.qnap.com/wiki/Running_Your_Own_Application_at_Startup

Exclude filetypes with rclone

If you want tofilter filetypes synced by rclone, the following is what you need:

--exclude=*.jpg --exclude=*.txt

and test it using rclone ls remote: -vv

and you can combine them like so
--exclude=*.{jpg,txt}

Plex Database Cache Setting

The comands below are for Plex in Docker, however you can change the paths relevant to any Plex install.

To get current cache size…

sqlite3 "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" "PRAGMA default_cache_size;"

Change cache size (and confirm value)

sqlite3 "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" "PRAGMA default_cache_size = 6000000;" "PRAGMA default_cache_size;"

The default cache size is 20000, if you have thousands of movies and tv shows set it to a larger value (I changed it to 6000000, but any number will work for you)

Before making changes to the sqllite database stop the plex server and service then edit and restart.

also change the paths to your plex installation paths as mine are custom.
ALWAYS MAKE A BACKUP FIRST OF YOUR ENTIRE INSTALLATION FOLDER AND DATABASE STUFF!!!

Windows Server 2019/2022 Unknown Device BTH\MS_BTHPAN

Summary

Instructions to resolve unknown device appearing labeled Hardware ID BTH\MS_BTHPAN after installing Windows Server 2019 or 2022 and all drivers for Intel® NUC8i3/v5/v7PN products.

Description

After installing Windows Server 2019 and all available drivers, an Unknown Device appears in Device Manager.

Resolution

Perform the following steps to install drivers for the unknown device:

  1. Open Device Manager and double click the unknown device 
  2. Click the Details tab
  3. Click the dropdown and select Hardware Ids
  4. Confirm that the Hardware ID is BTH\MS_BTHPAN
  5. Click the Driver tab
  6. Click Update Driver > Let me pick from a list of available drivers on my computer > Bluetooth, then click next
  7. Select Microsoft from the Manufacturers list on the left, select Personal Area Network Service from the list on the right
  8. Click Yes on the “Update Driver Warning” dialog that appears

Official Windows 7 SP1 ISO Image Downloads

These are now available for those who currently have Microsoft Windows 7 with Genuine Activation Keys. These are the legitimate downloads, full ISO image to burn to a good quality blank DVD using any good image burning program such as ImgBurn or the like.

These ISO image download have Service Pack 1 integrated into the installation setup, so therefore there is no need to separately install SP1 after the initial install of Windows 7.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Windows 7 SP1 ISO Download Links Including English and Foreign Language Versions:

 

These are very high speed downloads which should take anywhere from 30 minutes to about 50 minutes, if you have a high-speed broadband connection.

My download took approximately 18 minutes from start to finish. Both IE9 and Firefox have their own download managers you may use to accomplish the download.

Thеѕе аrе NOT illegal – Thеѕе аrе јυѕt thе download links fοr Windows 7 SP1 ISO whісh іѕ a retail wrap thаt offers a 30-day trial period. Yου need tο activate уουr Windows afterwards wіth a genuine license activation key tο continue using іt. Downloading thеѕе files frοm Digital River іѕ absolutely legal аnԁ completely free οf charge.