Thursday, July 23, 2015

Checking SSL Certifcate on Plesk Mail Server


Run this command (mail.DOMAIN.de is the MX-Record):

SMTP:
openssl s_client -starttls smtp -crlf -connect mail.DOMAIN.de:25

POP3:
openssl s_client -starttls pop3 -crlf -connect mail.DOMAIN.de:110

IMAP:
openssl s_client -starttls imap -crlf -connect mail.DOMAIN.de:143


As result you can see your certificate if it installed correctly:

Certificate chain
0 s:/description=FmJdZEx3lsXPoIXv/C=DE/CN=mail.DOMAIN.de/emailAddress=hostmaster@DOMAIN.de
   i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA
1 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA
   i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority
---


How to downgrade Openssl on CentOS?



List the available versions by running this command:

yum --showduplicates list openssl


you should see these lines:

Installed package:
openssl.x86_641:1.0.1e42.el7.9

Available packages:
openssl.x86_64 - 1:1.0.1e-42.el7 - base
openssl.x86_64 - 1:1.0.1e-42.el7_1.5 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.4 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.6 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.8 - updates
openssl.x86_64 - 1:1.0.1e-42.el7.9 - updates


then doing:

yum downgrade openssl-1.0.1e-42.el7_1.5

it will downgrade openssl to 7_1.5 version.

Friday, March 27, 2015

Rollback to previous package version after bad upgrade with Debian

This will show all the versions of the package in the cache:
apt-cache show [package name]

This will install an older version of the package
apt-get install [package name]=[version]

Tuesday, November 11, 2014

RSYNC using filter to include some files

use rsync with Filter option to include some files.

For example:


rsync -auvz -f'+ [Aa][Mm]*'  -f'+ */' -f'- *' /SOURCE-Folder/ /TARGET-Folder/



It means: exclude all files and include only files beginning with A and M (insensitive).

Wednesday, November 5, 2014

Add line to the beginning of a file in Bash

To add a line to the beginning of a file, use this command: 
 
sed -i '1s/^/YOUR NEW LINE\n/' YOUR-FILE.TXT

Thursday, October 30, 2014

Mysql 5.5 Innodb slow insert query issue

An upgrade MySQL from version 5.1 to 5.5 has very slowed Typo3 instances.

The reason was very slow insert queries in InnoDB tables.

In order to save you some distress, for a possible solution, add following line to my.cnf and restart the mysql:

innodb_flush_log_at_trx_commit=0



Wednesday, October 15, 2014

Disable SSLv2 and SSLv3 in Apache

The best way to disable both SSLv2 and SSLv3 and only enable TLS 1.0-1.2 is to use this configuration in your Apache configuration file:






SSLProtocol TLSv1
 
Example:
 
SSLEngine On
SSLProtocol TLSv1
SSLCertificateFile      domain.crt
SSLCertificateKeyFile   domain.key

Testing your SSL Version

if you want to test your ssl version details of perticular host use the following command:

openssl s_client -connect YOURDOMAIN:443

You need to replace YOURDOMAIN to your website hostname Output looks like below:

Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : ....
    Session-ID: ....

Wednesday, September 24, 2014

Checking Varnish configuration syntax

If you have updated your Varnish configuration and want to check it,
run this command:

varnishd -C -f /etc/varnish/default.vcl

if everything is correct, Varnish will dump out the genrated configuration, otherwise you will get an error message pointing you to a specific line number.

Tuesday, September 23, 2014

Benchmarking LAN Network Connectivity in Linux

Using netcat:

on destination machine run this command:
(This tells netcat to open port 20000 and listen for connections.)

nc -l 20000 > /dev/null


on source machine execute this command:
(This command will transfer 30MB of data over the network (a blocksize of 1MB, and 30 blocks, is 30MB)


dd if=/dev/zero bs=1M count=30 | nc HERE.COMES.DEST.IP 20000



Once all data is transferred, you’ll get the output from the dd command, showing throughput:


30+0 records in
30+0 records out
31457280 bytes (31 MB) copied, 5.40742 s, 5.8 MB/s





source: http://techthrob.com/2014/01/benchmarking-lan-network-connectivity-in-linux/




Friday, September 19, 2014

TYPO3 extension manger won't work in XAMPP under Windows

Add these lines to all three apache configuration files (http.conf, http-ssl.conf,http-xampp.conf):


<IfModule mpm_winnt_module>
 ThreadStackSize 8388608
</IfModule>


then restart the apache.

Thursday, September 18, 2014

Getting HTTP HEAD from command line

Install libwww-perl (Debian) / perl-libwww-perl (CentOS):

Debian: apt-get install  libwww-perl

CentOS: yum install perl-libwww-perl

Run this command:

GET -Used http://YOUR-WEBSITE.COM/

Monday, September 15, 2014

MySQL Database Benchmark

Installing sysbench:

apt-get install sysbench


Preparing the Test Database:

sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare

Running Test:
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=ADMIN-USER --mysql-password=ADMIN-PASSWORD prepare

Cleaning test Databse:
sysbench --test=oltp --mysql-db=test --mysql-user=ADMIN-USER --mysql-password= ADMIN-PASSWORDcleanup