Upgrade PCRE from 7 to 8 on CentOS 6.8

Per: http://stackoverflow.com/questions/12212079/pcre-libraries-version-is-too-old

  • Create a file: /etc/yum.repos.d/utter-ramblings.repo

[utter-ramblings]
name=Utter Ramblings
baseurl=http://www.jasonlitka.com/media/EL5/x86_64/
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
enabled=1
gpgcheck=1

  • Install:

# yum –disablerepo=* –enablerepo=utter-ramblings install pcre pcre-devel

  • Restart Apache: #service httpd restart
  • Verify version:

#pcretest -C

PCRE version 8.13 2011-08-16
Compiled with
UTF-8 support
Unicode properties support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack

# php -i|grep PCRE
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.13 2011-08-16

 

Compile tesseract(master) with training utils on CentOS 6.5 Linux

People say tesseract OCR is tough. I agree.

The Binary version I installed on a default CentOS 6.5 had no training utils installed.

Googled several tips on how to install/compile/build the training utils on Linux command line. No clue.

Finally figure out there is an error when trying to run ./configure say some package not there, then not able to compile training

cc1plus: error: unrecognized command line option “-std=c++11”

This need to upgrade gcc to 4.8 or later, refer related document to upgrade gcc on CentOS 6.5.

Configuration is done.
You can now build and install tesseract by running:

$ make
$ make install

Training tools can be build and installed (after building of tesseract) with:

$ make training
$ make training-install

old libicu version 4.2 caused issue,

