wlado's website

Raspberry Pi 3 - Plex server

$ sudo apt-get update
$ sudo apt-get upgrade

1) Instalace HTTPS download transport pro APT (pokud chybí)
-----------------------------------------------------------

$ sudo apt-get install apt-transport-https -y --force-yes
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.4.8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$

2) Stažení klíče pro download
-----------------------------

$ wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -

--2017-12-26 18:58:25-- https://dev2day.de/pms/dev2day-pms.gpg.key
Resolving dev2day.de (dev2day.de)... 144.76.172.47, 2a01:4f8:200:502e::2
Connecting to dev2day.de (dev2day.de)|144.76.172.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1646 (1.6K) [application/pgp-keys]
Saving to: ‘STDOUT’

- 100%[===================>] 1.61K --.-KB/s in 0s

2017-12-26 18:58:26 (35.4 MB/s) - written to stdout [1646/1646]

OK
$

3) Přidání Plex repozitáře do seznamu zdrojů
--------------------------------------------

$ echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
deb https://dev2day.de/pms/ jessie main
$

Aktualizace: 2018-11-13 Stretch
echo "deb https://dev2day.de/pms/ stretch main" | sudo tee /etc/apt/sources.list.d/pms.list
deb https://dev2day.de/pms stretch main

4) znovu update
---------------

$ sudo apt-get update
Hit:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Get:3 https://dev2day.de/pms jessie InRelease [1,803 B]
Get:4 https://dev2day.de/pms jessie/main armhf Packages [960 B]
Fetched 2,763 B in 1s (1,400 B/s)
Reading package lists... Done
$

5) Instalace Plex Media Server
------------------------------
$ sudo apt-get install -t jessie plexmediaserver -y
...
$

Aktualizace: 2018-11-13 Stretch
sudo apt-get install -t stretch plexmediaserver-installer -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
plexmediaserver-installer
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,680 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://dev2day.de/pms stretch/main armhf plexmediaserver-installer armhf 1.14.1.5488-cc260c476-1 [7,680 B]
Fetched 7,680 B in 0s (11.9 kB/s)
Selecting previously unselected package plexmediaserver-installer.
(Reading database ... 34656 files and directories currently installed.)
Preparing to unpack .../plexmediaserver-installer_1.14.1.5488-cc260c476-1_armhf.deb ...
Unpacking plexmediaserver-installer (1.14.1.5488-cc260c476-1) ...
Setting up plexmediaserver-installer (1.14.1.5488-cc260c476-1) ...
Adding user plex to group video
Downloading readynas package ...
######################################################################## 100.0%
Passed checksum test.
Extracting readynas.deb ...
rm: cannot remove '/etc/systemd/system/plexmediaserver.service.d/override.conf': No such file or directory
Synchronizing state of plexmediaserver.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable plexmediaserver
Processing triggers for systemd (232-25+deb9u6) ...
$

6) reboot
---------

$ sudo reboot

pozor trvá dlouho cca 2 minuty

7) Spuštění Plexu na prohlížeči
-------------------------------

7.1 Ve web prohlížeči: http://ip_adresa_raspberrypi:32400/web

7.2 zmáčknout vpravo dole What’s this?

7.3 zmáčknout dole Skip...

7.4 zmáčknout Chápu Aktualizace: Rozumím

7.5 zavřít okno Plex Pass

7.6 Nastavení serveru
- Pojemnování ... : plex
- Nezaškrtnout: Povolit přístup k mým médiím i mimo můj domov
- Další

7.7 Nastavení serveru
- Přidat knihovnu
- Další

tady někde to skončí ve smyčce, protože nejsou na disku žádná užitečná data

8) Nastavení uživatele
----------------------

$ sudo nano /etc/default/plexmediaserver.prev
(defaultní výpis)

# default script for Plex Media Server

# the number of plugins that can run at the same time
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6

# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000

# where the mediaserver should store the transcodes
PLEX_MEDIA_SERVER_TMPDIR=/tmp

# uncomment to set it to something else
# PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application\ Support"

