Scrath

joined 2 years ago
[–] Scrath@lemmy.dbzer0.com 7 points 1 day ago (3 children)

I remember building something vaguely related in a university course on AI before ChatGPT was released and the whole LLM thing hadn't taken off.

The user had the option to enter a couple movies (so long as they were present in the weird semantic database thing our professor told us to use) and we calculated a similarity matrix between them and all other movies in the database based on their tags and by putting the description through a natural language processing pipeline.

The result was the user getting a couple surprisingly accurate recommendations.

Considering we had to calculate this similarity score for every movie in the database it was obviously not very efficient but I wonder how it would scale up against current LLM models, both in terms of accuracy and energy efficiency.

One issue, if you want to call it that, is that our approach was deterministic. Enter the same movies, get the same results. I don't think an LLM is as predictable for that

[–] Scrath@lemmy.dbzer0.com 2 points 2 days ago

Thanks. I'll keep this in mind in case my new stack causes issues again

[–] Scrath@lemmy.dbzer0.com 1 points 3 days ago

Hey, just wanted to let you know that my updated stack has been running perfectly since I changed it based on your setup. Thanks

[–] Scrath@lemmy.dbzer0.com 1 points 5 days ago

Well, guess that's it for heaven

[–] Scrath@lemmy.dbzer0.com 4 points 5 days ago

I guess I missed that.

Anyway, I updated my stack to be similar to what you pasted and so far it seems to be working. I'll have to check tomorrow if the reboot issue persists.

[–] Scrath@lemmy.dbzer0.com 1 points 5 days ago (3 children)

I know that the port forwarding command can be simplified. In my case its this complex because the way it is listed in the gluetun wiki did not work even though I disabled authentication for my local network. The largest part of the script is authenticating with the username and password before actually sending the port forwarding command.

I'll definitely try adjusting my stack to your variant though. I've also tried the healthcheck option before but I must have configured it wrong because that caused my gluetun container to get stuck.

One question regarding your stack though, is there a specific reason for binding /dev/net/tun to gluetun?

[–] Scrath@lemmy.dbzer0.com 5 points 5 days ago (2 children)

As far as I am aware, Mullvad has removed port forwarding support a while ago. While I am not sure which VPN providers except proton still support it, I kind of remember seeing a small list of them some time ago which listed Proton among one of the few trustworthy ones left.

 

Hello everyone, I recently tried switching my docker torrent client setup from haugene/transmission-openvpn to linuxserver/qbittorrent with gluetun for my VPN.

I have gluetun set up to use port forwarding with ProtonVPN which assigns a random port on every connection. Gluetun provides a VPN_PORT_FORWARDING_UP_COMMAND which can be used in this scenario to update the port used by qbittorrent. While I had issues with the example command in the gluetun wiki to do this, I eventually managed using a bash script I found in another forum.

My issue now is that my server shuts down for the night to reduce noise and after restarting, even though I have the container startup order set up, qbittorrent is no longer reachable on its webinterface. The logs do not indicate any issue though.

As far as I can tell, the stack as I have set it up is extremely finnicky in terms of startup order and time. If I start gluetun first and then wait too long before starting qbit, the port update script will fail because there is obviously no target for it. If qbit is up and running before gluetun is done, I typically can't access its webinterface for some reason and the network interface used by gluetun will set itself to loopback.

The result of this is that basically every morning I have to start and restart the containers in the stack a couple of times until I can access the interface and ensure that the port and network interface of qbit are configured correctly.

If anyone has a similar setup working that they could share or maybe another solution to my current issue that would be great. Thanks.

This is my docker-compose stack for the new setup

version: '3'
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - 8080:8080 # qbittorrent webinterface
      # - 6881:6881 # qbittorrent, only needed without port-forwarding
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - OPENVPN_USER=${OPENVPN_USERNAME}
      - OPENVPN_PASSWORD=${OPENVPN_PW}
      - SERVER_COUNTRIES=Switzerland
      - VPN_PORT_FORWARDING=on
      - PORT_FORWARD_ONLY=on
      - TZ=Europe/Berlin
      # From gluetun wiki: https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/vpn-port-forwarding.md
      - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'sh /gluetun/update-port.sh "{{PORTS}}"'
      - VPN_PORT_FORWARDING_DOWN_COMMAND=/bin/sh -c 'echo "Execution port forwarding down command" && wget -O- -nv --retry-connrefused --post-data "json={\"listen_port\":0,\"current_network_interface\":\"lo\"}" http://127.0.0.1:8080/api/v2/app/setPreferences'
      - QBIT_ADDRESS=http://localhost:8080/
      - QBIT_USERNAME=${QBIT_USER}
      - QBIT_PASSWORD=${QBIT_PW}
    volumes:
      - /mnt/truenas/qbittorrent/update_port.sh:/gluetun/update-port.sh
    labels:
      - "com.centurylinklabs.watchtower.enable=true" # Auto update using watchtower

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    network_mode: "service:gluetun"
    depends_on:
      - gluetun
        # condition: service_healthy
        # restart: true
    volumes:
      - /home/poseidon/qbittorrent:/config
      - /mnt/truenas/qbittorrent:/downloads
    # ports:
    #   - 8080:8080
    #   - 6881:6881
    #   - 6881:6881/udp
    restart: unless-stopped

