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?

10 comments

  1. admicos
    (edited )
    Link
    Working on resetting my server and starting from scratch, again. This time, I decided to switch things up a bit. Trying Ansible again, and replaced Nginx and Docker with Caddy and "rootless...

    Working on resetting my server and starting from scratch, again. This time, I decided to switch things up a bit. Trying Ansible again, and replaced Nginx and Docker with Caddy and "rootless Podman" respectively. Everything is currently on a "staging" VM, so nothing permanent yet.

    Ansible and Caddy were a breeze to set up. Especially surprised at Caddy, though setting up wildcard certs seemed a bit hacky, and I had to use a probably unreliable 3rd party repo with 1 commit to set up the Acme DNS challenge for my (reasonably popular) DNS provider.

    Anyway, that part is all good. If we come back to Podman, on the other hand...

    I never expected Podman to be this much of an hassle. The initial hurdle I came across is their (IMO) terrible approach to container networking, where you either put all containers that need to see each other into one single "pod"¹, or expose ports to your host and put another firewall on top of it²

    After a day of refining Google searches and shuffling quotes around, I found out that Podman 4's user networking was different? somehow? something something netavark? what? Fortunately, my host distro of choice, Alpine Linux, has already packaged Podman 4... on their unstable/rolling/"edge" repository. Wonderful, now I have to deal with a rolling release for ~3 months (if I'm lucky)...

    So I switch around the repositories do an upgrade, and it works? maybe? still haven't had that much of a chance to test that out (beyond ping container2). might still be broken.

    Second hurdle: Caddy is set up, :80 and :443 seem to work well, Let's Encrypt Staging server works well, but it's still root inside the container, which apparently still matters.

    Oh, that --userns=keep-id flag looks like just what I need! Run as my user, which has the added bonus that UNIX permissions will probably actually work and I can set up backups easily! It can't POSSIBLY have ANY hurdles setting up and will JUST WORK when I add userns_mode: keep-id to my docker-compose.yml because there is an entry for it in the compose spec!!! You see where this is going, right?

    Nope! Both docker-compose OR podman-compose can't make that work. After hours of Google keyword juggling, nothing I can actually use worked. I guess it's time to set user the traditional way and stop caring about file permissions, like Docker.

    Third hurdle: Rebooting breaks Podman. Why? Because apparently Podman assumes /tmp is a tmpfs, which Alpine doesn't seem to do. Fine, hacked around OpenRC for a few mins and made it rm what Podman needed before launch

    Oh, also restart=always (or unless-stopped) doesn't work when rebooted. Why? bEcAuSe We'Re DaEmOnLeSs (the solution they refuse to implement is literally one comment below)

    Oh yeah, you might've noticed. Alpine DOES NOT use systemd. It's not any of the reasons why I picked it, but it DOES NOT. podman generate systemd is completely and utterly useless.

    So yeah, I'm this close to giving up and using ol' reliable Docker. It's not like I'd need any of the security of everything being rootless brings, right?


    1: And I mean ALL containers. can't split them up by purpose, or overlap them like regular Docker networks would do.
    2: And probably get hacked like what happened to NewsBlur

    4 votes
  2. [2]
    th0mcat
    Link
    hibpwned-console, a terminal "client" for hibpwned I'm very new to programming (< 3 months) and python, so this is about a weeks worth of labor on about 3 weeks of studying python. Definitely...

    hibpwned-console, a terminal "client" for hibpwned

    I'm very new to programming (< 3 months) and python, so this is about a weeks worth of labor on about 3 weeks of studying python. Definitely needs more options like outputting to a file/DB, but I'm happy with my progress so far.

    3 votes
    1. [2]
      Comment deleted by author
      Link Parent
      1. th0mcat
        Link Parent
        I started CS50 in mid-January and got through 3 weeks, which really helped with For/If-Else/While loops, then slammed through Python by Example by Nichola Lacey, and asked for (and got a lot of)...

        I started CS50 in mid-January and got through 3 weeks, which really helped with For/If-Else/While loops, then slammed through Python by Example by Nichola Lacey, and asked for (and got a lot of) help in a group chat. I also have 8 years of experience in Networking, and 3-4 years self-hosted my own stuff which helped tremendously in getting familiar with understanding python errors (even if I didn't understand the code).

        I definitely intend to finish CS50, but python was just so much easier to use than C, and the problem sets are pretty damn difficult.

        3 votes
  3. [3]
    Rudism
    Link
    I hand-wired some keyboard switches (got a bunch of clickies left over since I swapped them out for linears in my main keeb) to a Raspberry Pi Pico and 3D-printed a case to make a little 3x3...

    I hand-wired some keyboard switches (got a bunch of clickies left over since I swapped them out for linears in my main keeb) to a Raspberry Pi Pico and 3D-printed a case to make a little 3x3 macropad running CircuitPython. I've got it next to my Ploopy Nano, using it for mouse buttons, scrolling, and browser forward/back. Very handy, and not something I could have imagined myself building from scratch even a couple years ago. Enjoying my foray down the rabbit hole of custom mechanical keyboards quite a bit.

    3 votes
    1. [2]
      hungariantoast
      Link Parent
      Love this! How does CircuitPython compare to QMK is terms of features? I imagine it's easier to program and "flash"? (I'm working on my own macropad, hoping to assemble it this summer, but have...

      Love this! How does CircuitPython compare to QMK is terms of features? I imagine it's easier to program and "flash"?

      (I'm working on my own macropad, hoping to assemble it this summer, but have not yet settled on what microcontroller I want to use.)

      2 votes
      1. Rudism
        Link Parent
        CircuitPython on the Pico is insanely easy to work with compared to QMK. It's as easy as mounting the Pico as a storage device and copying your new python code onto it (or even editing it...

        CircuitPython on the Pico is insanely easy to work with compared to QMK. It's as easy as mounting the Pico as a storage device and copying your new python code onto it (or even editing it directly). It starts running the new code whenever it detects changes. You can also connect to it as a serial terminal (using screen for example) to start up a REPL and write live code that's executed on the fly.

        Since it's a general purpose controller firmware it's not keyboard-centric like QMK is and doesn't have all the niceties that come with that like layer management and stuff, but sending key codes, media keys, mouse events, etc. is super easy with the adafruit_hid library, so I don't imagine there's anything you could do in QMK that you couldn't do in CircuitPython as long as you're willing to code it from scratch. It's great for macropads wired directly to the GPIO pins because detecting keydown and keyup events and firing the appropriate keycodes, events, or macros (or whatever Python code you want, really) in response is really straight forward.

        1 vote
  4. [3]
    Wulfsta
    (edited )
    Link
    I did some statistical analysis to figure out the expected value of the minimum square distance between a uniformly sampled point in a k-dimensional hypercube and n other uniformly sampled points....

    I did some statistical analysis to figure out the expected value of the minimum square distance between a uniformly sampled point in a k-dimensional hypercube and n other uniformly sampled points. Finding an expression was easy, computing an estimate with the large k and large n for which I wanted to know this value was exceptionally difficult.

    2 votes
    1. [2]
      mnj
      Link Parent
      Just out of curiosity, this was for something and not a purely academic exercise? Have a stats related background and my partially educated guess, feels like the application is in graphics...

      Just out of curiosity, this was for something and not a purely academic exercise? Have a stats related background and my partially educated guess, feels like the application is in graphics rendering or portfolio construction but I could be totally off.

      1 vote
      1. Wulfsta
        Link Parent
        Accuracy bound for a neural network.

        Accuracy bound for a neural network.

        1 vote
  5. teaearlgraycold
    Link
    Just released a beta of an AI accelerated blog writer. You can get 1000-2000 words with about 20 minutes of work (or 30 seconds if you’re okay with going full auto and getting lesser results).

    Just released a beta of an AI accelerated blog writer. You can get 1000-2000 words with about 20 minutes of work (or 30 seconds if you’re okay with going full auto and getting lesser results).

    1 vote