Convert a pfx certificate to crt and key files

Extract the key and decrypt it:

openssl pkcs12 -in cert.pfx -nocerts -out cert-encrypted.key
openssl rsa -in cert-encrypted.key -out cert.key

extract the certificate:

openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.crt

extract the bundle:

openssl pkcs12 -in cert.pfx -nokeys -nodes -cacerts -out ca-bundle.crt

Use PyLance with VSCodium

PyLance is a very good language server for Visual Studio Code developed by Microsoft. Because of that MS has restricted the usage of PyLance to their own marketstore and distribution of VSCodium, titled Visual Studio Code. What MS does is it takes the open-source base (MIT) and republishes it under a different license. Their version contains telemetry and maybe other “MS features”.

Here is how you can make PyLance accessible under VSCodium, but there is a catch: these changes has to be made after every update of either PyLance or VSCodium.

Please note that all paths here are for the macOS version, the paths may change on other operating systems.

So let’s first change the file /Applications/VSCodium.app/Contents/Resources/app/product.js from VSCodium. You need change the values of the keys below:

{
“nameShort”: “Visual Studio Code”,
“nameLong”: “Visual Studio Code”,
“extensionsGallery”: {
“serviceUrl”: “https://marketplace.visualstudio.com/_apis/public/gallery”,
“cacheUrl”: “https://vscode.blob.core.windows.net/gallery/index”,
“itemUrl”: “https://marketplace.visualstudio.com/items”
}
}

As a second step you have to delete the extension.bundle.js file in the PyLance plugin folder, in my case the folder was:

/Users/myuser/.vscode-oss/extensions/ms-python.vscode-pylance-2023.10.12/dist/extension.bundle.js

Please note that every pylance update changes the path. here is was for version 2023.10.12

Now PyLance should start. Unfortunately PyLance is such an amazing language server and better than Jedi, so at least for me, it is worth the effort after every update.

MS is not an open-source company!

Install Python 3.7+ on CentOS 7

Step 1: Install requirements

# yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel

Step 2: Download python

# cd /usr/src
# wget https://www.python.org/ftp/python/3.7.15/Python-3.7.15.tgz

Feel free to replace -3.7.15 by any version available

Step 3: Configuring and installing

# tar -xzf Python-3.7.15.tgz
# cd Python-3.7.15
# ./configure --enable-optimizations --enable-shared
# make altinstall

–enable-shared installs shared libraries instead of building into python. This enables some 3rd party modules to install and load (e.g. mod_wsgi)
make altinstall installs python as an alternative to the OS version, thus leaving the installed version untouched

Step 4: Post installation

To activate python on your system, add the path to /etc/ld.so.conf and run ldconfig (only needed the first time):

# echo "/usr/local/lib" >> /etc/ld.so.conf
# ldconfig

or simply run this commnand (this does not survive ldconfig reloads or system reboots):

# ldconfig /usr/local/lib