JQ

Examines skeleton of big data using stream

  • e.g. from
govc find -type m | xargs govc vm.info -json > vms.json

Lib

def firstElt(f): fromstream(inputs | select(first | map(numbers == 0) | all) | f);
def firstElt: firstElt(.);
def firstEltType: firstElt(if length == 2 then last |= type else . end);
def asPath: tostream | select(length == 2) | first + [last] | join("/");

Keeps first elt of all arrays

< vms.json jq -n --stream 'include "lib"; firstElt'

Keeps type instead of value

< vms.json jq -n --stream 'include "lib"; firstEltType'

Shows as path

< vms.json jq -nr --stream 'include "lib"; firstEltType | asPath'

Mate and CRD on debian 12

r () { declare -f $1; echo $@; }
f () { sed -i.$(date +%F) '/^fi/i \    unset DBUS_SESSION_BUS_ADDRESS' /etc/X11/Xsession.d/99mate-environment; }
r f | ssh $node -l root bash

Chrome and CRD on debian 12

  • See Overriding the User Data Directory

      Chrome Remote Desktop (CRD) used to set $CHROME_USER_DATA_DIR or
      $CHROME_CONFIG_HOME on the virtual session on a Linux host, since
      a single Chrome instance cannot show windows on multiple X
      displays, and two running Chrome instances cannot share the same
      user data directory. However, with the obsolescence of dbus-x11,
      most modern Linux distros have lost the ability to simultaneously
      run multiple graphical sessions for the same user without running
      into difficult-to-trace dbus cross talk issues, and Chrome can
      only be run on a single X display per user in reality. Therefore,
      CRD no longer sets these environment variables for new
      installations after CRD host M105.
    
google-chome --user-data-dir ~/.config/google-chrome-RD