And this is the script I use for updating the qbittorrent ports

#!/bin/sh
# update-port.sh
port="$1"
retries="${UPDATE_PORT_RETRIES:-5}"
interval="${UPDATE_PORT_RETRY_INTERVAL:-10}"

echo "Attempting to update qBittorrent port to $port..."

for i in $(seq 1 "$retries"); do
  response=$(wget --quiet --save-cookies=/tmp/cookies.txt --keep-session-cookies \
                  --post-data="username=$QBIT_USERNAME&password=$QBIT_PASSWORD" \
                  --header="Referer: $QBIT_ADDRESS" \
                  "$QBIT_ADDRESS/api/v2/auth/login" -O -)

  if [ "$response" = "Ok." ]; then
    break
  fi

  echo "Login attempt $i/$retries failed. Retrying in $interval seconds..."

  sleep "$interval"
done

set -e

if [ "$response" != "Ok." ]; then
    echo "Unable to log in to qBittorrent."
    rm -f /tmp/cookies.txt

    exit 1
fi

wget --quiet --load-cookies=/tmp/cookies.txt \
     --post-data="json={\"listen_port\": $port, \"current_network_interface\":\"$VPN_INTERFACE\", ,\"random_port\":false,\"upnp\":false}" \
     "$QBIT_ADDRESS/api/v2/app/setPreferences" -O /dev/null

rm -f /tmp/cookies.txt

echo "qBittorrent port updated successfully to $port."

Update

After updating my stack based on the recommendation from hyphen612 it has been running flawlessly for a few days. This is my new docker-compose file. The extra script I used before for updating the port has been retired.

version: '3'
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - 8080:8080 # qbittorrent
      # - 6881:6881 # deluge or qbittorrent, only needed without port-forwarding
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - OPENVPN_USER=${OPENVPN_USERNAME}
      - OPENVPN_PASSWORD=${OPENVPN_PW}
      - SERVER_COUNTRIES=Switzerland
      - VPN_PORT_FORWARDING=on
      - PORT_FORWARD_ONLY=on
      - IPV6=off
      - TZ=Europe/Berlin
      - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'wget -O- --retry-connrefused --post-data "json={\"listen_port\":{{PORTS}}}" http://127.0.0.1:8080/api/v2/app/setPreferences 2>&1'
      - HEALTH_SUCCESS_WAIT_DURATION=20s
      - HEALTH_TARGET_ADDRESSES='1.1.1.1:443'
    healthcheck:
      test: ["CMD", "/gluetun-entrypoint", "healthcheck"]
      interval: 10s
      timeout: 10s
      start_period: 20s
      retries: 10 #has internal fix mechanism
    labels:
      - "com.centurylinklabs.watchtower.enable=true" # Auto update using watchtower

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    network_mode: "service:gluetun"
    depends_on:
      gluetun:
        condition: service_healthy
        # restart: true
    volumes:
      - /home/poseidon/qbittorrent:/config
      - /mnt/truenas/qbittorrent:/downloads
    restart: unless-stopped
[–] Scrath@lemmy.dbzer0.com 1 points 6 days ago

Good thing I decided against switching to it, even though my main reason is that my weird book organisation scheme isn't feasible with anything but calibre or manual organisation currently as far as I know

[–] Scrath@lemmy.dbzer0.com 1 points 1 week ago* (last edited 1 week ago) (1 children)

That was my exact setup as well until I switched to a different router which supported both custom DNS entries and blocklists, thereby making the pi-hole redundant

[–] Scrath@lemmy.dbzer0.com 4 points 1 week ago (5 children)

Not OP but a lot of people probably use pi-hole which doesn't support wildcards for some inane reason

