Table of Contents
Hugo is an open-source static site generator and the more I use it, the more I like it. Unfortunately, my first choice was Jekyll, a Ruby-based generator and it was terribly slow and hard to work with. Switching to Hugo decreased site compilation time from 14 seconds to 14 milliseconds but I expected Hugo to slow down as I add more features but it’s still blazingly fast. Here are two new (to me) Hugo features I’ve been using during December:
Websites tend to grow in size and my websites are no exception. Sooner or later, we have to find a way to make the content searchable and that’s one of the many use cases when static site generators can improve both user experience and developer happiness.
The thing is, site searches usually happen on servers so you have to send your query string and wait for a response. That introduces a significant lag between typing something and getting back the results. Not with “static” approach! There is nothing that stops us from generating JSON version of site content along with the default HTML version and that allows us to use client-side search libraries that can take that JSON input and show the results without making any additional network requests.
Hugo can also read and modify raster images. That can be useful for displaying or removing image Exif data and for resizing images for certain use cases such as making smaller “thumbnail” versions of existing images. Different image filters can also be employed to adjust the images depending on user theme (light/dark).
I’ve played with this pipeline and created some kind of an Instagram feed here. I’m planning to continue working on it and I’ll probably use it as a place to share some of my photos.
Switching to Linux can be a bit of a headache at first but then it just keeps making your life more pleasant and productive. There are an infinite number of tools and most of them are easy to install and easy to use from the command line. One of the most interesting December discoveries for me was a simple and minimalistic tool called
This utility just shows all of the currently held file locks in the system. It can be great for debugging as well as for showing what other programs are doing. Here is the example:
COMMAND PID TYPE SIZE MODE M START END PATH firefox-esr x POSIX 9.1M WRITE 0 x x /.../favicons.sqlite
Looks like Firefox keeps it’s cached favicons in SQLite database file.
As I slowly move more and more of my stuff to Nextcloud, my performance and reliability requirements grow so I’ve tried a few things in order to improve Nextcloud performance.
Moving Nextcloud Fata From SD Card to SSD
I’ve used 1GB random file (/dev/urandom) for all of the tests listed below.
- Downloading file over a local network: 11.7 MB/s
- Uploading file over a local network: 3.55 MB/s
- Downloading file over a local network: 11.3 MB/s
- Uploading file over a local network: 6.67 MB/s
It seems that switching to SSD helped a bit but I haven’t noticed any dramatic changes. Still, SSD is a good choice for many other reasons but Nextcloud speed isn’t one of them. It will be interesting to repeat this test once Raspberry Pi 4 will get an ability to boot it’s operating system from an SSD.
Changing SSH Tunnel Location
Local speeds listed above are fine by me but what about the speeds outside of my home network? Here are my measurements:
- Downloading file over the Internet: 0.2 MB/s
- Uploading file over the Internet: 0.8 MB/s
That’s horrible! There must be a really nasty bottleneck somewhere and three immediate candidates are:
- My tunnel to home network is located in Amsterdam and my home network is in Phuket, seems like something less then optimal, to say the least.
- My cloud provider (Scaleway) might have some speed limits.
- Setting up SSH tunnel is kind of a hack and there are better (and faster) ways to achieve the same goals.
So I’ve decided to switch to Digital Ocean and move my SSH tunnel entry to Singapore (much closer) and repeat the same test:
- Downloading file over the Internet: 4.68 MB/s
- Uploading file over the Internet: 2.91 MB/s
Much better. That’s enough speed to cover my current needs but I guess I’ll come back to speeding up my Nextcloud deployment sooner or later.
Speeding up Web Pages
Most web pages are terribly slow and full of trackers and other shit. I’m not a big fan of Google but it made a good tool to shame the bastards who make browsing the web an unpleasant experience. They even claim to lower their page ranks, at least one nice thing from Google.
Interesting read on that topic: https://markosaric.com/speed-up-wordpress/
I’ve discovered a great book/practical guide on typography and now it’s hard for me to not notice how important fonts and content sizes are. The author sells some sexy fonts and they start from $100+ but he also recommends a few free fonts that look pretty nice too. Interestingly, this guy claims to make $10k+ a year from this free book which is pretty cool, I didn’t think that it’s possible given that even “not for free” books often fail to earn enough money to cover their costs.
I don’t watch as much video as many people seem to do, whether it’s YouTube or Netflix, but I have a weak spot for documentaries and the videos about economics. This month, I’ve came across a series of videos called “Free to Choose” featuring Milton Friedman. That’s a good set of videos where Friedman explains his brilliant ideas and then discusses them with different public figures. His verbal skills are fascinating and I’ve never seen an economist who can explain complex things in such an easy and fun way as Mr. Friedman.
I also couldn’t ignore the hype around The Witcher on Netflix so I watched it and it’s a great movie. It’s hard to escape comparison with Game of Thrones but I find The Witcher more fun and less dramatic. I mean, I liked the beginning of game of Thrones but I couldn’t bear it after season 4 due to its extreme dullness.
This month, I’ve been listening Linux Action News podcast, mostly old episodes from 2017-2018. It helped me to catch up on a lot of things I’ve been missing due to using MacOS for quite a while before switching back to Linux this year. The single thing that they’ve got terribly wrong is the price of Bitcoin. They’ve made a prediction in the end of 2017 that the price of Bitcoin will reach $100k+ by the end of 2018. Looks like even smart guys can be terribly wrong sometimes, although I think that their prediction will hold in the long run.
I’ve been lucky to have some free time to play a few games. Here are my favorites:
Hotline Miami 2
Perfect, just perfect. It feels like incremental improvement over Hotline Miami 1 and that’s exactly what I hoped for. The story got better, the weapons are more plentiful and the gameplay itself is even more fun and challenging than before. Call me a heretic but I’d like some RPG elements and an open world in the next game in this series.
Interestingly, this game was made with Game Maker, an engine made for education purposes that is aimed at kids. I used it when I was a kid and that’s a great tool to learn how to program.
That’s a nice arcade style game that’s perfect for anyone who has a couple of free evenings and who’s not ready to invest a ton of time in completing a long game. It feels a bit retro and it doesn’t need a 100-page manual as most AAA games tend to do. Just run, shoot and have fun.