Install fallback version for JetBrains products using snap

In this video, we demonstrate to the user where they can find their JetBrains fallback license and the fallback versions of the products they had purchased in the past.

After finding the list, the user has a couple of options to proceed.
They can either download the archives from the website or install the correct version using a package manager like snap.

To install using snap, the first thing to do is call the snap info command and get the list of available versions or the available channels as they are called in snap.

snap info phpstorm;
$ snap info phpstorm 
name:      phpstorm
summary:   PhpStorm
publisher: jetbrains✓
license:   Proprietary
description: |
  PhpStorm is a PHP IDE that actually ‘gets’ your code. It supports PHP 5.3-7.2, provides on-the-fly
  error prevention, best autocompletion & code refactoring, zero configuration debugging, and an
  extended HTML, CSS, and JavaScript editor.
snap-id: qYt8GFdYX5B4J7mm6S6F4r4vAwnG5IgV
  latest/stable:    2021.3      2021-12-02 (245) 607MB classic
  latest/candidate: 2021.3      2021-12-02 (245) 607MB classic
  latest/beta:      2021.3      2021-12-02 (245) 607MB classic
  latest/edge:      2021.3      2021-12-02 (245) 607MB classic
  2021.3/stable:    2021.3      2021-12-02 (245) 607MB classic
  2021.3/candidate: 2021.3      2021-12-02 (245) 607MB classic
  2021.3/beta:      2021.3      2021-12-02 (245) 607MB classic
  2021.3/edge:      2021.3      2021-12-02 (245) 607MB classic
  2021.2/stable:    2021.2.3    2021-10-15 (238) 476MB classic
  2021.2/candidate: 2021.2.4-RC 2021-12-15 (246) 481MB classic
  2021.2/beta:      2021.2.4-RC 2021-12-15 (246) 481MB classic
  2021.2/edge:      2021.2.4-RC 2021-12-15 (246) 481MB classic
  2021.1/stable:    2021.1.4    2021-06-30 (222) 475MB classic
  2021.1/candidate: 2021.1.4    2021-06-30 (222) 475MB classic
  2021.1/beta:      2021.1.4    2021-06-30 (222) 475MB classic
  2021.1/edge:      2021.1.4    2021-06-30 (222) 475MB classic
  2020.3/stable:    2020.3.3    2021-03-16 (208) 425MB classic
  2020.3/candidate: 2020.3.3    2021-03-16 (208) 425MB classic
  2020.3/beta:      2020.3.3    2021-03-16 (208) 425MB classic
  2020.3/edge:      2020.3.3    2021-03-16 (208) 425MB classic
  2020.2/stable:    2020.2.4    2020-11-25 (191) 373MB classic
  2020.2/candidate: 2020.2.4    2020-11-25 (191) 373MB classic
  2020.2/beta:      2020.2.4    2020-11-25 (191) 373MB classic
  2020.2/edge:      2020.2.4    2020-11-25 (191) 373MB classic
  2020.1/stable:    2020.1.4    2020-07-22 (173) 348MB classic
  2020.1/candidate: 2020.1.4    2020-07-22 (173) 348MB classic
  2020.1/beta:      2020.1.4    2020-07-22 (173) 348MB classic
  2020.1/edge:      2020.1.4    2020-07-22 (173) 348MB classic
  2019.3/stable:    2019.3.4    2020-03-18 (151) 341MB classic
  2019.3/candidate: ↑                                  
  2019.3/beta:      ↑                                  
  2019.3/edge:      ↑                                  
  2019.2/stable:    2019.2.5    2019-11-22 (130) 325MB classic
  2019.2/candidate: ↑                                  
  2019.2/beta:      ↑                                  
  2019.2/edge:      ↑                                  
  2019.1/stable:    2019.1.4    2021-02-26 (115) 281MB classic
  2019.1/candidate: ↑                                  
  2019.1/beta:      ↑                                  
  2019.1/edge:      ↑                                  
  2018.3/stable:    2018.3.6    2019-04-11  (93) 273MB classic
  2018.3/candidate: ↑                                  
  2018.3/beta:      ↑                                  
  2018.3/edge:      ↑                                  
  2018.2/stable:    2018.2.7    2019-04-11  (94) 272MB classic
  2018.2/candidate: ↑                                  
  2018.2/beta:      ↑                                  
  2018.2/edge:      ↑                                  
  2018.1/stable:    2018.1.7    2018-12-04  (73) 264MB classic
  2018.1/candidate: ↑                                  
  2018.1/beta:      ↑                                  
  2018.1/edge:      ↑                                  
  2017.3/stable:    2017.3.7    2018-12-04  (72) 263MB classic
  2017.3/candidate: ↑                                  
  2017.3/beta:      ↑                                  
  2017.3/edge:      ↑                                  

