Author Archives: manuel

iCUE shutdown/reboot bug on Windows 10 – The memory could not be read

With Corsair’s iCUE (latest version) on my Windows 10 (all updates installed) I got an error dialogue on every shutdown/reboot from iCUE. It was something like the following:

The instruction at 0x000000005FC4030B reference memory at 0x000000003ED0860. The memory could not be read.

Taken from the Corsair forum this especially effects systems with ASUS soundcards. I have an ASUS Essence STX II and a Corsoir keyboard which requires iCUE for LED config.

I didn’t want to try switching soundcard drivers to get rid of a keyboard led software problem so I went with the solution to run C:\Windows\SysWOW64\HsMgr.exe as admin. Here the steps I followed (taken from the forum – thx to the guys investigating this already and posting a solution):

Go to ... C:\Windows\SysWOW64, here you'll find a HsMgr.exe file.
HsMgr.exe is a driver component for Asus, Auzentech, Creative and other sound cards. If you run it as Admin, the error will disappear.
Do this by right clicking it > Properties > Compatibility > Change settings for all users > Run this program as an administrator.

Now just restart your system. The error won't be there anymore the next time you reboot or shut it down.

I didn’t investigate if this compromises system security but I can confirm that the error is gone.

IntelliJ .http/.rest cli support

I’m a big fan of the IntelliJ .http/.rest files but only being able to run them from within the IDE was not very satisfying. So I was looking for a way to run them from the cli as well and found https://github.com/restcli/restcli. This project offers a cli tool named rest-cli that is able to run IntelliJ’s files including env files. So those can also be integrated into CI/CD or other workflows that don’t use IntelliJ.

On the release page https://github.com/restcli/restcli/releases you can find the latest version of the tool as zip or brew package. If I remember correctly I was able to install the brew package with

brew install -f brew_restcli.zip

But just downloading it and putting it into the path also works fine.

nvm slows down shell startup

Recently I was wondering why my shell is taking so long to show a prompt and was able to track it to nvm – node version manager. The check which version to use as default takes quite long so I was looking for a solution that allows me to keep nvm functionality and have a fast shell.

When installing nvm it tells you to add the following statement to your shell config:

export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" --no-use # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

Line to of this is causes the delay in the startup. As more on the backend side of development I don’t switch node versions and so on around very often so I found a solution that let’s me disable this check, which version should be used on nvm startup by adding a default version to the path and disable that check in the startup script:

# set default node version
export PATH="~/.nvm/versions/node/v12.18.3/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" --no-use # This loads default nvm version from above and skips default check
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

The first line set my default node version to 12.18.3 as default – which is stable right now. Then I added --no-use to the end of the second line. Now every time i start the shell node 12.18.3 will be used until i say nvm use. But that’s a tradeoff I can live with to have my shell start in an acceptable timespan again.

gradle jacoco plugin with java 15

In my latest experiments I upgraded a project to Java 15 and received exceptions during the build from jacoco that state that the used Java version isn’t supported. Here the exceptions stacktrace I received:

java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
        at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:94)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
        at java.base/java.lang.ClassLoader.defineClass2(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:586)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:634)
        at java.base/java.lang.Class.forName(Class.java:546)
        at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:854)
        at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1078)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
        at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89)
        at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
        at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.<init>(CLDRLocaleProviderAdapter.java:86)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287)
        at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258)
        at java.base/java.util.Calendar.createCalendar(Calendar.java:1693)
        at java.base/java.util.Calendar.getInstance(Calendar.java:1661)
        at java.base/java.text.SimpleDateFormat.initializeCalendar(SimpleDateFormat.java:677)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:621)
        at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:600)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.getLastResortErrorLogFile(SystemApplicationClassLoaderWorker.java:168)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:111)
        at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:69)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:68)
        at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:73)
Caused by: java.io.IOException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
        at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrumentError(Instrumenter.java:159)
        at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:109)
        at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:92)
        ... 37 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 59
        at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:195)
        at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:176)
        at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.<init>(ClassReader.java:162)
        at org.jacoco.agent.rt.internal_43f5073.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
        at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:75)
        at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:107)
        ... 38 more

Especially “Unsupported class file major version 59” is a good indicator that Java 15 isn’t supported yet. To get around that you need to upgrade the jacoco tool version in your gradle project by adding:

jacoco {
    toolVersion = "0.8.6"
}

You need at least 0.8.6 because there experimental Java 15 was added. You can find the release history under https://www.jacoco.org/jacoco/trunk/doc/changes.html. Right now 0.8.6 is the latest release that solves the issue without the need to go to a snapshot build of 0.8.7.

Professional audio stack for video editing/streaming

I just managed to get the audio stack of my windows 10 more professional with equalizer and VST plugins:

First I installed virtual audio cable and voicemeeter potato:

  • https://vb-audio.com/Cable/index.htm
  • https://vb-audio.com/Voicemeeter/potato.htm

