user-data-dir in recent Chrome update

In a recent update of Chrome (version 90.0.4430.93 at the time of writing), the user data directory argument (user-data-dir) behavior changed.

Before, you were able to launch Chrome with an additional argument like so:

& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --user-data-dir=chrome

which will create a custom user data directory in the working directory.

However, now if you launch the above command, you will get the following error:

Interestingly, if you run the same command in an elevated prompt (Run as Administrator), you won’t get any error, but you also cannot see the chrome folder created in your working directory!

What happened was that Chrome actually tried to create the user data directory not in the working directory, but in its executable directory, which, in case of a 64-bit installation, in C:\Program Files\Google\Chrome\Application, and as expected if you run the command as a normal user, you shouldn’t be able to write anything to C:\Program Files\.

A workaround to this issue is to specify an absolute path to the user data directory that you want to create instead of just the directory name. For example,

& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --user-data-dir=D:/chrome

should create chrome in the expected D: drive.

I haven’t tested if this behavior is exclusive to Windows or if it is prevalent on other platforms.

Installing ocaml-usbmux on macOS Catalina

To setup SSH over USB with my iPhone on Catalina, I used the solution ocaml-usbmux+gandalf like I usually did on previous versions of macOS. The project being relatively old (the last commit was on Mar 11, 2017), I had to downgrade the opam version as indicated in their README.

However, on running opam install usbmux, I was met with the following error:

install_man.sh: line 3: /Users/fidele007/.opam/4.04.0/man/man1/gandalf.1: Operation not permitted

I assume that it’s due to the new app permission restriction put in place with Catalina (…why, Apple?). After racking my brain for an hour on finding the solutions to no avail, I finally settled upon a hack/workaround I came up with:

  1. Clone the repository: https://github.com/onlinemediagroup/ocaml-usbmux
  2. Comment the line ./main.native --help=groff > $(opam config var man)/man1/gandalf.1 in install_man.sh
  3. Run opam-install on the local package: opam install usbmux --working-dir

Basically, I just skipped the installation step for gandalf‘s man. With this, I was finally able to get gandalf to work.

Of course, it’s not the best solution; ideally it would be fixing the package so that all the installation steps succeed without any error.

Avoid the Cooler Master Masterkeys Lite L Keyboard

Some key combinations do not work on this keyboard. For instance, the combination LCtrl+LShift+P, which is used by default in VSCode to open the command palette, does not do anything. At first I thought it was because it was intercepted as a global hotkey by another running program, but the combination still does not work even after I killed all other programs. Finally, I found my answer here and here.

Dear Nomikos, Thank you for your inquiry. We have checked the MasterKeys Lite L and unfortunately is this normal that certain key combinations don’t work. This is because the MasterKeys Lite L combo doesn’t have NKRO (n-key rollover). When a keyboard doesn’t have the NKRO then some combinations, where you need to press multiple keys will not work. This is not implemented because the MasterKeys Lite L is a budget set. When you have any other question please let us know. Kind regards, Cooler Master Support

Weirdly, the combination RCtrl+RShift+P works, though there isn’t even a way to remap the left Control and Shift key combination because it just does not send any to the system. This means that one day during the product meeting, they just decided to deliberately disable/remove the functionality for the left LCtrl+RShift key combinations.

This lack of functionality is not mentioned anywhere in the product description, and sadly neither is it mentioned in the customer reviews on Amazon where I ordered it (Link). So, here’s a warning to those who think of buying this budget keyboard: several key combinations DO NOT WORK!

Theos with Visual Studio Code

Since Visual Studio Code has gained popularity as a free and open-source text editor/IDE, I think it might be a good idea to share about how I use it to compile your Theos project.

In Visual Studio Code, you can write scripts called Tasks to run on your project folder in order to build and test your code. Below is the code for two tasks written to Build with Theos and Build & Install with Theos:

Continue reading “Theos with Visual Studio Code”