Thursday, August 4, 2022

My personal HTPC server setup v3

I managed to brake my HTPC operating system when forcing Ubuntu to update to version 22.04, so I decided to format everything and start from scratch. This is like a step by step list of software and scripts I am using:

That is it for now. In near future will add either Syncthing or Nextcloud and other stuff I might need.

Sunday, July 4, 2021

How to run web apps in background

Most popular browsers stop web apps when there is another full screen app in the foreground.

To fix that on Chromium based browser (Chrome, Edge, Brave, etc) go to chrome://flags and disable #calculate-native-win-occlusion.

Update 1: This flag is being removed, for now it can be temporary brought back enabling flags starting with #temporary-unexpire-flags, but not for long.

Update 2: The flag is gone. Another solution would be adding command line parameter --disable-features=CalculateNativeWinOcclusion, found on r/Granblue_en subreddit.

Update 3: Looks like the flag #calculate-native-win-occlusion is back in version 101+, but I would suggest using both the flag and the command line parameter.

To fix that on Firefox go to about:config and here are some options:

Chrome also suspends non-active tabs. Disabling flag #intensive-wake-up-throttling or extension The Great Suspender should remedy that, however it did not work for me at a first glance. Not sure about Firefox.

Wednesday, June 26, 2019

Friday, March 15, 2019

My personal HTPC server setup v2

  • Ubuntu
  • Vino
  • SSH
  • Samba + NFS maybe
  • Dropbox (nautilus-dropbox)
  • Kodi + sudo adduser $USER dialout for Kodi to be able to access CEC adapter
  • Kodi plug-ins:
  • Docker + post-installation steps
  • Docker compose
  • Docker packages, using /opt/appdata/package_name/ for config and /var/package_name/ for data storage:
    • Letsencrypt + reverse proxy, should switch to SWAG
    • Portainer
    • Emby
    • Nextcloud, if online update timeouts these commands can be used to update manually:
      • docker exec -it nextcloud /bin/bash
      • sudo -u abc php7 /config/www/nextcloud/updater/updater.phar
    • MariaDB
    • WebGrab+Plus, should change <timespan> and <update> values to default, also change downloads folder to `/Downloads` instead of `/root/Downloads`. To update manually exec into the container and run s6-setuidgid abc /bin/bash /defaults/update.sh.
    • Deluge - run it in bridge mode and assign port 8112 for reverse proxy to work 
    • Jackett
    • Sonarr, needs adjustments in Settings -> Download Client -> Remote Path Mappings
    • Duplicati
  • Secure Apache + PHP Nginx webserver bundled with Letsencrypt container is used instead
  • Steam + Xbox One S controller fix

Sunday, September 2, 2018

My personal Xubuntu htpc/server setup

1. Install Xubuntu

Enable auto login https://askubuntu.com/questions/530072/how-to-auto-login-in-xubuntu
Install Chrome
Install Chrome Remote Desktop + make it use same windows server...
Using Vino instead

2. Install Emby

Mount my external HDD for Emby to have full control:
https://emby.media/community/index.php?/topic/32218-file-permissions-guide-for-new-linux-users/ and https://askubuntu.com/questions/502727/how-do-i-automount-partitions-on-statup-xubuntu-14-04,
also some bonus information for possible future use:
https://emby.media/community/index.php?/topic/37535-building-emby-in-ubuntu-server/

Autostart Emby https://emby.media/community/index.php?/topic/31993-emby-server-doesnt-autostart/
service file location /etc/systemd/system/multi-user.target.wants/emby-daemon.service
config /etc/emby-server.conf
[Service]
ExecStartPre=/bin/sleep 30

3. Install Kodi

Fix libcec https://forum.kodi.tv/showthread.php?tid=226183

4. Install Dropbox

Fix Dropbox...

5. Install Docker and a few containers


sudo docker run -d --name portainer --restart=always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

Get the containers and some instructions from https://gitlab.com/hotio/suitarr/blob/master/README.md and https://www.smarthomebeginner.com/install-sonarr-using-docker/

sudo docker run -d --name sonarr --restart=always -p 8989:8989 -e PUID=1000 -e PGID=1000 -e UMASK=022 -e VERSION=image -v /etc/localtime:/etc/localtime:ro -v /home/docker/sonarr/config:/config -v /mnt/my_passport/TV\ Series:/tv -v /home/docker/sonarr/downloads:/downloads hotio/suitarr:sonarr

Important: Sonarr needs adjustments in Settings -> Download Client -> Remote Path Mappings

sudo docker run -d --name jackett --restart=always -p 9117:9117 -e PUID=1000 -e PGID=1000 -e UMASK=022 -e VERSION=image -v /etc/localtime:/etc/localtime:ro -v /home/docker/jackett/config:/config hotio/suitarr:jackett

sudo docker run -d --name radarr --restart=always -p 7878:7878 -e PUID=1000 -e PGID=1000 -e UMASK=022 -e VERSION=image -v /etc/localtime:/etc/localtime:ro -v /home/docker/radarr/config:/config -v /mnt/my_passport/Movies/Other:/movies -v /home/docker/radarr/downloads:/downloads hotio/suitarr:radarr

6. And finally the web server

https://lowendbox.com/blog/how-to-setup-apache-virtual-hosts-on-ubuntu-16-04/
Required for WordPress: https://www.digitalocean.com/community/tutorials/how-to-rewrite-urls-with-mod_rewrite-for-apache-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04

Tuesday, April 11, 2017

Ubuntu + Kodi + IPTV + Exodus + Dropbox + Deluge cheatsheet

