Linux package managers like Apt and DNF can be set to not install
recommended packages
by default, which can be useful for headless embedded systems or WSL.
This can save 100s of MB or more, which can be important for embedded systems or WSL to save time and disk space.
Saving of download/install time is often relevant to CI/CD systems.
A caveat is that some expected features may be missing.
Git submodules don’t put their individual Git config file under .git/config.
This Git command issued from the Git submodule directory tells the file path to the Git submodule config file:
git rev-parse --git-path config
Say a repository “alpha” has submodule “beta”.
Find the Git config file location of “beta” from “alpha” like:
NEXRAD preview PNGs are 12200 x 5400 pixels:
example
This takes over 650 MB of RAM to load each frame.
ImageMagick
-limit
option can be used to limit the amount of RAM and/or disk used by ImageMagick operations.
For example, if processing images on an embedded systems like a Raspberry Pi, the limited RAM may lead to disk swapping, taking 1000x longer or failing anyway.
Use combinations of -limit options to control RAM and disk usage.
By design, CTest
WILL_FAIL
test property
does not handle
segmentation faults and other unexpected terminations.
That is, a failing test will also show as failed in CTest, when the desire may have been to show an intended failure as success via WILL_FAIL.
A simple workaround for this is to make a wrapper call for the intentionally segfaulting executable and catch that result, as in
example project.
Git
submodules
can switch remotes.
This is useful when making a pull request for a project that relies on another pull request submodule.
Verify the change in the top project’s “.gitmodules” file.
Example: suppose the directory “subdir” is a Git submodule.
In this command, do not put “./subdir” or “subdir/”, just “subdir” by itself.
Suppose you also wish to change the branch to “feat1” in the submodule.
For certain use cases, it’s feasible to run a Bash script from within Windows using Windows Subsystem for Linux (WSL).
Another way to run Bash scripts from within Windows itself without WSL is the Bash shell installed with Git on Windows.
Start the Bash script you want to run from Linux or Windows with the shebang (first line of Bash script file):
#!/bin/bash; C:/Program\ Files/Git/git-bash.exe
This tells the shell (Linux or Windows) to first try /bin/bash which is a Unix-like path, and then try the Git Bash shell on Windows.
If Python is on Windows Path, one can use Bash scripts that invoke Python scripts.
CMake outputs default compiler flags based on platform and project configuration, which can be overridden.
This
example
shows how to override the default compiler flags by putting the user flags later in the command line