The Cisco VPN Secure Client is a small app that runs on the user device to establish and monitor a VPN connection.
It requires background services to be allowed to run at login/startup to function.
Otherwise, the connection attempt will fail with a message like:
VPN connect capability is unavailable because the VPN service is unavailable
For example, on macOS under settings → Login Items, there may be about three Cisco items that need to be enabled.
After enabling, reboot the computer and try the VPN connection again.
CMake presets allow simple or complex JSON configurations for configuring, building, and testing projects.
A project maintainer may with to enforce the use of presets, which may be accomplished by using sentinel environment variable:
Assuming the console shell supports color output, it can be pleasant for users to have color build system (Make) and compiler output.
This is easily set by setting environment variable
CMAKE_COLOR_DIAGNOSTICS.
Set environment variable CMAKE_COLOR_DIAGNOSTICS=1
to have CMake colorize the build system and compiler output.
CTest by design combines stdout and stderr into stdout for each test.
For programs that emit a lot of text to stdout and put only diagnostic content to stderr, the combined text stream can be burdensome when debugging a test failure.
There is a proposal to add a CTest property to make optional separate stdout and stderr, but it is not yet implemented as of this writing.
On Windows GitHub Actions runs where a Windows program needs to be installed, WinGet can be used like the following
example.
In this example, environment variable FFMPEG_ROOT tells Python where to find the ffmpeg.exe program.
One could more generally append to the GITHUB_PATH environment variable.
Many IDEs create per-project cache directories with metadata relevant to the IDE configuration for that project.
Similar to
user global .gitattributes,
instead of editing the .gitignore file for each repository,
ignore directories in Git for all repos a particular user has as follows, for any operating system.
On Windows with Python subprocess, an executable may be missing DLL from PATH.
This environment error can be detected and a message given to the user.
The return code of the subprocess can be checked for the error code 3221225781, which corresponds to hex error code C0000135.
import subprocess
import os
import logging
ret = subprocess.run('myprog.exe')
if ret.returncode ==3221225781and os.name =='nt':
# Windows 0xc0000135, missing DLL logging.error('missing DLL detected. Ensure DLL directory is in environment variable PATH')
path = os.environ['PATH']
print("PATH:", path)
raiseSystemExit(ret.returncode)
If putting DLLs on PATH is problematic, another possible approach is
statically compiling the executable,
but this may not be feasible for all programs.
Most shells (including Bash) don’t have a straightforward way to get the directory of the script being executed. Here’s a common
one-liner
to get the script directory:
sdir="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1&& pwd )"
However, for some HPC batch systems, the above may not work as it copies this script to a temporary directory.
This fallback put after the line above works if “qsub” batch command was run from this script’s directory–supposing a script file “gcc.sh” also exists in the same directory as the original script.