Sunday, June 22, 2025

Immich on QNAP TVS-671

Hardware

  • Model: TVS-671
  • CPU: Intel(R) Core(TM) i3-4150 CPU, up to 3500 MHz (2 cores, 4 threads)
  • Total memory 16 GB (16 GB usable)
  • Firmware version: QTS 5.2.5.3145

Software

QNAP pre-configuration

  1. Enable SSH in QNAP
  2. Enable Container Station in QNAP
  3. Volumes
    1. Containers - Thick volume. RAID1. Where docker will be install. Also, it will be where immich-app folder will be placed.
    2. Storage - RAID5. Where immich library will be stored


  4. Shares
    1. Containers - Whrere immich-app folder will be located






    2. PhotosImmich - Where immich library will be located




Install Immich

Connect into machine

> ssh marky@192.168.26.60

Create immich-app folder in Containers volume

> cd /shares/Containers
> mkdir immich-app
> cd immich-app

Download docker-compose.yml  and .env files

> wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml

> wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env

Edit environment file

> vi example.env
> mv example.env .env

Install Immich 

> docker compose up -d 

Using Immich

Configure Immich

1. Storage Template 




2. External Libraries

> vi docker-compose.yml

Add the lines in blue to docker-compose.yml:

 volumes:
     # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
     - ${UPLOAD_LOCATION}:/usr/src/app/upload
     - /share/PhotosVol1:/share/PhotosVol1:ro
     - /share/PhotosVol2:/share/PhotosVol2:ro
     - /share/PhotosVol3:/share/PhotosVol3:ro

     - /etc/localtime:/etc/localtime:ro

docker compose up -d

Add to external library path via web interface



Upgrading Immich

> docker compose pull && docker compose up -d
> docker image prune

Backup immich's postgres database

docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | gzip > "/share/PhotosImmich/immich-library/backups/dump.sql.gz"


Restore immich's postgres database [WARNING!]

> docker compose down -v 
> docker compose pull
> docker compose create
> docker start immich_postgres
> sleep 10

> gunzip -c "/share/PhotosImmich/immich-library/backups/dump.sql.gz" | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i immich_postgres psql --dbname=postgres --username=postgres

> docker compose up -d


Materials

Immich installation files

  • .env
  • docker-compose.yml

Scripts 

  • status.sh

docker ps

  • start.sh

docker compose up -d

  • stop.sh

docker stop immich_server immich_machine_learning immich_postgres immich_redis

  • upgrade.sh

docker compose pull && docker compose up -d
> docker image prune

  • backup_db.sh

docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | gzip > "/share/PhotosImmich/immich-library/backups/dump.sql.gz"

  • delete.sh

docker compose down -v
> rm -rf postgres

  • restore_db.sh

docker compose down -v  # CAUTION! Deletes all Immich data to start from scratch
## Uncomment the next line and replace DB_DATA_LOCATION with your Postgres path to permanently reset the Postgres database
# rm -rf DB_DATA_LOCATION # CAUTION! Deletes all Immich data to start from scratch
docker compose pull             # Update to latest version of Immich (if desired)
docker compose create           # Create Docker containers for Immich apps without running them
docker start immich_postgres    # Start Postgres server
sleep 10                        # Wait for Postgres server to start up
# Check the database user if you deviated from the default
gunzip -c "/share/PhotosImmich/immich-library/backups/dump.sql.gz" | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true)
;/g" | docker exec -i immich_postgres psql --dbname=postgres --username=postgres  # Restore Backup
docker compose up -d            # Start remainder of Immich apps

References

Enable SSH on QNAP TVS-671 QTS 5.2

 

Enable SSH in QNAP

  1. Open Control Panel
  2. Navigate to Network & Files Services
  3. Telnet / SSH


Saturday, June 14, 2025

How to fix youtube playback on Firefox on Linux

about:config

media.wmf.zero-copy-nv12-textures ---> false

gfx.direct3d11.reuse-decoder-device ---> false


Reference:

  • https://www.youtube.com/live/0fiVciCs8zU?

Sunday, April 6, 2025

PDF editor + Converter + Merger

 https://github.com/pdfarranger/pdfarranger

Tuesday, December 31, 2024

Galileo Sol Dive Computer Battery

 Standard Battery: CR12600SE 

Alternative Battery: two LR1

Reference:

  • https://blog.briangweber.com/2024-04-28-galileo-computer-batteries/
     

Sunday, November 17, 2024

Low latency remote deskktop for gaming: Sunshine + Moonlight

Server: https://github.com/LizardByte/Sunshine/releases

Clients: https://moonlight-stream.org/

Hotkeys:

  • Ctrl+Alt+Shift+Q - Quit the streaming session (leaving the game running on the host PC)
  • Ctrl+Alt+Shift+Z - Toggle mouse and keyboard capture
  • Ctrl+Alt+Shift+L - Toggle locking the mouse pointer to the video area (requires "Optimize mouse for remote desktop instead of games" checkbox enabled)
For Mac:
  • Ctrl+Opt+Shift+Q - Quit the streaming session (leaving the game running on the host PC)

Friday, October 25, 2024

Access Github using SSH

  1.  ssh-keygen -t ed25519 -C "first.last@company.com"
  2.  eval "$(ssh-agent -s)"
  3. pbcopy < ~/.ssh/id_ed25519.pub
  4. Github -> Profile -> Settings -> SSH and GPG Keys

References:

  • https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection