All posts by Don Matteo

lebt in der Schweiz, ist System Engineer MCP bei A-Enterprise GmbH. Mitglied des UNBLOG Knowledge Network. Author und Blogger zu den Themen, Tutorials für Linux und Open Source.

Source Code preview in Windows File Explorer

It can be helpful for developers to look into the source code of files, with the preview of the Windows File Explorer, without need opening all the files.

Source Code Preview with File Explorer

Specifying File Handlers for File Name Extensions with add the registry classes keys to preview files for php, ps1, py, css, vbs, shell scripts and more in File Explorer with just expanding it.

To do this, open a command prompt with elevated rights as an administrator and add the following lines.

REG ADD "HKCR\.sh" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.sh" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.sh" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.sh\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

REG ADD "HKCR\.php" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.php" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.php" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.php\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

REG ADD "HKCR\.py" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.py" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.py" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.py\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

REG ADD "HKCR\.ps1" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.ps1" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.ps1" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.ps1\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

REG ADD "HKCR\.css" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.css" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.css" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.css\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

REG ADD "HKCR\.vbs" /v "PerceivedType" /t REG_SZ /d "text" /f
REG ADD "HKCR\.vbs" /ve /t REG_SZ /d "txtfile" /f
REG ADD "HKCR\.vbs" /v "Content Type" /t REG_SZ /d "text/plain" /f
REG ADD "HKCR\.vbs\PersistentHandler" /ve /t REG_SZ /d "{5e941d80-bf96-11cd-b579-08002b30bfeb}" /f

Now just activate the preview in Windows File Explorer.

Enable PowerToys Thumbnail Previews

Another approachis brings PowerToys. Preview Pane is an existing feature in the Windows File Explorer. Which allows you to see a preview of the file’s contents in the view’s reading pane. PowerToys adds multiple extensions: Markdown, SVG, PDF, and G-code. In addition to those, PowerToys also adds support for source code files (for more than 150 file extensions).

Settings for Source code files previewer

If the preview pane does not appear to work after setting the extension to On. There is an advanced setting in Windows that may be blocking the preview handler. Open the Options menu in Windows File Explorer and select the View tab. Under the View tab, you will see a list of Advanced settings. Ensure that Show preview handlers in preview pane has a check next to it in order for the preview pane to display.

Open Windows File Explorer, select the View menu in the File Explorer ribbon. Hover over Show, and then select Preview pane.

Firefox Secure Connection Failed

If you open a website that uses an deprecated TLS encryption, you may get the Firefox error page “Secure Connection Failed”.

An error occurred during a connection to [host] Cannot communicate securely with peer: no common encryption algorithm(s).

Error code: SSL_ERROR_NO_CYPHER_OVERLAP

The story behind

Sometimes administrators have to be able to access devices that are operated with older operating systems they uses deprecated TLS versions, this can be network devices, servers and routers for which updates are no longer available, but are still required in a transitional period. Nevertheless older equipment usually still works fine, have they reached the status end of live and should be replaced in the near future.

TLS 1.0 and TLS 1.1 have been deprecated since Firefox 78 Release and should not be used nowadays.

Firefox supports the deprecated protocols (if you absolutely need it) via “security.tls.version.enable-deprecated” in about:config . This should only be enabled temporarily to access your device.

How to enable TLS 1.0 and TLS 1.1 in Firefox

Open Firefox and hitabout:configin the search bar and press Enter. In the caution screen, select “Accept the Risk and Continue”.

Now search for security.tls.version.enable-deprecated and set it to true at the switch on the right.

Next search for security.ssl3.dhe_rsa_aes_128_sha and set it to true, do the same for security.ssl3.dhe_rsa_aes_256_sha.

Last search for security.tls.version.min in the search bar above and set it to “1” then click save on the right. After a Firefox restart, the connection using weak encryption is established.

  In the Warning screen, Potential Security Risk Ahead, select “Advanced” and choose “Accept the Risk and Continue”.

In this result an weak encrypted connection to an older iLO – Lights-Out-Management.

The values for the TLS security.tls.version.min and security.tls.version.max preferences mean:

1 = TLS 1.0
2 = TLS 1.1
3 = TLS 1.2
4 = TLS 1.3

no success yet! the next hint might help

Search for security.ssl.enable_ocsp_stapling in the search bar and set it to false, then restart Firefox and try again.

  OCSP is a method to check whether a site’s SSL certificate has been revoked by its issuer. “Stapling” is a method for the site to deliver proof of validity along with its own certificate. This improves privacy for the user because you don’t need to reveal to a third party (the issuer) that you need to know about the site you’re trying to use.