Category: Open Source

How to avoid Microsoft’s GitHub takeover

Now that Microsoft has taken over GitHub, it’s not as easy to forecast the company’s new long-term direction. Here are some strategies you can implement today to reduce your reliance …
Upgrade to PHP 7.3 or 7.2 on macOS Mojave, Sierra or on OSX 10.6 – 10.11

Upgrade to PHP 7.3 or 7.2 on macOS Mojave, Sierra or on OSX 10.6 – 10.11

macOS Mojave ships with PHP 7.1, High Sierra 7.1,  Sierra ships with PHP 5.6, OSX 10.11 El Capitan with PHP 5.5.x, there is an easy upgrade method to either the latest PHP version 7.3 or 7.2  or you can also go back to the older stable version 5.6.

PHP versions 5.5 and older are now considered end of life, with 5.6 and version 7.1 these will be the end of life in December 2018.

With the new macOS Mojave & High Sierra they already come shipped with PHP7.1.

The latest PHP version in this guide is from this PHP Packaged site  which is being maintained for macOS and is known as a reliable source.

Download and Install PHP 7.3, 7.2, 7.1 or 7.0

Open Terminal and run…
or for 7.3

curl -s | bash -s 7.3

or for 7.2

curl -s | bash -s 7.2

or for 7.1

curl -s | bash -s 7.1

or for 7.0

curl -s | bash -s 7.0

You get a warning error for if the php is a newer version
The version is filed in /usr/local/php5 – Test the php version by creating a php file named phpinfo.php in your web root with the single function:

Browse to that file and see the version displayed.



If instead you just want to just update to the latest 5.6 PHP…

Open the Terminal and issue one command –

curl -s | bash -s 5.6


That’s it! One line command in the terminal, this will download and install PHP5.6 in:



Apache Configuration

For either PHP version install 7.3, 7.2, 7.1 or 5.6 etc, the install script will also disable the previous PHP5.5 if it was enabled in the Apache configuration file /etc/apache2/httpd.conf . The new version is enabled in Apache right off the bat, the new install will comment out the older PHP module.

#LoadModule php5_module libexec/apache2/

It will load the new PHP version via the /etc/apache2/other/+php-osx.conf file.

So to reverse the behavior uncomment the older PHP module in httpd.conf and remove the new config in other.

The post Upgrade to PHP 7.3 or 7.2 on macOS Mojave, Sierra or on OSX 10.6 – 10.11 appeared first on Coolest Guides on the Planet.

Installing Homebrew on macOS Mojave 10.14, Package Manager for Linux Apps

Installing Homebrew on macOS Mojave 10.14, Package Manager for Linux Apps

The easiest way to install a number of Linux applications and open source software onto macOS Mojave and earlier Sierra OS versions is via a package manager, unfortunately, macOS Mojave doesn’t come with one, but fortunately, some good folks care, they come in the form of Homebrew.

The install of Homebrew also works on macOS Mojave, (High)Sierra, El Capitan, and Yosemite, so macOS 10.10 – 10.14

Homebrew isn’t the only option, also available is MacPorts and Fink but Homebrew is the newest and most popular of the trio.


Install Homebrew

To download install Homebrew run the install script on the command line as below and let the script do its thing:

/usr/bin/ruby -e "$(curl -fsSL"

If you don’t have Apples Xcode command line tools installed it will be installed for you.



Then Homebrew is installed.

Installing Homebrew on macOS Mojave 10.14, Package Manager for Linux Apps 2


After this Homebrew is installed and ready to install other apps.

To get started run

brew help

To check for any issues with the install run:

brew doctor

One issue that typically comes up is an outdated or missing version of XQuartz.

For the latest Mojave, brew doctor will warn that the Home-brew install won’t be 100% if Xcode is not up to date, so that’s the Xcode 10.1 beta 2 available for download via Apple Developers site.

To search for an application:

brew search

To install

brew install 

To list all apps installed by Homebrew

brew list

To remove an installed application

brew remove 

To update Homebrew

brew update

To see what else you can do

man brew

Where does Homebrew install stuff …. in the Cellar


Where the brew lives.

You can see your Homebrew configuration by running

brew config

The output should be similar to …

admins-MacBook-Pro:~ admin$ brew config
admins-MacBook-Pro:~ admin$ brew config
HEAD: f239b7a62790cfb4f33bda9aab7597d43f1b1e3b
Last commit: 2 weeks ago
Core tap ORIGIN:
Core tap HEAD: 346ca20ecf823752169652849e63b4862158b9c9
Core tap last commit: 3 hours ago
CPU: quad-core 64-bit skylake
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: N/A
macOS: 10.14.1-x86_64
CLT headers: N/A
Xcode: 9.2 => /Volumes/Macintosh HD/Applications/
XQuartz: N/A

