WSL2
works with Nmap directly and is generally recommended instead of Cygwin.
For those who do need Cygwin, it’s possible to use Nmap from Cygwin, silently calling Windows Nmap.
Install by download nmap.
Install nmap “self-installer” .exe. When asked, also install Npcap.
Cygwin: add to ~/.bash_profile the following. Note the \ and \( are vital for Cygwin shell to interpret the command correctly.
Starting Nmap ( https://nmap.org )
Nmap scan report for 8.8.8.8
Host is up (0.0092s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE
53/tcp open domain
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 7.41 seconds
Troubleshooting:
errors about interface → try running Cygwin as Administrator (right click on Cygwin icon).
find interface names available to nmap
nmap --iflist
Notes:
to find servers with a particular port open on a subnet, try my
Python findssh
program that scans for SSH, HTTP, or otherservers without nmap.
If you don’t install Npcap when asked in the nmap installer, nmap does not work.
Nmap claims no host existed at a known working IP address.
Opening Paraview Python “pvpython” terminal is accomplished by:
Linux: pvpython should be on $PATH.
macOS: Look under /Applications/ParaView*.app/Contents/bin/pvpython
Windows: Look under Start Menu > ParaView > pvpython
Paraview’s Python interface scripts that use Render() create a vestigial feature that is frozen.
To make the plots interactive, use Interact() instead.
Python Paraview example:
fromparaview.simpleimport *
s = Sphere()
Show()
Interact()
CMake with the Ninja and Ninja Multi-Config generators virtually always work well together, including with Fortran projects.
To generate the dependency graph, CMake directs the Fortran compiler to
preprocess each Fortran code file
when using the Ninja generator.
In rare cases, some legacy Fortran large code files can generate unexpected and spurious syntax errors when using CMake + Ninja.
The workaround seems to be to use the GNU Make backend, we have found that works for the rare case this became an issue.
Android task switching swipe navigation can be switched to 3-button navigation.
Some workflows are much easier via the traditional 3-button navigation used by Android since Android 3.x / 4.x.
Also when wearing gloves, using 3-button navigation can work better.
Switch an Android device to traditional 3-button navigation (back, home, switch or triangle, circle square)
by going to Settings → System → Gestures → System navigation and select “3-button navigation”.
CMake is excellent for building very complex Fortran projects across operating systems and computing platforms from embedded systems to HPC.
Here are a few common Fortran CMake patterns.
For hand-written Makefile the order of libraries matters completely.
CMake attempts to determine the graph for library files, starting from the user specified order.
CMake will try a finite multiplicity to resolve the graph, but in tough cases of library interdependency library ordering may need to be influenced by
add_dependencies()
or even
object libraries.
“Undefined reference to” occurs at linking of main executable: be sure the library is actually linked to the user library with
cmake --build build -v
Fortran module include: be sure the *.mod file directory is included, particularly to the main executable by setting the target properties like:
CMake
Object Libraries
can be used to keep build directories less cluttered and speed up the build process.
The traditional workflow for Makefile was to create lots of object files (targets) with the relevant compile options, definitions and link flags.
Then the final executable or library targets would be linked from all the object files.
CMake
add_library()
defaults to creating static libraries.
The following stanza creates “libfoo.a” or similar:
add_library(foosrc.f90)
With numerous targets, there are a lot of “lib*.a” that may be cluttering the build directory.
Also, there is a finite time consumed in creating all those archive .a files from the object files.
For projects that use Visual Studio, using Object Libraries can help avoid
complications with exporting symbols for MSVC.
CMake object libraries: a cleaner option for most cases where the “lib*.a” artifact is not needed is to create CMake Object Libraries instead:
instead of having files under build/ like “libfoo.a, libbar.a” there will be only “baz.exe”.
The object files will be tucked away under build/CMakeFiles/foo/*.o and build/CMakeFiles/bar/*.o.
The generator expressions expand to all the object files of “foo” and “bar” like a legacy Makefile.
The INTERFACE
target properties
of object libraries propagate up to targets linking them as usual.
You may need to modify the PUBLIC / PRIVATE / INTERFACE of object libraries or add them to the “target_link_libraries()” of the top-level targets when going from static or shared libraries to object libraries.
Caveats: object libraries with duplicate symbols can cause conflicts that need to be manually resolved.
When linking non-object libraries, the linker typically just uses the first instance seen of a symbol.
It’s worthwhile to upgrade Raspberry Pi OS to have recent Python with system / GPIO libraries.
These Python-tied libraries are not always easy to install otherwise.
It is generally not worthwhile to upgrade the OS in place.
Instead, copy off your files, do a fresh Debian install, and copy your files back.
Keep the original SD card in case some setup is hard to figure out.
The best way to upgrade the Raspberry Pi operating system is get a new SD card and load the OS from scratch as described below.
Copy any wanted files from Raspberry Pi to the PC with sftp or rsync.
This is in case the original SD card fails.
Setup SD card: the contents of the SD card are erased in the following procedure.
Buy a new SD card so that the original SD card remains with a working configuration in case there’s an issue.
Headless Raspberry Pi first boot: without a monitor and keyboard on the Pi, the Avahi dæmon on the Raspberry Pi will make it easy to find your Raspberry Pi when you plug into LAN or connect WiFi.
Put the SD card into the Pi, plug an Ethernet cord into the LAN router/switch and from the PC (username, hostname are those picked for the Pi by the Raspberry Pi Imager program):
Raspberry Pi reliable long-term install tips: avoid
overclocking
the Raspberry Pi for best long-term reliability.
Use a heatsink kit for high-stakes remote operations.