Scientific Computing

Enhancing OS clipboard security

Captchas provide a means to limit automated access to web services. Users have become accustomed to solving captchas to access common web resources. Malicious actors are exploiting users with fake captcha prompts to trick them into pasting malicious content from the clipboard, even when the user never copied the content themselves. There are multiple approaches to mitigate clipboard-based attacks, such as disabling clipboard history and cross-device synchronization. These measures can reduce the risk of accidentally pasting harmful data.

Note that disabling web browser clipboard features may impact legitimate sites (e.g., Google Docs or other cloud editors).

Browser Settings

  • Firefox: In about:config, set dom.event.clipboardevents.enabled to false.
  • Chrome / Edge: Go to chrome://settings/content/clipboard (or equivalent in Edge).
  • Safari: Go to Settings → Websites → Clipboard.

Cross-Device Risks

These attacks become more dangerous when clipboard synchronization is enabled across devices, such as Apple’s Universal Clipboard or Microsoft Cloud Clipboard.

Windows: Disable Clipboard History & Cross-Device Sync

The following policy keys are the most effective way to disable these features:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\AllowClipboardHistory → Set to 0
  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\AllowCrossDeviceClipboard → Set to 0

You can check them with PowerShell:

Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory"
Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowCrossDeviceClipboard"

macOS disable Universal Clipboard and clipboard history

To disable Universal Clipboard on macOS, users can turn off the Handoff feature, which is responsible for clipboard synchronization across Apple devices. This can be done by disabling Handoff in System Preferences under the General settings. This prevents the clipboard from being shared between devices, reducing the risk of spreading malicious content. macOS clipboard history can be disabled in System Settings. In the sidebar, click Spotlight. Turn off the toggle for “Results from Clipboard”.

Satellite radio broadcast services

SDARS satellite radio broadcasts of music or video to mobile receivers have largely been a North American phenomenon since the 1990s. Increased need for terrestrial repeaters arose as geostationary SDARS satellites took over from geosynchronous orbits. A key appeal of S-band SDARS is the ability to cover vast areas with a few satellites and coin-sized receiver antennas. The SDARS signal is easily blocked by buildings or terrain, necessitating the use of terrestrial repeaters in urban areas to ensure reliable reception. The SiriusXM 360L receivers seamlessly integrate satellite, terrestrial, and streaming content.

SDARS never took off on other continents, which instead focused on vast terrestrial radio networks such as DAB+ and DRM. DRM is increasingly adopted throughout Africa and Asia, while DAB+ is more popular in Europe. This free DRM broadcast schedule database helps listeners find DRM broadcasts worldwide. It is of note that parts of Europe are trending towards retaining VHF FM broadcast radio (besides DAB+), with multiple nations adding mandates for FM tuners in new cars. North America terrestrial radio networks may use HD Radio for improved audio quality and additional data services. 5G broadcast is being tested by multiple countries as a way to deliver broadcast content to mobile devices instead of individual mobile data streams.

Home satellite TV

In contrast to satellite radio broadcast services, Direct Broadcast Service (DBS) / Direct To Home (DTH) satellite TV has been a global phenomenon with the emergence of sub-60 centimeter dish antennas using 12 GHz Ku-band frequencies by DirectTV and Dish Network emerging in the mid-1990s and analogous services on other continents.

Using dotnet build

For .NET projects using file-based C# .cs apps or .slnx project files, the dotnet build command is used to compile the project and its dependencies. This command is part of the .NET CLI (Command Line Interface) to build .NET applications from the command line. The complementary dotnet run command builds and runs the application in one step. To create standalone, self-contained dotnet publish binary executables cross-compiled for different CPU arches, see CI example.

Zoom Windows install by WinGet

Zoom can be installed and updated by WinGet, automatically installing the appropriate binary for the CPU architecture.

winget install Zoom.Zoom

The 32-bit Zoom client was discontinued in December 2025. If the 32-bit Zoom was originally installed, reinstalling the Zoom 64-bit Windows client will improve Zoom performance, especially choppy audio / video under high CPU usage. It’s generally recommended to use the match the binary architecture to the CPU (e.g. 64-bit program on a 64-bit CPU) to avoid emulation performance penalties. Latency-sensitive 32-bit Windows programs may not work as well as 64-bit programs on 64-bit Windows due to WOW64 emulation for 32-bit programs on 64-bit Windows.

Create RAM drives with open source tools

RAM drives are a filesystem mount point mapped to RAM instead of a hardware storage device. RAM drives are very fast and have high IOPS compared to durable storage devices, which is useful for applications like interprocess communication (when network socket pipes are not usable), temporary files, and caches. Unless synced or copied to durable storage, the contents of RAM drives are ephemeral and may be lost on reboot, logout, or unmounting. We give simple examples of creating / using RAM drives on Windows, Linux, and macOS with open source tools.

Linux RAM drive

On Linux systems, RAM drives are typically built into the OS. Mount points /dev/shm/ and /run/shm/ map shmem shared memory to a RAM drive. They are also present in Windows Subsystem for Linux (WSL).

df -kh /dev/shm
free -h

