Thursday, January 5, 2023

WSL2 in minutes

The Windows Subsystem for Linux (WSL to those in the know) is a great thing, allowing emulation of Linux on Windows machines without the need for dual booting or any of that nonsense. I got excited about it years ago, and I am still excited about it now. My years of buying Apple machines so that I could have a command-line enabled machine that could also run desktop software are over. Hurrah!

Anyway, I just installed it again on a new machine running Windows 11, so I thought I'd document how.

1. Run the install command

This is remarkably easy these days (compared to, say, the olden days). I googled for instructions and found this link: https://learn.microsoft.com/en-us/windows/wsl/install 

It boils down to this. Open a PowerShell window as Administrator, and run:

wsl --install

And it will download things and do it all for you. By default it installs the latest Ubuntu LTS version, which is completely fine with me! 

Once installed, you should reboot your machine. But while you're doing that, you might as well...

2. (Optional, but you'll probably need to) Activate the virtualization in BIOS 

My new PC, although built from reasonably up-to-date components (AMD Ryzen 7 processor, 5xxx series, B550 motherboard), did not have virtualization enabled in BIOS by default, and so when I tried to run my new Ubuntu instance, it quit on my immediately, saying:

Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS

Since the current version of WSL (WSL2) makes use of virtualization at the hardware level, this was not entirely surprising. Unless you have been mucking about with this sort of thing already, it is quire likely you need to turn on virtualization in the BIOS.

So I rebooted again, went into my BIOS and after a little googling, found instructions for my ASUS motherboard. (I had to enable 'SVM mode' under 'CPU configuration'.) 

After that, the Ubuntu app opened, and asked me to generate a username and password. Success!

3. Set up X-Windows

Assuming you want to do anything serious with your WSL instance, you will probably want to install some kind of X-Windows server. Over the years I have had good luck with VcXsrv, and it is still my go-to. So go ahead and download it, and install it.

When you run VcXsrv (a.k.a. 'XLaunch'), you will get some options in a pop-up window. I make sure to select:

  • 'Multiple windows', on the first page
  • 'Start no client', on the second page
  • Check the box for 'Disable access control' on the third page 
  • Click the button to save your configuration, and save it to your desktop. That way next time you can use the configuration file icon to open VcXsrv with a working configuration from the get-go.

4. Configure your display

I usually have to look this up. I found a useful blog post that had all the information I needed... The key is to configure the DISPLAY environment variable in your terminal properly. This boils down to adding a line to the end of your .bashrc file (you can edit it using nano).

The line you need to add is:
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"

Once you have added it, close your terminal and open it again. 

5. Testing!

You can use the aptitude package installer to add some useful things to your Ubuntu install. One I like to use as a test that X-Windows is working is x11-apps, which is easily installed:

sudo apt install x11-apps

and once installed, run

xeyes

 and you should see a pair of googly eyes on your screen! If so, it's working! 

Thursday, December 22, 2022

ISCE with data from the olden days

Processing legacy data (we're talking ERS, Envisat, JERS, Radarsat) with ISCE is possible, although not well documented. Since the developers are (rightly) more focused on getting the code running well on contemporary data, and developing the new versions that will one day handle data from the NISAR mission, you might need to do a lot of the legwork yourself.

So it proved the other day, when I tried to process some very old JERS data over southern California using stripmapApp. In theory, there are good reasons for wanting to do so – to make use of the improved topographic registration, split-band processing and other goodies built into the stripmapApp workflow, for instance. Plus of course, the software is still supported (unlike legacy codes like ROI_PAC), so if it can be coaxed into working, you would have a working set-up for the next few years at least!

1) The ISCE JERS parser was incomplete


Once upon a time, in a version of ISCE a long way away, there might have been an effort to write a parser for JERS data, Looking in the guts of the Python code, it seems that someone started writing a script to do it, maybe based on the scripts from ROI_PAC, and then gave up halfway through. I tried to run it once, just to see if it would work, and I got an error. Digging into the code a little (at $ISCE_HOME/components/isceobj/Sensor/JERS.py), I found the following:
def extractImage(self): raise NotImplementedError()

...in other words, at the part where the script is supposed to extract the image, it just raises an error that it is not implemented. Oof! Never mind...

2) ISCE didn't read ROI_PAC format metadata properly