I have a very old laptop and want to use it as a HTPC, so I decided to install some light Ubuntu distribution and Kodi on it, accompanied by Deluge to download stuff using web interface, Dropbox for IPTV playlist and program guide and Exodus for VOD. Bellow I listed important terminal commands and other notes important for this setup to have them all in one place:
  1. First install Lubuntu or Xubuntu.
  2. Next add Kodi and Deluge repositories and update packages index:
    sudo add-apt-repository ppa:team-xbmc/ppa (Ubuntu repository has own version so this might be skipped)
    sudo add-apt-repository ppa:deluge-team/ppa (Ubuntu repository has own version so this might be skipped)
    sudo apt-get update
  3. Upgrade stuff:
    sudo apt-get upgrade
  4. Install stuff:
    sudo apt-get install kodi
    sudo apt-get install kodi-pvr-iptvsimple
    sudo apt-get install nautilus-dropbox (or download Ubuntu package from dropbox and install it with gdebi)
    sudo apt-get install deluged
    sudo apt-get install deluge-web
  5. Remove residual stuff:
    sudo apt-get autoremove
  6. Fix Dropbox:
    dropbox stop
    dbus-launch dropbox start
    Go to Dropbox preferences and disable "Start Dropbox on system startup"
    Open Autostart settings (in Lubuntu it is in "Default applications for LXSession", is Xubuntu it is in "Session and Startup") and add new item with command dbus-launch dropbox start
  7. Setup Deluge services:
    sudo leafpad /etc/systemd/system/deluged.service (in Xubuntu replace leafpad with mousepad, or any other text editor You like)
    sudo leafpad /etc/systemd/system/deluge-web.service
    Copy new files content from http://dev.deluge-torrent.org/wiki/UserGuide/Service/systemd.
    To use same account: in [Service] section change User line, remove line Group=deluge and add line Password=your_password. UMask line should also be removed.
    systemctl enable /etc/systemd/system/deluged.service
    systemctl enable /etc/systemd/system/deluge-web.service
    systemctl start deluged
    systemctl start deluge-web
    To auto-connect web UI to daemon:
    systemctl stop deluge-web
    sudo leafpad ~/.config/deluge/web-ui.conf
    Set default daemon to 127.0.0.1:58846
    systemctl start deluge-web
  8. Set Kodi to auto start:
    sudo leafpad /etc/lightdm/lightdm.conf
    Add line autologin-session=kodi
    I had some issues here, after starting this way only laptop screen would work and TV connected over HDMI would be blank, so instead I added kodi to Autostart (in Lubuntu it is in "Default applications for LXSession", is Xubuntu it is in "Session and Startup")
  9. Add source to Kodi to install Indigo: http://fusion.tvaddons.ag/ Then use Indigo to install Exodus.
    Exodus is dead, use google to install Covenant or similar add-on instead.
    This might be good time to create folders Movies and TV Series in home folder and add them to Kodi and to Deluge.
    Also if using Exodus Covenant I would recommended to add Video Database Cleaner (direct link), otherwise library cleaning might take forever.
  10. Keep Ubuntu running when idle:
    There should be some options in Power Manager.
  11. Keep Ubuntu running when lid is closed:
    There should be some options in Power Manager, if not or they do not work then:
    sudo leafpad /etc/systemd/logind.conf
    Set HandleLidSwitch=ignore
    sudo leafpad /etc/UPower/UPower.conf
    Set IgnoreLid=true
  12. Set unattended upgrades:
    There should be options for that in Software & Updates, if not here are some resources to read:
    http://askubuntu.com/questions/9/how-do-i-enable-automatic-updates
    http://askubuntu.com/questions/87849/how-to-enable-silent-automatic-updates-for-any-repository
    https://blog.sleeplessbeastie.eu/2015/01/02/how-to-perform-unattended-upgrades/

Monday, November 14, 2016

Ghost in the Shell anime chronological order

There are three independent stories that should not be mixed:

Arise, set in 2027:
  1. GitS: Arise - Ghost Pain (ova) or GitS: AAA - Ghost Pain, Part 1-2 (tv series ep. 3-4, cut down version of ova)
  2. GitS: Arise - Ghost Whispers (ova) or GitS: AAA - Ghost Whispers, Part 1-2 (tv series ep. 5-6, cut down version of ova)
  3. GitS: Arise - Ghost Tears (ova) or GitS: AAA - Ghost Tears, Part 1-2 (tv series ep. 7-8, cut down version of ova)
  4. GitS: Arise - Ghost Stands Alone (ova) or GitS: AAA - Ghost Stands Alone, Part 1-2 (tv series ep. 1-2, cut down version of ova)
  5. GitS: AAA - Pyrophoric Cult (ova) or GitS: AAA - Pyrophoric Cult, Part 1-2 (tv series ep. 9-10, cut down version of ova)
  6. GitS: The New Movie (movie)
Stand Alone Complex, set in 2030-2034:
  1. GitS: SAC (tv series season 1, set in 2030) or GitS: SAC - The Laughing Man (ova, cut down version of tv series)
  2. GitS: SAC 2nd GIG (tv series season 2, set in 2032) or GitS: SAC 2nd GIG – Individual Eleven (ova, cut down version of tv series)
  3. GitS: SAC - Solid State Society (movie, set 2034)
The movies, set in 2029-2032:
  1. GitS (movie, set in 2029, comparison of versions)
  2. GitS 2: Innocence (movie, set in 2032)
It would be recommended to start watching with the original movies (considered the best), then SAC and finish with Arise (considered the worst), however chronological order would start with Arise, followed by SAC and finished by the movies.

Some would suggest after Arise to watch the first movie, then the SAC series, then the Innocence and finish it with the Solid State Society, but as mentioned these are completely independent stories (despite sharing same world and characters) and most would suggest to not mix them up.

There is a major spoiler explaining why SAC should be watched before the movies despite set times being mixed up.

More info at r/Ghost_in_the_Shell.