fail2ban for Wordpress and Plesk

I’m hosting quite a bit of pages that run WordPress, and one of the biggest problem that I ran into is that people don’t keep their WordPress or plugin installations updated.

I gave up on having everyone upgrade, because they all use different plugins, customized plugins, and a lot of other stuff that will break if they upgrade.

So here comes fail2ban to the rescue, we can use it to go through the logs, to configure the system to ban the users when they fail to log in, or do some bad stuff, or try to brute force their way into the wordpress installation, either through the login form or through xmlrpc.

Interview question - About arrays

I had an interview for a job, and one question they asked was how to do something in a language I’m comfortable with.

So I told them what language would they like for me to give them a solution, I said I can do it in Java, PHP, C/C++, …, and they said that it’s not a problem, they understand everything, doesn’t mater which language it is written in, if you want to know the difference read bellow in the PHP section.

Getting started with gradle and java

I always used ant with Apache Ivy or maven to build java applications, so I thought there has to be something better and easier to build the application instead of using them. So I decided to give gradle a go.

Express4 + Mongoose + JSON Web Token Authentication

Authentication is part of almost every system, even if it is in node.js, Express, Angular.JS, PHP, Perl, Ruby, or any other languages you are using. Dealing with authentication is a must for most of the systems.

How to generate self-signed certificate for usage in Express4 or Node.js HTTP

I needed to generate a self-signed certificate for usage with node.js and express, since I don’t want to buy a certificate for just trying out and playing with it.

Let’s figure out how to do it.

Emergency reboot/shutdown using SysRq

As you know linux implements some type of mechanism to gracefully shutdown and reboot, this means the daemons are stopping, usually linux stops them one by one, the file cache is synced to disk.

But what sometimes happens is that the system will not reboot or shutdown no mater how many times you issue the shutdown or reboot command.