You are here

Michel's Blog

Disable swipe-left back gesture on Android 11

This one I found really annoying when I bought a new phone with Android 11. Both swiping left AND right makes it jump back to the last thing you were doing. I found myself accidentally swiping left... a lot.

Unfortunately Google didn't give us an option to disable this annoying behaviour from the phone itself, but it can be disabled pretty easy with adb. You do not need to root your phone for this but you do need the developer tools with usb-debugging enabled (which you can disable directly after if you wish).

Getting passwords from KWallet on the cli

After a few years of using a Mac professionally I switched back to using Linux again. I'm using KDE because I'm most comfortable with that.

If you use KDE, you automatically use KWallet to store stuff like your wifi-password so you don't have to remember that yourself. It's encrypted but will be unlocked when you login. I wanted to use that to automount some cifs shares so I don't have to put my password in a plain textfile.

Integrate Nagvis maps nicely in Check_MK

Check_MK has build-in dashboards you can create and alter from within the Check_MK webinterface. However, they do not (or at least not at this moment) give you the opportunity to create a single icon that represents a group of checks together like Nagvis. Fortunately, the current check_mk builds (both the enterprise and raw editions) comes with Nagvis preinstalled. Nagvis, on the other hand, does not handle check_mk dashlets like graphs or the status-globe. So, in order to use both on one dashboard we'd have to mix things up a bit.

Human-readable json-output with a python one-liner

I was trying to get some metrics from a service that outputs in json and copy-pasted the output into an editor and used a json-plugin to order the output in a human-readable way. While this works fine, I thought it would be easier to write a one-liner that parses the json-output and pretty-prints it on my screen.

That way it would be easier for me to read. Also I can now use grep on the output to search for specific metrics.

The one-liner uses python to read and dump json-output. Here it is:

Automatically rip audio cd's

Whenever I buy a new audio cd I use my laptop to rip the music to disk and place it on my server so that we can listen to it using a Raspberry Pi with Kodi. So, I bought myself an new and shiny laptop... but the thing does not have a cd/dvd-player! Oops... now what? Keep my old laptop just for cd ripping purposes?

I figured it would be kinda cool to attach an old usb DVD-player to the Raspberry Pi and make it rip the contents of every audio cd inserted automatically.

So, I created an udev-rule that triggers a bash-script whenever an audio-cd is inserted into the drive:

Tmux-integratie iTerm2

Leuk, thuis inloggen op een machine via ssh met gebruikersnaam, wachtwoord en een tijdelijke token.
Dan een nog een sessie openen, weer je wachtwoord en een token intikken.
En nog een keer, en nog een keer... onhandig!

Wat blijkt? iTerm2 (ja ik werk op een Mac) kan prima integreren met Tmux!
Wat is Tmux? Nou, da's net zoiets als screen, dus meerdere sessies kunnen draaien binnen 1 login... maar screen heeft zo zijn beperkingen zoals standaard geen scrollback en 't uit je hoofd moeten kennen van toetscombinaties om van sessie naar sessie te schakelen.

IP-adressen sorteren met 'sort'

Leuk, ip-adressen listen... als je normaal gesproken bijvoorbeeld ip-adressen .1 t/m .10 op een server hebt en je probeert ze te sorteren dan krijg je iets als dit:

Maar die 10 zie je toch liever netjes onder de 9, niet?
Wat je kunt doen is sort inlichten over het feit dat de punt een scheidingsteken is en vervolgens per veld sorteren. bijvoorbeeld als volgt:

Monitoring java memory-usage with Check_MK

After running out of memory with a Java application, I wanted to monitor the internal Java memory usage.

It cost me quite some time trying to get the information I seeked from JMX, still have not figured that out. Suddenly I ran into a simple Nagios-plugin that utilizes the jstat-command to just get the heap- and permgen usage from a java-process. The original plugin can be found here:

Looking-up PHP sessions in memcached

If, like me, you use memcached primarily for storing php-sessions using the php-module 'memcache' or 'memcached', then you probably have no idea what's actually happening inside memcached. It took me some time to figure out simply how to lookup a php-session.

Like most things in life, the answer is actually pretty simple.

You need two things:
- The session name (can be found in php.ini / phpinfo()), usually just "PHPSESSID".
- The session id (I've used Firefox add-on "view cookies" to see mine).


Subscribe to RSS - blogs