The Blog

Installing OpenCV 3.1 on Ubuntu 16.04

Posted on


# INSTALL THE DEPENDENCIES

# Build tools:
sudo apt-get install -y build-essential cmake

# GUI (if you want to use GTK instead of Qt, replace 'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option in CMake):
sudo apt-get install -y qt5-default libvtk6-dev

# Media I/O:
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev

# Video I/O:
# sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev

# Parallelism and linear algebra libraries:
sudo apt-get install -y libtbb-dev libeigen3-dev

# Documentation:
# sudo apt-get install -y doxygen

# INSTALL THE LIBRARY (YOU CAN CHANGE '3.1.0' FOR THE LAST STABLE VERSION)

sudo apt-get install -y unzip wget
wget https://github.com/opencv/opencv/archive/3.1.0.zip
unzip 3.1.0.zip
rm 3.1.0.zip
mv opencv-3.1.0 OpenCV
cd OpenCV
mkdir build
cd build
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON ..
make -j4
sudo make install
sudo ldconfig

Posted in Linux Leave a comment

Gracefull Apache2 config reload

Posted on

Login as root and type the following command
# /etc/init.d/httpd reload
OR
# apachectl -k graceful
This is also known as gracefully restarting the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them.

Posted in Uncategorized Leave a comment

Service Container delemas

Posted on

How to access “service container” in Symfony2.

Dirty way, works anywhere:


global $kernel;
$serviceContainer = $kernel->getContainer()->get('any service you want');‏

But most people says you should do it as service, which in my world is not always possible, especially using __construct injection.

This way as setContainer

MyService:
class: MyBundle\Command\MyCommand
calls:
- [setContainer, ["@service_container"] ]

Or this way as __construct injection

TaskScheduleUtility:
class: Claimatic\TaskScheduleEngineBundle\Helpers\TaskScheduleUtility
arguments: ["@doctrine.orm.entity_manager"]

You can also pass it from controller, always at your fingertips as

$this->container;
//Or better yet service container shortcut
$this->get();

Posted in PHP, Symfony2 Leave a comment

Simple script that can save you from blacklist.

Posted on

This simple php scrips can be run by cron job once an hour to let you know if the qmail queue is getting full.


$x = shell_exec('/usr/local/psa/admin/sbin/mailqueuemng -s');

$y = explode("\n", $x);

foreach($y as $z){
$a = explode(":", $z);
$out[trim($a[0])] = trim($a[1]);
}

if ($out['Messages total'] > 100) {

mail('resonsible@domain.com', 'Email Problems', print_r($out, true));
}

Posted in Linux, PHP, PLESK Leave a comment
Next Page »