[–] Scrath@lemmy.dbzer0.com 1 points 1 week ago

Maybe they added new ones since I last looked

[–] Scrath@lemmy.dbzer0.com 12 points 1 week ago (4 children)

Extra hard drive space is good and all but the last time I looked at their lists, all decently sized torrents had a good enough amount of peers while the large torrents which aren't as manageable were the issue.

 

Hello everyone, I am currently looking for a software solution to use my home server as a DLNA renderer which can output audio to my stereo amplifier.

The only solution I found was called gmrender-resurrect which seems like it would do exactly what I want but I was unable to get a docker container of it working. While I was able to find and connect to the DLNA Renderer, playback would fail every time and I was unable to get any information from the logs regarding why.

Do any of you know another solution to stream audio from my phone to my server (I am using Symfonium on the phone side)? Ideally it would be something I can deploy as a docker container on my server.

Thanks.

 

Hello everyone, I am currently trying to set up a kmonad config file to replace the autohotkey script I used on windows. My goal is simply to use the right alt key in combination with a,o,u and so on to type german umlaut characters like ä,ö,ü, etc.

So far I am having trouble even getting kmonad to run the config. I guess I probably misunderstand how this is supposed to work significantly. My initial config file was generated by ChatGPT since I had no idea where to even start.

This is my current config file

(defcfg
  input  (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
  output (uinput-sink "kmonad_keyboard")
  fallthrough true
  allow-cmd true
)

(defsrc
  ralt a o u s lsft
)

(deflayer german
  ralt-a "ä"
  ralt-o "ö"
  ralt-u "ü"
  ralt-s "ß"
  ralt-shift-a "Ä"
  ralt-shift-o "Ö"
  ralt-shift-u "Ü"
)

Any help would be appreciated.

44
submitted 1 year ago* (last edited 1 year ago) by Scrath@lemmy.dbzer0.com to c/electronics@discuss.tchncs.de
 

Hello everyone, I recently built a small distribution board to distribute 5V to multiple components for use in a robotics project. I made each output switchable with an individual switch and an LED to indicate the current state. When I went to test it using a lab power supply I noticed that the LEDs would start flickering weirdly when I turned them off and on again.

https://imgur.com/a/zaSCUby

As it turns out, the LEDs, which I found in my dads old parts in a bag labeled TLBO 5410, are apparently blinking LEDs. I found a datasheet for TLBR5410 LEDs which seem pretty much identical to what I have accidentally used.

Apparently these LEDs are made to operate directly from a 5V supply without an additional current limiting resistor (it is already built in) and are made to continuously blink at a frequency of 3Hz.

Because I thought I was using standard LEDs I added a series resistor causing them to behave weirdly due to low voltage. For comparison, this is how they are supposed to act: https://imgur.com/a/fXlcEDs

 

Hello everyone, I have another question regarding reverse-proxying again, specifically for the linuxserver.io jellyfin image.

On the dockerhub page for this image there are 4 ports listed which should be exposed:

  • 8096 for the HTTP Web UI
  • 8920 for the HTTPS Web UI
  • 7359/udp for autodiscovery of jellyfin from clients
  • 1900/udp for service discovery from DLNA and clients

Additionally there is also an environment variable JELLYFIN_PublishedServerUrl which is for "Setting the autodiscovery response domain or IP address". I currently have that set to my subdomain https://jellyfin.mydomain.com though I am not sure if that is correct.

I already have a reverse-proxy set up allowing me to access my servers webinterface under https://jellyfin.mydomain.com without exposing the https port on the container. What I am unsure about now however, is what to do with the two ports for UDP traffic.

By my understanding, a reverse-proxy will only forward traffic which comes to the ports 80 for http and 443 for https. Those are also the only ports my reverse-proxy container has exposed alongside the management interface. As such the 2 udp ports will not be reachable under my jellyfin domain.

How can I change this or is this even an issue?

10
submitted 2 years ago* (last edited 2 years ago) by Scrath@lemmy.dbzer0.com to c/selfhosted@lemmy.world
 

Hello, I have a question regarding the usage of a reverse-proxy which is part of a docker network.

I currently use Nginx Proxy Manager as a reverse-proxy for all my services hosted in docker. This works great since I can simply forward using each containers name. I have some services however (e.g. homeassistant) which are hosted separately in a VM or using docker on another device.

Is it possible to use the same reverse-proxy for those services as well? I haven't found a way to forward to hosts outside of the proxies docker network (except for using the host network setting which I would like to avoid)

view more: next ›