This site now sports HTTPS

I finally decided it’s the high time to serve the content using HTTPS, otherwise who knows what will be injected in the page as it crosses various nefarious networks. To that end, I decided to move the hosting away from Bluehost and to Hetzner. There were two main reasons to do the switch: Bluehost is based in the US, and I don’t (or want to) have connections with US Bluehost doesn’t offer Let’s Encrypt SSL certificates for the basic hosting – Hetzner does.

FreeBSD jails: the bare hands way

Many things have changed since my previous post about FreeBSD jails. Warden seems not that much used, and it’s alternative iocage is deprecated. Hence, based on ideas from this post I ventured on a rewarding way of setting jails manually. Setup exec.start += "/bin/sh /etc/rc"; exec.stop += "/bin/sh /etc/rc.shutdown"; exec.clean; mount.devfs; mount.fdescfs; mount.procfs; allow.raw_sockets = 1; allow.mount; allow.mount.zfs; enforce_statfs = 1; devfs_ruleset = 4; path = "/usr/jails/$name"; # snip torrente { host.

Power of Enums in Java

It comes sporadically that one has to implement a state machine for a project. Be it a benchmarking tool, or an authentication backend, or a Markov chain generator, it boils down to having a variable in one state, moving to another on certain action. In some of the cases, it might be quite useful to probabilisticaly move among states. There are many ways to implement such behaviour, but I found one really elegant, using Enum in Java.

xelatex in Org-mode 8+

Since I’ve switched to spacemacs I started moving more and more of my workflows in Emacs, org-mode specifically. One of my big items (kept in org-mode) is actually moving this blog from markdown to .org format, but that is not the topic of this post. The topic is how to use xelatex from Org-mode’s export, or even more precise, how to be able to switch between different processors per file basis.

Protip: Notes in your zsh prompt

I tend to follow good practices. For example, commit certain things in a particular git branch, that should be re-based of another branch that tracks the upstream. However, sometimes I just forget that, especially after not working on that particular code base for a long time, and do a commit in a wrong branch. Git is forgiving, but I wanted more, I wanted to avoid making that mistake in the first place.