Installing Tesseract OCR 4.0 on CentOS 6

xkcd: compiling - https://xkcd.com/303/Tesseract OCR package is available for CentOS 6 via EPEL yum repository, but unfortunately, at the time of writing this article, the latest available Tesseract version in EPEL is 3.0.4.

Installing Tesseract 4.0 from source is possible, but with some extra effort as CentOS 6 doesn't come with Leptonica 1.77, which is required by Tesseract 4.0, nor it comes with autoconf-archive package (which was orphaned in EPEL), nor it comes with GCC that supports C++11.

So far, things don't look promising but rest assured, it's not the end of the world Smile


Solr full text search for Dovecot

Index all emails!Dovecot is great POP3/IMAP mail server but its internal search mechanism falls short when dealing with large mailboxes. Search is not only super slow, but also extremely resource intensive on both CPU and disk IO front.

Offloading mail indexing and search to Apache Solr is not only recommended, but a must in such scenarios.

In this tutorial, I'll cover Apache Solr 7.5.0 installation and integration with Dovecot 2.2. I won't go into Dovecot installation and configuration details.


Dynamic HAProxy backends

Bill Lumbergh - Office SpaceHAProxy is one of very few pieces of software that are truly a joy to use. It's written in C, it's reliable, fast, secure and versatile.

I've been using it for a number of years now for all kinds of purposes and its ability to inspect and manipulate HTTP requests is one of the features I use most often.

In this tutorial, I won't explain how to install and configure HAProxy, but rather how to use HAProxy for load balancing or simply redirecting HTTP traffic to desired backends by matching specific cookies or request headers. The cherry on the top will be dynamic HAProxy backends defined in map files, for easier automation and cleaner configuration file.


Rebuilding software RAID without mdadm.conf

Austing PowersRebuilding software RAID array is very easy when you have your mdadm.conf file at hand, but when you find yourself in a situation without backup of that little config file, e.g. after reinstalling the system or when your migrate disks to the new server, it can be a bit daunting.

Recently I had to reassemble two software RAID1 arrays one small Debian server after OS reinstall. So, there were four hard drives in total and to avoid mix-up and data loss, I had to find out which disk belonged which RAID array. Examining each drive with mdamd provided me with the necessary information.




How to remove VirtFS like a boss

Like a bossRecently I was unfortunate to witness huge filesystem loop on a cPanel server that was caused by combination of VirtFS and Idera's Server Backup software (previously known as R1soft CDP backup). To cut the chase, I had to disable and remove VirtFS for all users on the server. cPanel has documented how to do this on their wiki, but they failed to mention couple of very important things that will help you not to destroy your server.

So, cPanel provided us with nice little script that can unmount orphaned VirtFS mounts. The script is located at /scripts/clear_orphaned_virtfs_mounts and you can get to know it better if you run it with --help switch. Running the script with no arguments will simply unmount obsolete VirtFS mounts (e.g. for terminated account), but if you have to remove VirtFS for an account that is still active, you will have to take a different approach.