I managed to reduce a PostgreSQL view’s query time by more than 80% with just the two keywords NOT MATERIALIZED and by reading the actual database manual when GPT-4 gave up. Below, I will explain the context of the speedup. I recently moved a little bit of business logic from an API endpoint and into… Continue reading NOT MATERIALIZED
Category: Tips
Web-friendly images with ImageMagick
Before uploading images to my blog or AI Tales, I run them through ImageMagick to resize and convert them to “web-friendly” JPGs: The command converts all PNG images in a folder to JPG while preserving the filename. Even though quality is set to 50% (you can of course experience with this, I often don’t see… Continue reading Web-friendly images with ImageMagick
Simple website visitor stats and location with GoAccess
I do not use cookies or browser trackers (like Google Analytics) on any of my personal websites to track visitor information. From time to time however, it is nice to get an idea of the amount traffic to my sites, including what pages get viewed the most. I use the following one-liner for this: Read… Continue reading Simple website visitor stats and location with GoAccess
Clean up harddrive space on Ubuntu Server with journalctl
After running for a while, an Ubuntu server tend to get bloated with… stuff. One particularly weird one is the disk usage of a bunch of /var/log/journal/* entries that hog a lot of space. In my case, 2GB. This is significant on a machine with just 20GB of space. You can see their disk usage… Continue reading Clean up harddrive space on Ubuntu Server with journalctl
Simple photo effects with ImageMagick
I recently explored the capabilities of converting photos to something that looks hand-drawn with a pencil using ImageMagick. It is difficult to get good results, but I thought I would share a few one-liners that I found useful to play around with, as well as a bonus effect that turns a photo into something resembling… Continue reading Simple photo effects with ImageMagick