With those I am able to split up all my audio sources and manage volumes per channel or add equalizers. With OBS you can install the voicemeeter plugin from https://obsproject.com/forum/resources/obs-voicemeeter.741/

Just disable all audio in the OBS settings and add Voicemeeter sources instead. You should use scene inheritance so that you don’t have to do that for every scene. With insert input sources you can grab the input from every input line of potato directly. You could then add VST plugins for every channel directly in OBS. If you want to use equalizers or plugins from potato – or change volumes there – then you need to grab the output instead and route the channel to single hardware/virtual outputs.

Next I took care of my microphone and installed equalizer APO from https://sourceforge.net/projects/equalizerapo/.

This alone wouldn’t help much so I also downloaded some VST plugins from https://www.tokyodawn.net/tokyo-dawn-labs/ and https://www.reaper.fm/reaplugs/ and created my audio stack for the microphone.

docker reset script – docker prune

I’m using docker for a lot of projects and have to switch context very often – I know – that kind of sucks, but that’s how it is…

Most containers can’t be shared between projects and I don’t want to spend more resources than necessary as my machines are on their limits. So I wrote a small bash script to get rid of all running containers, images, … on my local machine:

#!/bin/bash
echo "###########################"
echo "# clean docker"
echo "###########################"

echo "# stopping containers"
docker stop `docker ps | awk '{print $1}' | grep -v CONTAINER` >> /dev/null 2>&1

echo "# prune system"
docker system prune -f --volumes >> /dev/null 2>&1

echo "###########################"
echo "# done"

It will output a text like this

###########################
# clean docker
###########################
# stopping containers
# prune system
###########################
# done

when executed.

After that there shouldn’t be any leftovers except your images. If you also want to get rid of those you can run:

docker system prune -f --all --volumes

Or just add –all in the script above.

Attention: This will delete all your local volumes and images. So make sure you don’t run this if any data in the containers is of importance for you.

Shells starting very slow on my ubuntu and mac

My shells were starting very slow which is really bad as a dev/admin. I found out that all those version managers I installed were to blame for that. So I decided to get rid of nvm and rvm by simply removing the directories and cleaning up my .bashrc and .profile in $HOME.

#nvm
rm -rf ~/.nvm
rm -rf ~/.npm
rm -rf ~/.bower
rm .zshrc # i am using bash

#rvm
rm -rf .rvm

# cleanup configs
vim ~/.bashrc ~/.profile

After those simple steps my shell is up within an instand instead of needing some thinking time.

sdkman and brew seem to be ok and are allowed to stay installed for now.

Uninstall snapd from ubuntu 20.04

In my last post I found out who was to blame for filling my complete disk. It was this new and fu**** slow snapd added to ubuntu in the last few moments before release to get into the app market business. I decided to live without this feature and uninstalled it:

snap list | awk '{print $1}' | xargs -rn1 sudo snap remove

After letting this run a few times i tried to uninstall the remaining snaps manually with

sudo snap remove <name>

Some refused to uninstall but I continued with unmounting its volume and getting rid of snapd from the system:

sudo umount /snap/core/<replace_with_number_in_your_folder>
sudo apt purge snapd

In the end i cleaned up any stuff left from snapd:

rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd

In the end removing all snaps freed about 20GB of data. I will reinstall everything based on apt as usual and will then be back at maybe 15GB of saved space without snapd.

Next to this space problem all the apt installed applications start seconds faster.

Thanks for the long years of great operating system but that’s a way I won’t go with you.

Remove old/disabled snaps from the system – ubuntu why…

The new snap system starts eating my system partition. Next to being slow it also holds old backups of upgraded snaps. Ubuntu itself has no option to disable that. You can only lower the number of old versions by using

sudo snap set system refresh.retain=2

which will limit the number to one live and one backup copy. But what if you also don’t need or want that backup copy? refresh.retain doesn’t allow 1:

sudo snap set system refresh.retain=1

error: cannot perform the following tasks:
- Run configure hook of "core" snap (run hook "configure": retain must be a number between 2 and 20, not "1")

I didn’t further check how to remove that but used the following one-liner to get rid of old versions:

sudo su
snap list --all | awk '$6~"disabled"{print $1" --revision "$3}' | xargs -rn3 snap remove

Next to those backups also the /var/lib/snapd/cache folder holds a massive amount of space on my machine. I considered it to be safe to delete:

sudo rm -f /var/lib/snapd/cache/*

This cleanup of snapd folder freed around 12GB of data on my root partition.

Stop firefox from changing your URLs automatically to https

As an admin I have to work with http and https sites quite often. Firefox started to put https in front of everything automatically and clearing the cache all the time is not what I wanted to continue. I found a quick workaround that avoids this issue. Open a new tab and enter about:config in the address bar and hit enter. Confirm the warning and the look for browser.urlbar.autoFill and disable it. With this set to false Firefox stopped that annoying behavior for me.