There is often more than one way to do something in a code as versatile as ISCE. Since I had processed this pair of images from raw in ROI_PAC, I had the raw data in ROI_PAC format. So all I would have to do was tell it I had the files in that format. Easy!

My stripmapApp.xml file looks a bit like this:

<stripmapApp> <component name="insar"> <property name="sensor name">ROI_PAC</property> <component name="reference"> <property name="RAWFILE"> <value>/path_to_files/19930430/19930430.raw</value> </property> <property name="HDRFILE"> <value>/path_to_files/hdr_data_points_19930430.rsc</value> </property> <property name="OUTPUT"> <value>reference</value> </property> </component> ...

The key, really, is that the ROI_PAC raw file is accompanied by a raw.rsc file that contains the metadata. In this case, the metadata contained the vital information that there was a fairly large Doppler centroid bias in both scenes (about -1.2 PRF, or -1900 Hz in each case). However, it became obvious that this vital information was being ignored, as the interferogram that I ended up with was fuzzy, as if it were processed with the wrong Doppler.



A fuzzy mess


Doing a little detective work, it seems that ISCE had re-estimated the Doppler centroid bias all on its own, as when I consulted the log files, they proudly cited an incorrect value:

reference.frame.doppler_vs_pixel = [-284.0383895212319, -0.08412333288059079, 2.1196022751847877e-06] 
reference.instrument.range_pixel_size = 8.76586134502924
reference.sensor.DOPPLER_RANGE0 = -1.2416044171086 
reference.sensor.DOPPLER_RANGE1 = -4.42229572736922e-05 
reference.sensor.DOPPLER_RANGE2 = 0
reference.sensor.PRF = 1555.2000000

Note that the Doppler value of -284 Hz is approximately 1 PRF away from the 'correct' Doppler of approximately -1900 Hz. And, digging deeper, it seems that ISCE tried to estimate the Doppler itself (using the ROI_PAC-era 'DopIQ' code), rather than use the values from the metadata. Aha!

3) Force ISCE to use the metadata values (and scale them properly)

The 'default Doppler' approach in ISCE uses information from the metadata for its Doppler needs. But it seems that the ROI_PAC data type defaults to something else! You can force it to use the metadata by including the following in your stripmapApp.xml file:

<property name="reference doppler method">useDEFAULT</property> <property name="secondary doppler method">useDEFAULT</property>

This change made, I was intrigued to find that the reported Doppler values increase to very large numbers!

reference.frame.doppler_vs_pixel = [-3003002.848290641, 0.0, 0.0, 0.0] secondary.frame.doppler_vs_pixel = [-2882779.5730339526, 0.0, 0.0, 0.0]

-300,000 Hz is a very big shift! About 1555 times too big, I would say. And would you know it, 1555 Hz is the value of the PRF! So the fix to the problem was to figure out where these values were coming from (in $ISCE_HOME/components/isceobj/Sensor/ROI_PAC.py) and scaling them appropriately by the PRF, up or down. I submitted these changes as a pull request to the ISCE repo on GitHub, so hopefully these changes will propagate through to everyone in due course...

4) Fix alignment and timing issues

One more issue to overcome is the alignment of the two images. After making the necessary changes to focus them properly, it still seems that there were still issues with making an interferogram out of them. Namely, that they were not aligned. Whoops!



This failed interferogram is made from two focused images that were not properly aligned. If you look carefully, you can see double features throughout, suggesting that the misalignment is in the azimuth (y) direction.


Poor alignment is not entirely surprising – it is a matter of timing and orbit information, neither of which was as accurate 30 years ago as more recent missions provide. (We've been spoiled by Sentinel-1 for sure!) It turns out that there is a fine alignment that is done within ISCE that is ultimately used to correct for relative timing biases, and this was not doing the job with this interferogram. The likely reason? The timing bias is probably too large for the standard tolerances in ISCE. We need more 'slop' in the process so that these larger misalignments can be fixed.

It turns out that the place where these things are hard-coded (!) is in a script: $ISCE_HOME/components/isceobj/StripmapProc/runRefineSecondaryTiming.py

By default, the search window size is 40 lines in azimuth. I changed it to 80, which I figured would be big enough to capture the misalignment in radar coordinates (this was a guess, but if you are really keen, you could look at the focused slcs and measure some offsets between the images manually). Having updates and saved the script, I reran the interferogram formation, And, lo and behold! It worked!



Giving the two images a taller search window enabled them to be properly aligned. And now the amplitudes are crisp and the phase is coherent. And there are fringes!


While it is great that it is fixable, and that I know where to make such changes now, I do wonder if this should be an input parameter, rather than something you have to edit in a script. But that might be an issue to fix on another day...

5) I get by with a little help from my friends

