János Pásztor

Blog on Web Development and Operations

Photo: Istvan Molnar

May 14, 2013
by János Pásztor
0 comments

How Linux' new container virtualization works in detail

LXC tutorial

LXC is the new container virtualization technology of the Linux world. It’s free, it’s fast and it’s open source. Although it’s meant to replace OpenVZ, it’s not quite there yet.

Despite this fact LXC is an immensely useful tool to run various applications in mostly separated environments. As with all new technology, no in-depth documentation exists to date, so bear with me as I endeavor to show you how it is all put together.
Continue Reading →

May 7, 2013
by János Pásztor
1 Comment

Proper time handling with PHP and MySQL

Few developers actually know that not only character encodings but also time handling can cause you headaches when it comes to PHP and MySQL. Contrary to popular belief, PHP’s time handling actually works quite reasonably if you know how time actually works. If you don’t, you may be in for a big surprise when you add 3 days to a date and end up with a date 4 days from now. The answer lies within the *NIX time handling.

Continue Reading →

I find your lack of faith disturbing

May 6, 2013
by János Pásztor
15 Comments

I find your lack of Code Completion disturbing...

Fixing the Dependency Injection Container in PHP

I’ve been developing PHP well over a decade now and I came to develop a distaste of a phenomenon that has been ravaging the community for quite some time: the lack of code completion. Editors like PHPStorm do an amazing job at discovering variable types, but even they can’t cope with one thing: the Dependency Injection Container.

Framework designers place modularity of their systems above their developer’s convenience, which results in a lot of f-words being thrown while developing. So I went out on a quest to bridge the gap and enable code completion for the Dependency Injection Container.
Continue Reading →

May 3, 2013
by János Pásztor
0 comments

Festina lente!

Supercharging your sitebuild work with SASS and PHPStorm

Sitebuild is a pain in the neck, no small part due to CSS’ inability to use variables, includes and such. Most of the time we also constantly need to upload stuff to a server. I’ve been a PHPStorm user for almost a year now and even though it has already been an awesome IDE for PHP, with version 6 it became even more awesome. (Full disclosure: I am in no way affiliated with JetBrains.)

I’ve recently started to create a new theme for my WordPress and I’ve found a really comfortable way for working with these tools. Even though I’m going to take WordPress as an example, the techniques described here are applicable to just about any sitebuild process.
Continue Reading →

April 29, 2013
by János Pásztor
0 comments

Hic abundant leones

Setting up Apache with PHP-FPM

Nowadays nginx seems to experience a serious growth in terms of numbers when looking at HTTP server software. Almost all articles regarding PHP-FPM detail the setup with nginx, very few talk about the good old Apache HTTPd. Admittedly, it’s a little harder to set up due to the myriad hacks layered in it’s internal infrastructure. It has one major advantage however: it handles .htaccess files which allows customers to configure their own little corner of the webserver without poking the admin or endangering the server’s stability.
Continue Reading →

April 26, 2013
by János Pásztor
3 Comments

Anno Domini

Don’t use FTP – here’s why

FTP has been around since the early days of the internet. Even though it’s old and cranky a lot of sysadmins, especially those just getting into managing a server, still don’t know anything else.

FTP is outdated, has a lot of problems and sometimes it can be outright dangerous, however it’s wide spread acceptance as an easy way for transferring files makes it hard to switch to alternative protocols. If you have a choice, don’t use it. I’ll show you why.
Continue Reading →

March 25, 2013
by János Pásztor
4 Comments

What is REST?

Representational State Transfer, in short REST is the API of the Web 2.0 Era. It’s fast, easy to code and in general no-nonsense. However, there seems to be a great deal of confusion on the topic. Even Wikipedia has issues with the corresponding article. So what is REST and how does it work?

Continue Reading →

forbidden

February 6, 2013
by János Pásztor
4 Comments

Cgroups explained: Limiting Linux Processes

How do you limit a group of processes on Linux? – The classic answer to that is: you don’t. The reason for that is simple. Linux’ historical resource limiting solution – ulimit – works on a process level. If you start a new process, that process has limits of it’s own, which is the direct explanation for the fork bomb’s effectiveness.

Unbeknownst to a lot of sysadmins however, Linux has a new toy to play with: control groups. As you might have guessed these are groups of processes, which limits can be applied to as a whole. How do they work? Bear with me and I’ll show you…
Continue Reading →

January 22, 2013
by János Pásztor
6 Comments

LXC vs. OpenVZ

LXC (Linux Containers) is the new flagship of container-based virtualization on Linux. Although being around for quite some time, LXC is still not feature complete which leads to many people still using OpenVZ. Mostly based on Michael Renner’s work, here are the features that are missing and those already complete in a nice overview. The data represented here takes Ubuntu 12.04 as a basis, as it is the distribution that supports LXC best.
Continue Reading →