# the user that PMS should run as, defaults to 'plex'
# note that if you change this you might need to move
# the Application Support directory to not lose your
# media library
PLEX_MEDIA_SERVER_USER=plex

* Poznámky k posledním verzím 2017: https://forums.plex.tv/discussion/288301/update-plexmediaserver-on-raspberry-pi-3

* Starší návod: https://medium.com/@nem25/plex-media-server-on-raspberry-pi-3-using-raspbian-lite-b2f67761e674

* Novější návod: https://medium.com/@nem25/plex-media-server-on-raspberry-pi-3-using-raspbian-lite-stretch-feace75f2b1d

Samba
=====

Instalace
---------

$ sudo apt-get install samba samba-common-bin -y

Aktualizace 2018-11-13 Stretch lite

$ sudo apt-get install samba samba-common-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
attr libaio1 libfile-copy-recursive-perl libgpgme11 python-dnspython
samba-dsdb-modules samba-vfs-modules tdb-tools update-inetd
Suggested packages:
gpgsm bind9 bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind
ufw heimdal-clients
The following NEW packages will be installed:
attr libaio1 libfile-copy-recursive-perl libgpgme11 python-dnspython samba
samba-common-bin samba-dsdb-modules samba-vfs-modules tdb-tools
update-inetd
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,869 kB/2,424 kB of archives.
After this operation, 15.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
...
Setting up samba-common-bin (2:4.5.12+dfsg-2+deb9u4) ...
Setting up samba-dsdb-modules (2:4.5.12+dfsg-2+deb9u4) ...
Setting up attr (1:2.4.47-2) ...
Setting up libfile-copy-recursive-perl (0.38-1) ...
Setting up update-inetd (4.44) ...
Setting up samba-vfs-modules (2:4.5.12+dfsg-2+deb9u4) ...
Setting up samba (2:4.5.12+dfsg-2+deb9u4) ...
Adding group `sambashare' (GID 114) ...
Done.
Samba is not being run as an AD Domain Controller, masking samba-ad-dc-service.
Please ignore the following error about deb-systemd-helper not finding samba-ad-dc-service.
Created symlink /etc/systemd/system/multi-user.target.wants/nmbd.service
/lib/systemd/system/nmbd.service.
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Created symlink /etc/systemd/system/multi-user.target.wants/smbd.service
/lib/systemd/system/smbd.service.
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u6) ...

Zálohovat soubor smb.conf
-----------------------------

$ sudo cp /etc/samba/smb.conf /etc/samba/smb.bak

Editovat smb.conf
-----------------

$ sudo nano /etc/samba/smb.conf
# wins support = no
změnit na
wins support = yes

Nastavení sdílené složky
------------------------

# name of share, it will be displayed when we search your network for shares
[PLEXMEDIA]
# komentář
comment = Plex media share
# path to shared folder
path = /home/pi/media
# this argument will determine the permission settings used when
# we create a new file in our share
create mask = 0775
directory mask = 0775
# alow our share to be seen by the windows client
browseable = yes

only guest = no
# alow guests to read/download files in our share (0775)
guest ok = yes


[public]
comment=veřejná složka
path=/home/pi/public
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
#public=no
guest ok=yes


Kontrola nastavení
------------------

$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[PLEXMEDIA]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

...

[PLEXMEDIA]
comment = Plex media share
path = /home/pi/media
create mask = 0775
guest ok = Yes


Nastavit uživatele
------------------
$
sudo smbpasswd -a pi
-- heslo stejne jako k uzivateli pi (aby se to lépe pamatovalo)
New SMB password:
Retype new SMB password:
Added user pi.

Restart
-------

$ sudo /etc/init.d/samba restart
Restarting nmbd (via systemctl): nmbd.service.
Restarting smbd (via systemctl): smbd.service.


--------------------------------------------------
Zdroje:

https://medium.com/@nem25/plex-media-server-on-raspberry-pi-3-using-raspbian-lite-b2f67761e674

parametry samba: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html