The Approximately Monthly Zoomer


To PHP or not to PHP

2022-12-06

Up until now my blog has been using PHP with a MySQL database to store blog entries. It was a nice exercise to try PHP again, every year the language becomes more and more bearable. However, it always seemed a bit overkill for what I’m trying to achieve: a few pages with nicely laid out text.

Why now?

I’m currently in the process of migrating all of my services onto a Proxmox cluster, so I guess now is as good a time as any.

The New, Better, Improved and 100% Future-Proof System

My blog neither has a lot of posts nor frequent updates, so a search function is something I can procrastinate doing for now. This means there is no need for anything else than a few static pages. The general idea I had was to write articles in markdown and have them converted into html. Without checking I was certain such a program already existed so I started thinking about the rest of the setup. I settled on a python script which takes the markdown files, which have a few lines of metadata at the beginning, and passes them to pandoc for conversion using templates. Since the python script runs on my local machine with trusted™ files and not on the server itself, I sleep with a clear conscience each night, knowing the security of the script and sanitizingh the input is not a thing to worry about.

Challenges

Passing one article to an html template is not a big deal, but what if you want three articles on the same page? Let’s say on the landing page? Templates within tempates? How do you use templates all the way down?

Turns out I don’t even know how to google that, so instead I’ll just generate the articles with pandoc and then manually insert multiple into a single page using a python script.

Et voilà

It’s better than good - it’s good enough! I’m happy with the way it turned out. To some it might be ugly spaghetti code, to others it might be pretty spaghetti code - either way, it’s my spaghet and I’m proud of it.




Non-Evil Cloud Storage

2019-03-30

This is post about me installing NextCloud on my server - there is a TLDR at the end if you don’t want to read the whole thing.

GNU + Obligatory Virtue Signaling

At this point most people who understand something about tech should know that most offers of private cloud storage providers are indeed too good to be true. “Google admits to actively scanning and analysing everything you upload” when you use their service Google Drive [sauce] and OneDrive and iCloud (or Microsoft and Apple respectively) reserve the right to scan your files for “objectionable content”. If you want cloud storage with security by design instead of security by pinky promise policy, you have two options: Pay for a decent, trustworthy cloud service or do it yourself. If you are also particularly worried about glow-in-the-darks the latter is probably the option to go with.

Meet. NextCloud.

NextCloud is basically Dropbox on steroids, a detailed comparison with other cloud storage providers can be found here. With NextCloud you can sync and backup not only data but also calendars and contacts, you can edit your files in the browser using Collabora or OnlyOffice, connect it to other clouds using various protocols, use the integrated chat functions for end-to-end encrypted (video) chat and completely encrypt all your data on the server so even the person running the server cannot access your data. Cost: 0 Gold + Hardware. Since NextCloud is not really resource-hungry you can literally install and use it on a RaspberryPi so hardware cost should be manageable.

What You Need

There are a few things and abilities you will need to know/have for this (besides basic knowledge of Linux):

Installing NextCloud

With their Web Installer it’s basically as simple as dropping a php file in your www folder, you can then configure it from any browser with access to your server. Detailed information on how to prepare for the installation can be found in their comprehensive docs here (I’m not going to reinvent the wheel by creating yet another tutorial).

Quick Tips and FAQ

TLDR

Google/Microsoft/Apple bad, NextCloud good. Install on Linux server with web installer from here. Read this. Enjoy your freedom.




Fresh fish, straight from the fjords!

2019-02-22

After all the privacy shenanigans with Facebook trying to merge WhatsApp, Messenger and Instagram, I decided to try out some other messaging apps - my favourite so far in terms of functionality: Telegram. The ability to create and write with bots is something WhatsApp forbids in its TOS. They’d much rather make some sweet money selling the API access to businesses. Telegram on the other hand actively encourages the creation of bots and there are plenty of easy to use libraries to get started. I decided to create one for controlling my home-server so I can, for example, restart apache without having to ssh into the machine. It’s mostly just a python script which runs some bash scripts if the correct user (me) gives the command. Check it out on GitHub if you’re interested.

“But why is the bot named Addvar?” you may ask - I’ve spent way too much time playing Skyrim for me not to constantly reference it in random things.




Funny Talks for BigBrains

2019-02-08

You want to watch something but you don’t want to watch TV because of all the commercials? You want to watch something funny? You like tech talks? You want to learn something? If you answered this wannabe-eloquent apposition of questions with yes I’ve got something for you: Funny Tech Talks - when regular tech talks just don’t cut it anymore and you fear death by PowerPoint.




© Dominik Odrljin

Newer   2