• 1 Post
  • 36 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle
  • Yes it is correct. TLDR; threads run one code at the time, but can access same data. processes is like running python many times, and can run code simultaneously, but sharing data is cumbersome.

    If you use multiple threads, they all run on the same python instance, and they can share memory (i.e. objects/variables can be shared). Because of GIL (explained by other comment), the threads cannot run at the same time. This is OK if you are IO bound, but not CPU bound

    If you use multiprocessing, it is like running python (from terminal) multiple times. There is no shared memory, and you have a large overhead since you have to start up python many times. But if you have large calculations you can do in parallell that takes long time, it will be much faster than threads as it can use all cpu cores.

    If these processes need to share data, it is more complicated. You need to use special functions to share data, like queues and pipes. If you need to share many MB of data, this takes a lot of time in my experience (10s of milliseconds).

    If you need to do large calculations, using numpy functions or numba may be faster than multiple processes, due to good optimizations. But if you need to crunch a lot of data, multiprocessing is usually the way to go






  • I use syncthing to copy important files between pc, phone and proxmox server. Syncthing can be set up with version control so it keeps old versions of files.

    Only the proxmox server is properly backed up though. to a proxmox backup server running in a VM on said proxmox server. the encryptred backup files are copied to backblaze using rclone

    Not sure if this is what you are looking for, but it works for me.

    TLDR syncthing for copies between local machines, and proxmox backup server and backblaze for proper backups





  • I use dovecot for this. And thunderbird to actually move/archive the emails. I use caddy for many of my services, so I have pointed dovecot to caddys certificates (for “my.domain”), since it manages certificates through let’s encrypt. I had a plan to install postfix for sending internal emails from my self-hosted services, but it seemed like a bit of configuration and I got busy with other stuff

    I made an excerpt from my docker-compose.yml, but you probably have to figure out some things on your own

    
    version: '3.4'
    
    services:
      dovecot:
        image: dovecot/dovecot:2.3.20
        restart: unless-stopped
        volumes:
          - ./dovecot/:/etc/dovecot
          - /mnt/storage/dovecot/mail:/srv/mail
          - ./caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.my.domain/wildcard_.my.domain.crt:/etc/ssl/cert.crt
          - ./caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.my.domain/wildcard_.my.domain.key:/etc/ssl/key.key
        ports:
          - 993:993
    

    contents of ./dovecot folder:

    dovecot.conf
    passwords
    

    contents of dovecot.conf (I think I searched online to find a good example, I don’t remember where from…)

    ## manage this file
    
    mail_home=/srv/mail/%Lu
    mail_location=sdbox:~/Mail
    mail_uid=1000
    mail_gid=1000
    
    protocols = imap pop3 submission sieve lmtp
    
    first_valid_uid = 1000
    last_valid_uid = 1000
    
    passdb {
      driver = passwd-file
      args = scheme=argon2i /etc/dovecot/passwords
    }
    
    ssl=yes
    ssl_cert=</etc/ssl/cert.crt
    ssl_key=</etc/ssl/key.key
    
    namespace {
      inbox = yes
      separator = /
    
      mailbox Drafts {
        auto = subscribe
        special_use = \Drafts
      }
      mailbox Sent {
        auto = subscribe
        special_use = \Sent
      }
      mailbox Spam {
        auto = subscribe
        special_use = \Junk
      }
      mailbox Trash {
        auto = subscribe
        special_use = \Trash
      }
      mailbox Archive {
        auto = subscribe
        special_use = \Archive
      }
    }
    
    service lmtp {
      inet_listener {
        port = 24
      }
    }
    
    listen = *
    
    log_path=/dev/stdout
    info_log_path=/dev/stdout
    debug_log_path=/dev/stdout
    







  • I might miss your target, but have you considered tasks.org android app + caldav?

    I have been using silverbullet the last few months, but I struggle keeping up with its updates (too bleeding edge at the moment). I has a lot of nice features like all markdown, queries and templates.

    Now I am back to tasks.org app + radicale self-hosted caldav server. For tasks it flows so well on android. for windows you need to use something that supports caldav, like thunderbird.

    When silverbullet matures and if it is still fast and offline, I might go back. It has a lot of nice stuff going on. I still use for stuff like recipes and travel lists


  • I used it for a few years, but it broke a few times, and I had to search online and find an occ command to fix it. It also could break if you didn’t upgrade regularly and skipped versions. Or you upgraded too quickly before a bug was hotfixed.

    Maybe it is better now, but I looked into alternatives and found syncthing to be awesome (after I switched from iphone to android). I use samba share for cold storage. Syncthing can take a lot of space since it syncs all the files to all units