KTamas' Blog

Remember kids, if Internet Explorer is brave enough to ask to be your default browser, you're brave enough to ask that girl out.

Posts about tech

Converting My Blog To Hugo and Getting Rid of My VPS

· 955 words · 5 min read

I have a blog (you’re reading it!). It’s got history: I set it up in early 2009, and I have almost 600 posts, mostly in Hungarian. I had one before that, between 2005 and 2008, but it was lost due to a variety of reasons, including my failure to properly back things up. Small bits of it are still up in the Wayback Machine, though. It was all in Wordpress, which does its job, though even in 2019 it can be a pain to update things.

From Wordpress to Jekyll to Hugo

About a week ago I decided it was time to migrate it to Jekyll. I was bored, and it gave me a good excuse to play with a static site generator. Plus, doing this kind of conversion became a rite of passage for people working in tech these days.

This is not a complete guide; you can find hundreds of them with a quick google. I will, however, provide a general overview of the process with some helpful pointers and links.

I started by migrating all the comments to Disqus with their official Wordpress plugin. After that, I used a Jekyll exporter plugin that converted all my posts into markdown… except it stripped all the embeds.

I used to blog a lot about music, so I had a lot of embeds, mostly from Youtube. In retrospect, I could have saved myself some time by patching the exporter or finding another one. In the end, however, I ended up fixing every single post by hand. I replaced old, pre-iframe flash embed codes with updated ones and changed the newer, but still http ones to https. In most places, if the video was not necessary or wasn’t available anymore, I added the song to the post via Spotify. The chances of a given song being up on Spotify in a few years feels marginally higher than on Youtube right now. I had a few other embeds that I could fix with newer code (Soundcloud) and others that I couldn’t (Deezer), but most of the time I could find the given song or playlist within Spotify. All of this had the benefit of walking down on memory lane, reading 10-year old blog posts and cringing a lot. I was so young.


I’ve found a reasonably decent theme for Jekyll, which felt like a good starting point, though it didn’t have built-in support for tags or archives. I started googling how to implement that, and around the same time I was venting about my embed issues on the XOXO slack. That was when David chimed in about his experiences on doing this exact same process, except he ended up using Hugo, another popular static site generator that’s kind of like Jekyll except faster. The theme of his blog had everything I wanted: a fancy archives page and proper support for tags. So I figured I might as well continue my journey: switch to Hugo and use his theme as a basis.

Jekyll is written in Ruby and uses a simple templating language. Hugo’s code is in Go, and it uses Go’s own templates; they definitely have a learning curve, even if you have coded in Go before. With some help, googling and a lot of trial and error, I got the hang of it and managed to change things to my liking as well as the look and the color scheme of the site. I converted most of my posts’ front matter with a script and fixed the rest with a few search-and-replaces. With 8-10 hours of work behind me — half of that was fixing those embeds — I had my new blog ready to be hosted on Github Pages for free. I use a modified version of the sample deploy script they have in Hugo’s documentation.

Getting Rid of My VPS

I had a small VPS at Linode for years now, hosting my pet projects, my blog and a bunch of static sites (like my home page) over the years. It also had OpenVPN installed so I could watch iPlayer for free until BBC started cracking down on that. By now it only had my blog and those static sites; I figured if I could find something for the latter, I could ditch the VPS entirely.

I don’t remember how, but I came across Netlify. They give you free static hosting with extremely generous soft limits (100 gigs of storage, 100 GB/month transfer). You just point them to a Github repository, and about 30 seconds later you have your site ready, with support for multiple custom domains and SSL.

I spent an hour or two moving everything to Netlify, changing the necessary DNS entries and in the end, I was ready to say goodbye to my VPS and save a grand total of $7 a month in the future. I made backups of everything and then, somewhat emotionally pressed the “Delete” button on Linode’s control panel. I wouldn’t be surprised if I would get another one eventually for a side project or something, but for now, I’m happy with my all my stuff hosted around the internet for free and stored in git repos.

On the Future of My Blog

There is a lot more content to come as I started writing regularly. Feel free to subscribe to this blog in your favorite RSS reader.