From there, the user needs to select any of the versions available up to the version number that their JetBrains profile mentions they can get. For this demo, we chose version 2020.3/stable (2020.3/stable: 2020.3.3 2021-03-16 (208) 425MB classic), which was the maximum version allowed for our license. The installation command of that specific version using snap is as follows:

sudo snap install phpstorm --channel=2020.3/stable --classic;

We had to add the classic flag as instructed by the version we decided to install.

This revision of snap "phpstorm" was published using classic confinement and thus may perform arbitrary system changes outside of the security sandbox that snaps are usually confined to, which may put your system at risk.

Just some notes for setting up a new OS to develop projects on GNU/Linux Fedora

If the project is in C++ and uses mysql then install

sudo dnf install mysql++-devel;

If the project is in C/C++ and you are missing talloc.h install

sudo dnf install libtalloc-devel;

Set your name and email for all git projects

git config --global --edit
Then fill-in the configuration file similar to below
# This is Git's per-user configuration file.
# Please adapt and uncomment the following lines:
#       name = Michael, George
#       email = [email protected]
        name = Michael, George
        email = [email protected]
        editor = gedit

or use these individual commands to set the configuration

[[email protected] ~]$ git config --global "Michael, George"
[[email protected] ~]$ git config --global "[email protected]"

Increase amount of inotify watchers

If you are using CLion or IntelliJ IDEA by jetbrains increase the amount of inotify watchers.
CLion, IntelliJ (and other tools of jetbrains) use inotify on GNU/Linux to monitor directories for changes. It’s common to encounter the system limit on the number of files they monitor.

inotify requires a watch handle to be set for each directory in the project. Unfortunately, the default limit of watch handles will not be enough for sized projects, and reaching the limit will force the jetbrains platform to fall back to recursive scans of directory trees.

Create a file (as root) called /etc/sysctl.d/idea.conf and add the following content to it to increase the number of watchers to 512K

fs.inotify.max_user_watches = 524288

Then call sysctl to reload the settings and apply the new configuration

[[email protected] ~]$ sudo sysctl -p --system;
  •  -p[FILE] or --load[=FILE]: Load in sysctl settings from the file  specified  or /etc/sysctl.conf if none  given.
    Specifying - as filename means reading data from standard input. Using this option will mean arguments to sysctl are files, which are read in the order they are specified.
    The file argument may be specified as regular expression.
  •  --system: Load settings from all system configuration files.

Start CLion as root on Fedora 1


Execute the following as a normal user

xhost +si:localuser:root;
sudo ./;

Background Story and More Information

Recently we needed to start CLion as root on Fedora to allow the application we were developing to bind the DHCP service of the system.
When we tried to start CLion as root we got the following error:

java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

Specifically, the whole error log was as follows:

[[email protected] bin]$ sudo ./ 
[sudo] password for george: 
No protocol specified

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.access$200(
    at sun.awt.X11GraphicsEnvironment$
    at Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at java.awt.GraphicsEnvironment.createGE(
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
    at sun.awt.X11.XToolkit.<clinit>(
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at java.awt.Toolkit$
    at java.awt.Toolkit$
    at Method)
    at java.awt.Toolkit.getDefaultToolkit(
    at java.awt.Toolkit.getEventQueue(
    at java.awt.EventQueue.isDispatchThread(
    at javax.swing.SwingUtilities.isEventDispatchThread(
    at javax.swing.text.StyleContext.reclaim(
    at javax.swing.text.StyleContext.addAttribute(
    at javax.swing.text.html.StyleSheet.addAttribute(
    at javax.swing.text.StyleContext$NamedStyle.addAttribute(
    at javax.swing.text.StyleContext$NamedStyle.setName(
    at javax.swing.text.StyleContext$NamedStyle.<init>(
    at javax.swing.text.StyleContext.addStyle(
    at javax.swing.text.StyleContext.<init>(
    at javax.swing.text.html.StyleSheet.<init>(
    at javax.swing.text.html.HTMLEditorKit.getStyleSheet(
    at com.intellij.util.ui.UIUtil.<clinit>(
    at com.intellij.ide.plugins.PluginManager.start(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.ide.Bootstrap.main(
    at com.intellij.idea.Main.main(

This error occurred because the default configuration of the X server permissions did not allow the root to connect to it.
To verify this, we used xhost X server access control program to check the permissions.
Executing xhost with no command line arguments gave us a message indicating whether or not access control was currently enabled, followed by the list of those users allowed to connect.
For example in our case the output was as follows:

[[email protected] bin]$ xhost
access control enabled, only authorized clients can connect

To add root to the list of users that was allowed to start an X application we executed the following command:

[[email protected] bin]$ xhost +si:localuser:root
localuser:root being added to access control list

Executing xhost again, we got the updated list which included the root

[[email protected] bin]$ xhost
access control enabled, only authorized clients can connect

After this, we were able to start CLion using sudo with no problems.

[[email protected] bin]$ sudo ./

Note: This patch is not permanent, we actually execute it once at every restart of the machine.