Setup Xrdp server: remote Linux PC has the Xrdp server.
Install Xrdp and Openbox desktop
apt install xrdp openbox
Create ~/.xsession containing
exec openbox-session
Enable xrdp with new config
service xrdp restart
Openbox will show a grey screen upon typing password at Xrdp login.
Right-click mouse to open menu.
If only a gray/black screen, try editing /etc/xrdp/startwm.sh on the remote PC:
#!/bin/sh
if [ -r /etc/default/locale ]; then. /etc/default/locale
export LANG LANGUAGE
fiexec openbox-session
By default, the Fortran MPI parallel sparse direct solver library MUMPS is extremely verbose, clogging up the terminal or log file with perhaps 100s of MBytes of text.
Disable the log messages by setting ICNTL as in the following MUMPS example.
Note: for MUMPS < 5.2 the ICNTL(4) does not take effect; that was a known bug.
MUMPS can be installed on Linux systems with package names like “mumps-openmpi-devel” or “libmumps-dev”,
or install MUMPS using
CMake MUMPS superbuild.
For ICNTL(1-4), setting the value ≤ 0 suppresses verbose messages.
ICNTL(4) allows fine-grained setting of verbosity; see page 54 of the MUMPS User Manual.
!! this must be called AFTER the first mumps call that had job=-1
programtest_mumpsuse,intrinsic::iso_fortran_env,only:output_unit,error_unitimplicitnone(type,external)include'dmumps_struc.h'! per MUMPS manual
type(dMUMPS_STRUC)::mumps_parmumps_par%ICNTL(1)=error_unit! error messages
mumps_par%ICNTL(2)=output_unit! diagnostic, statistics, and warning messages
mumps_par%ICNTL(3)=output_unit! global info, for the host (myid==0)
mumps_par%ICNTL(4)=1! default is 2. 1 is less verbose
endprogram
This is a brief description of how we choose software licenses for over 100 geospace software projects.
The discussion is quite simplified to keep length short.
The 2018 NAS
report on open source for NASA
provides a useful software license survey for geospace science.
One of the costs of copyleft licensing to the contributing author is possible opportunity cost.
Will the other party simply reimplement what you did to avoid your copyleft, and you lose out on collaboration / consulting?
Would you actually have the resources and time to enforce the copyleft license?
A cost of permissive licenses is the lost possibility of licensing fees.
If the code was developed for a grant or employer, the possibility of the contributing author actually getting those license fees may be small.
Also the chance that anyone would even try to pay for a license rather than reimplement etc. is usually small for geospace programs.
Thus, except for large programs that would have real value to a large company or contractors thereof, we usually use MIT or Apache licenses.
Permissive licenses such as MIT / BSD are among the most corporate-friendly and collaborator-friendly.
For these programs, we get large companies using them who may be interested in consulting work.
If the license was too restrictive (copyleft), we might not hear from these companies or possible collaborators.
Types of programs for which we often use MIT / BSD permissive-style licenses:
one-off scripts that maybe are only useful to a handful of users
~ 1000 line or so programs that didn’t take a lot of effort
program has significant public domain / permissive components
For geospace programs and libraries that need to be used by geospace agencies, we typically use Apache.
If the license is non-permissive, they might not be allowed to use / modify / distribute tje code freely and we might miss collaboration / consulting opportunities.
The Apache license’s
patent protection
provisions read like those of GPLv3.
The
Affero GPL,
is said to provide some cloud / SaaS protections in addition to
GPLv3
that it’s based on.
However, there are also said to be “holes” in Affero GPL that have not yet been tested in court.
Copyleft licenses are often shunned by companies.
Government agencies typically discourage and/or restrict copyleft usage.
The trend from both industry and funding agencies is to support permissive open-source licenses instead of copyleft licenses.
cd cpython-3.*
./configure --prefix=$HOME/.local --enable-optimizations
Build and install–this step takes 10-40 minutes, depending on Raspberry Pi model.
Do not use sudo!
make -j -l 4make install
Note: don’t omit -l 4 or Pi will be quickly overwhelmed and error build.
This limits load average to 4. Without it, load average will soar to 100+ (bad).
Add to ~/.profile:
exportPATH=$HOME/.local/bin/:$PATH
then open a new Terminal.
Check that which python3 and which pip3 etc. refer to ~/.local/bin/ instead of /usr/bin.
Don’t uninstall system Python 3 /usr/bin/python3 because system packages depend on it.
The PATH you set in Step 5 above makes Linux prefer the new Python.
Avahi mDNS allows connecting to the Raspberry Pi and other Avahi-enabled host devices without knowing the host IP address.
The default /etc/avahi/avahi-daemon.conf puts mDNS on all active interfaces–including WiFi.
Be sure to open the Raspberry Pi ufw firewall port.
Port 22 (or other SSH port assigned in /etc/ssh/sshd_config on the Raspberry Pi) should be seen in:
Use SSH Public Key Authentication with ED25519 keys.
Raspberry Pi is trivial to hack like any other device on any operating system if proper cybersecurity is not used.
Why do you care if someone hacks your Pi?
The hacker can use the Pi’s relatively powerful CPU & GPU to stage sophisticated attacks on the rest of your network.
It’s generally much better to use 440 MHz band instead of 144 MHz band for portable hand-held radios (walkie-talkies).
The 440 MHz signal is able to pierce through openings in buildings better.
The interference from computers, LED lights, phone chargers, etc. is generally 20 dB or more less on 440 MHz vs. 144 MHz.
Generally we use “wide” 25 kHz bandwidth, as the performance is about 4 dB better than “narrow” 12.5 kHz spacing due to the nature of FM analog “processing” gain from wider bandwidth.
That is, in the absence of interference, 25 kHz wide modulation performs significantly better than 12.5 kHz narrow modulation.
Most members have analog-only radios at this time, so we kept with analog FM.
In North America, hams generally should not use FM below 442 MHz, as there are other modes coordinated for that frequency range.
Hams should first consider 445.975, 446.0, or 446.025 MHz for FM simplex to be “safe” in most of North America, to not interfere with data links or repeater backbone links.
With modern radios after about year 2000 or so, there isn’t a significant advantage of one PL tone over another.
There is too much bursty interference to run carrier squelch (no PL).
Python packages can make Python scripts callable from any directory, by adding them to system PATH via the <PythonDistroRoot>/bin directory.
On a typical Anaconda Python install, the shortcuts to these scripts are installed in a directory like ~/miniconda3/bin/
Make sure entry points are set up correctly before running pip install, or you will get the VersionConflict error (See Notes at bottom of this article).
Here is a simple example “src/mypkg/adder.py” to run directly from console (in any directory) as
add_two 6.75
to get result 8.75.
Note that the end user doesn’t even know they’re running a Python script.
#!/usr/bin/env python3fromargparseimport ArgumentParser
defadd_two(x: float) -> float:
return x + 2defcli():
p = ArgumentParser(description='adds two to number')
p.add_argument('x', help='number to add two to', type=float)
P = p.parse_args()
print(add_two(P.x))
For each function you wish to have be accessible from anywhere on the system be sure there is a function that handles console arguments as in the example above.
Importing Fortran code in Python just like any other Python module is very straightforward, using F2py.
On any operating system, a Fortran compiler and Numpy are required to use F2py.
If you don’t already have a Fortran compiler, we suggest GNU Gfortran.
macOS / Linux: using Homebrew: brew install gcc
Linux / Windows Subsystem for Linux: apt install gfortran
Windows: use MSYS2pacman -S mingw-w64-ucrt-x86_64-gcc-fortran
f2py does not allow inline comments for COMMON blocks for Fortran 77 .f code.
This is because f2py works more strictly to Fortran specifications than most modern compilers.
Inline comments are not Fortran 77 standard, and will make f2py throw an error.
To fix this problem, just make the inline comment a full-line command with ! in column 1.
Fortran90 .f90 files won’t throw an f2py error due to inline comments on a line with a COMMON block:
goodcomment.f90.
This will manifest itself two different ways, depending on whether you have implicit none or not:
Another solution is to use
Windows Subsystem for Linux
with Anaconda Python.
However, with the techniques below, I’ve always gotten f2py to work on Windows.
Tell Python to use MinGW by creating file ~/pydistutils.cfg containing:
If you have problems using f2py or other development work on Windows, consider
Windows Subsystem for Linux,
which runs at full performance within a terminal window on Windows.