BRiTEBOT Mac OS

BRiTEBOT Mac OS

June 01 2021

BRiTEBOT Mac OS

Britbox articles on MacRumors.com. BritBox, a streaming service offering shows from ITV, the BBC, Channel 4 and Channel 5, has launched in the United Kingdom (via BBC). ‎Download apps by BritBox, LLC, including BritBox by BBC & ITV.

I recently decided to run Kali Linux on my MacBook. I originally thought I'd just build it into a Virtual Machine (using Parallels), but was concerned that I might not have the control over the hardware that I'd need in order to make Kali effective as a learning environment. So, I set about working on a dual-boot scenario. Needless to say, I failed miserably when I opted to have Kali install Grub and it overwrote my primary Boot Manager on the Mac and rendered the system unbootable (and eventually unrecoverable). Thank goodness for good backups...

WARNING: Do not proceed with any of these steps unless you have the ability to restore a bare-metal backup. Everything I'm doing has the potential to trash all of the data on your computer, requiring a clean installation of macOS and subsequent data recovery from backups. I use a combination of Time Machine, CrashPlan, and Arq to back up my system, you should too.

Triple Boot the Right Way

If you're interested in triple booting your MacBook Pro, and Windows is going to be one of the Operating Systems you're going to boot, then take my word for it, this is the only way you want to accomplish this feat.

At a high level, the process goes like this:

  1. Install Apple's Bootcamp and use it to install Windows 10
  2. Use Windows 10 to shrink the Bootcamp partition, freeing up space to install Linux
  3. Install Linux (I used Kali) into the newly freed space
  4. Install rEFInd as a Boot Manager for all 3 OSes

To be fair, a lot of my instructions and the guide I initially followed, can be found here. However, several of the steps in that guide I didn't have to use at all, so I'm documenting my process here.

Install Apple's Boot Camp

Apple provides a supported method of installing Windows as a dual-boot option for Macintosh owners. There are several advantages to using Apple's process:

  1. Apple supports this as a way to boot Windows
  2. Apple provides native drivers for the hardware under Windows
  3. You will have supported ways to control the Windows and macOS boot process on your MacBook from within Windows (via the Boot Camp Control Panel)

Apple's official documentation for Boot Camp is found here.

Follow Apple's instructions for installing Windows, but make sure you create the Windows partition approximately 64GB larger than what you want to end up with for Windows, that space will end up being given to Linux. Adjust if you wish, I used a 196GB partition for Windows 10, then split it into 128GB for Windows and 64GB for Linux (FYI, a Windows 10 installation with Office 365 installed takes up 68GB, so give yourself enough room under Windows).

Note: Apple only supports Windows 8.1, or newer, for hardware released after 2014. There is no way to install an earlier version of Windows using Boot Camp on newer hardware. See this table to check your hardware and what versions of Windows are supported on it.

Now that you have an Apple-supported dual-boot system running macOS and Windows 10 (presumably), it's time to perform the Linux installation.

Create Partition for Linux

For the purposes of this article, I'm going to install Kali Linux, that's what I used, but installation with ANY version of Linux should work the same way.

The first step is to shrink the Windows partition to make some space for Linux:

  1. Boot into Windows 10
  2. Right-click on the Start Menu and select Disk Management
  3. Select the BOOTCAMP partition, right-click and select Shrink Volume
  4. Enter the size, in megabytes, by which to shrink the volume. I shrunk mine by 64GB, so I entered 65,536

This image is AFTER I did my initial shrink and subsequent installation of Kali linux, you'll have fewer partitions when you do this. I also have an SD card mounted.

The shrinking process took a LONG time (~30 minutes), don't worry about it, let it run to completion and do not interrupt.

After the Volume shrinking process is completed, it's time to download some files to perform the installation; however, you probably want to do this under macOS, so first boot back to your macOS volume and the download them both:

  1. Kali Linux, 64-bit, can be downloaded here
  2. rEFInd, can be downloaded here

Place all of the rEFInd files (after unzipping) on a removable volume (SD Card, USB drive, or even a secondary HFS+ volume) so you can use it in the next step.

Install rEFInd

