6 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

5 comments

  1. [2]
    Comment deleted by author
    Link
    1. helloworld
      Link Parent
      Hah. This woke up all the repressed memories trying to explain our own "Security Group" why their 'reports' included more false positives than anything of substance. Nevermind the security theatre...

      Hah. This woke up all the repressed memories trying to explain our own "Security Group" why their 'reports' included more false positives than anything of substance.

      Nevermind the security theatre turned me off so badly, despite earning a promotion for working on it that I just quietly walked away from the whole thing. You're not alone, my friend :)

      4 votes
  2. admicos
    Link
    I'm currently working on some automation tool thingy that I repeatedly complained about not existing. I chose Python as the "scripting" language, because it's reasonably simple and has has a...

    I'm currently working on some automation tool thingy that I repeatedly complained about not existing.

    I chose Python as the "scripting" language, because it's reasonably simple and has has a pretty good ecosystem to depend on.

    My current obstacles are:

    1. Trying to figure out the best combination of good looking code, functionality, and IDE/tooling friendliness.
    2. Trying to wrangle Sphinx's autosummary into the shape I want it to be.
      • The only alternative is manually defining every single module for autodoc, and I'd rather not do that.
      • Or I could just not have any documentation other than docstrings and tutorial-esq stuff, not sure yet.
    3. Naming
    4. Not abandoning it at some point in the future

    I did quite a bit of progress with the structure, and am probably gonna settle on something like the following:

    from pprint import pprint
    from thingy.event import NewMessage
    
    
    @NewMessage.on(message_id="test")
    def _test_message(message_id: str, message_data: dict):
        pprint(message_data)
    
    
    if __name__ == "__main__":
        NewMessage.trigger(message_id="test", message_data={"a": 1})
        # todo: something to trigger events automatically
    

    Currently the only part that can't be autocompleted (at least from the VSCode language server) is the definition of _test_message(), but I'm still pretty happy with that.

    There will also be more stuff than just events, but that's probably mainly going to be wrapping other packages in a consistent-ish way, so that's hopefully not going to be that hard. (And even then, it's just regular Python functions. Nothing is stopping anybody from just importing something else)

    4 votes
  3. tomf
    Link
    Nothing crazy, but I set up an ad-free podcast ripper. The dudes from Its Always Sunny in Philadelphia have a podcast and with todays episode started ads. The handy thing is that they film it, so...

    Nothing crazy, but I set up an ad-free podcast ripper.

    The dudes from Its Always Sunny in Philadelphia have a podcast and with todays episode started ads. The handy thing is that they film it, so I can use a combination of this php script with youtube-dl

    yt-dlp -f 140 https://www.youtube.com/playlist\?list\=PL5yoAqU0pTLmJivdRjh3dvv9ubstmiGx0 -o "%(upload_date>%Y-%m-%d)s_%(title)s.mp4" --replace-in-metadata 'title' " \| The Always Sunny Podcast|[0-9]+\." "" --download-archive /var/www/example.domain/rss/pod.txt --restrict-filenames
    

    I run it with a cron job every monday morning, giving a little time for the breaks to be tagged.

    Submit the domain to pocketcasts as a private feed and you're good to go. I'd like to get some sort of ID3 writing, but it doesn't really matter.

    The episode names come out as

    2022-02-28_The_Gang_Gets_Invincible.mp4
    2022-03-07_Dennis_and_Dee_s_Mom_Is_Dead.mp4
    2022-03-14_Everybody_Browns_Out.mp4
    2022-03-21_The_Gang_Gets_Held_Hostage.mp4
    2022-03-28_The_Aluminum_Monster_vs._Fatty_Magoo.mp4
    2022-04-04_The_Gang_Solves_the_North_Korea_Situation.mp4
    2022-04-11_Who_s_Got_Donkey_Brains.mp4
    2022-04-18_The_Gang_Sells_Out.mp4
    

    yt-dlp technically downloads an m4a, but the container is the same. That script will work with any filetype, though.

    Another fun thing I might do with this script is a simple feed to share tracks with friends. The script would benefit from some extras like a podcast image and some other metadata for something like that, though.

    3 votes
  4. helloworld
    Link
    Been setting up my Raspberry Pi as poor man's homelab. I decided to go fully declarative, was expecting to have at least one container so far, but somehow avoided it. NixOS with completely...

    Been setting up my Raspberry Pi as poor man's homelab.

    I decided to go fully declarative, was expecting to have at least one container so far, but somehow avoided it. NixOS with completely declarative syncthing, prometheus and loki. Grafana is also working, but I'm looking to make dashboards declarative as well.

    So far only doing this with 32G thumb drive, because I don't have SD card reader (used my Redmi 4X for that before, but that one is busted since postmarketOS experiment). I finally croaked and ordered an SSD. Should be a nice test for 'fully declarative' config while moving this whole thing over.

    2 votes
  5. DMBuce
    Link
    @admicos' comment reminded me that I have a couple xmacro companion scripts that lack documentation, so I spent some time documenting them today: https://github.com/DMBuce/macro I should probably...

    @admicos' comment reminded me that I have a couple xmacro companion scripts that lack documentation, so I spent some time documenting them today: https://github.com/DMBuce/macro

    I should probably add a proper config file to the project, but that's a task for a rainy day.

    1 vote