Recent Posts

  • Plesk MTAs – the Qmail and Postfix Mail Transfer Agents / SMTP mail servers

    Plesk usually uses either Postfix (new versions) or Qmail (old ones). To find out which one you’re currently using, run the following command via SSH: # /usr/local/psa/admin/sbin/mailmng –features | grep SMTP_Server A QUICK COMMANDS GUIDE FOR POSTFIX Show the email messages in Queue: # postqueue -p | tail -n 1 | cut -d’ ‘ -f5 List all messages currently in queue: # mailq To see the contents of an email in queue, including headers, use: # postcat -vq messageID *you can see the message ID in the queue To delete the messages in the queue: # postsuper -d ALL # postsuper -d […]

  • PHP mail() function simple test script

    This is a simple script you can use to test the functionality of the php mail() function on your server: ?php $to = ““; // <– replace with your address here $subject = “Test mail”; $message = “Hello! This is a simple test email message.”; $from = ““; $headers = “From:” . $from; mail($to,$subject,$message,$headers); echo “Mail Sent.”; ?> Simply add your e-mail address, copy and paste the script into a .php file (eg. test.php), upload it on your server and access it directly. Once accessed, the file will return the message “Mail sent” and you should receive the test message […]

  • How to patch/disable SSL 3.0 and fix POODLE vulnerability

    SSL 3.0 is an old protocol for securing connections over the internet, its successors currently used are TLS 1.1  and TLS 1.2. However, for compatibility reasons, most servers still support SSL 3.0 and default back to it if a connection via TLS cannot be established. To disable SSL 3.0 and thus protect yourself from POODLE, you need to alter your server config. Apache Server Add the following to your configuration file: SSLProtocol All -SSLv2 -SSLv3 and restart the server using: #service httpd restart or #service apache2 restart Nginx server Include the following line in your configuration among the other SSL directives: […]

  • Force redirect http to https

    A simple and very straight forward way to force redirect http requests to https without amending your website code in environments where the server hosting your website is behind a load balancer (such as for most shared hosting/cloud platforms) is by using this piece of code in your .htaccess file: RewriteEngine On RewriteCond %{ENV:SSL} !1 RewriteRule ^(.*)$$1 [R,L]

  • WordPress force redirect http to https

    Usually when needed to force redirect requests to https a simple rule is added in a htaccess file to take care of this, but not all hosts support that especially when a proxy or load balancer is used. What you need to to is to simply download and manually install this plugin.    

  • cPanel – Cron Jobs/Scheduled tasks

    cPanel – Cron Jobs/Scheduled tasks

    Cpanel -> Advanced->Cron Jobs-> As an example for using this feature, we will run a php script (test.php) which sends an e-mail to a predefined e-mail address. In the command line enter: /usr/bin/php -q /home/cpanelusername/public_html/test.php As per the above settings, the command to run the test.php script will be executed every five minutes. Make sure to repalce cpanelusername with your own username.

  • The plain HTTP request was sent to HTTPS port nginx

    The plain HTTP request was sent to HTTPS port nginx

    Getting annoyed by the error message displayed each time you forget to use https in your URL when trying to access th Plesk panel? The “400 Bad Request – The plain HTTP request was sent to HTTPS port” error is caused by a bug in the Parallels Plesk panel version 11.5, here is a quick fix for it: create a new file called zzz-myhost.conf  in /etc/sw-cp-server/conf.d/ and add the following line into it: error_page 497$server_port$request_uri; (! replace with your domain/sub-domain or IP address) Then restart sw-cp-server: # /etc/init.d/sw-cp-server restart  That’s it, a quicker way to do this in one line: # echo ‘error_page 497$server_port$request_uri;’ […]

  • Stop Excel 2013 from auto-converting numeric values to dates

    Stop Excel 2013 from auto-converting numeric values to dates

    There are few ways to resolve that, the most common and simple one would be to format the cells prior pasting the data as text (select range, right click, format cells, double click on text). What I have done was to simply change the decimal separator: File -> options -> advanced -> untick “use system separators” and set the decimal separator to a dot “.” (default in my case was the comma). File -> Options -> Advanced -> untick “use system separators” and set the decimal separator to a dot “.”   

  • OpenSSL Heartbleed bug – a quick explanation on the recent security issue and the fix

    Heartbleed is a recently discovered small bug that relates to the OpenSSL’s implementation of the TLS ‘heartbeat’ mechanism. The bug is present only in the OpenSSL versions 1.0.1 through 1.0.1f! By exploiting this bug, an attacker can request that a running TLS server hand over a relatively large slice (up to 64KB) of its private memory space. Since this is the same memory space where OpenSSL also stores the server’s private key material, an attacker can potentially obtain data such as: 1) private keys 2) TLS session keys 3) confidential data 4) session ticket keys. The remedy You can test […]

  • Quick commands guide for the vi / vim editor

    Vim is a text editor that you can use in Linux environments to create or edit files. There are two working modes in vim. One is the command mode and another is the insert mode. To enter text or edit any line, press the “i” key on your keyboard (the i stands for Insert). Once you’re done editing, you can exist this mode by pressing  the Esc key. Some usefull commands: :? – Search dd – Delete line p – paste below cursor u – Undo last change Exit Commands :wq Write file to disk and quit the editor :q! Quit (no warning) :q […]