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.

rsyslog centralized logging

First of all logging is really important, and are a critical part of any system, they will give you insight into what a system is doing as well what happened.

Virtually every process running on a system generates logs in some form or another. When your system grows to multiple hosts, managing the logs and accessing them can get complicated.

Searching for a particular error across hundreds of log files on hundreds of servers is difficult without good tools.

A common approach to this problem is to setup a centralized logging solution so that multiple logs can be aggregated in a central location.

Upgrade Plesk 11.5 to Plesk 12 on Debian Wheezy 7.6, fixing OpenDKIM and DK

I wanted to upgrade to the newer edition of Plesk as it has some interesting features for controlling outgoing mail that make my life easier. So I wanted to upgrade and ran into some weird issues during the upgrade.

tmux logging complete output to a file

I’ve needed to log the complete output of a node.js process I’ve been running, even though I’ve been logging everything, there are some situations where the process completely crashes and nothing was logged.