All installations via Homebrew are filed independently in the filing system in /usr/local/Cellar and linked into /usr/local/bin which is a directory which allows you to run these commands and apps as if part of the regular operating system.

This directory is also out of the SIP bounds so there should be no authentication macOS error dialog boxes.

HomeBrew is a great package manager just start installing some apps and explore.!


The post Installing Homebrew on macOS Mojave 10.14, Package Manager for Linux Apps appeared first on Coolest Guides on the Planet.

Generate SSH Private and Public Keys in macOS Mojave

Generate SSH Private and Public Keys in macOS Mojave

This guide goes through setting up SSH keys on macOS Mojave 10.14 back to Mac OSX 10.11 and also a secure password-less SSH connection between a local macOS workstation and a remote server also running a Linux variant operating system.

The process requires generating a public and private key on the local computer and then adding the public key to the remote servers authorised list. What is great about this is that it allows a password prompt free session, handy for a lot of uses.



First thing that you need to do on your macOS machine is to create a directory that will store your SSH keys. Then you will generate a public and private key for your account, launch the Terminal and punch in some commands:

Create a .ssh Directory

Change to the home directory

cd ~/

Create a SSH directory name .ssh and move into it

mkdir .ssh ; cd .ssh

Make sure that the file permissions are set to read/write/execute only for the user

chmod go-rwx .ssh

Create your private and public key, the blank quotes at the end of the command gives the private key no password, so allowing for passwordless logins!

ssh-keygen -b 1024 -t rsa -f id_rsa -P ""


Change into the .ssh directory and list the contents of that .ssh directory

cd .ssh ; ls -la
 -rw-------   1 username  staff   887B Jun  1 11:35 id_rsa 
 -rw-r--r--   1 username  staff   239B Jun  1 11:35

Thats your SSH keys created, the private key is the id_rsa and the public one is the, don’t give out the private one always keep that one only on your local machine.

Sharing the Public Key

Create an authorized_keys in the .ssh directory of the remote computer that you want to connect to.

touch authorized_keys

You can create automatic logins by adding the contents of your public key to the  authorized_keys file on the remote device.

To see and copy your public key use the cat command and copy the contents:

RVw29p V7mxW16wd/q9z7n+xytqdp4wsAc/7+24ZVikMhhRetEGr3LSBz5gm9980oTPEy61+pDP2y
jafShe5xcszIUnQ rN1ohCuF7Y/a/TG6G6gaJGcLexUiwfTRtCAbpuzfU= username@yourcomputer.local

On the remote computer if needed, change the permssions on the authorized_keys file to write to add the public key, on a new line paste in your public key, and change permissions back to read only after for security.

Allow write on authorised_keys

chmod u+w authorized_keys

Paste the entire content with vi or nano into the authorized_keys file, if using nano use the -w flag to not use incorrect line breaks.

If the remote host does not have an “authorized_keys” file simply create one and after the public key is pasted in don’t forget to takeaway write permissions.

chmod u-w authorized_keys

Going Both Ways

So now when you connect via SSH no password is prompted as the remote computer has your public key which is only decrypted by your private key held in your local .ssh/ directory. If you want the communications to be bilateral then repeat the process in the opposite order between the two.

Now the two computers can securely connect with no password prompting, making it ideal to script between the two for file copies or back ups.

Doing it Quicker

Now instead of typing in


Make an alias in your bash shell you could alias it to

alias now='ssh'

Reload the the shell

source ~/.bash_profile

Then all you have to type in is the alias


The post Generate SSH Private and Public Keys in macOS Mojave appeared first on Coolest Guides on the Planet.

Installing node.js on macOS Mojave, macOS Sierra and earlier OSX

Installing node.js on macOS Mojave, macOS Sierra and earlier OSX

node.js allows you to run javascript in the Terminal as appose to a regular browser which makes for a modern workflow in web development, with both node.js installed and a package manager called npm (Node Package Manager) also installed, which can manage other packages that work with node.js, one of the main ones being gulp.js for a web development workflow.

To install node.js on macOS Mojave, Sierra  (and earner OSX versions)  you can download a pre-compiled binary package which makes a nice and easy installation. Head over to and click the install button to download the latest package. Either version is Ok, if you are new to it best to use the recommended version.

Installing node.js on macOS Mojave, macOS Sierra and earlier OSX 3