For all macOS versions starting with El Capitan (10.11) Apple has enabled System Integrity Protection (SIP). This security feature of macOS prevents changes to various areas of the Operating System including System-owned files. That means that you cannot install rEFInd directly on drives where SIP is enabled. In order to install rEFInd you will have to boot into Recovery. Make sure the rEFInd files are available on a drive that macOS can see and use, then follow these instructions:

  1. Reboot the computer and hold down Command-R
  2. Once in Recovery mode select Terminal from the Utilities menu
  3. Find the volume where you have rEFInd stored (start with ls /Volumes)
  4. Change into the rEFInd directory and run ./refind-install
  5. You will still get a warning that SIP is enabled, but you can ignore it (SIP is enabled on the boot volume, but you're not installing it there

Full installation instructions can be found on the rEFInd site.

You may also want to theme rEFInd to look more 'mac-like'. I used the OSX Standard Theme 1.0 found here. Upate 20200906: This theme's installation instructions ask you to 'replace the EFI folder' in the rEFInd install you just did, it ALSO replaces the more curent version of rEFInd and the cryptographic keys that were provided. You probably shouldn't do that, though your milage may vary on getting this to work. At the time of this article's original publication, they were both the same version, but now, 3 years later, the theme's version of rEFInd is woefully outdated. Use with caution or update the components in the theme with the newer versions. (thank you Phillip!)

Test that rEFInd is installed and operational. Just reboot and you should be taken to the rEFInd boot menu, from there you should be able to boot into either macOS or Windows 10.

Note: rEFInd will automatically find what it believes to be bootable volumes. They probably all won't be bootable, through trial-and-error you should be able to find the correct macOS and Windows 10 volumes. You can then configure rEFInd to ignore some volumes, but save that for after you have everything working properly.

Install Linux##

Boot into macOS and have a USB key available to be reformatted, it can be pretty small (small works better), an 8GB drive is perfect.

In order to create a bootable USB drive, you can use the Terminal:

  1. Run the Terminal from the Utilities folder under Applications
  2. Change the directory to where you downloaded the ISO for your Linux installation, e.g. kali-linux-2016.1-amd64.iso
  3. Find your USB key by running: diskutil list, note the drive name, e.g. disk2
  4. Run the command: dd -if=kali-linux-2016.1-amd64.iso -of=/dev/disk2 bs=1m
  5. The above command will take a long time to run, as it is imaging the ISO onto the USB drive. Once it finishes you should have a bootable USB key for Kali Linux (or whatever)

Alternatively, if you want a graphical imaging process, you can use UNetbootin as documented here for Ubuntu (just use Kali or whatever image you want).

You're now ready to install Linux. The reason you had to install rEFInd before installing Linux was that, in my experience, I could not get the standard macOS boot manager to recognize the USB drive I had prepared with Kali Linux. However, if you reboot now, you'll see the rEFInd boot menu. You can then insert your USB drive, then hit ESC to refresh the volumes and you should see the Linux installation drive appear. Select it for booting.

Follow the instructions for installing Linux, making sure to select the correct partition that you created while you were under Windows 10 earlier.

Completed

You should now have a triple-booting MacBook Pro. Using rEFInd you can select the appropriate OS and it should boot cleanly on your hardware.

In the event that rEFInd gets clobbered (you'll know, because a power-cycle takes you to the built-in macOS boot manager) you should still be able to boot into Windows, but you'll probably lose the ability to boot into Linux. Just follow the instructions and re-install rEFInd again and it should come back and allow you to boot again.

# Prerequisites

Before you begin downloading and installing BriteCore-specific tools, you will need to set up some generic software. This guide assumes familiarity with the Terminal in Mac OS, the basics of a Unix command line, Git, and GitHub.

# XCode Command Line Tools

These are the core utilities necessary to compile code from source on Mac OS. Installing them is as simple as running:

from the Terminal and following the prompts.

# Homebrew

Homebrew is an open source package manager specifically for Mac OS. You can install it via the following terminal command, which runs Homebrew's installation script from GitHub.

More information about how to use Homebrew is available at brew.sh/.

Britebot Mac Os X

Once Homebrew is set up, install the following packages with brew install package_name replacing package_name:

  1. python@2 - This specifies the most up-to-date version of Python 2.7.xa. This package automatically installs pip and setuptools as well.
  2. ipython
  3. mysql@5.6 - This specifies the most up-to-date version of MySQL 5.6.x

# Docker

Docker CE can be downloaded here: store.docker.com/editions/community/docker-ce-desktop-mac (it requires the creation of a free account).

Note: Running devbrite create fails if Docker does not have enough RAM allocated; 8 GB is typically sufficient.

# Sequel Pro

Sequel Pro is a nice, open source database visualization tool available for download from https://sequelpro.com/download#auto-start

See Tools for instructions to Color Code Sequel Pro Tabs.

# Credentials

You need to set up an SSH key pair for GitHub. Before you create a new key pair, you should see if you already have one by running ls -al ~/.ssh. In the resulting list of files (assuming there are any to display) look for files ending in .pub to indicate the public half of a key pair. If any of the following is true, you should generate a new key pair:

  • There is a .pub file but you don't remember generating that key pair, or don't remember what it is for
  • There is a .pub file but it is more than a few years old
  • There are no .pub files, or the .ssh directory does not exist

To generate a new key pair:

  1. Run the following using your professional email address (BriteCore employees should insert their BriteCore email address):
  1. You will be prompted for a filename; hit enter to accept the default name and location. You will also be prompted for a passphrase to lock the key files. Doing so involves a measure of inconvenience you can get around by configuring your ssh-agent.

  2. Having generated an SSH key pair, you now need to add the public half to your GitHub. Run the following to copy the contents of the public key file to your clipboard:

  1. Paste the public key file into the Key box at github.com/settings/keys. Title the key as you see fit (the name is not significant outside of helping you keep track if you have more than one of them).

  2. Once you have your IAM credentials, put them in two files you create:

  1. If you are comfortable with a CLI text editor such as vim, emacs, or nano feel free to use them. Otherwise, run the following to create and then open the files in TextEdit:

# Fixing Paths

There just a couple of things you need to adjust before proceeding.

  1. First, there are a few packages to install with pip that expect there to be a /usr/local/man. Create a symbolic link like so:
Britebot mac os download
  1. Next, one of the tools in our dev suite needs mysql_config for installation. It was installed along with MySQL, but it's not discoverable on the $PATH. You will need to find the location where Homebrew installed MySQL, which you can accomplish with this:
  1. That will list a folder named 5.6.nn where 'nn' will be the actual version number installed. Amend your $PATH as follows, replacing 'nn' with what you found:

Note: Amending your PATH this way is not permanent. Finish setup before exiting your terminal; exiting will lose this change. If you must exit your session for some reason, simply amend the path again before continuing.

# Pip Packages

Britebot Mac Os Update

Install the following with /usr/local/bin/pip install package_name, replacing package_name:

  1. virtualenv
  2. pudb
  3. nosecomplete
  4. nose-pudb

# PowerTools

If you've gone through all the prerequisites, you're ready to install our suite of dev tools. To install them, simply run:

You can also look through the repository if you wish at github.com/IntuitiveWebSolutions/PowerTools.

# DevBrite

Chief among the tools in PowerTools is devbrite. Documentation on the tool is available in DevBriteDocumentation.pdf.

# Creating a Local BriteCore Instance

Britebot mac os download
  1. Then clone the IntuitiveWebSolutions/BriteCore repo (using the SSH method) for a local copy of the code to run and work on
  2. The following will then create a virtualenv for your BriteCore instances, and load you into it (The version output should correspond to Python 2.7):
  1. Now that you're inside the venv, run the following to finalize your AWS credentials, perform first time setup for devbrite, create a local instance, and then get it running. Replace <project> with whatever you want the project to be called. Replace <client> with the name of the client whose data you want to work with:

# Optional

When creating a local instance, the following tables are excluded by default because they tend to be very large:

  • system_log
  • premium_records
  • files
  • cron_jobs
  • notes
  • archives
  • agency_experience_claim_count
  • agency_experience_claims
  • agency_experience_earned_premium
  • agency_experience_loss_reserves_beginning
  • agency_experience_loss_reserves_ending
  • agency_experience_paid_premium
  • agency_experience_policy_changes
  • agency_experience_policy_state
  • agency_experience_summary
  • agent_experience_summary
  • agency_experience_written_premium
  • agency_group_experience_summary
  • x_files
  • system_test_results
  • vendor_transactions
  • deleted_records

If you need some of them anyway, there are options:

# Next Steps

You can find more information about using BriteDevEnv in theBriteDevEnv documentation.

Before diving into the code, go read General Considerations.

BRiTEBOT Mac OS

Leave a Reply

Cancel reply