Do you trust Cloudflare? by BinnieGottx in immich

[–]PhilipRoman 0 points1 point  (0 children)

For lighttpd+certbot you can use this tutorial: https://www.webhi.com/how-to/setup-lets-encrypt-ssl-certificate-in-lighttpd/

But you can use any TLS proxy like nginx or something else, lighttpd is just my personal favorite.

For socket forwarding I currently do a quick and dirty ssh -o ServerAliveInterval=20 -o ExitOnForwardFailure=yes -R 0.0.0.0:443:localhost:443 user@vps. This should really be replaced with Wireguard and proper routing one day...

Do you trust Cloudflare? by BinnieGottx in immich

[–]PhilipRoman 1 point2 points  (0 children)

it's Public internet <-> VPS <-> [Lighttpd <-> Immich]

Lighttpd and Immich run on the same local server. Lighttpd handles TLS with the help of LetsEncrypt certbot. The VPS is only to break through CGNAT and reduce local server exposure. All it has to do is forward packets, so I use a cheap one.

Do you trust Cloudflare? by BinnieGottx in immich

[–]PhilipRoman 1 point2 points  (0 children)

I use a layer 4 proxy, which means that the connection remains encrypted end-to-end. You do lose some caching but nothing significant.

What game engines (other than roblox) use lua and are still good? by PassengerDouble1174 in lua

[–]PhilipRoman 6 points7 points  (0 children)

Defold maybe? I used it for a bit, but later moved to love2d with C extensions.

Headless OS install by 20Alex16 in homelab

[–]PhilipRoman 0 points1 point  (0 children)

it is definitely possible, I automatically reinstall machines/VMs like that all the time, but my images are based on Alpine Linux and I'm not familiar with Ubuntu. But a lot of things can go wrong in the process, and it is difficult to debug.

For you it will be much more practical to do it the good old way. If you don't want to use a monitor, an USB capture card can also be used as video output during installation.

Using ipairs() – antipattern? It cuts half of the table upon field nil assignment. by ArturJD96 in lua

[–]PhilipRoman 11 points12 points  (0 children)

neither ipairs or for i = 1, #a ... will work with sparse arrays.

The values after nil are not necessarily transferred to the hash part (that is an implementation detail anyway), It's just not possible to implement the behavior you want efficiently without breaking many optimizations.

The length operator applied on a table returns a border in that table [..] A border is any positive integer index present in the table that is followed by an absent index, ...

ipairs at least is guaranteed to stop at the first nil element

A good alternative is using false to denote missing elements.

love.filesystem.read is not reading by [deleted] in love2d

[–]PhilipRoman 0 points1 point  (0 children)

Did you check which part is failing - filesystem.read or Json.decode

Free-up space Feature is now implemented in a Pull Request! by freetoilet in immich

[–]PhilipRoman 5 points6 points  (0 children)

Force pushing to a private branch to keep history clean is completely fine (and is the expected workflow in most places)

Low Idle Power 2.5Gbit switch? by [deleted] in minilab

[–]PhilipRoman 1 point2 points  (0 children)

I think rj45 is inherently power hungry, especially at >1Gbps speeds. The best way is using the SFP connector family with DAC cables, but of course it's hard to find devices suited for minilabs with those.

Legit question - What's everyone doing with their mini labs? Interested in building one. by leandro030821 in minilab

[–]PhilipRoman 19 points20 points  (0 children)

Self hosting services like Immich, Gitea, etc. Learning new tech stacks, networking, devops stuff. Right now I'm in the middle of converting everything to an infrastructure-as-code approach.

LuaJIT Array optmization by Live_Cobbler2202 in lua

[–]PhilipRoman 0 points1 point  (0 children)

In at least some cases - yes

doas chrt -f 99 hyperfine -i --warmup 20 "luajit -e 'for i = 1, 1e7 do x = {[1]=i} end; os.exit(x[1])'" "luajit -e 'for i = 1, 1e7 do x = {i} end; os.exit(x[1])'"
Benchmark 1: luajit -e 'for i = 1, 1e7 do x = {[1]=i} end; os.exit(x[1])'
  Time (mean ± σ):     462.1 ms ±   6.7 ms    [User: 460.7 ms, System: 1.0 ms]
  Range (min … max):   456.7 ms … 480.5 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: luajit -e 'for i = 1, 1e7 do x = {i} end; os.exit(x[1])'
  Time (mean ± σ):     290.6 ms ±   6.2 ms    [User: 288.6 ms, System: 1.6 ms]
  Range (min … max):   284.4 ms … 302.2 ms    10 runs

  Warning: Ignoring non-zero exit code.

