Bash scripts by default ignore aliases, unless the command
shopt -s expand_aliases
has been used before the aliased command.
This is typically a good thing, as if one has set in ~/.bash_aliases something like
aliasmv="mv -v"
any script using mv could produce extremely lengthy and verbose output when installing a program for example.
However, sometimes a user has multiple versions of a program installed in directories in $PATH and for whatever reason cannot use update-alternatives to make the desired one the default.
Use
update-alternatives
instead whenever possible as this method described here is not as robust.
Because we are not sourceing the Bash script, the alias scope is only within the Bash script itself.
That is, once the script is done, the alias disappears.
If a script needs CMake 3.x and update-alternatives is not available, do within the Bash script:
Again, we stress this is not general or robust, so only do this as a last resort.
sudo is not required for
update-alternatives.
Put the softlinks under $HOME/.local/bin and put that on your $PATH as a much better choice.
RFSpace SpectraVue is a nice SDR GUI that work both online (with a radio) and offline (from a saved file).
SpectraVue is a Windows program that also works on Linux via WINE.
For USB based SDRs, since WINE doesn’t currently have USB support, we use the Linux program siqs-ftdi to connects to the SDR-IQ over USB, and provide the packets on a local network socket.
For Debian and Ubuntu, siqs-ftdi is provided with the CuteSDR program, another useful SDR interface.
It is necessary to use siqs-ftdi on the Linux Terminal to make the USB → network connection, since WINE currently does not support USB in general.
This method has worked for several years across various versions of WINE, SpectraVue and Linux.
SpectraVue on Linux is run via WINE.
Configure WINE with MFC42 and VCRun2010:
For USB-connected RFSpace SDR-IQ, use siqs-ftdi to make the USB connection.
For Ubuntu, siqs-ftdi is available in the cutesdr package for
Ubuntu:
apt install cutesdr
If siqs_ftdi is not included with your CuteSDR Ubuntu package, it’s possible to manually extract siqs-ftdi from the
cutesdr*.deb for your platform using dpkg-deb:
USB SDR and SpectraVue on Linux is one of the best ways to use the RFSpace SDR-IQ or other USB-connected SDR on Linux.
Open a Terminal and type
siqs-ftdi
Open a second Terminal window and type:
SpectraVue
Errors like:
err:module:import_dll Library mfc100.dll (which is needed by L"C:\SpectraVue\IOModule.dll") not found
err:module:import_dll Library IOModule.dll (which is needed by L"C:\SpectraVue\SpectraVue.exe") not found
err:module:import_dll Library mfc100.dll (which is needed by L"C:\SpectraVue\SpectraVue.exe") not found
are fixed by
winetricks vcrun2010
The error
err:module:import_dll Library MFC42.DLL (which is needed by L"c:\\SpectraVue\\SDR14X.dll") not found
htop is great for viewing processes on Unix-like systems.
It has the unfortunate behavior of overwriting changes to a manually written ~/.htoprc.
It seems the best way to disable threads is to remember the following:
capital H: toggle user thread display
capital K: toggle kernel thread display
This helps declutter the process tracking display.
There can exist incompatible terminal types between the local and remote computers on an SSH connection.
The issue arises when trying to scroll in a text editor on the remote computer such as nano, emacs or vim among others.
The text display would become all scrambled.
On the local SSH client PC, make the entries to the problem remote connection(s) as follows in the ~/.ssh/config file on your local PC.
opens a pseudo-terminal on the remote server, like the ssh -t option. If you have trouble, try RequestTTY force
RemoteCommand
this should normally have a && bash at the end of the command, assuming you want an interactive SSH session. Otherwise the remote server runs the command and immediately disconnects.
CLOC is a single-file Perl program that counts lines of code very quickly in large projects.
If even more speed is needed, CLOC can run with parallel processes.
Recent versions of CLOC are 10-100x faster than old versions.
The Linux distro might have an old / slow CLOC version.
It can be worth downloading the current version of CLOC if you use it a lot.
CLOC works on any operating system since it’s just Perl script.
For Linux / macOS:
download
latest cloc-*.pl to ~/.local/bin.
Be sure $HOME/.local/bin is on your PATH by adding to ~/.profile:
exportPATH=$HOME/.local/bin:$PATH
For convenience, make a softlink for cloc:
ln -s ~/.local/bin/cloc-*.pl ~/.local/bin/cloc
Make sure it’s executable:
chmod +x ~/.local/bin/cloc
For Windowsdownload
latest cloc-*.exe to c:\cloc\ and add c:\cloc to the user PATH.
To make CLOC run N times faster, you need the Perl Parallel::ForkManager library, which on Linux is installed by:
Word wrapping in nano text editor can make scripts and files fail to run/parse properly.
A simple edit can goof up a config or script by adding unwanted newlines.
These settings are in general good for nano on any operating system.
Disable text wrap in nano by adding to ~/.nanorc
set nowrap
A suggested ~/.nanorc contains the following for good defaults including Python coding:
set constantshow
set tabsize 4set nowrap
set tabstospaces
constantshow: show line and column of cursor position (on old nano version as in Red Hat 7, this option may not be recognized)
tabsize 4, tabstospaces: make tabs into 4 spaces
nowrap: disable long-line text wrapping
Nano syntax highlighting is enabled with
include statements
in ~/.nanorc.
WINE creates serial port
softlinks(
automatically.
Serial port mapping is managed via
WINEPREFIX=~/.wine wine regedit
Be sure to include the WINEPREFIX (default is ~/.wine)
Which WINE serial port to use: find the WINE serial port corresponding to the Linux serial port device name by watch log output from:
dmesg -w
when plugging in the serial ↔ USB adapter.
Using WINEPREFIX, start the WINE registry editor:
WINEPREFIX=~/.wine wine regedit
Configure the port–if the device is seen at /dev/ttyUSB0, and you want it to appear to WINE on COM1, edit HKEY_LOCAL_MACHINE\Software\Wine\Ports to have a new string entry named COM1 with value/dev/ttyUSB0.
Verify this setting (but do not edit) by:
ls ~/.wine/dosdevices
where again ~/.wine is the location of your WINEPREFIX.