I didn't just magically intuit what to do and where to fix things, as much as I would like to think I could. No, I got this far by asking for help, namely by opening an issue on the ISCE repository on Github. Luckily, one of the developers helped me by pointing to some of the places where the problems might arise, and this was enough to inspire a deeper dive into the places where things might be going awry (and then I could grep for the rest!)

So yes, if you have a problem, and nobody else can help, perhaps opening an issue might be the solution. (Assuming that the A-Team can't help you, of course...)

Tuesday, December 20, 2022

Forging ahead with conda

UPDATED August 2023: The basic recipe as outlined below is pretty much the same for the current version (2.6.3), except that you don't need to avoid the newest versions of Python and numpy anymore! So step 2 is even easier!

...

Friday, November 4, 2016

Twice as (n)ISCE

UPDATE (August 2020):


In honour of ISCE release 2.4, with the removal of the distasteful terminology that cluttered previous editions, I have been trying to install it on my Windows 10 PC (with Windows Subsystem for Linux 2, running Ubuntu 20.04).

I managed to get a clean clone of the isce2 repo to compile, but not without incident. I had to hack around with several files to get it to work.

Here is what I did...

Get the repo, link the directory:
git clone https://github.com/isce-framework/isce2
ln -s isce2 isce 

Install dependencies:
sudo apt install scons libfftw3-dev libxm4 libmotif-dev python3-dev python3-pip snaphu cython3 libgdal-dev python3-gdal libhdf5-dev opencv-python libopencv-dev

sudo apt install scipy numpy h5py

I had to edit some files (paths from the isce2 directory):

1) contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp - insert 
#include "opencv2/imgproc/types_c.h"
after the other include commands

2) components/zerodop/SConscript - commented out statements from line 36 to end
3) PyCuAmpcor/SConscript - commented out statements from line 14 to end
4) test/SConscript - commented out statements from line 23 to end

2) and 3) caused the compilation to crash, as I was not compiling with CUDA. You probably need them if you are. 

My new .isce/SConfigISCE : 

PRJ_SCONS_BUILD = /home/gareth/pkgs/isce/build
PRJ_SCONS_INSTALL = /home/gareth/pkgs/isce/isce

LIBPATH = /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/lib /home/gareth/pkgs/isce/lib /home/gareth/pkgs/isce/lib64 /home/gareth/pkgs/isce/lib32 

CPPPATH = /usr/include/python3.8 /usr/include/python3.8/numpy /usr/include/hdf5/serial /usr/include/gdal /usr/include/opencv4 

FORTRANPATH =  /usr/include
FORTRAN = /usr/bin/gfortran
CC = /usr/bin/gcc
CXX = /usr/bin/g++

MOTIFLIBPATH = /usr/lib/x86_64-linux-gnu
X11LIBPATH = /usr/lib/x86_64-linux-gnu
MOTIFINCPATH = /usr/include  
X11INCPATH = /usr/include  

(substitute 'gareth' for your own username!)

My ISCE_config.sh script is now:

export ISCE_INSTALL_ROOT=/home/gareth/pkgs/isce
export PYTHONPATH=$ISCE_INSTALL_ROOT:$PYTHONPATH
export ISCE_HOME=$ISCE_INSTALL_ROOT/isce
export PATH=$ISCE_HOME/applications:$PATH  

(substitute /home/gareth/pkgs for wherever you cloned the github repo)

I added the following lines to the end of .bashrc to tell the shell about my install:
export SCONS_CONFIG_DIR=/home/gareth/.isce
source /home/gareth/pkgs/isce/ISCE_config.sh
(again, edit to point these to your own directories and script, whatever they are called)

When compiling, scons wasn't finding the dependencies, so 
scons install --config=force
gave it a bit more encouragement. And it ran to the end.

Good luck if you're trying it yourself! I'm off to provide 'feedback' on the process to the developers...


Monday, June 27, 2016

Hopes no longer dashed in Windows 10

