Validate your domain information

You may want to check if all the information available online in regard of your domain is complete and correct.

In such a case you can go to intodns.com and enter the address of your domain to verify the settings.

One thing you will often see failing is “Reverse MX A records (PTR)” for your mail server, and this is a good way to find out if everything is all right or not.


Video capture VirtualBox from command line

Start and then stop VirtualBox screen recording from command line for a headless Windows 10 session running in virtual machine named Win10:

  • VBoxManage controlvm Win10 videocap on
  • VBoxManage controlvm Win10 videocap off

Generate QR code

  • This simple command will give you an SVG file with QR code vector image in it:
echo "Hello world!" | qrencode --level=H --dpi=300 --type=SVG -o qr.svg
  • If a bitmap is enough, just type:
echo "Hello world!" | qrencode --level=H --dpi=300  -o qr.png

  • Even this simple command will work:
qrencode -o qr.png "Hi!"

  • Change the color from standard black to any if you like:
echo "Hello world!" | qrencode --foreground=808080ff --level=H --dpi=300 --type=SVG -o qr.svg
  • Alpha supported too:
echo "Hello world!" | qrencode --foreground=FFFF00FF --background=0000FF55 --level=H --dpi=300 -o qr.png
echo "Hello world!" | qrencode --foreground=FFFF00FF --background=0000FF55 --level=H --dpi=300 --type=SVG -o qr.svg

		

Remove Apache server signature from footer

By default error pages served by Apache2 contain a line at the bottom, stating version of Apache, OS etc.

If you want it gone, edit /etc/apache/apache2.conf:

  • Add a line:
ServerSignature Off
  • Reload the new configuration:

service apache2 reload

 

P.S. While you are at it you may also add this to tell server not to share more information about itself than necessary:

ServerTokens ProductOnly

 


Prevent Apache from listing files in directory

One way to prevent automatic directory listing with Apache2 is to disable its autoindex module (results in: 403 Forbidden):

  • sudo a2dismod autoindex
  • service apache2 restart

To enable it later again:

  • sudo a2enmod autoindex
  • service apache2 restart

Another way is to edit Apache2 main configuration file /etc/apache2/apache2.conf (results in: 404 Not Found):

  • Find the section which looks like the one below

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

  • Remove the word "Indexes":
  • service apache2 reload

UTF-8 from MySQL does not show correctly in PHP

The data you have in MySQL is all in UTF-8, you have UTF-8 specified in your HTML, PHP is set up to use UTF-8, but you still get gibberish as output, with question marks showing up on screen instead of correct symbols.

The problem may be that the communication between MySQL and PHP is not happening in UTF-8.

Try telling “SET NAMES ‘utf8′” to MySQL when you initiate the connection, before you run any other queries.

For example, as soon as you establish the connection to database, run this in your script:

mysqli_query( $conection, “SET NAMES ‘utf8′” );


Change phpMyAdmin logo

The easiest way to change phpAdmin logo is to replace logo images of the current theme:

  • Login screen: /usr/share/phpmyadmin/themes/pmahomme/img/logo_right.png
  • Worklpace screen: /usr/share/phpmyadmin/themes/pmahomme/img/logo_left.png