DEV Community

Bartlomiej
Bartlomiej

Posted on

DevOpsWay Mini #3 - a closer and cyclic look at html

First of all - sorry for the long wait!

Next of all - this time another mini side project
Another one that isn't that crazy - a primitive logger.
While most of the projects I have thought about, then seen, are all about checking usage of RAM (free), storage (df, most likely with -h), CPU (ps -ef, or even pipe it with head: ps -ef | head -n X).
Also, it has the added benefit of needing to learn how to parse the .html versus just sending the outputs of the Linux commands

Initially, it had an issue that made it pretty unexciting.
I don't really use the server for that much, so the only way I could get alert is if I deliberately did some shenanigans on the server.

So what could alert me?
Whenever McDonald's promos change
As funny as it sounds - it also seems reasonable... and tasty sometimes ๐Ÿ˜…๐Ÿ˜‚
I've decided to make alarming via e-mail, and job scheduling via crontab

I'll be honest - while I've sent emails via C#, I've used AI to generate the mailing script - but the most important thing is that you always want to review and edit the changes - under no circumstance blindly use the generated code!

I left myself a possibility to add more recipients if friends of mine would like to be alarmed of promos changing - so I've decided on using file for configuration of sending emails
One thing I know for a fact, I want to make an update in the near future: replacing e-mail configuration file with environment variables.

It has a TREMENDOUS added value: not only do I need to ensure it is structured properly, but I can just take data from the variable names, so I will be sure they won't be tangled.
But that's not even the best part!
It is the fact that I can easily set up the same code, and test different things (for this script - such as sending e-mail only when using the server, and on local tests I can use print instead of spamming my email!)

Speaking about that, I wouldn't need to edit the script every single time to account for the fact I'm using a different OS on the server vs locally!
Pretty powerful, isn't it?

Oh, and I'm dropping the scripts - I'll admit they are not professional, but do they really need to be? Maybe, but software development is an iterative process which I'll come back to and update later ๐Ÿ˜
Also, I believe showing the whole iterative process is much more insightful than showing just the highlights!

See you in the next one - whatever that may be ๐Ÿค”

Top comments (0)