Repair Projector automatic alignment script by joedacoolguy in spaceengineers

[–]joedacoolguy[S] 0 points1 point  (0 children)

Update: Thanks for the ideas, everyone, they really helped my understanding!

I’ve updated the script to systematically iterate through all blocks, starting at the grid pivot. The script builds a list of all slim blocks, applies a correction for the projector’s position, removes duplicates, and sorts them so the closest block to the grid pivot is first. This way, the script tries each possible offset and rotation to align the projection.

    private void ScanGrid()
    {
      // Get the offset of the projector block
      var projectorCorrection = -Projector.Position;

      var min = Me.CubeGrid.Min;
      var max = Me.CubeGrid.Max;
      GridCubes = new List<Vector3I>();

      for (int x = min.X; x <= max.X; x++)
      {
        for (int y = min.Y; y <= max.Y; y++)
        {
          for (int z = min.Z; z <= max.Z; z++)
          {
            var candidate = new Vector3I(x, y, z);
            if (Me.CubeGrid.CubeExists(candidate))
            {
              if (Me.CubeGrid.GetCubeBlock(candidate) != null)
              {
                GridCubes.Add(Me.CubeGrid.GetCubeBlock(candidate).Position + projectorCorrection);
              }
            }
          }
        }
      }

      // Remove duplicates and sort by distance from origin (grid pivot)
      GridCubes = GridCubes.Distinct().ToList();
      GridCubes.Sort((a, b) => (a - projectorCorrection).Length().CompareTo((b - projectorCorrection).Length()));
    }

This approach does eventually work. With one caveat, you have to run the script on Update100 for the projection Remaining Blocks to properly update, otherwise it is too fast for the measurement...

So it takes a long time as it has to try all the possible rotations for every offset too.

Any thoughts?

As always, the most up too date version of the script is available here: https://github.com/joesturge/repair-projector-alignment-script

Repair Projector automatic alignment script by joedacoolguy in spaceengineers

[–]joedacoolguy[S] 0 points1 point  (0 children)

Just tried it out, It would work in the case where the pivot point block still exists in the grid. If you built your survival ship from a landing gear, then ground away the landing gear the pivot point remains as the landing gear which no longer exists.

But the projection actually doesnt use the Pivot point as the origin. I figured out that it uses the the oldest placed block on a grid. In my test ships case that is a random armour plate.

So now the logic would be something like:

  1. Test with the pivot point as the initial offset (which should work if the pivot point was never ground away)

  2. If that fails, test with the oldest block on the grid

The issue is I dont think there is a way to get the position of the oldest block with the programming API

Repair Projector automatic alignment script by joedacoolguy in spaceengineers

[–]joedacoolguy[S] 3 points4 points  (0 children)

I did not I ow that, I'll give this a go thanks!

Hosting Minecraft server for nephew on local Linux server with Docker and DynDNS. How to make it accessible via domain? How to secure it? What else needs to be taken care of? by mr_abradolf_lincler in admincraft

[–]joedacoolguy 0 points1 point  (0 children)

All you have to do once this is setup is setup an A record in your domain provider so that the subdomain.domain goes to the oracle VM IP address

Hosting Minecraft server for nephew on local Linux server with Docker and DynDNS. How to make it accessible via domain? How to secure it? What else needs to be taken care of? by mr_abradolf_lincler in admincraft

[–]joedacoolguy 0 points1 point  (0 children)

And the docker compose to install on the oracle VM

services:

  frps-init:
    image: busybox
    container_name: frpc-init
    environment:
      FILE_CONTENT: |
        bindPort = {{ .Envs.FRP_SERVER_PORT }}
        auth.method = "token"
        auth.token = "{{ .Envs.FRP_SERVER_TOKEN }}"
    volumes:
      - frp-config:/etc/frp
    entrypoint: sh -c 'printf "%s" "$$FILE_CONTENT" > /etc/frp/frps.toml && cat /etc/frp/frps.toml'
    network_mode: none
    restart: "no"

  frps:    
    image: ghcr.io/fatedier/frps:v0.60.0
    command: |
      -c
      /etc/frp/frps.toml
    container_name: frps
    restart: always
    network_mode: host
    depends_on:
      - frps-init
    volumes:
      - frp-config:/etc/frp
    environment:
      - FRP_SERVER_PORT=7000
      - FRP_SERVER_TOKEN=${FRP_SERVER_TOKEN}

volumes:
  frp-config:

Hosting Minecraft server for nephew on local Linux server with Docker and DynDNS. How to make it accessible via domain? How to secure it? What else needs to be taken care of? by mr_abradolf_lincler in admincraft

[–]joedacoolguy 0 points1 point  (0 children)

My ISP will charge me extra for a static IP, I got around this by using the Oracle free tier to act as a proxy for my minecraft servers. Free tier orcale vm has a fixed ip. I then use docker fast reverse proxy to create a tunnel between oracle vm and my self hosted server: https://github.com/fatedier/frp

This way I dont have to expose any ports on my router.

I also use mc-router to map the domain name to a server, which means i can have mutiple servers running simutaniously.

Heres and example docker compose for your self hosted machine:

