Why exit code 141 with grep -q?

This is because grep -q exits immediately with a zero status as soon as a match is found. The zfs command is still writing to the pipe, but there is no reader (because grep has exited), so it is sent a SIGPIPE signal from the kernel and it exits with a status of 141. Another … Read more

error : BOOST DISABLE THREADS

The experimental GCC version 4.7 disables Boost.Threads. See: https://svn.boost.org/trac/boost/ticket/6165 Edit: It should be noted that as of the release version of GCC 4.7, and Boost higher than 1.48 (Boost_1_48_0 is still not working), threads works again.

A way to determine a process’s “real” memory usage, i.e. private dirty RSS?

On OSX the Activity Monitor gives you actually a very good guess. Private memory is for sure memory that is only used by your application. E.g. stack memory and all memory dynamically reserved using malloc() and comparable functions/methods (alloc method for Objective-C) is private memory. If you fork, private memory will be shared with you … Read more

Insert newline (\n) using sed

The sed on BSD does not support the \n representation of a new line (turning it into a literal n): $ echo “123.” | sed -E ‘s/([[:digit:]]*)\./\1\n next line/’ 123n next line GNU sed does support the \n representation: $ echo “123.” | gsed -E ‘s/([[:digit:]]*)\./\1\nnext line/’ 123 next line Alternatives are: Use a single … Read more

How to install packages offline?

On the system that has access to internet The pip download command lets you download packages without installing them: pip download -r requirements.txt (In previous versions of pip, this was spelled pip install –download -r requirements.txt.) On the system that has no access to internet Then you can use pip install –no-index –find-links /path/to/download/dir/ -r … Read more