4. August 2019

How to download invalid or self-signed HTTPS certificate without OpenSSL by using Google Chrome

When you need to acquire a public server certificate in PEM format from a web server and you do not have OpenSSL tools then you can use one “hidden” feature of Google Chrome.

Just open HTTPS URL in Google Chrome. You’ll see an error:

Your connection is not private.
NET::ERR_CERT_COMMON_NAME_INVALID

Do not click on Advanced or Reload.

Just click letters NET::ERR_CERT_COMMON_NAME_INVALID and PEM certificate will appear directly in the browser.

Now you can copy PEM encoded chain and paste it to your text editor.

24. July 2019

Creating Python virtualenv fails with error: Could not find a suitable TLS CA

You can create Python virtualenv using command:

virtualenv -p /usr/bin/python3 py-env3

You may encounter following strange error:

  Collecting setuptools
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels
...
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /etc/ssl/certs/ca-certificates.crt
...
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
    os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_virtualenv.1000.crash'

The error message is not very clear. Problem is caused by ca-certificates and it could be fixed by command:

sudo update-ca-certificates

22. July 2019

How to convert AVI to MP4 by MEncoder

Here is a simple command which allows conversion of AVI format to MP4 format by MEncoder.

mencoder input.avi -o output.mp4 -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg

The conversion is useful e.g. for Smart TV like Samsung which are often not able to play AVI.

6. July 2019

Web request command line generator

Tool for generating commands for web requests in different technologies.

3. July 2019

Android Studio: How to display compiler error output

When build in Android Studio fails with following error:

Compilation failed; see the compiler error output for details.

You can display error output by click on Toggle view icon on left side of Build panel.

Then you can walk through build errors and navigate to problematic parts of source code in Android Studio.