Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

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

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, January 8, 2023

OpenVPN Server on Ubuntu 22.04 LTS Desktop VMWare Virtual Machine

Hardware & Software

  • Host: Windows 11
  • Host: VMWare Workstation Pro 18
  • Guest: Ubuntu 22.04 LTS Desktop
  • OpenVPN

VMWare Guest Configuration



  • VMWare Network: Bridged
  • Install Ubuntu 22.04 LTS Desktop
  • In Ubuntu, set Static IP Address (e.g. 192.168.26.60/24)

OpenVPN Server Installation

  • Update System
    • sudo apt update
    • sudo apt upgrade
  • Get OpenVPN
    • wget https://git.io/vpn -O openvpn-ubuntu-install.sh
    • chmod -v +x openvpn-ubuntu-install.sh
  • Install OpenVPN
    • sudo ./openvpn-ubuntu-install.sh
    • Public IP address or hostname: <your DDNS hostname>
    • Protocol: UDP
    • Port: 1194
    • DNS: 1.1.1.1
    • Client Name: phone
  • Additional options in /etc/openvpn/server/server.conf
    • duplicate-cn
    • client-to-client
  • Manage OpenVPN
    • sudo systemctl stop openvpn-server@server.service
    • sudo systemctl start openvpn-server@server.service
    • sudo systemctl restart openvpn-server@server.service

Configure Router / Gateway


OpenVPN Client Installation

  • Transfer /root/phone.ovpn to your device
  • Import phone.ovpn in OpenVPN

References:

  • https://www.cyberciti.biz/faq/ubuntu-20-04-lts-set-up-openvpn-server-in-5-minutes/


Sunday, March 5, 2017

Thinking about assembling a new PC after 10 years

Hello! It's been a long time.

I'm writing this blog post from the machine I assembled 10 years ago. It's still alive and kicking as it has had it's share of upgrades throughout the years. But it's time for me to build a new one! Yehey!

Here is my current setup:
  • Intel Q6600 2.4GHz Quad Core (Passively watercooled with a Zalman Reserator)
  • MSI P5K-E Wifi motherboard
  • 8GB DDR2 memory
  • GeForce GTX 680 video card (Passively watercooled with a Zalman Reserator. Yes! Two of them in separate loops.)
  • Seasonic X650 (I think) 80 Plus Gold PSU
  • Vertex 3 256GB SSD 
  • Dell U3011 monitor
What I use it for:
  • Facebook (Of course!)
  • Web browsing / Work - Since most of my work is mostly over the web.
  • Light gaming (ahem!... Diablo 3, Civilization, This War Of Mine, XCOM)
  • Photo editing with Adobe Lightroom
What I want to build my next machine for:
  • VR gaming with HTC Vive
  • 1 or virtual machines for experimenting
  • Basically the same as before
And so the hunt begins! Stay tuned. :)

Wednesday, May 5, 2010

How to change window border thickness in Ubuntu 10.04 (Gnome)

prompt%> sudo vi /usr/share/themes/Human/metacity-1/metacity-theme-1.xml

Change following values to 5 or higher:
<distance name="left_width" value="3"/>
<distance name="right_width" value="3"/>
<distance name="bottom_height" value="3"/>

Enjoy!

Thursday, June 4, 2009

How to run aptitute / apt-get via a proxy in Ubuntu Hardy and Jaunty

I always have problems with this whenever I setup a new install. So, I decided to log it here.

Add the following to your .bashrc:

# -------------------------------------------------------------
# Variables for apt-get
export HTTP_PROXY="http://myproxy.mydomain.com:myportnumber/"
export http_proxy="http://myproxy.mydomain.com:myportnumber/"
export FTP_PROXY="http://myproxy.mydomain.com:myportnumber/"
export ftp_proxy="http://myproxy.mydomain.com:myportnumber/"
# -------------------------------------------------------------


Enjoy!

Thursday, May 21, 2009

