home -> Gnu/Linux snippets
These are just too easy to lose, I hope you find them useful.
They are in no particular order. I'll add more as I think of them.
readelf -d some-program | grep NEEDED
The "ldd" command is recursive, the above is not.
valgrind -v --leak-check=full --show-reachable=yes --db-attach=yes --db-command="kdbg -p %p %f" some-program 2>&1 | tee make.txt
sudo apt-get install apt-file
$ sudo apt-file update
$ apt-file search openvg.h
sudo mkdir /var/chroot/squeeze32
sudo debootstrap --arch=i386 squeeze /var/chroot/squeeze32 http://ftp.ie.debian.org/debian
< set up bind mounts, edit schroot.conf >
< addgroup -gid GGG yourgroup; adduser -gid GGG -uid UUU youruser >
< inside the chroot as root > apt-get install sudo
< inside the chroot as root > visudo < add yourself! >
< inside the chroot > apt-get install make automake g++ libtool pkg-config less uuid uuid-dev doxygen graphviz mscgen
edit ~/.bashrc to replace "debian_chroot" with "SCHROOT_CHROOT_NAME"
gcc -print-search-dirs | grep ^libraries | cut -d= -f2- | sed -e 's/:/\
/g' | while read line; do b="$(readlink -q -m "$a")"; readlink -f "$b" || echo "[X] $b"; done
groups
or
groups `whoami`
or, for another user
groups >user<
Pass the following to your compiler for non-multiarch-aware builds
-B/usr/lib/$arch -I/usr/include/$arch
clang -dD -E -xc /dev/null