Hugo gives me a lot of ways to tinker; I am already thinking about replacing the commenting system, adding reading time, word count and so on. I might write something on this in again in the future.

This post was not sponsored by anyone, just in case some of it reads like an ad for Github or Netlify or whatever.

A Year in Smartphones

· 675 words · 4 min read

I started 2018 with wanting to try Android after not using it for like five years; I had a Nexus S with Android 4 point something back in 2013 before jumping on to the iPhone bandwagon. So I got myself a cheap Moto G5 Plus just to play around with it, and to my surprise, I promptly fell in love with the whole thing.

Android has come a long way, and in many ways, it’s a better fit for me than iOS. I like the (relative) openness of it, the way it handles notifications, the ability to turn off animations (I hate UI animations with a passion), the customizability in general, better integration with Google and so on. The G5 Plus shipped with 7.0 Nougat, with the promise of an Oreo upgrade coming in late 2017, which arrived at the end of 2018 and made an otherwise fast phone somewhat slow. It ships with a vanilla version of Android, with a few enhancements from Motorola that are actually useful: a few gestures (for example, shake twice for flashlight) and a really good implementation of an active display (you can preview and even dismiss notifications from it very quickly). Oh and it had a great battery life.

The phone did have one major flaw: the camera sucks. It’s… passable at best, but even with the best daylight conditions, pictures simple look off at best, because of Motorola applying some extremely aggressive sharpening. Low-light performance? What low-light performance?

So I replaced it with a Pixel 2 which, at the time had the best camera on the market (it still is one of the best ones) and it was pretty great, except the GPS in it was pretty shitty, and I was used to using my phones for running. After it spending literally months in repair – which is hard in a country where you can only buy grey market imports; mine is from Canada –, going back and forth and getting nowhere, I just got fed up with the whole thing and sold it. Only later I learned that many of the high-end phones lately come with shitty GPSes and if you wanna go running, you better buy yourself a running watch.

In any case, I decided to jump back to iOS and got myself an iPhone X, about two months before the fall keynote. I figured I’d replace it with the new model when it comes out but the XS is a ridiculously incremental upgrade and I have no desire whatsoever to spend money upgrading. Maybe next fall.

The X also has a good camera, and the optical 2x zoom should be mandatory on phones; its portrait mode is, in my experience, ever-so-slightly better than the Pixel 2’s (its low light performance, on the other hand, is miles behind). I shot a series of portraits with it on XOXO 2018, and I was pretty satisfied with the results.

I do miss Android, but I came to appreciate the big screen in a relatively small package – I can still more or less use the X with one hand – as well as the build quality. iOS 12 was a very welcome update as well with a few small things (faster animations! less waiting!).

And there are certain things that, even in 2018 are just better in my experience on an iPhone; small things, like the smoothness of the touchscreen and the handle of touch in general, or having a working implementation of auto-brightness that not even the Pixel 2 can get right.

Overall I am pretty happy with the X, and I will stick with it for the foreseeable future, even though I recently got myself a Pixel 2 again because I needed an ARCore-capable phone for AR game development.

The moral of the story is that I have disposable income and I was bored. I am tempted to say that none of this stuff really matters but I spend a fair amount of time on my phone every day so… it kinda does for me.

Internetmegosztás

· 113 words · 1 min read

Mit csinál az ember, ha elvágják az épületben a koaxot és hirtelen egy egész iroda marad internet nélkül? 40 ember nem tud éppen dolgozni, valamit muszáj kezdeni a helyzettel. Mobilnetünk van, és a céges routeren van külön USB port ennek — de pont a mi modemünket nem támogatja. Pánikra azonban semmi ok: mobilnetet be a gépünkbe, fel vele az világhálóra, majd azt azt továbbosztjuk rögtön a gép hálókártyájára. Ezután a kábelmodem WAN portjából átdugjuk a hálókábelt a gépbe, és már csak a routernek kell megmondani, hogy az internetet DHCP-n kérje, és hirtelen az egész irodában újra van net. Távolról sem olyan gyors ugyan, mint 120 megabites UPC, de arra a fél órára tökéletes…