Install the package from the .dmg by following along the install wizard which will install both node and npm, npm is Node Package Manager which allows for installs of additional packages for node.js.

Installing node.js on macOS Mojave, macOS Sierra and earlier OSX 4


At the end of the install you are prompted to make sure that /usr/local/bin is in your path, double check you have it by running in the Terminal:

echo $PATH

If not add it in either .bash_profile or .bashrc in your home directory.

After install check it was ok by entering in the command line node which will open a node javascript session:


> console.log('hello node');

hello node



To exit the node.js session just hit ‘control’ + ‘c’ twice.

If you have an earlier version of node you can just download the latest version and install to upgrade it and it will over write the previous version.

To check your version of node run …

node -v

Installing Packages for Node

There are many packages for Node such as the popular gulp.js,  you use the command npm to see a complete list run:

npm search

This will return an exhaustive list of available packages, to install a package run npm install

npm install easyimage

To list installed packages run

npm ls

To upgrade npm packages

npm update

To sudo or not to sudo

It is cleaner not to use sudo when installing npm packages there are a couple of options here on how this is done.

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

Updating NodeJS

To upgrade node.js itself on macOS just download and install the latest from – this will simply override the previous version and keep all your packages that have been already installed.

The post Installing node.js on macOS Mojave, macOS Sierra and earlier OSX appeared first on Coolest Guides on the Planet.

Restart, Start, Stop MySQL from the Command Line macOS, OSX, Linux

Restart, Start, Stop MySQL from the Command Line macOS, OSX, Linux

To restart, start or stop MySQL server from the command line, type the following at the shell prompt…

On Linux start/stop/restart from the command line:

 /etc/init.d/mysqld start
 /etc/init.d/mysqld stop
 /etc/init.d/mysqld restart

Some Linux flavors offer the service command too

 service mysqld start
 service mysqld stop
 service mysqld restart


 service mysql start
 service mysql stop
 service mysql restart

On macOS Sierra & OSX to start/stop/restart MySQL post 5.7  from the command line:

sudo launchctl load -F /Library/LaunchDaemons/
sudo launchctl unload -F /Library/LaunchDaemons/

On OS X to start/stop/restart MySQL pre 5.7  from the command line:

 sudo /usr/local/mysql/support-files/mysql.server start
 sudo /usr/local/mysql/support-files/mysql.server stop
 sudo /usr/local/mysql/support-files/mysql.server restart

mysql-start-stop-restart command line

The post Restart, Start, Stop MySQL from the Command Line macOS, OSX, Linux appeared first on Coolest Guides on the Planet.

Vagrant – Getting Started on macOS

Vagrant – Getting Started on macOS

This is a 4 part reference guide to getting started with Vagrant, VVV and WordPress.
This is Part 1 – Vagrant – Getting Started on macOS

Vagrant is a bit of an odd name for a software app but kind of follows along the trend of naming like Git.It has been around for over 12 months and is an open source project. It essentially builds virtual images from references (boxes) of a type of operating system with applications and dependent software,  this can be referenced in a template file that is given to users on a group project to ensure that their development environment is the same as everybody elses as it is using the same virtual image. Sort of like making sure everyone is singing from the same hymn book.

It is also great for checking a development that is built on a different environment to which it is being deployed, so you can set up the target environment in a virtual instance to test.

Installing Vagrant

Download the latest installer, for macOS there is a point and click .dmg installer.



Expand the .dmg and install the Vagrant.pkg package file. The binary gets installed in the Applications folder with a link to the /usr/bin so it is added to the shell path.

The user data for Vagrant is filed in the directory from which vagrant was used and is stored in an invisible directory named .vagrant.d

Upgrading Vagrant on macOS

You can check the version of vagrant you have by typing:

vagrant -v

If you want to upgrade to a later version just download the latest installer and drag and drop the uninstall.tool onto an open Terminal window and follow the process, then install the Vagrant.pkg file or simply just install the new version over the top of the older one  e.g 1.9.4 -> 2.0.0

Using a Virtual Machine

Along with Vagrant you need to use a VM solution to store the image or box, some solutions include VMWare and AWS but Virtual Box is a free and popular solution. This needs to be downloaded and installed on your local machine.

If you are just interested in Vagrant, VVV and WordPress then move onto the next part – from here it goes through just more on vagrant and using it with a VM and a box not WordPress or VVV related.

Creating a Vagrant Template File

Change directory to where you want to store the Vagrant project and run

vagrant init

This will place a set up file named Vagrantfile in that top level. After the Vagrantfile has been created the next step is to pull the image or box that will be used.