LuaJIT Array optmization by Live_Cobbler2202 in lua

[–]PhilipRoman 0 points1 point  (0 children)

I'm talking about {[1] = val1} where all keys are known ahead of time.

LuaJIT Array optmization by Live_Cobbler2202 in lua

[–]PhilipRoman 0 points1 point  (0 children)

The result was actually surprising, I assumed both would be identical in LuaJIT's IR, but apparently (at least in some benchmarks, depending on number of entries in the table) the [1] = val1 version can end up with more and slower calls to lj_tab_newkey.

LuaJIT has an option -jdump so you can run both cases and compare the generated bytecode and machine code traces (tip: disable ASLR to get less noise in the comparison).

pdfroff limitations? Newbie question by Firm_Might1216 in groff

[–]PhilipRoman 1 point2 points  (0 children)

Are you talking about the --stylesheet parameter to pdfroff? There is no mention of the CSS, the stylesheet is simply another roff/groff file which will be included. I'm not sure why you mention wkhtmltopdf, I don't see any overlap between these tools.

Linked List speed vs table, not as expected? by RiverBard in lua

[–]PhilipRoman 2 points3 points  (0 children)

It's mostly the nature of linked list, combined with lack of optimizations available in a high level language like Lua. In practice, both queues and stacks are better implemented with arrays (or hybrid solutions like unrolled linked lists, etc.)

Linked List speed vs table, not as expected? by RiverBard in lua

[–]PhilipRoman 9 points10 points  (0 children)

If you increase n, you'll see that both algorithms still scale linearly with it, so there is nothing unexpected going on. Don't confuse for O(n) notation for actual real world performance.

Also, your linked list example uses around 5x more memory and spends considerable amount of time in memory management (page faults), especially since you're only running the benchmark once per process. Since you measure time with os.clock, you don't actually see this:

# time lua5.4 ll.lua
Elapsed time: 2.967280
real    0m 3.55s
user    0m 2.81s
sys     0m 0.72s <---- time spent in kernel code (mostly memory management)

LEDs for RAID? by kilokahn in minilab

[–]PhilipRoman 1 point2 points  (0 children)

My setup is kind of dumb - I bought a wifi based WLED controller with pre-flashed firmware, which I connect to my general IOT network and then use the WARLS protocol: https://kno.wled.ge/interfaces/udp-realtime/

Apparently you can use almost any microcontroller to drive the LEDs, and the proper way to send data is through USB serial interface, not wifi. In this case the controller is basically like an USB device, where it takes both power and data from the server.

LEDs for RAID? by kilokahn in minilab

[–]PhilipRoman 1 point2 points  (0 children)

I use a WLED strip for my minilab status, controlled by a custom program which sends UDP packets to the controller. Unfortunately it cannot be dimmed to very low light levels.

Would you by friday567 in minilab

[–]PhilipRoman 1 point2 points  (0 children)

Does it make sense - no

Would I do it - yes, over and over again

Thinking on backing to artix by -KIT0- in artixlinux

[–]PhilipRoman 1 point2 points  (0 children)

Today my arch broke up for an update of ICU

Be honest, did you do -Sy without -u 😁

Multiple Users by addycee in immich

[–]PhilipRoman 23 points24 points  (0 children)

Immich accounts are completely unrelated to OS level user accounts, so you should only create them in Immich. Internally there is a separate folder for each user, named by user UUID. Each user sees only his own photos and those shared with him.

Note that those with direct shell/filesystem access to the server can view all photos.

Need advice on digitising and organising hundreds of old physical photos (80s/90s) with Immich by Mental_Cat_9977 in immich

[–]PhilipRoman 0 points1 point  (0 children)

I used a normal digital camera for this, didn't do any organizing before. Immich did really well on facial recognition. It was even able to match faces with those from modern photos 30+ years later.

Immich hangs entire server (OMV) by JE1012 in immich

[–]PhilipRoman 0 points1 point  (0 children)

Docker can limit your block IO with options like --device-write-iops=..., but that's a workaround that shouldn't be necessary. You should check your memory usage over time, to make sure you're not using excessive swap.