I have largely weaned myself off of my old Mac laptop (a 2010 MacBook Pro) in favour of my newer, spiffier Microsoft Surface Pro 3. The SP3 is slim, weighs less than a kilo, which makes it a dream to carry about, and has functionality that a Mac can only dream of (a touchscreen! a stylus!) The Mac is now retired to sofa duty in my living room, while the SP3 is my new world travelling companion.

But not everything is automatically better. At least, not right away. There are a few little things that were so easy to do on the Mac that are nigh-on impossible in the Windows 10 operating system on the SP3. And the one that really bugs me is a little bit grammar-nerdy: en-dashes.

As an undergrad, I used to work as a sub-editor on the university newspaper. In essence, my job was to proofread chunks of the copy that eventually made it onto the pages. And one of the most common corrections I had to make was switching hyphens - these weedy things - for en-dashes. The en-dash is a dash the width of an 'n' – a far more satisfying size – and is just the thing to add emphasis or clarification to a sentence.

On a Mac, you could get an en-dash by typing <option><hyphen>, but there is no easy equivalent for Windows. Within certain applications, like Word, you can set macros to autocorrect to dashes, but that doesn't exactly help with typing in a web browser (say). Some websites suggest that you can get there with Alt-codes, but the big catch there is that you need a full-size keyboard with numeric keypad to get those to work. Which the SP3 is notably lacking in. Well, today, I spent some time googling the problem, and was heartened to find that a) I was not the only person obsessing over dashes, and b) at least one of those people had figured out a fix:
AutoHotKey is the simple solution to this problem. It's a free app that lets you set keystroke combinations to perform any action in any application, including browsers. I was able to map en and em dashes to alt-hyphen and shift-alt-hyphen, respectively. Works flawlessly — every time. (See what I did there?)
You'll see some discussion about this not working with Windows 10, but that's old discussion. It's working for me on my Surface Pro 4 just dandily as of January 21, 2016.
Here's what you do:
1. Download and run AutoHotKey (autohotkey.com)
2. Right-click on your desktop, and choose New > AutoHotKey Script. Name the script with a .ahk at the end.
3. Right-click the script, and select Edit Script.
4. Paste this code in that script below the existing text:
!-::–
return

+!-::—
return
5. Save, close and double-click the script to run it. Test it out in some random program. You'll see it now works.
6. Make a shortcut of the script, and move it to your Startup Items folder. (Windows-R, then type "shell:startup" to open the Startup folder.) Drag your shortcut into it.
I followed the instructions, and can confirm that they work a treat. Now to write some dashing prose!

Hat tip: David R Nagel on this thread.

Wednesday, June 22, 2016

Giving Linux in Windows a bash – Part 2: How-to

So you want to tool up your Windows 10 install to include the Linux bash shell, eh? Have dreams of natively running compiled Fortran programs in a terminal window on the same PC that you use to craft your PowerPoint slides? Want to make GMT figures and then edit them immediately in Adobe Illustrator? (You say yes and yes? Are you me?) Well, I've started to figure these things out, and I'll share with you how I did it...

[Almost all of this could be cribbed from other places on the web, if you can be bothered; this is blog post is more of a compilation. If you want to track things back to the original sources, this is where I found instructions for changing to Insider Previews; I used these suggestions to try and get Windows Update to work with the previews; I downloaded a working ISO file for a suitable update here; this Microsoft blog showed me how to activate the bash shell; I found out about configuring the X server here; and there was also a subreddit with some useful background.]

1. Update to a suitable build of Windows 10

The bash shell interface is set to be included in the Windows 10 Anniversary Update, which is rumoured to be released in July. Since it isn't out yet, you will have to update to a 'preview' (read, beta) build of Windows to do that. All builds after version 14316 have bash included as an option, so go for one of those.
  • To check your operating system version, you need to take a short trip into the settings:
    • Click on the start button and then on the 'Settings' icon.
    • In the window that pops up, click on the 'System' icon.
    • From the sidebar menu that appears, scroll down and click on 'About'.
    • On the screen that appears, look for 'OS Build' and the number that goes with it. If it is above 14316, you don't need to do anything more here. 
      The Insider Program website. Yesterday.
  • If it turns out you do need to install a newer build of Windows, you first need to join the 'Windows Insider Program'. This is associated with your Microsoft account, and so you'll need to log in to Windows using it from here on in, if you aren't already.
    • Go to the Insider Program website, (pictured, right) and answer the questions there. It's free to join. 
    • Make sure you're logged into Windows with your Microsoft account.
  • The next step is to enable Insider Previews inside Windows. This requires some changes to your settings. 
    • Click on the start button and then on the 'Settings' icon.
    • In the window that pops up, click on the 'Update and Security' icon.
    • From the sidebar menu that appears, click on 'Windows Update'.
    • Then click on 'Advanced Options'.
    • Scroll down on the screen that appears, and click on the button that says 'Get Started' under the heading 'Get Insider Builds'.
    • A slider will appear with three positions, representing different levels of involvement. I chose 'Slow' – this means you only get preview builds that have been reasonably stable under testing. (If you like to live life on the edge, and can handle the possibility of the occasional less-vetted, unstable update, choose 'Fast'.) After a quick restart of your computer, you should now be ready for updates... 