Looking for VMware on Vista x64? Use VirtualBox!

Well, I had my mind set on installing VMware and configuring a few virtual machines. So, I went ahead and downloaded the latest version of VMware server. After a long wait, to my disappointment, it wouldn't install! It doesn't look like VMWare supports Vista x64 as the host. Oh well, forget it!



After seeing a demo of VirtualBox during the Java Developer Day conference a few days ago, I decided to try it out. If it's as good as they claim, then maybe this could be my answer? And true enough, it supports Vista x64 as a host and it pretty much supports all operating systems as a guest. (Except OSX, I think. Hmm... we'll see about that. *wink*)

So, I suggest you give it a try as an alternative to VMware. It's working well for me so far. Here is the link.

Update 2009-05-22:
Hmm... after giving it a good test, I don't think I'm very happy with VirtualBox. Switching from gui mode to text mode on a Linux guest seems to mess up the mouse pointer. A Vista x64 guest caused it to crash. I had to restart my pc to kill the Virtualbox process. And snapshots are so limited in functionality compared to VMware. I might actually give VMware another try. Perhaps I was just doing it wrong the first time. Oh well...


Enjoy!

Tuesday, May 19, 2009

Ubuntu 9.04 Jaunty Jackalope

Well, Ubuntu 9.04 Jaunty Jacklope was just recently released. And I'm just about to download it and give it a go. Please stay tuned. I will be adding a few more HOWTOs for problems & solutions I encounter.

In the mean time, why don't you try it out for yourself as well? Here's the link.



Enjoy!

Tuesday, April 7, 2009

How to enable / disable word wrap in vim

To enable wrapping, type:
:set wrap

To disable wrapping:
:set nowrap

Easy! Enjoy!

Saturday, July 26, 2008

Control multiple computers with one keyboard and mouse

If you're geekozoid like me, you probably have more then one computer at home. And maybe even have them in a range of different operating systems. How do you control them from one source?

Well, there are plenty of options out there, like VNC, etc. But I just discovered one cool app: Synergy. I works for Windows, linux and mac. And best of all, it's free!

Check out my video below.



References:
* http://synergy2.sourceforge.net/
* PC World Magazine August 2008

Enjoy!

Monday, July 14, 2008

How to enable color profiles & color management in Firefox 3

Photographers and photo enthusiasts will be happy to hear this. Firefox 3 now supports color management. No more viewing flickr using Safari. You have to explicitly enable it though. Read on to know how.

Here is the link to the official test site for ICC v4. Go ahead and open it in a new window.

If your browser does not support color profiles or has it disabled, here is what you'll get:


If your browser does support color profiles, this is what you'll get:


Here is how to enable Color Management on Firefox 3:
1) Open Firefox 3 browser.
2) On the address bar type the following:

about:config

3) On the search bar type the following:

gfx.color_management.enabled

4) Confirm it is now set to true, then restart firefox.

That's it! Go back to the test site and confirm that you get the proper image.

Now, if only they had turned this on by default...

Enjoy!

Saturday, June 28, 2008

How to disable firefox session restore dialog

I know the session restore is a very useful feature. And a lot of people actually rely on it. But I find a bit annoying that it has to prompt me every time I start firefox.

I read somewhere that it is actually a bug in that firefox cannot distinguish between a machine shutdown and a crash. It thinks it crashed, an so prompts you if you want to continue off with the previously open windows that you had.

Anyway, until they get this fixed, I'm turning it off. Here's how to do it:

1) Open firefox and type the following in your address bar:
about:config

2) Right-click, and select:
New -> Boolean

3) In the dialog box, type the line below and press ok.
browser.sessionstore.resume_session

4) Set the value to:
false

You're done. Enjoy!

Monday, June 23, 2008

Use Winkey-E to start File Manager (Nautilus) on Ubuntu 8.04

