error: Python.h: No such file or directory

When install dlib python module, i get error

This is because missing python3-dev package. To fix, install

If you are using python virtualenv, you will need to recreate the virtualenv after installing dev package.


To list all packages installed with brew

To see if a specific package installed, run

php programming

HTTP 301 Redirect using PHP

You can use PHP header() function to do redirect.

To do 301 redirect, use

For 302 redirect, use

If you need to redirect a site to new site keeping same URL structure, you can use

Nginx Web Server

Nginx HTTP 414 request-URI too large

On a Nginx server, when accessing a long url, i get error

Nginx HTTP 414 request-URI too large

To fix the error, edit

inside “http” section, find

Replace the line with

If your URL is very large, you may need to increase the 32k to higher or reduce the url length.

Large url like this mostly happend due to bad application design, so if possible try to make URL smaller.

Restart nginx

On older servers (centos 6, ubuntu 14, etc..), run

postfix mail server

Postfix email forward

On an Ubuntu Server, i done following to setup email forwarding.

Install postfix

Edit /etc/postfix/, add following


Create Virtual mailbox


Create alias file, used for mail forwarding


Wth above configuration, mail coming to [email protected] will get forwarded to [email protected] Email coming to [email protected] get delivered to local mailbox folder.

Now run following commands to make hashmap

Restart postfix

EasyEngine upgrade

Upgrade EasyEngine

To upgrade EasyEngine, run

It is recommended you run this in tmux or screen to avoid disconnection while upgrading.

EasyEngine upgrade


Related Posts


MySQL server has gone away

When restoring a MySQL database, i get error “MySQL server has gone away”.

To fix this, edit MySQL configuration file. Add following line under [mysqld] section.

Restart MySQL

If you use MariaDB

Related Posts


iredmail increase mail attachment size

Default mail attachment size in iredmail is 10 MB. To increase mail attachment size, login to server as user root, run following commands

Here 104857600 is 100 MB in bytes (100 * 1024 * 1024). Change this as required. Sending very large file using mail attachment is not recommended, it is better use file sharing services like Google Drive, Dropbox, Microsoft OneDrive or another file hosting service for sharing large files.

Now edit php.ini file

Change value for 3 of the following settings. It can be anything above 100 MB or whatever attachment size you want to use.

Restart php-fpm

Edit roundcube configuration file

Set value for

Edit Nginx config file

Set value for

restart nginx


Uninstall Time Doctor on Ubuntu

Time Doctor is an application to track time. To uninstall Time Doctor on Ubuntu, run

Time doctor run following process