Setting up Systemd on Debian in 10 minutes

Recently I’ve been reading more and more about Systemd. Now, most distros have already moved to Systemd but I’m using Debian and was stuck with init which was the default. Given the recent discussion on the Debian mailing lists about migrating to systemd as the new default, I was even more inclined to make the switch now and get used to it before it’s forced upon us.

Actually I was really looking forward to it, but as Linux goes I was expecting it to be a pain, so I was pleasantly surprised that it only took me 10 minutes and wasn’t a hassle at all.

I’ve decided to document the steps I’ve taken in case that someone finds it useful.

Read more →

Docker and Logstash: Smarter Log Management For Your Containers

Docker currently supports getting logs from a container that logs to stdout/stderr. Everything that the process running in the container writes to stdout or stderr docker will convert to json and store in a file on the host machine’s disk which you can then retrieve with the docker logs command.

This is handy but it has its drawbacks because you don’t get any log rotation and the file size of the collected logs can become an issue as it eats up your host’s disk space. Not to mention the fact that every time you run docker logs container_id you get all the logs of that processes from the beginning.

While there are some interesting things being discussed on the docker-dev mailing list, I wanted to see if I could get docker to play along with proven logging systems out there with the functionality I have now.

Read more →

Classes for all the things?

Recently I’ve been thinking a lot about how to simplify my code. Now, the key thing to note here is that simple != familiar.

Classes for example are familiar to most people. But code consisting exclusively of classes and OOP concepts isn’t necessarily simple all of the time. The question arises: Is there something simpler?

Well, the first thing that comes to mind, of course, good old functions. Functions are universal, everybody understands them, even new programmers that don’t yet get all the fancy concepts about OOP, get plain old functions.

Keep in mind, I’m not saying that classes don’t have their place in our code, but rather that maybe we don’t need them quite as often as we might think.

Read more →

The switch to Nikola

I switched Blog engines because I wasn’t very happy with the one I was using (Syte) and I wanted something more simple. Something that wold let me focus on writing and not maintaining code. Don’t get me wrong, Syte is an awesome project, it just seems like way too much. And the deal breaker for me was the fact that it used Tumblr for hosting blog posts and Tumblr has one of the worst online editors ever. It’s just not made for writing.

Read more →

One-liner Instant Postgres for your development environment

When working on web applications it’s very important to have a setup as similar to the production environment as possible.

The major component here is using the same database locally, for development, as you use in production. I myself work mostly with Django and, as most of you Django devs know, it’s very easy to get started using a Sqlite database.

Read more →