# Write 1 GB to shmem
dd if=/dev/zero of=/dev/shm/blah bs=10M count=100

df -kh /dev/shm
free -h

See which one has 1GB space more used. This tells if hard drive or RAM was used.

For programs using shared memory for heavy writing operations:

  1. order(s) of magnitude slower /dev/shm/ operations when HDD is used versus RAM
  2. wearing of solid state drive if /dev/shm is pointed there

Example data bandwidths:

  • SSD: 100s of MB/sec
  • HDD: 10s of MB/sec
  • RAM: 1000s of MB/sec

macOS RAM drive

macOS factory program diskutil can create a RAM drive via factory program hdiutil like:

diskutil partitionDisk $(hdiutil attach -nomount ram://2097152) 1 GPTFormat APFS "RAMDisk" '100%'

The command line options are:

partitionDisk
partitions a disk
$(hdiutil attach -nomount ram://2097152)
creates a RAM drive
-nomount
prevents RAM drive from being automatically mounted in Finder
ram://2097152
creates a 1 GB RAM drive (512 bytes/sector * 2097152 sectors = 1 GB)
1
creates 1 partition on the RAM drive
GPTFormat
formats the partition with GPT
APFS
formats the partition with APFS
"RAMDisk"
names the partition “RAMDisk”
'100%'
uses 100% of the RAM drive for the partition

There is a shell utility to simplify the process of creating and managing RAM drives on macOS with command line options. A Swift GUI open source app for those who prefer a graphical interface is also available.

References:

Windows RAM drive

On Windows, RAM drives can be created with the open source tool RamDrive. This is a user-mode RAM drive that can be created and used without administrator privileges, unlike kernel-mode RAM drives such as ERAM.

Update Conda from command line

From time to time generally it’s good to update Conda from Command Prompt / Terminal. Conda itself will remind the user to do this.

conda update -n base -c defaults conda

If it’s been a long time since updating, sometimes instead of updating conda, conda just repeats than an update is available and finally # All requested packages already installed. To workaround this issue, do a complete conda update by:

conda update -n base conda --all

After this, purge old package install info by:

conda clean --all

Install Rust lang on Windows

Even if not directly coding in Rust, one may need to build programs in Rust. For example, to control Apple Studio Display brightness from Windows, one would build the asdbctl Rust program. Many revivals (and newly developed) open-source games are in Rust, such as the classic forest-fire game firefighter.

Rust programs are generally OS-agnostic, unless the Rust code itself uses OS-specific features. Install the Rust toolchain on Windows using WinGet:

winget install --id=Rustlang.Rustup -e

Building and running a Rust program is generally accomplished from the directory containing the Cargo.toml manifest file:

cargo run --release

Intel oneAPI compiler flag syntax

The Intel oneAPI compiler flags are generally somewhat distinct on Windows and Linux. However, there is a platform-agnostic syntax that can be used to specify the flags in a way that works on Windows and Linux without if-else logic needed in the build system (e.g. CMake). The oneAPI OS-agnostic compiler flag syntax is as follows:

-option:value

Where option is the name of the compiler flag and value is the value to be passed to the flag. Observe this is a hybrid of Linux options that use - as a prefix, and Windows options that use : as a separator between the option and its value. This syntax allows developers to write build scripts and command lines that are portable across both Windows and Linux without needing to change the syntax of the compiler flags. This method is used internal to CMake for example, as a demonstration of its robustness.

Fortran Package Manager install

The Fortran Package Manager (fpm) is a tool for building Fortran projects and their dependencies. FPM stands alone, written in Rust, as an alternative to CMake, Meson, or Make for building hierarchies of Fortran projects. The fpm build command is used to build a Fortran project and its dependencies. If a main executable program exists, fpm run runs the executable after building. The fpm install command is used to install a Fortran project and its dependencies. fpm test is used to run tests after building.

FPM itself is easily installed by:

  • Windows winget install FortranLang.fpm
  • macOS: brew install fpm

In general and including for Linux, downloadable FPM binaries are available from the FPM GitHub releases page.

CMake LINKER_LANGUAGE with Fortran and C++

CMake target property LINKER_LANGUAGE is used by CMake to determine the language of the linker when linking a target. When this target property is not set, CMake uses a heuristic to determine the linker language based on the source files and the compiler being used. LINKER_LANGUAGE is important for mixed-language projects, such as those that use both Fortran and C++. However, CMake’s heuristic for determining the linker language can sometimes fail, especially with certain compilers like Intel oneAPI or NVHPC.

This is the general CMake script we use on our Fortran and C++ mixed projects:

set(linker_lang)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_GENERATOR STREQUAL "Unix Makefiles")
  # otherwise failed to link since -lc++ is missing
  set(linker_lang CXX)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM|NVHPC" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
  # IntelLLVM|NVHPC need Fortran
  set(linker_lang Fortran)
endif()
if(linker_lang)
  message(STATUS "Setting linker language to ${linker_lang} for certain targets")
endif()

Then for individual mixed Fortran and C++ targets, we set the LINKER_LANGUAGE property explicitly:

set_target_properties(mixed_target PROPERTIES LINKER_LANGUAGE ${linker_lang})