Vagrant Boxes

You can see a bunch of Vagrant boxes on the Vagrant Cloud website that you can download and use.

To add a box using one of the examples:

vagrant box add chef/centos-6.5


This will download the Centos 6.5 box to the current directory, if asked select the relevant VM solution such as Virtual Box. The original box is always left intact and can be used across multiple projects, the Vagrant image built is based from the box.

Configure Vagrant to use the Box

After the box has downloaded we need to tell Vagrant which box to use in the current project, this is done in the Vagrantfile created earlier, using you preferred Terminal editor:

nano Vagrantfile

Find and change

 # Every Vagrant virtual environment requires a box to build off of. = "base"

To the box name, so in this example:

 # Every Vagrant virtual environment requires a box to build off of. = "chef/centos-6.5"

Boot the Box – Vagrant Up

The next step is to boot the box up which is done with the most popular vagrant command:

vagrant up

Which will run through a series of start up steps

neilg@[~/vagrantstart]: vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'chef/centos-6.5'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/centos-6.5' is up to date...
==> default: Setting the name of the VM: vagrantstart_default_1405229326035_48404
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address:
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/neilg/vagrantstart

Connect to the Vagrant Box

To actually connect to the box use ssh and you will be in the home of the VM box

vagrant ssh

You can also verify its running in Virtual Box


Whilst in your Vagrant box your starting directory point is /home/vagrant – it is the vagrant directory at the root /vagrant which shares the same content as your initial project directory. This is a key thing, it essentially mirrors the 2 directories so the content in your project folder will also be in the /vagrant directory on the Vagrant Box.

Installing Apache Web Server

Create a bootup script that will upgrade the OS and install Apache when the Vagrant box is booted up, so still in your initial project directory on macOS or in /vagrant on the Vagrant Box. You need to create a script and also edit the VagrantFile to include the script, if you use the Vagrant Box to edit the file you’ll need to use vi or nano , but install it first.

sudo yum -y install nano

The bootstrap script also changes the webroot directory to be our project directory named /vagrant in our remote vagrant box instance, and also starts the webserver.


And add the content:

#!/usr/bin/env bash

yum update
yum -y install httpd
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
service httpd start

Then include this file in the Vagrantfile

nano VagrantFile
# Every Vagrant virtual environment requires a box to build off of. = "chef/centos-6.5"
config.vm.provision :shell, path: ""

Then reload the Vagrant Box by issuing, if you are in the box you need to exit :

vagrant reload --provision

Set up Port Forwarding

To use our local browser to see files served from our remote vagrant box you need to forward a port, open the VagrantFile again and search for and uncomment the line below "forwarded_port", guest: 80, host: 8080

Then refresh the vagrantbox

vagrant reload --provision

Now we can access the remote Vagrant Box via the local browser by going to  –

If you are using the Port 8080 for another AMP stack like MAMP use another port number.

When you vagrant ssh back to your box and move into the /vagrant directory this will be your webroot structure, web serving files in the /vagrant directory

[vagrant@localhost vagrant]$ ls  cgi-bin  error  html  icons  Vagrantfile

 Sharing Your Vagrant Box

Now that the development environment is up and running, well al least with Apache, you can share that local/remote Vagrant Box with others outside of your network. You need to create a free account at the Vagrant Cloud. Then login at the Terminal

neilg@[~/vagrantstart]: vagrant login

'In a moment we'll ask for your username and password to Vagrant Cloud.
After authenticating, we will store an access token locally. Your
login details will be transmitted over a secure connection, and are
never stored on disk locally.

If you don't have a Vagrant Cloud account, sign up at

Username or Email:

Use your accounts login, then run:

vagrant share

And you will be given a URL which others can see, like so…

==> default: URL:

Keep the Terminal screen session active to keep the sharing going, when done enter ‘Control’  + ‘c’ to end the session, you can get another session by repeating the process.

Stopping The Vagrant Box

Couple of ways of finishing up with the Vagrant Box you can either suspend it to use again at the same point for later, halt it – which powers it down or you can destroy it which removes it completely:

To suspend the box use

vagrant suspend

To halt use

vagrant halt

To completely remove and delete the Vagrant box (which does not include the original downloaded  image) run:

vagrant destroy

 Starting the Vagrant Box

vagrant up

 More info.

The post Vagrant – Getting Started on macOS appeared first on Coolest Guides on the Planet.

How to Change the MySQL root Password in Linux or macOS via Command Line

