I take my shitposts very seriously.

  • 1 Post
  • 143 Comments
Joined 2 years ago
cake
Cake day: June 24th, 2023

help-circle


  • I’ve never used the AIO image. I’ve heard it’s weird. This is my compose file for the community image:

    compose.yaml
    volumes:
      db:
    
    services:
      db:
        image: mariadb:10.6
        restart: always
        command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
        volumes:
          - db:/var/lib/mysql
        secrets:
          - mysql_root_password
          - mysql_nextcloud_password
        environment:
          - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
          - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
          - MYSQL_DATABASE=nextcloud
          - MYSQL_USER=nextcloud
    
      nextcloud:
        image: nextcloud
        restart: always
        ports:
          - 8080:80
        depends_on:
          - db
        links:
          - db
        volumes:
          - /var/www/html:/var/www/html
          - /srv/data:/srv/data
        secrets:
          - mysql_nextcloud_password
        environment:
          - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
          - MYSQL_DATABASE=nextcloud
          - MYSQL_USER=nextcloud
          - MYSQL_HOST=db
    
    secrets:
      mysql_root_password:
        file: ./secrets/mysql_root_password.txt
      mysql_nextcloud_password:
        file: ./secrets/mysql_nextcloud_password.txt
    

    You can access it on port 8080 and perform the initial setup manually. For the database server address, use the db hostname. You’ll have to use a reverse proxy for HTTPS.

    You could also try OpenCloud, which is a Go rewrite of ownCloud.



  • No. I’m so bloody fed up with AI “search” solutions that return everything on the fucking planet except what I want. Text search has been a solved problem for a decade. All I want out of a search engine is to be deterministic, stable, and reliable, and to look in titles, descriptions, and keywords. Vibe processing is completely unnecessary and will only create issues.

    If you really want to iNnoVAte, then consider creating an index with transcripts and summaries that users can search by keywords.








  • Change this:

        print(calculate(splitter(expression)))
    

    to this:

        print(calculate(* splitter(expression)))
    

    The error is that calculate expects three float values (x, and y, and z), but splitter returns a tuple object ((x, y, z) as one object, similar to arrays in other languages):

    >>> type(splitter("1 + 2"))
    <class 'tuple'>
    

    Prepending a tuple or a list with a * operator (unpacking or splatting) unpacks the object into its individual items that are then passed to the function as separate arguments.

    In fact, str.split() already returns a tuple. By assigning multiple values at once in x, y, z = expression.split(), you actually unpack the returned tuple into individual values, then in return x, y, z, you pack those values into a tuple.





  • My compose.yaml inside...
    volumes:
      db:
    
    services:
      db:
        image: mariadb:10.6
        restart: always
        command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
        volumes:
          - db:/var/lib/mysql
        secrets:
          - mysql_root_password
          - mysql_nextcloud_password
        environment:
          - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
          - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
          - MYSQL_DATABASE=
          - MYSQL_USER=
    
      nextcloud:
        image: nextcloud
        restart: always
        ports:
          - 8080:80
        depends_on:
          - db
        links:
          - db
        volumes:
          - /var/www/html:/var/www/html
          - /srv/data:/srv/data
        secrets:
          - mysql_nextcloud_password
        environment:
          - MYSQL_PASSWORD_FILE=/run/secrets/mysql_nextcloud_password
          - MYSQL_DATABASE=
          - MYSQL_USER=
          - MYSQL_HOST=db
    
    secrets:
      mysql_root_password:
        file: ...
      mysql_nextcloud_password:
        file: ...
    

    If you use the links: element in the nextcloud service, the services listed there will be available using their hostnames. On the Nextcloud setup screen, choose mysql as the database engine, use db as the database host, and enter matching values into the other fields.




  • I was kind of past giving a shit. The teacher and I hated each other’s guts, but she couldn’t do a damn thing to me because I was top of my class (ESL at least) and represented my school multiple times in national competitions, and any attempt on her part to sabotage me would have been obvious. The worst thing she could do was mark one of my answers incorrect because I had used an American synonym instead of the British word (I think it was “trunk” instead of “boot”), and when I reminded her that she had marked it correct for two other students, she went back and crossed them out. My classmates knew and didn’t resent me for it.

    I took an option to graduate early from that class mostly out of spite, but partly because I knew I couldn’t keep biting my tongue.