20 February 2018

Mac Parallels Unable to Start Virtual Windows

On Sunday morning, my Windows VM blue screened. I was able to get it working again witht he following procedure:

  • In Mac Recovery mode (Apple R + Power), Terminal: csrutil disable
  • Relaunch OSX, shoudl be able to start Parallels virtual
  • Upgrade Parallels to v13
  • Check can run VM
  • Back in Mac Recovery, Terminal: csrutil enable
  • Relaunch OSX, Should still be able to run VM

This KB article by parallels:
Which suggests using csrutil disable to re-gain access to the VM. This worked for me.

Also found this one by VMWare which has a similar vein:

Python on a Mac

Don't use the default Python installation: it isn't the latest and can result in permissions issues and pacakges being wiped after an OSX update.

  1. Install it from Homebrew:
    brew install python
  2. Check which version of Python you're using:
    which python
    If it responds '/usr/bin/python' you're using the system one. Read on.
  3. Edit the paths to include your Homebrew Python install:
    sudo vi /etc/paths
  4. Prepend /usr/local/bin to the list of locations
  5. Check the result:
    Should result in the Homebrew version.

19 February 2018

Mac: Create Bootable High Sierra

Find the USB mount point:
Look for:

/dev/disk5s1 on /Volumes/Install macOS Sierra
or similar

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume "/Volumes/Install macOS Sierra" --applicationpath /Applications/Install\ macOS\ High\ Sierra.app

08 December 2017

MySQL on Mac

The install instructions are all there but a bit detailed.

These are just shortcuts:

  1. Install from the DMG
  2. Set alias for the commands:
    alias mysql=/usr/local/mysql/bin/mysql
    alias mysqladmin=/usr/local/mysql/bin/mysqladmin
    or add to your PATH
  3. Set the root password:
    mysql -u root -h -p
    Enter password: (enter the random password here)
  4. Use the Visual Studio Code MySQL Extension to connect to and run queries

19 September 2017

Enable Yum Repositories on CentOS

NB: This may break your install if they've been disabled for a reason e.g. on a bespoke Linux

If the yum repos containing the packages you need are disabled by default:
  1. Find the version of CentOS:
    cat /etc/issue
  2. List the installed repos:
    yum repolist all
  3. Enable the repository in the config file e.g.:
    1. Copy original:
      cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig
    2. Edit file:
      vi /etc/yum.repos.d/CentOS-Base.repo
    3. Initiate INSERT mode: i
    4. Make necessary changes in the first repo:
      Uncomment (remove #) from baseurl=http
      Replace centos/$releasever with the version e.g. centos/7.2.1511
  4. Update the repositories:
    yum update
    1. Install yum-utils:
      yum install yum-utils

    05 September 2017


    Favourite Icons aka Favicons

    Using Gimp

    Create the Original High Res PNG

    You can use whatever size you like but remember it's going to be reduced to a poultry 16px.
    • Create or download from ClipArt e.g. Clipart Library
    • Ensure you have transparency (alpha channel, represented by grey check squares)

    Save as Gif

    • Resize the image to the highest size you need e.g. 64, 48, 32, 16 px square.
    • Export as Gif e.g. favicon-64.gif, favicon-48.gif etc

    Layer the Files

    NB: If the colours are messed up in the new layers, change the image mode to RGB (Image, Mode, RGB)
    • Open the highest res gif e.g. favicon-64.gif
    • "Open as Layers" the other files (48, 32, 16)

    Export as Favicon

    • Export As and choose Microsoft Icon
    • Optionally compress them further at this stage

    30 April 2017

    Node.js Install Secific from NPM or Git

    Whilst carrying out an upgrade of an Angular2 to v4 andfollowing  instructions on the Angular blog "Updating to 4.0.0" I ran the npm install command to update Angular2 to 4:
    npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save

    However you get the error:
    npm WARN @angular/core@4.1.0 requires a peer of zone.js@^0.8.4 but none was installed.

    Trouble is the latest version of zone.js on Git was v0.8.9 when we need 0.8.4

    Install Specific Version From NPM

    You can install a specific version from npm:
    npm install <package>@<version>
    npm install zone@0.8.4 --save

    Install Specific Version from Git

    To install the specific tag from Git directly run:
    npm install git+https://github.com/angular/zone.js.git#v0.8.4 --save

    Note the format: git+; then the github normal clone url; a hash; a v; the tag name; and --save to set it in project.json