Category Archives: Bugs & Troubleshooting

VS code dialogs do not appear in foreground (cinnamon)

That is a common bug in electron applications when they are using GTK (see here and here).

Add to your .bashrc the line:

export GTK_USE_PORTAL=1  

Then edit the menu of the operating system as follows:

  • Right click on the menu
  • Select configure
  • Open the menu editor
  • Select the application
  • Click properties
  • Add the following:
env GTK_USE_PORTAL=1 /usr/share/code/code --unity-launch %F

Screenshots:

can’t find gem vagrant (>= 0.a) with executable vagrant

In Visual Studio Code, terminal may set GEM_HOME and GEM_PATH environment variables to incompatible values for vagrant. In such case you may see the following error:

can't find gem vagrant (>= 0.a) with executable vagrant

You can use the following command instead:

unset GEM_HOME
unset GEM_PATH
vagrant ...

Or in one line:

env -u GEM_HOME -u GEM_PATH vagrant ...

POSIX semaphores: The futex facility returned an unexpected error code

Impressive error and hard to find when you use unnamed semaphores and you place them on a shared memory segment .

The most important issue you have to be aware of is the following:

All of the system calls that work with memory maps may malfunction if you give them offsets or sizes that aren’t a multiple of the system page size. (They’re supposed to round up for you, but historically there have been a lot of bugs in this area.) You get the system page size by calling sysconf(_SC_PAGESIZE), and you round up with a little helper function shown below.

So if you place unnamed semaphores to a shared memory segment and you calculate offsets manually you have to check that the semaphores are placed in multiples of the system page size.

An easy way is to place all semaphores in the beginning of the segment since the sizeof(sem_t) is a multiple of the page size.

Read more here.

Disable trackpoint on Linux

Trackpoint is more evil than good. Maybe some people find it useful but i certainly am not.

On some computers if you apply pressure around the touchpad or on the touchpad buttons, it short-circuits making the pointer moving automatically to a direction (usually towards right). Usually it stops moving after a while but most people have no idea what is happening.

The simplest fix is to disable the trackpoint completely.

On Linux, it is as simple as this:

xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Enabled" 0

Howevere this will not apply after reboot.

Simple way to fix it is to run Startup applications and copy paste the command there.

Hyperlinks not working in Outlook

Another minor bug where official documentation only gives us a solution for Internet explorer.

You may get the error:

This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.

Or:

Your organization’s policies are preventing us from completing this action for you. For more info, please contact your help desk.

Perform the following steps:

  • Create a file named bla.reg (name does not matter)
  • Type the content below
  • Double click to add to registry (confirm when asked)
  • Reconfigure your defaults so that links open with a browser of your choosing.

File content:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.html]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.htm]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.shtm]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.shtml]
@="htmlfile"
"Content Type"="text/html"
"PerceivedType"="text"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\htmlfile\shell\open\command]

@="\"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE\" -nohome"

KDiff3 missing window controls (Ubuntu 18)

This is a bug.

Easy solution:

mkdir -p ~/bin/kdiff3
chmod +x ~/bin/kdiff3
nano ~/bin/kdiff3

Add the code:

#!/bin/dash
# workaround https://invent.kde.org/sdk/kdiff3/-/merge_requests/8
# see also: https://stackoverflow.com/q/60251339/334451
perl -i -npe 's/WindowStateMaximised=true/WindowStateMaximised=false/' ~/.kde/share/config/kdiff3rc ~/.config/kdiff3rc
exec /usr/bin/kdiff3 "$@"

If you are using file managers, configure them so that they use ~/bin/kdiff3 instead of the system one.

For details about this read here

MySQL workbench cannot connect via SSH

If you cannot connect to a MySQL server via SSH in MySQL Workbench, you should take into account that MySQL workbench cannot use OPEN SSH keys but only RSA keys. So a common cause is that the key you have is in OpenSSH format.

You can convert OpenSSH keys to RSA. The following command will do the conversion for you but keep in mind that it will overwrite the existing key so you should take a backup if you still needed.

To convert an OpenSSH key to RSA use the command:

ssh-keygen -p -m PEM -f id_rsa.pri