Posts

Showing posts from February, 2018

openssl and atexit

TIL: - linux calls atexit() callbacks when a library is unloaded, not just at process exit - AIX doesn't - openssl 1.1 adds an atexit handler - openssl 1.1 has some code to try to prevent the library from really being unloaded by inflating the dlopen reference count so its atexit will really be available at exit. - https://github.com/openssl/openssl/pull/1693 - apparently this isn't working on AIX - openssl 1.1 doesn't seem to be provided by IBM or third parties on AIX as of early 2018.

Media buttons on 17.10 thinkpad

I just spent what felt like an eternity restoring a working Ubuntu on my w530. One of the things that took the longest was getting the media (VOLUP/VOLDOWN/MUTE) buttons working. In the end, clearing my migrated ~/.config/pulse, installing swh-plugins, and rebooting did the trick.

Stripping arguments from a bash script

I've always avoided bash-isms like arrays or slices, but I found this non-portable script interesting. I needed to strip a option and it's value because the caller couldn't be modified. #!/bin/bash # This script filters out "-expire X" from gskcmd and passes it down # to "gskcmd.real" # Get absolute install root the hokey portable way dir=`dirname $0` CUR_DIR=`pwd` IHS_DIR=`dirname ${0}` cd ${IHS_DIR} SR=`pwd` cd ${CUR_DIR} if echo "$@" | grep -- -expire > /dev/null; then COUNTER=1 while [ $COUNTER -lt $# ]; do eval VAL=\$$COUNTER if [ "$VAL" = "-expire" ]; then set -- "${@:1:COUNTER-1}" "${@:COUNTER+2}" break fi let COUNTER=COUNTER+1 done fi exec $IHS_DIR/gskcmd.real "$@"