Install latest ImageMagick library on Ubuntu 14.04

Install latest ImageMagick

apt-get install -y build-essential checkinstall
apt-get build-dep imagemagick -y
tar xzvf ImageMagick.tar.gz
(cd ImageMagick* && ./configure --prefix=/opt/imagemagick && make && checkinstall)
ln -s /opt/imagemagick/bin/animate /usr/bin/
ln -s /opt/imagemagick/bin/compare /usr/bin/
ln -s /opt/imagemagick/bin/composite /usr/bin/
ln -s /opt/imagemagick/bin/conjure /usr/bin/
ln -s /opt/imagemagick/bin/convert /usr/bin/
ln -s /opt/imagemagick/bin/display /usr/bin/
ln -s /opt/imagemagick/bin/identify /usr/bin/
ln -s /opt/imagemagick/bin/import /usr/bin/
ln -s /opt/imagemagick/bin/mogrify /usr/bin/
ln -s /opt/imagemagick/bin/montage /usr/bin/
ln -s /opt/imagemagick/bin/stream /usr/bin/

checkinstall will allow to manage the compiled install with dpkg like this

dpkg --list | grep imagemagick

Install PHP Extension

pecl install imagick-beta
echo "" | tee /etc/php5/mods-available/imagick.ini
php5enmod imagick

PM2 the missing node.js process manager

Long time I’ve searched for a NodeJS process manager that keep our script alive forever, ensure that our service and the worker restarted when the server restarted. I mean in a seamless and beautiful way.

So finally the team from (aFull Stack monitoring and App management web service) comes to the rescue. There highly active project PM2 [P(rocess) M(anager) 2] combine these cool features and is super easy to use.

The first, start a nodejs script

$ pm2 start app.js

The process is put in background, kept alive forever and monitored.

The second, managing the processes is pretty straightforward

$ pm2 list


$ pm2 stop <app_name|id|all>
$ pm2 restart <app_name|id|all>
$ pm2 delete <app_name|id|all>

The third, PM2 can generate and configure a startup script to keep PM2 and your processes alive at every server restart!

$ pm2 startup # auto-detect platform

(Execute the startup command only as the user to be running the PM2 daemon)

PM2 can also enables a built-in load balancing between multiple application to use all CPUs available in a server. Each HTTP/TCP/UDP request will be forwarded to one specific process at a time.

pm2 start app.js -i max  # Enable load-balancer and cluster features

PM2 is amazing when we have to manage several applications at once. It allows you to declare the behaviour of each application within a simple JSON file.

This all is super smart.

No more fat JS frameworks

In search of the perfect JavaScript framework my colleague and me we find out a new approach for building web apps and/or web services with tiny frameworks and libraries. For new projects we are using the following technology stack now:


  • NodeJS (NVM) – Server-Side Javascript’en
  • MongoDB – NoSQL Datastore
  • Express – Fast, unopinionated, minimalist web framework for Node.js
  • Node-restful (include mongoose) – A library for quickly providing a data api
  • PubSub – publication/subscription pattern in JS
  • – optionally for websocket communication
  • PM2 – Production process manager for Node.js. Perfectly fitted for microservices architecture.


  • Babel – Use next generation JavaScript, today.
  • Mithril – minimalistic client-side MVC framework – a tool to organize code in a way that is easy to think about and to maintain
  • JSX – templates – XML-like syntax extension to ECMAScript
  • msx – JSX for Mithril: MSX
  • gulp – the streaming build system
  • gulp-msx – Precompile Mithril views which use JSX into JavaScript
  • lodash – utility library delivering consistency, modularity, performance, & extras
  • webpack – module/components bundler
  • youmightnotneedjquery

Getting Started

First I install NodeJS with the Node Version Manager and the MongoDB. Then I install globally the Express application generator. For example, the following creates an Express app named myapp in the current working directory:

express myapp
cd myapp

Then I also install node-restful by npm on the command line:

npm install node-restful --save
npm install

So I can start the basic RESTful API Express on http://localhost:3000/ now.

« Older Entries