Skip to content

2025

Using Kopia to setup snapshot backups

Well, I've had this spare 4TB hard drive laying around that wasn't particularly doing much so I decided to attach it to my ubuntu server, and just set up Kopia so write snapshots of my Immich Upload folder to it. Basically just an extra layer of backup.

Using GoAccess with Nginx Proxy Manager (NPM) to visuallize logs.

I mainly wanted to make sure and get this docker-compose.yml in here for future use.

Note the last couple of lines. You can set to the log file to digest all logs. However, GoAccess doesn't support any filtering per hostname, so if you want to see analytics for only a particular host name, you want would to just mount the proxy-host-1_access.log for example. npm creates one of these for each proxy host.

Hosting local https with trusted cert from Cloudflare with NPM

This is really just a helluva lot easier than what you need to do with Caddy.

Configure Cloudlfare DNS

Go to your DNS records in cloudflare and create an A record with a wild card to take care of all apps. Something like *.local. Determine the local IP address of your server. You can use ifconfig, or look at your router settings to find what the local IP is for that particular device. For Proxy status just do DNS only.

Listening to events in SpringBoot

Jotting down some examples of different ways to handle events in Spring Boot

Entity Lifecycle

Entities, i.e. pojos annotated with @Entity, can utilize the following methods with annotations to manage life cycle events of the entity. JPA defines several lifecycle events that occur during an entity's persistence operations. You can use annotations to specify methods that should be executed when these events occur.

  • @PrePersist: Called before the entity is persisted (inserted into the database).
  • @PostPersist: Called after the entity is persisted.
  • @PreUpdate: Called before the entity is updated in the database.
  • @PostUpdate: Called after the entity is updated.
  • @PreRemove: Called before the entity is removed from the database.
  • @PostRemove: Called after the entity is removed.
  • @PostLoad: Called after the entity is loaded from the database.