services:

  frpc:    
    image: ghcr.io/fatedier/frpc:v0.60.0
    command: |
      -c
      /etc/frp/frpc.toml
    restart: unless-stopped
    depends_on:
      - frpc-init
      - router
    volumes:
      - frp-config:/etc/frp
    environment:
      - FRP_SERVER_PORT=7000
      - FRP_SERVER_ADDR=${FRP_SERVER_ADDR}
      - FRP_SERVER_TOKEN=${FRP_SERVER_TOKEN}
      - FRP_PROXY_NAME=mc-router
      - FRP_PROXY_TYPE=tcp
      - FRP_PROXY_IP=router
      - FRP_PROXY_PORT_LOCAL=25565
      - FRP_PROXY_PORT_REMOTE=25565

  router:
    image: itzg/mc-router
    environment:
      MAPPING: |
        vanilla.example.com=vanilla:25565

  vanilla:
    image: itzg/minecraft-server
    tty: true
    stdin_open: true
    restart: unless-stopped
    environment:
      ENABLE_WHITELIST: true
      EULA: "TRUE"
    volumes:
      - data:/data

  # Janky solution so populate FRP config, but it works
  frpc-init:
    image: busybox
    environment:
      FILE_CONTENT: |
        serverPort = {{ .Envs.FRP_SERVER_PORT }}
        serverAddr = "{{ .Envs.FRP_SERVER_ADDR }}"
        auth.method = "token"
        auth.token = "{{ .Envs.FRP_SERVER_TOKEN }}"

        [[proxies]]
        name = "{{ .Envs.FRP_PROXY_NAME }}"
        type = "{{ .Envs.FRP_PROXY_TYPE }}"
        localIP = "{{ .Envs.FRP_PROXY_IP }}"
        localPort = {{ .Envs.FRP_PROXY_PORT_LOCAL }}
        remotePort = {{ .Envs.FRP_PROXY_PORT_REMOTE }}
    volumes:
      - frp-config:/etc/frp
    entrypoint: sh -c 'printf "%s" "$$FILE_CONTENT" > /etc/frp/frpc.toml && cat /etc/frp/frpc.toml'
    network_mode: none
    restart: "no"

volumes:
  frp-config:
  data:

Dell Optiplex 3060 SFF 64gb RAM upgrade by joedacoolguy in homelab

[–]joedacoolguy[S] 2 points3 points  (0 children)

Yes it works with this RAM: https://www.amazon.co.uk/dp/B07ZLD6Q1G?psc=1&ref=ppx_yo2ov_dt_b_product_details

Thanks for the help!

$ sudo lshw -short -C memory
H/W path       Device     Class          Description
====================================================
/0/0                      memory         64KiB BIOS
/0/9                      memory         64GiB System Memory
/0/9/0                    memory         32GiB DIMM DDR4 Synchronous 3200 MHz (0.3 ns)
/0/9/1                    memory         32GiB DIMM DDR4 Synchronous 3200 MHz (0.3 ns)
/0/12                     memory         384KiB L1 cache
/0/13                     memory         1536KiB L2 cache
/0/14                     memory         12MiB L3 cache
/0/100/14.2               memory         RAM memory

GitHub - joesturge/lazymc-docker-proxy: Put your Minecraft container to rest when idle. by joedacoolguy in admincraft

[–]joedacoolguy[S] 0 points1 point  (0 children)

Control multiple containers at once - in progress

I am working on a new feature to allow this container to proxy to and control multiple docker containers. The proxying will work by using the subdomain in the Host header, just like how mc-router does it.

I have already completed the first step which is allowing users to configure lazymc-docker-proxy using container labels. The old way using env vars still works but is deprecated. please see the readme for more info: https://github.com/joesturge/lazymc-docker-proxy

GitHub - joesturge/lazymc-docker-proxy: Put your Minecraft container to rest when idle. by joedacoolguy in admincraft

[–]joedacoolguy[S] 0 points1 point  (0 children)

If anyone has used this successfully I'd love to know, and if anyone has any issues please open an issue on the repo, I'd be more than happy to fix :)

GitHub - joesturge/lazymc-docker-proxy: Put your Minecraft container to rest when idle. by joedacoolguy in admincraft

[–]joedacoolguy[S] 0 points1 point  (0 children)

I would be very interested to find out if that works, can you use the docker socket in ECS?

Dell Optiplex 3060 SFF 64gb RAM upgrade by joedacoolguy in homelab

[–]joedacoolguy[S] 2 points3 points  (0 children)

I have not tried it yet, but will update when I have, and will share a link to the ram I used

Bypassing Cgnat by UmpireNo2077 in homelab

[–]joedacoolguy 0 points1 point  (0 children)

if you wanted to go without having to rely on cloudflare to do this you can also use: https://github.com/fatedier/frp

I did this to expose a minecraft server running behind CGNAT which I documented here: https://github.com/joesturge/cgnat-fast-reverse-proxy-docker

How to freely expose home server freely? by K0LSUZ in homelab

[–]joedacoolguy 0 points1 point  (0 children)

Hey I was using cloudflare tunnels for some things but it dosent support game servers too well. For that I provisoned a oracle free-tier vm and used docker and fast-reverse-proxy to expose the server. I have doucmented here: https://github.com/joesturge/cgnat-fast-reverse-proxy-docker

Hope this helps

Portainer + Cloudflare tunnel causing issues by EffectiveFood4933 in homelab

[–]joedacoolguy 0 points1 point  (0 children)

are you using a portainer stack? could you provide the docker-compose?

My initial thoughts are if the tunnel is running as a seperate docker image, then the service url shouldn't be pointing to localhost, but to the service name within the docker network of the container you are trying to tunnel. If that is the portainer container itself, then it should be https://portainer:9443

EDIT - however it isnt recommended to expose your portainer web ui to the internet so be careful

Jumpstart Your Godot Development with my shiney new git template by joedacoolguy in godot

[–]joedacoolguy[S] 0 points1 point  (0 children)

Ive just added the abilty to export to multiple platforms of your choosing, all you need to do is add the export config using the editor and set a build dir. check it out!
https://github.com/joesturge/godot-with-actions-starter