Make a grep() function in PowerShell by saving the following to a file “grep.ps1”.
To use this function in PowerShell command line, source the file with
. grep.ps1 and then use the function from the PowerShell command line like grep pattern filename.
One could make this function fancier to be more grep-like.
A botched program install, upgrade, or install such as
can make a Windows registry mis-entry that causes many commands to fail.
The symptoms may include that simply trying to run “cmd.exe” COMSPEC fails with message including:
& was unexpected at this time
If this message occurs even when just opening a new Command Prompt window, the problem may be that the Windows Registry AutoRun is messed up.
Check this in Registry Editor under:
On Windows, VS Code “code” shell command is enabled by default when installing VS Code:
winget install -e --id Microsoft.VisualStudioCode
The installer program adds to “Path” environment variable like:
%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin
That directory contains “code.cmd” that invokes “Code.exe” in the directory above.
This technique avoids DLL Hell due to to the .dll files in the path above interfering with other programs if that folder was on Path.
For macOS, install VS Code shell command by pressing
For Linux the keys are
Start typing “shell command”.
Select “Shell Command: Install ‘code’ command in PATH”.
This allows starting VS Code from Terminal by typing code.
RHEL adds a few complexities on top of the “plain” Debian-based Linux distros.
SELinux in particular is another layer to consider.
Here are common considerations for settings up SSH and/or VNC on RHEL, CentOS or similar RHEL-derived Linux distro.
For SSH connection problems, consider adding to /etc/ssh/sshd_config:
systemctl restart sshd.service
and try to login. This will print a good amount of information streaming and helps reveal .ssh/authorized_keys permissions issues and more.
To determine if SELinux is causing an issue, as a last resort one may temporarily and carefully edit /etc/selinux/config to have
Be sure to put that back to enforcing and reboot when done.
In general current VNC servers are not compatible with the Wayland desktop (that replaces X11).
Waypipe is a new remote desktop tool that works with Wayland.
However, Waypipe requires another Linux machine with Wayland, so it doesn’t work with Windows or macOS natively.
If permissible for your system, you may wish to switch the desktop to X11 instead of Wayland so that traditional VNC servers work.
Logoff the local server, otherwise when you try to view VNC, it will just show a black screen.
If you are logged on remotely and try to login locally, the local login gets a black screen.
If this happens, you can logout the unwanted black-screen sessions by:
Apt can be set to not install
by default, which can be useful for headless embedded systems or WSL.
Create a file like “/etc/apt/apt.conf.d/95-no-install-recommends” with the following contents:
This can save 100s of MB or more, which can be important for embedded systems or WSL to save time and disk space.
The caveat is that some expected features may be missing.
To override this setting at the command line, to install recommended packages add “–install-recommends” to the apt command line.
NEXRAD preview PNGs are 12200 x 5400 pixels:
This takes over 650 MB of RAM to load each frame.
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.
On Windows, Miniconda can be installed from the Command Prompt or PowerShell:
winget install --id=Anaconda.Miniconda3 -e
Update conda from Command Prompt / Terminal:
conda update conda
Setup the new shell support (PowerShell, Bash, Command Prompt, etc.) with
Reopen Terminal to see new conda environment.
If message upon opening PowerShell like:
Documents\WindowsPowerShell\profile.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
By design, CTest
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