7 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?

7 comments

  1. [3]
    m15o
    Link
    Last weekend I published https://ichi.city. It's like Neocities but simpler and with less features. It's inspired a lot by flounder.online but for the web. I'm a big believer that not everything...

    Last weekend I published https://ichi.city. It's like Neocities but simpler and with less features. It's inspired a lot by flounder.online but for the web. I'm a big believer that not everything we create needs to make sense. I'm hoping it inspires people to build quirky and fun pages.

    8 votes
    1. [2]
      balooga
      Link Parent
      This is really cool! I was pretty deep into Geocities back in the day. What are the free storage/bandwidth limits here?

      This is really cool! I was pretty deep into Geocities back in the day. What are the free storage/bandwidth limits here?

      2 votes
      1. m15o
        Link Parent
        Thanks a lot! It's 10MB per site for now, and the whole server shares 4GB of bandwidth per month.

        Thanks a lot! It's 10MB per site for now, and the whole server shares 4GB of bandwidth per month.

        4 votes
  2. [3]
    FluffyKittens
    Link
    I got a 2-Bay QNAP NAS recently that I've been setting up. It's Intel-based, so not being one to trust the proprietary stock OS, I threw Debian on it. The stock OS had been installed on a small...

    I got a 2-Bay QNAP NAS recently that I've been setting up. It's Intel-based, so not being one to trust the proprietary stock OS, I threw Debian on it. The stock OS had been installed on a small memory card (~4GB) that was too small for Debian, so I made a smaller (~30GB) partition on the HDDs for the OS, with the rest of the drive mostly taken up by a big mirrored storage partition.

    Problem is that some process is writing to disk pretty frequently, and the drives/enclosure are somewhat noisy - not terribly so, but enough to be noticeable in my cramped office. My plan is first going to be taking a look at iotop and /var/log timestamps, but it got me thinking: Has anyone played around with something along the lines of mounting /var/log as a temporary in-memory partition and using a cronjob to periodically persist logs from the temp partition to disk? I.e. creating a filesystem-level buffer to minimize the number of disk writes at the expense of some potential data loss?

    4 votes
    1. [2]
      FluffyKittens
      Link Parent
      Update answering my own question: Looks doable - use tempfs to create an in-memory partition, mount it as /var/log, set up a cronjob to transfer logs to the real, on-disk log directory using rsync...

      Update answering my own question: Looks doable - use tempfs to create an in-memory partition, mount it as /var/log, set up a cronjob to transfer logs to the real, on-disk log directory using rsync with the --append flag and then wipe the directory again (to limit amount of memory needed). Would have to fiddle with the journald conf too, I think, to turn off log rotation.

      2 votes
      1. DMBuce
        Link Parent
        Rsync's --remove-source-files option might be helpful here. For your overall goal it might also be worth looking into power saving options if your hardware supports it. Some of them are geared...

        transfer logs to the real, on-disk log directory using rsync with the --append flag and then wipe the directory again (to limit amount of memory needed)

        Rsync's --remove-source-files option might be helpful here.

        For your overall goal it might also be worth looking into power saving options if your hardware supports it. Some of them are geared towards reducing disk writes / keeping disks spun down. For example:

        https://www.kernel.org/doc/html/latest/admin-guide/laptops/laptop-mode.html#the-details

        No clue if that would help with your particular use case, I just remember it from when I was setting up a new laptop not too long ago.

        2 votes
  3. Apos
    Link
    I reworked the way links are handled in my static site generator. The SSG is designed so that it's easy to add documentation to an existing project. It's executed as a GitHub Actions pipeline....

    I reworked the way links are handled in my static site generator. The SSG is designed so that it's easy to add documentation to an existing project. It's executed as a GitHub Actions pipeline. What it does is takes the repo's main README.md along with the markdown files in the docs folder. It converts those into HTML files and publishes the site on GitHub Pages.

    One thing that's tricky is that I also want the markdown files to stand on their own. This means that to link to another markdown file, you'd do [Other file](./b.md). I like this because it means the docs aren't bound to the SSG. The SSG just gives a nicer view on them.

    To get clean URLs, a file called docs/a.md ends up at /a/index.html. Or /docs/nested/b.md ends up at /nested/b/index.html. The main README.md ends up at /index.html. This requires rewriting links so they still work in the context of the generated site.

    For a while I was keeping relative links relative, but then I also wanted to support linking to other files outside the docs folder. For example [Go to src](../src/). These types of links should instead get rewritten to the GitHub repo.

    Given this structure:

    README.md
    docs/a.md
    src/styles/...
    

    I ended up with this conversion table from inside the main README.md:

    Outbound / Other:

    Before After
    https://github.com https://github.com
    #test #test

    Relative:

    Before After
    ./README.md /
    ./README.md#test /#test
    ./docs/a.md /a/
    ./src/styles/ https://github.com/Apostolique/apos-docs/tree/main/src/styles/

    Absolute:

    Before After
    /README.md /
    /docs/a.md /a/
    /src/styles/ https://github.com/Apostolique/apos-docs/tree/main/src/styles/

    It was annoying to implement, but at least it seems to work for all the links I throw at it.

    1 vote