From 67250693997128ed8253aee3eec6e50a303ee5fa Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Fri, 16 Feb 2024 15:05:20 +0100 Subject: [PATCH] notes --- notes/cli/linux.scrbl | 13 ++++++++++++- notes/editors/emacs.scrbl | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/notes/cli/linux.scrbl b/notes/cli/linux.scrbl index 5666657..a333b06 100644 --- a/notes/cli/linux.scrbl +++ b/notes/cli/linux.scrbl @@ -1036,9 +1036,20 @@ # :xml command line XML tool (formating) xmllint - # shared library dependencies + # shared library / shared object dependencies ldd --verbose $(which vim) + # calculate the size of a shared library / shared object with its dependencies + # TODO The calculation doesn't work recursively. A shared object can require + # other shared objects. See https://news.ycombinator.com/item?id=39232976#39250540 + guile=$(readlink -f $(which guile)) + sizes=$({ echo $guile; ldd $guile|grep /|sed 's+^[^/]*\(/[^ ]*\).*+\1+'; }|xargs -n 1 readlink -f|xargs du -ab|cut -f 1) + sumsize=0 + for size in $sizes; do + sumsize=$((sumsize+size)); + done + echo $sumsize + # :library find out if libgconf is installed # -p, --print-cache Print cache ldconfig --print-cache | grep libgconf diff --git a/notes/editors/emacs.scrbl b/notes/editors/emacs.scrbl index 4944e2f..45693d2 100644 --- a/notes/editors/emacs.scrbl +++ b/notes/editors/emacs.scrbl @@ -91,6 +91,9 @@ } @block{@block-name{Various} + ;; default value of an an optional parameter is nil + ((lambda (a &optional b) (list a b)) 'a) ; => (a nil) + ;; check if FILENAME directory exists / is an existing directory (file-directory-p FILENAME)