11
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?
It's kind of dumb, but I'm not very satisfied with the behavior of GNU cp and mv. So I made my own:
The actual code is pretty boring but the tests file is interesting to read because you can see how different options affect the location of destination files.
To be honest, I wasn't really planning on making it, but after writing the mergerfs-cp command it was really simple to copy most of the logic. I still use normal
mv
most of the time, but writing it helped me catch a few bugs in the mergerfs-cp subcommand too. But the other benefit is that now Windows and Linux users can use BSD's confusing? trailing slash behavior when copying or moving folders/files.... Mac OS already has BSD styleMaybe next week I'll add parallelism. I think it should not be too difficult because everything is file-driven rather than "folder"-driven.
Wow, this is really cool. And by the way, incredible note-taking discipline! Any tips for us mortals that struggle with note-taking consistency/quality?
hmm... it took a number of false starts for me to find something that works for me. Everyone has different preferences. So I doubt that this is 100% transferable to you, but I hope that you'll try:
I haven't read it, but I imagine the book Atomic Habits would say something like, "change your environment to make the easy thing your desired thing"...
Or maybe the Tao Te Ching says something like "be like water. or be like earth: paths typically emerge as convenient shortcuts where more deliberately constructed paths take a longer or more circuitous route, have gaps, or are non-existent. Once a path has been trodden out through the natural vegetation, subsequent traffic tends to follow that visibly existing route (as it is more convenient than carving out a new path by oneself), and the repeated trampling will further erode away both the remaining groundcover and the soil quality that allows easy re-vegematation. Eventually, a clearly visible and easily passable path emerges that humans and animals alike tend to prefer".[1] But I haven't read that either.
I think to develop a habit you have to make it fun, especially in the beginning. After a week or two of consistent effort, and after you feel satisfied with the structure of your note-taking, it makes sense to backfill your notes from other sources but only if you do so incrementally.
Unless you can get it all done in one day it doesn't make sense to spend >2 hours on it per day. Cron, or systemd-timers, can be helpful for creating habits. Over the past two years I've been gradually adding my whole Linux home directory into git one file per day. As part of my "daily cron", a line from the bottom of ~/.gitignore is removed.
As long as you keep the amount of work small, it's not too annoying to see that a one or two things need to be checked and committed to git as I use the computer throughout the day. Maybe you could call this "microdosing work", "gamified labor", or "quiet quitting" /s
I continued work on my expense tracking app (it now has a name, Settlemint - but it's not final so I might change it).
It's now an easily deployable Docker container, you just need to point it towards a PostgreSQL instance using an environment variable. The folks at Koyeb have a free VM and 50 hours of PostgreSQL per month, so I'm hoping I can use them for my test deployment (and eventually my live deployment, when I feel ready to switch away from Splitwise).
Today and yesterday I refactored the shit out of the codebase, merging some functions together, splitting some, and trying to make use of async Rust to make ergonomic calls between server and client. I also broke my animations because I used some timer functions that only work in WASM and panic in the server, so I need to find something that works on both platforms.
Now I'm working on the user functionality. I have the login done, with properly hashed and salted passwords on both the frontend and backend (so no man-in-the-middle attacks hopefully), and now I want to add an administrator panel so I can add/remove users as needed.
I decided against hosting a public instance, and letting people make accounts freely on it. It turns out expense details can be treated as personal data (theoretically, under certain conditions, you could identify someone based on how much money they spent on something) so that makes me liable under the GDPR, which is a massive nope from me.
Instead, each person that will want to use Settlemint will need to host their own instance and use the admin panel to add users as needed, or join an existing instance hosted by someone else. For security, the admin will set a temporary password for each account, then on first login each user will have to set their own passwords.
Once the admin panel is done, I'll work on letting users create groups with other users and share expenses.
I will need to figure out a way to connect users together. Theoretically I could just add a dropdown with all the users on the instance and let the group owner select who to invite, or I could have people scan a QR code and join the group that way (like the Party Play feature in Pokemon Go). I'm thinking a bit too hard about privacy and security honestly, for an app that probably nobody else besides me and my partner are going to use.
There were features from Bazarr (subtitle manager for media library) that I wanted so I had implemented one of them a minute ago, have another one nearly complete but I've been too down to focus on anything. The one I finished let's the user input which codecs they'd like ignored when the program checks for subtitles embedded in a file, in main this is several toggles for pre-determined codecs. The one almost done is a user input score modifier for providers, allowing the user to set a preference in the case that two providers provide the same score evaluating if the sub matches the video. I had wanted to implement a table and support for multiple providers, but they're currently on Mantine v6 with plans to implement v7 soon so I figured I'd wait to do anything more complicated on the frontend (I also have 0 frontend experience so I was fumbling through it poorly). In the meantime, I've been doing support on their Discord. It's a fine distraction from work.
Update: they updated to Mantine v7 on dev, I've got no excuse now lol.
I have just released the initial version of comment-monk, an open source comment hosting system for static blogs and websites. I am working on adding new features mentioned in the change log and fixing bugs. The development is very much active.
Pico SDR
Turning Raspberry Pi Pico into FM radio receiver frontend. It was definitely not designed to do that. :-)
I have trouble identifying source of those pesky 72 kHz spurs. Please help.
Managed to export and move my blog from a hosted WordPress.com into a self-hosted static site using Jekyll. Found an export tool that could convert every post into markdown, ran them through some Vim macros to fix some minor things, changed the default theme a bit, made some custom archive overview pages and deployed everything with a simple rsync over SSH.
Still some details missing like a comment system. @pyeri's comment-monk system looks interesting, though I don't have a PHP setup at the moment. I might try https://commentbox.io as I don't want to use Disqus. Though I only got like 4 comments in the last 2 years, so not exactly a high priority. From Wordpress I do miss the nice and easy stats from Jetpack. I am playing a bit with https://goaccess.io/ which is really powerful but also way more low-level than I really need. But of course the whole purpose of this thing was to have fun playing around with things and being independent from other services.
Thanks for showing interest! You can get a free-tier PHP hosting from InfinityFree or several others. Or you can use the Amazon's AWS free-tier (first year) to get an EC2 instance and install Ubuntu Server with PHP on it. There are usually many options when it comes to PHP.
With a SAAS service like commentbox, the initial setup is easy but you'll be tied to their whims in the long run. They might increase the prices next year (many usually do) and then you'll again have to search for a new setup. On the other hand, fully owned FOSS technology is a long-term solution.
A bunch of rather minor things while I’m on vacation:
email), and activated SSL
To-do/up next, perhaps: clean up my scripts and dotfiles and integrate a dotfile manager like chezmoi to hopefully somewhat formalize setups of new hardware.