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?
I dipped my toes into python for the first time. I've modified stuff before, but this was the first from near-scratch. Its an F1 plugin for Limnoria (irc bot.)
It pulls all of these for all years available with the API
Tonight I need to figure out how to check if the argument (?) is either blank or within a certain range so I can throw a better error back. e.g. if they enter @gp 40, it should tell them to either return a blank or a number between 1-22.
I doubt I'll be doing AOC with python this year, but who knows.
I've got a side project (web service) that's nearing launch, but before I go live, my immediate goal is to get my shit together infrastructure-wise, as my dev setup is a bit of a mess. For context, each environment is hosted as its own VPS instance, running a whole Postgres/Flask/Caddy stack on one Debian box. I have a shell script with commented notes partially outlining how I set up the environments, but it's far from complete, and has a lot of manual steps to it. I'm also manually rsyncing code changes over to each box, and (re)starting the Flask app + my background ETL script on the server manually.
Questions:
useradd --system <account name>
?I read this blog:
https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to-gradual-automation/
about do-nothing-scripts to gradually automate repetetive tasks and I find the approach makes a lot of sense. It provides good documentation and can mix both manual and cleanly automated steps. Ansible et al. might be a better approach longterm if tou have a larger team working on many different things, but to me it seems overkill for a side project (unless you are already comfortable with it or just want to learn it).
As for deploying code, most continous integration systems have a bunch of plugins for this kind of thing. It is kind of dependnet on your infrastructure. I'm sure e.g. github actions could be used to trigger a deploy.
useradd --system <account name>
seems to be the way to go when adding the service accounts. Creating these could go into your do-nothing-script :)Thanks so much for the response - very helpful on all fronts!
Some two cents on 1. and 2.:
Does anybody have any advice or good books/guides on building a database driven website? My last foray into website programming was a sixth form computing project where I built a site using MySQL, PHP and HTML. But that was fifteen years ago.
I feel like I want to try my hand at building a lightweight social news aggregator of my own. This may be a big first project...
BCHS sounds like a good place to start. Just substitute your own components. Python's cgi server is really convenient, so HTML, SQLite, Python is a good starting point. Plus, Python might make it easier to transition off of cgi and into more modern practices down the road.
LAMP stack still works fine, especially for a small, homemade news aggregator! My advice would be to start building off the existing skills you know, and progressively add in new tools that interest you.
The easiest next step from basic LAMP to a more modern setup would be moving from inline PHP to Laravel for the interactive portions of your site. If frontend seems like your thing, you can try out Tailwind, React, or even build up a solid base of vanilla JS knowledge.
Alternatively, if you’re looking for a more all-in-one, gold standard, greenfield solution and don’t mind ditching PHP, Python’s Django framework is known for having really good documentation and a solid developer experience (though expect a several week learning curve). Like Laravel, it’s the sort of tool that will stick around for the next twenty years, and learning Python will probably give you greater ROI when it comes to day-to-day computing activities than will PHP.
I just wrote a quote of the day server in
scheme last night. It's an old protocol
defined by RFC 865, and was pretty easy to write--- most of my struggles were
figuring out libraries and stuff, since I'm new to chicken. Was fun though!
You can see my QOTD by