In my case, having followed all these steps and restarted, I checked Windows Update, hoping to see details of my new version, and... nothing. Some searching of the Internets suggested that in some cases (but there was no firm sense for which cases), Windows needs a little prompting to turn up those updates:
  • It may be that your Windows registry needs some 'adjusting'. This site has some suggestions about various hacks you can try. I tried all of them, including the suggestions found in the comments. They didn't seem to do that much good for me, but your mileage may vary.
In the end, I decided to update Windows manually using an ISO file (DVD image) of one of the preview builds: 
  • Download a preview build from Microsoft's website. (The link is for build 14342, which is the one I tried.) You need to have registered for the Insider Program for it to work, I think.
    • You get a choice of version, from a drop-down menu. Unless you have special circumstances, the top option ('Windows 10 Insider Preview - Build 14342') is probably the one to go for. Choose a language, too, and download the ISO file (should be 3.9 Gb or so).
    • Once downloaded, double click on the ISO file to mount it.
    • From the folder that appears, double click on 'setup.exe'.
    • Follow the prompts to install the preview build on your computer. (There will be warnings... be brave and accept them.) You will have the option to keep your files and settings – you'll probably want to do that. I found the install went much faster when I told it not to apply any updates as it went along, but your experience may be different.
    • After a series of restarts and logging in, you will eventually find yourself being introduced to a new version of Windows 10. Success!
    • Windows Update should now (hopefully) show you another update that can be installed. Mine showed an update to Build 14366, for instance. You'll probably want to do that – everything that I show you below worked better with the new update than it did before it...

2. Activate and install the bash terminal

The Ubuntu bash terminal, the thing we want to install, goes by the rather unsexy name of the 'Windows Subsytem for Linux (Beta)', WSL for short. You'll need to make an excursion into the deeper recesses of the Windows Settings and Control Panel in order to install it:
  • First, turn on Developer Mode. 
    • Click on Start, then Settings, then Update and Security, then For Developers.
    • On the screen that comes up, click on the radio button for 'Developer Mode'.
  • Next, install WSL.
    • In the Cortana 'Ask me anything' text box at the bottom of the screen, type 'features'.
    • From the menu that pops up, click on 'Turn Windows features on or off'.
    • Scroll down in the window that pops up, and click in the tick box for 'Windows Subsytem for Linux (Beta)'. Then select OK. The package should download and install, and you will be prompted to reboot. Do.
  • Next, run it for the first time.
    • Type 'bash' in the Cortana 'Ask me anything' box, and press return.
    • This will open a terminal window, which will ask you some simple questions. Yes, you do want to install it. It'll download more things, assuming you said 'y'.
    • At the end, it should ask you to set up your Linux username and password. Do so.
  • And then run it again!
    • Now you should find 'Bash on Ubuntu on Windows' in the start menu, or through the Cortana text box (try 'bash' again). And it should work. Huzzah!

3. Get X-Windows working

It's all very well to have the bash shell working. But the beauty of Linux, Unix and friends is that command line programs can open a wide variety of graphical outputs either from your own machine or on remote machines, through the X-Windows system. And so, until you have that functionality, it will only be a pale shadow of what is possible. Luckily, it isn't that hard to sort out.
  • Download and install the free VcXsrv X-Windows server application. (Internet people seem to think this is the best free option.)
  • Run VcXsrv. You should see an 'X' icon appear in your system tray.
  • Now set up bash to use your X-Windows server:
    • In your bash window type:  export DISPLAY=:0 (no misspellings, please)
  • You will need to install some apps that make X output to test it. Luckily bash comes with the Ubuntu/Debian package installer that does all the heavy lifting for you:
    • sudo apt-get install x11-apps  will install a set of simple apps that use the x11 system (you may need to enter your password to start the install)
    • xeyes  will generate a pair of graphical eyes that will follow your cursor around (sort of, it can be slow to update).
    • You could also try xcalc or  xclock (wonder what those do?)
  • To make the change permanent, you need to add the set-up information to your bash configuration file (.bashrc, in your home directory). If you don't know how to do that, try typing the following:
    • cd
    • nano .bashrc
    • scroll down to the bottom of the file
    • paste the  export command from above
    • ctrl–x to exit, 'y' to save changes.
  • You are now the proud owner of a (somewhat) functional Linux X-Windows system running natively on your Windows PC!

