12 March 2018

NPM Missing from Path: X

If you get a message similar to:
'X'  is not recognized as an internal or external command,
operable program or batch file.

Your npm path might be missing from the system PATH. To correct this:

  • Edit the Environment Variables
  • Add a new entry: %USERPROFILE%\AppData\Roaming\npm

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