Using fail2ban to check for WordPress brute forcing in Plesk12

Happily, Plesk12 now includes fail2ban. Adding a check to block IP-addresses trying to brute-force your WordPress installations is now simple.

Basically, in the fail2ban configuration, I added a filter named wp-auth, with the following Content:

failregex = <HOST>.*] "POST .*/wp-login.php
ignoreregex =

… And then a jail, named wp-auth, with the following config:

Skærmbillede 2014-11-20 kl. 12.09.30

This blocks any IP which has posted to /wp-login.php more than 7 times in the last 10 minutes (with the default config) – and blocks the IP for 10 minutes.

Limiting the number of active users on a site using haproxy

I was approached by a client; they had a site where they wanted to limit the number of active user sessions to a webshop.

The objective of this was to avoid over-selling stock (which they had previously experienced), and to keep the performance up. The site was used for booking activities for kids vacations.

We decided on haproxy, as it has a pretty efficient engine for rate limiting. After reading the documentation, it was clear that I needed to go bleeding edge (version 1.5dev18 at this point) to get the configuration functions needed. Continue reading

HP Universal driver gone from Win2008R2 Terminal Server

Got a call from a client, all of the sudden they were missing  a number of printers (but not all) from their terminal server.
All the missing printers shared the same driver; HP Universal Print Driver.

After digging around, I found a large number of event log entries stating (in danish):

Det lykkedes ikke at installere printerdriveren HP Universal Printing PCL 5. Fejlkode 0x2. HRESULT 0x80070002

…which roughly translates to “Unable to install the printerdriver … blabla”

After asking my good friend Google, I stumbled across this thread: which indicated that after faults with the spooler service (which is pretty common on this box), it might leave behind stray folders in C:\Windows\System32\spool\prtprocs\x64 – and after leaving 499 of them, it’ll silently fail upon trying to create another.

I cleared out the folders named 1-499 (moving them to a backup location, just in case), restarted the spooler service, and voilá – printers were now able to install.