Loading...
 

HP Elitebook Setup


#--------------------------------------------------------------------------------
# HP Elitebook BIOS upgrade
HP Elitebook 2570p (i7 3520M)      2x8GB RAM  BIOS v66 2 TB SSD, 2 TB 2nd
HP Elitebook 2560p (i7 2620M) x2   2x8GB RAM  BIOS v69 2 TB SSD, 2 TB 2nd (x2; on each)
  spare: 5x4 GB RAM, 150 GB Win8 disk, 2 TB spare

https://h30434.www3.hp.com/t5/Notebook-Hardware-and-Upgrade-Questions/Latest-BIOS-for-HP-EliteBook-2560p/td-p/8149281
 but requires windows running on the machine to upgrade.
 https://ftp.hp.com/pub/softpaq/sp85501-86000/sp85526.exe  2560p v66		# Likely last ever; from 2018
 https://ftp.hp.com/pub/softpaq/sp85001-85500/sp85500.exe  2570p v69		# Likely last ever; from 2018
 
Never could get to work using windows-B or other mechanisms; restored to using Win8 disk and running Windows utility

#--------------------------------------------------------------------------------
# Install Ubuntu Desktop on Elitebook
Install Ubuntu from USB Stick on Legacy Boot; then change to UEFI w/out CRM to boot off new disk
2570 needs to add custom boot order ahead of hardisk: \EFI\Ubuntu\shimx64.efi (or remove EFI/BOOT/fbx64.efi )
  (see https://askubuntu.com/questions/1417217/reset-system-boot-loop-after-installing-ubuntu-22-04-lts-on-hp-probook)

#--------------------------------------------------------------------------------  
# Remove SNAPD and all its apps
lsblk
To remove SNAP and /dev/loop* ent ries:
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.seeded.service
sudo systemctl mask snapd.service			# creates symlink /etc/systemd/system/snapd.service -> /dev/null
sudo apt purge snapd
sudo apt autoremove
sudo rm -rf /etc/systemd/system/snapd* /etc/systemd/system/snap-* var-snap-firefox*mount		# all the /dev/loop mount scripts
sudo umount /var/snap/firefox/common/host-hunspell							# One mount seemingly left over
sudo rm -rf /var/snap											# Only happens when umounts done
sudo apt-mark hold snapd				# https://askubuntu.com/a/1345401/1744185
sync ; sync ; reboot

# To get SNAPD back:
sudo rm -f /etc/systemd/system/snapd		# The symlink created earlier
sudo apt install snapd				# Turns off the hold

#--------------------------------------------------------------------------------
# Add Google Chrome
cd /usr/local
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
# rm -f google-chrome-stable_current_amd64.deb

#--------------------------------------------------------------------------------
# Add second H			# https://askubuntu.com/questions/125257/how-do-i-add-an-additional-hard-drive
sudo cgdisk /dev/sdb 		# if not yet partitioned)
sudo mkfs -t ext4 /dev/sdb1 	# if not yet formatted)  Capture UUID there or ...
sudo blkid /dev/sdb1		# To get UUID for partition
sudo vi /etc/fstab
  UUID=5d6c8f68-dcc8-4a91-a510-9bca2aa71521	/backup	ext4	defaults	0	0		# Used to be /dev/sdb1 instead of UUID
sudo mkdir /backup
sudo mount /backup

#--------------------------------------------------------------------------------
# Add ssh server		# https://www.cyberciti.biz/faq/how-to-install-ssh-on-ubuntu-linux-using-apt-get/
sudo apt install openssh-server
sudo systemctl enable ssh
sudo ufw allow ssh
# If needed later: sudo systemctl start ssh ; stop ssh ; restart ssh

# Add ssh client (if needed)
sudo apt install openssh-client
ssh user@server
scp file user@server:/path
ssh user@server who		# To run commands on remote server without creating a terminal connection

#--------------------------------------------------------------------------------
# Add static IP reservation
goto 10.1.10.1, advanced setup, ....
add reservation, select laptop currently on, shoose 16-18 for WebServ1-3
Apply ; reboot router

#--------------------------------------------------------------------------------
# To prevent laptop from sleeping when closing lid or over set period of time
sudo add-apt-repository universe
sudo apt install gnome-tweaks
start tweaks and disable "suspent on lid close"
sudo vi /etc/systemd/logind.conf
Uncomment and set:
  HandleLidSwitch=ignore
  HandleLidSwitchExtendPower=ignore
  LidSwitchIgnoreInhibited=no
GUI settings: power: auto-suspend turned off

#--------------------------------------------------------------------------------
# Turn off Wifi when cable connected
sudo apt install tlp
sudo vi /etc/tlp.conf
 Uncomment and possibly change value as shown:
 WIFI_PWR_ON=off
 WOL_DISABLE=N
 DEVICES_TO_DISABLE_ON_STARTUP=( )       # Remove wifi
 DEVICES_TO_ENABLE_ON_STARTUP=( wifi )   # simply uncomment
 DEVICES_TO_DISABLE_ON_SHUTDOWN=(  )     # simply uncomment
 DEVICES_TO_ENABLE_ON_AC=( wifi )        # simply uncomment
 DEVICES_TO_DISABLE_ON_BAT=(  )          # Remove wifi
 DEVICES_TO_DISABLE_ON_LAN_CONNECT=(  )  # Add wifi
 DEVICES_TO_ENABLE_ON_LAN_DISCONNECT=( wifi )   # Add wifi
 
#--------------------------------------------------------------------------------
# Disable MOTD via SSH
sudo vi /etc/pam.d/sshd
  comment out two lines w/ motd: session optional pam.motd ....

# Install LXC/LXD container software (vs Docker)		# https://ubuntu.com/server/docs/containers-lxc

#--------------------------------------------------------------------------------
sudo apt install net-tools -y   # to get ifconfig
sudo apt install cifs-utils -y  # to get SMB mount capability

#--------------------------------------------------------------------------------
# Install Docker     https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install docker engine
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

#--------------------------------------------------------------------------------
# Install Jellyfin version (see https://jellyfin.org/docs/general/installation/container#docker)  (not tried)

#--------------------------------------------------------------------------------
# Install Jellyfin apt version
sudo apt install jellyfin-server
# sudo apt update ; sudo apt upgrade  # for jellyfin-web jellyfin-server

#--------------------------------------------------------------------------------
# Install Jellyfin (manual automatic; not docker) (see https://jellyfin.org/docs/general/installation/linux#repository-automatic)
wget -O -  https://repo.jellyfin.org/install-debuntu.sh | sudo bash

sudo systemctl status jellyfin.service  or  sudo service jellyfin status (vs start, stop)

# Have to locally mount any media repositories that the Jellyfin server relies on ; gives local path for setup
sudo mkdir /media/cd_dvd ; sudo mkdir /media/family
sudo cat >> /etc/fstab <<EOF
//Media.local/cd_dvd    /media/cd_dvd cifs credentials=/opt/jellyfin/.smbcredentials,iocharset=utf8 0 0
//Media.local/family    /media/family cifs credentials=/opt/jellyfin/.smbcredentials,iocharset=utf8 0 0
EOF
sudo vi /opt/jellyfin/.smbcredentials
username jellyfin
password xxyyzzz  (see KeePass)
sudo mount -a

On another machine, web access the Jellyfin setup panel: 
http://10.1.10.16:8096/ ( account: admin, pass: xxxxxxxxx )
Add libraries
Add users (admin2 w/ db keyword and admin priv, randy, christina, roshan, beth; max 3 login attempts; max 1 user session except 3 for beth; hide only admin2 from panel)
Add TV Tuners (use SchedulesDirect, user: SurplusGadgets, pass: 3MAZXfTPtq2k3tn ; source is Antennae (at very bottom of list))
Add DVR
Add custom css in user Display (only works on web access; not in apps)
# https://www.reddit.com/r/jellyfin/comments/iomrc5/comment/jmq3jpa/?utm_source=reddit&utm_medium=web2x&context=3
@media all {
.homePage .emby-scroller { margin-right: 0; }
.homePage .emby-scrollbuttons { display: none; }
.homePage .itemsContainer { flex-wrap: wrap; }
}
Reorder libraries (user settings, home) Movies, TVShows, Music, LiveTV, Family Photos, Family Music, Family Videos
  And home sections (My Media-small, LiveTV, Continue Watching, Active, Continue listening, Active Recording, None, None)
  Remove Home * groups from Latest Media, etc.


# Add Subtitle feature (see https://gofoss.net/media-streaming/#subtitles)
load / enable "Open Subtitles" plugin
Opensubtitles.org account (RandyHa, Hz6DYhbyQBhMnPHl9wX4$)


# Due to a change to ffpmeg7 from ffmpeg5, needed to switch to aptitude to update jellyfin (https://askubuntu.com/a/510161):
sudo apt-get install aptitude -y
sudo aptitude safe-upgrade


# Required after software update (?) 
#  (debugging where service stops due to failed exit status=143; 
#  ( /opt/jellyfin/log/<latest log>/log shows -- ReadOnly: SQLitePCL.pretty.SQLiteException: attempt to write a readonly database)
  
ln -s /usr/share/jellyfin/web/ /usr/lib/jellyfin/bin/jellyfin-web
# found /opt/jellyfin/config/migrations.ml and some other files owned by root; rest owned by randy.  Changed all to owned by Randy

# Log when trying to restart (sudo service jellyfin start) lists read-only DB error. 
[2024-02-11 20:29:54.309 -05:00] [FTL] [1] Main: Error while starting server.
ReadOnly: SQLitePCL.pretty.SQLiteException: attempt to write a readonly database

# not clear what DB file has lock.  See /opt/jellyfin/data/data/{jellyfin,library}.db and /var/lib/jellyfin/data/{jellyfin,library}/db for possible)
sudo apt-get install sqlite3
sqlite3 dbname.db
pragma locking_mode                 # see https://www.sqlite.org/pragma.html#pragma_locking_mode
   
# Noticed that /opt/jellyfin/data/data/*db files owned by root; but all above owned by Randy. So changed all to owned by Randy.
# Rerun sudo /opt/jellyfin/jellyfin.sh (which is what /etc/systemd/services/jellyfin.services runs) (when halts; ctrl-z then bg)

*******
Noticed only accesible via internetIP:8096 and not from local 10.1.10.16:8096 . And then back to original setup screen to set admin password, etc. -- anybody on internet could do.
*******

# To uninstall when installed via apt-get:
rm -rf /var/lib/jellyfin /etc/jellyfin /opt/jellyfin    # see https://www.reddit.com/r/jellyfin/comments/xhgn2l/how_do_i_fully_reinstall_jellyfin/
sudo apt-get remove jellyfin-web jellyfin-server        # Not listed due to RHEL question but needed on other Debian instead of dnf command given

# But how to leave config settings and data folders to be reused if reinstalling?

# Admin account locked out
# https://jellyfin.org/docs/general/administration/troubleshooting/#unlock-locked-user-account
http://104.185.79.219:8096/  or 10.1.10.16:8096

sudo service jellyfin stop/status/start
*** IMPORTANT -- use /opt/jellyfin/config/system.xml and not /etc/jellyfin/system.xml  to get to system reinitialize screen
cd /opt/jellyfin/data/data
sqlite3 jellyfin.db
UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = 'admin3';
UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = 'admin3');
# https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/PermissionKind.cs




Created by Randy. Last Modification: Friday 13 of December, 2024 13:30:52 EST by Randy. (Version 4)