If you have forgot the MySQL root password, can’t remember or want to break in….. you can reset the mysql database password from the command line in either Linux or macOS Sierra and OSX as long as you know the root user password of the box you are on, this is for MySQL 5.7 onwards:

Stop MySQL

sudo /usr/local/mysql/support-files/mysql.server stop

Start it in safe mode:

sudo mysqld_safe --skip-grant-tables

This will be an ongoing command until the process is finished so open another shell/terminal window, and log in without a password as root:

mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Change the lowercase ‘MyNewPass’ to what you want – and keep the single quotes.


Start MySQL

sudo /usr/local/mysql/support-files/mysql.server start

Thats it, now your root password will be updated.

The post How to Change the MySQL root Password in Linux or macOS via Command Line appeared first on Coolest Guides on the Planet.

Fastest Way to install WordPress on OSX 10.11, 10.10, 10.9, 10.8, 10.7 and 10.6

Fastest Way to install WordPress on OSX 10.11, 10.10, 10.9, 10.8, 10.7 and 10.6


This tutorial assumes a certain degree of comfort in the command line Terminal for installing WordPress on macOS Sierra or Mac OS X El Capitan, Yosemite, Mavericks, Mountain Lion or Snow Leopard, the commands below are not overly complex and following the tutorial will get the job done. If you have no experience with the Terminal and want an easier way to install WordPress on your local Mac then consider using an already compiled set up, which allows for quick and easy multiple WordPress sites, like Desktop Server .

Before proceeding, WordPress needs a couple of things to get going and those things are an AMP stack  – Apache, MySQL and PHP, Apache and PHP come bundled in OS X but MySQL needs to be downloaded and configured. Optionally install phpMyAdmin to manage the database.

To get the AMP stack working correctly on OS X follow this Mac OSX 10.11 El Capitan  or Mac OSX 10.10 Yosemite or OSX 10.9 Mavericks.

Once these components are in place you are OK to proceed.

OS X has 2 web document roots ‘/Library/WebServer/Documents’ and ‘/Users/username/Sites/’ also known as ‘~/Sites’ this guide uses  ‘~/Sites’.

The shared WordPress directory will be called “wordpress“.

WordPress File Set Up

make a sharing directory and move into it

 mkdir ~/Sites/wordpress ; cd ~/Sites/wordpress

get the latest WordPress

curl -O

expand it

 tar -xvzf latest.tar.gz

move all files into shared directory one level up

mv wordpress/* .

remove empty directory and compressed archive

rmdir wordpress/ ; rm latest.tar.gz

create a settings file

cp wp-config-sample.php wp-config.php

Database Setup

create it a new database (no space between -p and password – as an alternative this can be done in phpmyadmin

mysql -u [username] -p[password] -e "create database [databasename];"

or in phpmyadmin






You can do all of the above in one hit at the command line just separate the commands with “;”. This would be handy with multiple installs and can be scripted – not necessary for this guide – but I thought I’d throw it in.

mkdir ~/Sites/wordpress ; cd ~/Sites/wordpress ; curl -O ; tar -xvzf latest.tar.gz ; mv wordpress/* . ; rmdir wordpress/ ; rm latest.tar.gz ; rmdir wordpress/ ; rm latest.tar.gz ; cp wp-config-sample.php wp-config.php ; mysql -u [username] -p[password] -e "create database [databasename];" ; nano wp-config.php

WordPress Database Config

Then proceed with the editing of the wp-config.php file which needs to have the database details added as below:

nano wp-config.php

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress‘);

/** MySQL database username */
define(‘DB_USER’, ‘root‘);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpassword‘);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost‘);

If you are not comfortable with editing this file in nano in the Terminal you can use Text Edit in Applications.

Famous 5 Minute Install

open it up in your default browser

open http://localhost/~username/wordpress/wp-admin/install.php

fill in your credentials:






Post Mortem


OSX El Capitan 10.11

In your username.conf in /etc/apache/users/ make sure you have the following directives:

AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted

This will allow .htaccess file usage.

But wait there’s more, you need to fix up those ownership and permissions

sudo chown -R _www ~/Sites/wordpress ; sudo chmod -R g+w ~/Sites/wordpress

Or just change the Apache user to be your regular user.

Thats it you should have a fully functioning local WordPress install built on a native AMP stack.

If you are having install issues possibly because of previous file configurations do try a solution like Desktop Server, it is a free app up to a level and then paid for some pro features.

The post Fastest Way to install WordPress on OSX 10.11, 10.10, 10.9, 10.8, 10.7 and 10.6 appeared first on Coolest Guides on the Planet.