4. Things to try/figure out, and some observations

  • I successfully installed GMT5 under bash by following the standard GMT installation instructions for Ubuntu. (This did seem to need the extra, post-install Windows Update mentioned above, however.) I haven't yet tried all the commands, but plotting a simple pscoast world map worked just fine.
  • I also successfully installed gedit, the GNU text editor. It started out by crashing with every file save, but following the extra Windows Update (to build 14366) it seems much better behaved and less temperamental. I have been unable to change the configuration of the editor yet, though.
  • I had trouble getting ghostscript to run initially, but this too seems to have been sorted out with the update. ghostview worked from the off, on the other hand.
  • I have not yet located where the computer has situated the files involved on the windows file system. To be honest, I just haven't looked too hard yet.
  • I do know, however, that /mnt/c is the location of the C drive on my PC in the bash terminal.

Giving Linux in Windows a bash – Part 1: Why bother?

For over a decade, Apple Macs have been the computer of choice for many of my professional colleagues in geophysics. Although there is an element of tribalism in the choice for some (especially among the Californian lifestyle set), and perhaps appreciation for the pretty hardware design carries rather more weight than it ought to for others, I suspect neither is the main consideration. For many, it's all about the operating system.
Mac OS X. Yesterday.

Mac OS X, launched in 2001, was revolutionary in that its back end (the guts of the operating system, behind the scenes) was based on BSD, a variant of Unix, the operating system beloved of scientists, sysops and servers in the 90s and earlier. (My undergraduate research, Masters research and early PhD research – all in geophysics – were all conducted on Sun workstations running a version of Unix.)  And Apple provided a terminal app, a native C compiler and an implementation of X-Windows, making people in the know very excited indeed. 

Suddenly, full-on techy types could do all of their programming, testing and running of their command-line based programs on a machine that could also run Microsoft Word and Powerpoint, and Adobe Illustrator! That's what sold me, back in 2003, when I bought my first Mac, a 12-inch aluminium PowerBook. And again several more times –when I started my faculty job, when my students needed new machines last year. As we approach the 12th version of OS X, Macs remain the best all-round machines for my work. But the advantage is not as clear as it might once have been.

Why, you might ask? Apple in recent years have not been the powerhouses of development and fancy hardware that they were in the past. The pro-level machines have become expensive, essentially unexpandable dustbins, with neither the aesthetics or upgrade path of my cherished 2010 Mac Pro desktop. The laptops have stagnated, with touchscreen technology passing them by, and the latest MacBook line is ridiculously undersupplied with ports (but overprovisioned with scandalously expensive dongles). Really, now, it's getting to the point where the obvious flaws in the hardware are starting to overwhelm the benefits of the software.

So, when my opportunity to get a new laptop through work came along, I bought myself a Surface Pro 3 which, minor foibles aside, has been a great purchase – light, flexible, speedy, with reasonable battery life and a stylus! I even managed to get it to dual boot, so that I can do proper work when travelling (although having to reboot it to run PowerPoint is annoying). And when I had money to spend on a desktop machine, I spent $2000 on PC components and built myself a awesome Linux-toting thunderbastard of a machine that can run all my research codes at express speed for a fraction of the price of a lesser-specced Mac Pro dustbin. If it could run professional application software (rather than the fairly weak sauce Linux alternatives), I wouldn't need anything else.

Which is why Microsoft's announcement that they are teaming with Canonical to produce an Ubuntu style bash terminal in Windows 10 is so exciting. It raises the possibility of doing everything on one machine again, but that machine could be a Windows machine. The tool is actually in beta right now, and if you enable Insider Previews on your Windows 10 install, you could have it today! I'll be giving that a go to see if it really is a solution to the 'one machine' problem... watch this space.