Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)H
Posts
3
Comments
190
Joined
2 yr. ago

  • Deleted

    Permanently Deleted

    Jump
  • I used duckdns for years without any issues at all. Only reason I switched is because I'm using Pangolin and tunneling instead of exposing my IP directly.

  • That makes sense. I'll add the whitespace capture. The actual string only has one backslash, the second is to escape, though as I'm typing this, I'm thinking I can do a `fr"regex here" to eliminate the second backslash? I'll have to test this later when I have time.

    Thank you!

  • No apologies necessary! This is incredibly helpful! I found in the documentation how to format the message with the basicConfig, so I'm going to get rid of the logDateTime, move the logger out of main (didn't even think about how that would limit it to only main and not the other functions.), and test output to stdout vs the file defined in basicConfig.

    Gotta go to work, but will implement this later. Thank you!!

  • Can you explain your reasoning behind adding the whitespace regex? I'm guessing that's insurance in case the config file syntax changes with an app update. Thank you!

  • I did run across the qbittorrent-natpmp when I was looking into how to change the port via the api, but wanted to work out the process myself (not because of NIH, but for the learning of figuring it all out).

    I had no idea about the up/down command in gluetun! That's very nice. I'm going to look into that for sure.

    Thank you!

  • Ooh, that's very nice. I will definitely use that instead of the with open... I'm using now. Thank you!!

  • So, if I understand what you mean correctly, with logger, drop the function, and in the main script body (which is now under an if __name__ == "__main__": check, call logger directly something like:

     
        
    if __name__ == "__main__":
        load_dotenv()
        
        logDateTime = datetime.today().strftime("%Y-%m-%d %H:%M:%S")
        logger = logging.getLogger(__name__)
    
        currentForwardedPort = get_current_forwarded_port()
        currentListeningPort = get_current_listening_port()
    
        if currentForwardedPort != currentListeningPort:
            update_qbittorrent_listen_port(currentPort)
            logger.info(f"[{logDateTime}] qbittorrent listen port set to {currentForwardedPort}")
        else:
            loger.info(f"[{logDateTime}] forwarded port and listen port are a match")
    
      

    And then in the crontab I can do:

    0 * * * * /path/stuff/python script.py > /path/to/log/file.txt

    Thanks!

  • That's a good idea. I will do that. Thank you!

  • I'm glad you mentioned the shebang. I was considering doing that (with the path to my venv python), but wasn't sure if that was a good idea.

    I will also add the if __name__ == "__main" to the main script. Thank you!

  • This sounds awesome. I'm going to read this tomorrow when I can give it my full attention.

  • And uses Arch BTW.

  • Sorry, typo. It's Play:sub

  • Unfortunately, yes

  • Android or iOS?

    On android I found symphonium to be a great app to use with my navidrome server. On iOS, play:sub was the best experience I found

  • Kevin was smart enough to know you don't call the police.

  • No joke.

  • 8

  • HAHAHAHAHAHAHAHAHAHAHA