training/unicharset_training_utils.cpp:64: undefined reference to `u_isalpha_51′

After yum erase the old icu version, goto the training subdir, run “make clean”, and “cd ..”,

# make training

# make training-install

Compiled the Training Utils successfully, binary file list under /usr/local/bin:

ambiguous_words
classifier_tester
cntraining
combine_tessdata
dawg2wordlist
derb
genbrk
gencfu
gencnval
gendict
genrb
icu-config
icuinfo
makeconv
mftraining
pkgdata
set_unicharset_properties
shapeclustering
tesseract
text2image
uconv
unicharset_extractor
wordlist2dawg

Configuring TLS for Sendmail (STARTTLS)

Very Good Articled: From:

http://www.netguy.org/wordpress/?p=299

Getting this to work took quite some time – mostly because the articles I have found on the subject are wrong or contain errors making them useless. Is that deliberate? It almost felt that way!

The basic structure isn’t difficult, but it is critical to get the right files in the right places. These instructions have been ripped from a number of different web sites, but have been fixed so they actually work!

The system in question is RedHat 5.6 with Sendmail 8.13.8. I also did this on CentOS 6.2 x64 with Sendmail 8.14.4 in testing. I am assuming a functioning Sendmail system.

1. Install openssl-perl:
yum -y install openssl-perl

2. You need to edit the CA.pl file. This was a common area of errors since the instructions for the edit were WRONG. Rather than screwing around with diff files, you just need to make the following changes (copying the existing /etc/pki/tls/misc/CA.pl to /etc/pki/tls/misc/CA1.pl)

Now edit CA1.pl and find:
system ("$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS");
and make it
system ("$REQ -new -x509 -nodes -keyout newkey.pem -out newcert.pem $DAYS");

then find
system ("$REQ -new -keyout newkey.pem -out newreq.pem $DAYS");
and make it
system ("$REQ -new -nodes -keyout newkey.pem -out newreq.pem $DAYS");

I also changed the $CADAYS variable to ’3650′ (10 years). YMMV

3. Create the Certificate Authority (CA)
./CA1.pl -newca
DO NOT ENTER A FILE NAME! Answer the questions as appropriate, but don’t use any ‘extra’ information.

4. Now create your request
./CA1.pl -newreq
Answer the questions as appropriate, and again, don’t give any ‘extra’ info.

5. Now ‘sign’ the Certificate Request with the CA you created earlier
./CA1.pl -sign

For some reason, no matter what I enter for the $DAYS variable, the cert is only ever good for one year. I have tried many variations and commands, but have not been able to get by this. The CA is still good fro 10 years.

6. Create a certificates directory
mkdir /etc/mail/certs

7. Copy the relevant files to the certs directory (This is another place I have found errors in other documentation)
cp /etc/pki/CA/cacert.pem /etc/mail/certs/CAcert.pem
cp /etc/pki/tls/misc/newkey.pem /etc/mail/certs/MYkey.pem
cp /etc/pki/tls/misc/newcert.pem /etc/mail/certs/MYcert.pem

8. Sendmail is very picky about permissions, so set them on the certs folder and files
chmod -R 600 /etc/mail/certs

9. Edit your sendmail.mc file to include the following:
define(`confCACERT_PATH', `/etc/mail/certs')dnl
define(`confCACERT', `/etc/mail/certs/CAcert.pem')dnl
define(`confSERVER_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confSERVER_KEY', `/etc/mail/certs/MYkey.pem')dnl
define(`confCLIENT_CERT', `/etc/mail/certs/MYcert.pem')dnl
define(`confCLIENT_KEY', `/etc/mail/certs/MYkey.pem')dnl

Then recompile your sendmail.cf

10. If you are using the packages this shouldn’t be a problem, but you may also check to make sure STARTTLS is compiled into Sendmail. Run this:
sendmail -bt -d0.8 < /dev/null

And look for this:

Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT

11. Send a HUP to Sendmail:
kill -HUP `head -1 /var/run/sendmail.pid`

If everything is correct, you may not see anything in the logs. But if you:
telnet localhost 25

and issue a proper ‘EHLO’, you should see this:

250-STARTTLS

The purpose of this document is to fix syntax errors is other documents I have found. The resulting errors are just to vague to get any real help. Hopefully this will help others avoid the hours of searching I had to go through!

Mount ISO in Mac

hdiutil mount filename.iso

Turn on: Windows 7 Automatic Update

RUN:

reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update” /v AUOptions /t REG_DWORD /d 0 /f

Command for enabling the service:

sc config wuauserv start= auto

Convert and Extend VMDK to VDI for Virtualbox on Mac

Shutdown VM, On Mac Terminal, use below command to convert the VMDK to VDI first, then resize to 80000 MB.

alberts-mbp-2:MacOS albertxu$ ./VBoxManage modifyhd /Users/albertxu/Documents/VDI/win7.vmdk –resize 80000
0%…
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!
alberts-mbp-2:MacOS albertxu$ ./VBoxManage clonehd /Users/albertxu/Documents/VDI/win7.vmdk /Users/albertxu/Documents/VDI/win7.vdi –format vdi
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone hard disk created in format ‘vdi’. UUID: 6941a00d-6634-4ea5-a76c-61b1a7ae7195
alberts-mbp-2:MacOS albertxu$ ./VBoxManage modifyhd /Users/albertxu/Documents/VDI/win7.vdi –resize 80000
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
alberts-mbp-2:MacOS albertxu$ ls -al /Users/albertxu/Documents/VDI/win7.vmdk
-rw——-  1 albertxu  staff  21478768640  4 Jan 13:46 /Users/albertxu/Documents/VDI/win7.vmdk
alberts-mbp-2:MacOS albertxu$ ls -al /Users/albertxu/Documents/VDI/win7.vdi
-rw——-  1 albertxu  staff  21460156416  4 Jan 13:54 /Users/albertxu/Documents/VDI/win7.vdi
alberts-mbp-2:MacOS albertxu$

On Virtualbox, Change the VM storage to the new VDI file. Start the VM, In Win7 Seachbox, input disk management, or run diskmgmt.msc, Select C: drive, right click, choose to extend volume, it can automatically detect the expandable space, confirm,

Then refresh your c: drive in “My Computer”, it will be in new size.

Note: gparted is not needed to expand the space in this case.

ZT:Eight Terminal Utilities Every OS X Command Line User Should Know

I am not that a Mac Fan. But using Mac all the day. should understand better to improve productivity.

Just read this article: Eight Terminal Utilities Every OS X Command Line User Should Know, some fun thing to learn like command “say”.

Also mdfind should pretty much useful.

Installed Brew with the command:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
There is another one with more tips: 

http://computers.tutsplus.com/tutorials/40-terminal-tips-and-tricks-you-never-thought-you-needed--mac-51192 

Anyway, Mac should be a tool to simplify day to day job for a tech savvy, not tech idiot. 

DHCP Option on Amazon VPC

If you enabled DHCP Option on VPC, (Virtual Private Cloud), do not disable the dhcp client process, or disable the network interface file in /etc/sysconfig/network-script/ifcfg-eth0.

Leave the bootproto=dhcp.

Otherwise, for Marketplace Images, I can’t recover the file by  trying attach the volume to another instance. this is Amazon bug.

 

Apache says DocumentRoot doesn’t exist when it does

This is due to SELinux, once you disable the SELinux, by changing /etc/selinux/config.

Done.

save iptables configuration upon reboot

Long time no touch iptables stuff, here is the command to allow  http/https protocol:


iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables-save | tee /etc/sysconfig/iptables

Google+