Help | Useful commands - markbaaijens/rpmusicserver GitHub Wiki
Search for the IP-address of the server
In several cases, you should know the IP-address of you RPMS-server. This address should be stored for later reference.
By an app on your phone (Lyrion or Squeezer)
- Install the app on your phone
- For Android: Lyrion (F-droid) or Squeezer (Play Store)
- Connect to a server (both are auto-discovery, so they detect servers automatically)
- Go to the server-specifics in the app en readout the server-address
In a terminal
nmap $(echo "$(hostname -I | cut -d"." -f1-3).1")/24 -p 9000 --open
The result looks something like this:
Nmap scan report for rpms.home (192.168.2.4)
Host is up (0.0062s latency).
PORT STATE SERVICE
9000/tcp open cslistener
There might be multiple machines with port 9000 (for LMS) open. You may either try:
watch nmap rpms.home
or
watch nmap 192.168.2.4 # for example, replace with the real address
The one with an similar output like this, is our RPMS-server:
Nmap scan report for rpms.home (192.168.2.4)
Host is up (0.0032s latency).
Not shown: 993 closed tcp ports (conn-refused)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
5000/tcp open upnp
9000/tcp open cslistener
9090/tcp open zeus-admin
Check for existence of cover.jpg #transcoder
Find folders (album) which do not contain cover.jpg
ssh pi@rpms
And then:
find /media/usbdata/user/music/flac -type d -exec sh -c 'ls -1 "{}"|egrep -iq "^*\.flac$"' ';' '!' -exec sh -c 'ls "{}"|egrep -q "\cover.jpg$" ' ';' -print
Check cover-image dimension #transcoder
Within RPMS, the norm for cover.jpg is 500 x 500. With this command, you can check your collection for these dimensions.
ssh pi@rpms
sudo apt install imagemagic # If identify (from imagemagic) is not installed
And then:
find /media/usbdata/user/music/flac -name "cover.jpg" -exec identify -format '%wx%h ' {} \; -exec echo {} \; | grep -v 500x500
Backup (remote)
Prepare a local disk
- format as (preferably)
fat32 - label:
backup
Connect the local disk to your workstation.
On your (Linux) PC:
sudo nano /usr/local/bin/backupserver
Copy and paste the following text into the text-editor:
#!/bin/bash
sshpass -p rpms rsync --progress --delete -rtv --max-size=4GB --modify-window=2 --exclude Downloads \
pi@rpms:/media/usbdata/user/* \
/media/$USER/BACKUP/user
sync
Note: when the server is not accessible by name, so ping rpms does not work, replace the rpms part in pi@rpms:/media/usbdata/user/* in the actual ip-address, for example [email protected]:/media/usbdata/user/*
Save changes in the editor with Ctrl-O en the exit with Ctrl-X
Make the script executable:
sudo chmod +x /usr/local/bin/backupserver
Execute:
backupserver
Start Squeezelite locally
Convert your Linux-machine into a LMS-player.
On your (Linux) PC:
sudo nano /usr/local/bin/startsl
Copy and paste the following text into the text-editor:
squeezelite -o default -z -n "<name oy your machine>"
Save changes in the editor with Ctrl-O en the exit with Ctrl-X
Make the script executable:
sudo chmod +x /usr/local/bin/startsl
Execute:
startsl