Scientific Computing

Windows VirtualBox guest Shared Folders

If a VirtualBox virtual machine can’t see Shared Folders in your Windows guest with Linux host, fix by:

In Linux Terminal:

adduser $(whoami) vboxusers

In Virtualbox Windows guest, click Install Guest Additions in the VirtualBox menu Run setup on the virtual drive that appears. Reboot the Windows guest. From Windows guest Command Prompt:

net use x: \\vboxsvr\share

where “share” is the name assigned in the VirtualBox shared folders dialog.

Rescue corrupt IDL .sav files to NetCDF or HDF5

IDL has been buggy in the past for writing .sav` files in the proprietary data format. One should instead save data to NetCDF4 or HDF5.

Read IDL .sav files from Python:

from scipy.io import readsav

data = readsav('mydata.sav')
data
dict() of IDL variables.

Our Scipy contribution: IDL was able to read the .sav file, so I wrote a one-off IDL script to convert from IDL .sav to NetCDF4 .NC: sav2nc.pro format. I also have code there to convert from IDL .sav to HDF5.

I also successfully submitted a patch to SciPy to fix some of these IDL .sav reading issues.

Bluetooth headsets not recognized in Pulseaudio

Fix Bluetooth no audio: force Bluetooth headset/speaker to be recognized in Linux sound control panel with

pactl load-module module-bluetooth-discover

Force A2DP/HSP audio mode by opening Pulseaudio control panel:

pavucontrol

Under “Configuration” select Bluetooth device audio mode:

Profile audio type direction
A2DP high-fidelity 0-24 kHz stereo one way playback
HSP low-fidelity 0-4 kHz monaural two way talk/listen for Skype et al

reference

Read THEMIS all-sky imager ASI data

THEMIS uses the CDF (Common Data Format) for many L1 data products.

CDF is NOT the same as NetCDF, so programs such as ncBrowse and ncview will NOT work with Themis CDF files.

Download THEMIS L1 CDF file by first looking at the L0 64x64 pixel GIF previews.

Matlab and Python functions for THEMIS ASI images make movies and the like.

Disabling middle mouse paste Linux

The “middle mouse button paste” behavior of X11 can lead to posting unwanted text in a document when you’re simply trying to scroll through it. Disable Linux middle-mouse button paste in Terminal:

xmodmap -pp

Telling the active mouse button function indices. The second number is apparently the middle mouse button function, which we will map to an unused index. Example output of xmodmap -pp:

There are 10 pointer buttons defined.
Physical Button      Button Code
1                    1
2                    2
3                    3
4                    4
5                    5
6                    6
7                    7
8                    8
9                    9
10                   10

Edit ~/.Xmodmap - swap the last number with the second number. Keep a backup of your original ~/.Xmodmap file if one existed. For the example above, edit and save:

pointer = 1 10 3 4 5 6 7 8 9 2

Finally, logout / login

the middle-mouse paste should be disabled, while you are still able to use the middle mouse button to scroll.

Reference

RTL2832 receiver overload

In high RF environments, you might notice false spurs in the spectrum. Tuning to a false frequency you might hear very distorted or whining audio.

false image spectrum due to strong signal overloading of the RTL2832. Bandwidth 240kHz. True signal is surrounded by false peaks.

RTL2832 Receiver RF overload fixes:

  • add bandpass RF filtering if you have a narrow frequency range of interest, or use lowpass/highpass filters as appropriate.
  • You might find decreasing RF/LNA gain slightly increases net sensitivity.
  • You can use a directional antenna. Compact log periodic (broadband) antennas made from a PCB are available.

Normal, non-overloaded RTL2382 spectrum display has residual center peak from a noisy power supply.

There is a remnant image on the left, due to IQ imbalance. The central hump is due to noisy onboard/PC power supply and remnant DC offset.

Windows Airplane Mode laptop charging

If Windows is set to Airplane Mode, this can prevent your battery from charging while in Airplane Mode, even after reboot or booting into Linux. The change is persistent even when booting into Linux–perhaps a no-battery-charge flag is set in the UEFI BIOS.

Windows in Airplane Mode prevents battery charging

Windows in Airplane Mode prevents battery charging.

Laptop charge after Airplane Mode: go back into Windows and turn off Airplane Mode to allow charging the battery.

Windows battery setting airplane mode

Re-enable battery charging on Windows and Linux--observe Airplane Mode is not highlighted.

The reason Lenovo gives for disabling battery charging in Airplane Mode is to avoid tripping the airplane seat power outlet circuit breaker. Seems fair, but they should have a popup message reminding you of this fact.

Switch to Android from Blackberry 10 Passport

The Snapdragon 808 CPU in the Blackberry Priv has a Cat 9 LTE modem on board, and feels quite speedy on LTE or Wifi as compared to the Blackberry Passport, which was hindered by a slower CPU.

BB10 market share has been subsumed by the release of Android-based Blackberry hardware. The Priv enables carrying just one device for productivity apps, instead of relying on carrying an Android tablet for business productivity apps.

Blackberry Hub+ has been continually improved and gives a better overall experience on Android than BB10.

The Blackberry Android Mosaic task manager is better than the BB10 limit of 6 full size apps. Pull down on notification banners to expand them into a preview.

Android allows granular app permission setting. The DTEK app on Blackberry Android hardware allows monitoring utilization of permissions that are allowed.

The BlackBerry Priv camera satisfied in a wide variety of scenarios as compared to Blackberry 10 Passport camera.

2.4 / 5 GHz WiFi performance of the Priv seems very comparable to the Passport.

The Priv keyboard is pretty good. I prefer the landscape orientation (e.g. Moto Droid 4) instead of portrait, but it was better than I thought it’d be. I needed a few days to adapt from Passport keyboard.

The Blackberry Priv AMOLED naturally has popping, bright (good) color. The color temperature can be adjusted, but I didn’t need to adjust it.