List fonts used in PDF document

If you want to see what fonts have been used in creation of a PDF document, you can use pdffonts utility of poppler-utils package for this. Just type:

  • pdffonts yourfile.pdf

Renew Let’s Encrypt certificate

If you have no automatic certificate renewal, you may found out one day that the browser is telling you that your site is “unsafe” as the certificate has expired.

Just type at the command line:

  • letsencrypt renew

But you can also add a simple cron job for automatic renewal, for example:

  • 15 5,17 * * * /usr/bin/letsencrypt renew

Checking twice a day is recommended for the unlikely event if something happens to your certificate due to the Let’s Encrypt themselves.

If the certificate is valid and new nothing happens aside from reading the certificate locally, so you can run it as often as you want.


Mount Truecrypt volume without Truecrypt

Some of you may have some old Truecrypt volumes lying around. Truecrypt was a nice and handy utility which is not developed anymore, unfortunately. But you still can mount the volumes created by it.

One way to do it on Ubuntu:

  • sudo cryptsetup tcryptOpen myvol.tc myvol

Where:

  • myvol.tc – the file name of your volume
  • myvol – arbitrary name of the virtual disk to be created

You will be asked for a passphrase, and if you still can remember it, the volume will be mounted under /dev/mapper with the name you provided and will show up as just another disk.


Set auto-increment field value in MySQL

You have a table. The table has a primary key auto-increment numeric ID field. You want to fast-forward the ID to a certain value (which is larger than or equal to the last value the field has).

Example, let the ID of the next entered record be 1000:

  • ALTER TABLE `mytable` AUTO_INCREMENT = 1000;

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