• 0 Posts
  • 37 Comments
Joined 3 years ago
cake
Cake day: November 26th, 2023

help-circle


  • yeah but I don’t mind having duplicated scripts, it’s just easier to go to single script and don’t have to worry about everything else, I keep them like bin/synapse/run, bin/synapse/stop, bin/synapse/logs etc. What I haven’t figured out is better way to keep all ports in one place instead of ports.md file but on the other hand it’s not like I have thousands of containers running.


  • I have a git repo with some directory convention and bash scripts. Ex stop is just

    #!/bin/bash
    name=synapse
    docker stop $name
    docker rm $name
    

    etc. depending on what actions I need to do against container I have bash script for that and if I need to perform same action against other container I just copy paste this file and change name variable. I pull this repo to my containers host and just type ./bin/synapse/stop and I stop synapse.

    Hope that makes sense.



  • If you’re proficient it’s 30minutes

    Something like this for server.

    generate config

    docker run -it --rm \
        -v <your-data-path>:/data \
        -e SYNAPSE_SERVER_NAME=<your-public-address-subdomain> \
        -e SYNAPSE_REPORT_STATS=no \
        matrixdotorg/synapse:v1.136.0 generate
    

    run

    docker run -d \
      --restart=always \
      --name synapse \
      -e SYNAPSE_REPORT_STATS=no \
      -v <your-data-path>:/data \
      -p 8008:8008 matrixdotorg/synapse:v1.136.0
    

    register user

    docker exec -ti synapse register_new_matrix_user http://localhost:8008/ -c /data/homeserver.yaml -u <username> -p <password> --exists-ok
    

    Proxy it using ex. openresty / nginx

    location / {
            proxy_pass    http://127.0.0.1:8008/;
            proxy_http_version 1.1;
            proxy_set_header    Upgrade         $http_upgrade;
            proxy_set_header    Connection      "upgrade";
            proxy_set_header    Host            $host;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-for $remote_addr;
            proxy_connect_timeout 600;
            proxy_read_timeout 86400;
        }
    

    For UI if you want element on your domain, download and unpack tar.gz from.
    https://github.com/element-hq/element-web/releases

    Point this location to your proxy server ex. openresty / nginx

    location / {
            root /opt/element-v1.11.109;
            index index.html;
        }
    

    Modify config.json inside /opt/element-v1.11.109 to point location to <your-public-address-subdomain>

    By default it’s using sqlite if you want postgres or other database then modify homeserver.yaml to use postgres


  • Buy refurbished / used Mini PC with at least 16GB RAM and 1Gbit network card. Don’t bother with M.2, SSD is enough.
    I have right now refurbished hp g4 ryzen 5 mini pc. There is 12 docker containers running there and couple applications in screen, I just add things. Don’t do ARM, as far as I remember running on ARM is compilation hell. Stick with x86. You want it to ease your life and not to make it harder.







  • Writing code is last thing you want to do as senior SWE because every line of code is potential debt and maintenence problem.
    The just write code bro, figure out things later attitude is good for R&D, MVP and POC that is like 10% of job.

    Just like with art, writing code like drawing is just a skill. AI is trying to replace the obvious part (that is actually the reward from thinking and describing problem in your head) because it can’t replace thinking. Removing rewards bring us to depression, depression bring us to death.

    Ergo AI will kill economy with no people left to replace it so we will end up to being monkas.
    That’s why I’d say SWE will go to farm and wait untill people in cities will start starving to death because AI stopped working and there is nobody left to fix it.