I'm used to hittig Winkey-E to bring up Explorer on Windows. So, I want to have a similar key binding on Ubuntu. Here's how I did it:

Step 1: Disable current key binding of Winkey-E.
System->Preferences->Advanced Desktop Effects Settings
Go to Desktop->Expo->Bindings
Click on Super-E and disable it.

Step2: Add new bindings
prompt%> gconf-editor

Go to /Apps/metacity/global_keybidings
Set run_command_1 to < super >E (without any space)

Go to /Apps/metacity/keybinding_commands
Set command_1 to /usr/bin/nautilus

You're done. Enjoy!

Friday, June 20, 2008

killps - Pipe /bin/ps to /bin/kill

Have you ever wanted to kill a bunch of processes? Here is how to do it:

1) Put this in your .bashrc

# Killps - Marky 2008-06-20
# usage: ps -ef | grep progname | killps
alias killps="awk '// { print \$2 }' | xargs kill"


2) Here's how to use it:

2.A) Search for the processes. Make sure you only see what you want to kill.
e.g.:
prompt%> ps -ef | grep program_name

e.g.:
ps -ef | grep username | grep program_name | grep -v grep

2.B) When you'r happy with the filter, pipe it to killps
e.g.:
prompt%> ps -ef | grep program_name | killps

e.g.:
ps -ef | grep username | grep program_name | grep -v grep | killps

Enjoy!

Thursday, June 19, 2008

Google Toolbar for Firefox 3.

Finally, it's here! Get yours from:
http://www.google.com/tools/firefox/toolbar/FT3/intl/en/index.html

Enjoy!

Wednesday, June 18, 2008

How to fix weird characters in aterm (for viewing man pages)

If your aterm is showing you weird boxes when viewing man pages, just put the following in your .bashrc:

# Fix weird characters in aterm
export LANG=C

Enjoy!

How to autostart emerald

There seem to be at least two ways to do this:

1) Add the following command to sessions:
emerald --replace &

2) Replace the following line in /usr/bin/compiz-decorator
from:
USE_EMERALD="no"
to
USE_EMERALD="yes"

Then, restart X server.

Enjoy!

Sunday, June 15, 2008

Auto-complete hostnames with using bash

Having forever used tcsh, this is something new I discovered when I switched to bash.

Here's how it works:
prompt%>ssh my
becomes:
prompt%>ssh mypc.homelinux.org

Here's how to set it up:
1) Create a file similar to /etc/hosts

e.g: (/home/marke/hostfile)

---snip---
# Local PC
127.0.0.1 localhost
127.0.1.1 mypc.homelinux.org
# Other
0.0.0.0 laptop1.homelinux.org
0.0.0.0 laptop2.homelinux.org
---snip---

* note: you don't really seem to need the real IP address. Just the name. You ca even shorten it if you have resolver set correctly.

2) Add the following to your .bashrc

export HOSTFILE="/home/marke/hostfile"


Yor're done!

Enjoy!

For more info:
* man bash
* link

How to disable tilde expansion on bash, Ubuntu 8.04 (hardy)

This is how to prevent bash from replacing "~" with "/home/" when you auto-complete using .

1) Edit .bashrc
prompt%> cd
prompt%> vi .bashrc


2) Add the following lines:

# Disable Tilde Expansion
_expand()
{
return 0;
}

3) Try it out on a new terminal


For those interested, see: /etc/bash_completion Look for "tilde".

References:
* http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-bash-from-replacing-with-homeusername-643162/

Saturday, June 14, 2008

Ubuntu standard hotkeys I always forget

Actually, I only wanted to note down one. "Activate window menu". The hotkey for it is: ALT + Space. You then have access to the move command. This is particularly useful when your window just happens to slide under the menubar like this:


Update:
Alt-F7 Move Window


I'll add to this post as I forget & remember more hotkeys. :)

Enjoy!

References:
* http://vntutor.wordpress.com/2007/05/23/useful-hotkeys-in-ubuntu/