Sign up with your email address to be the first to know about new products, VIP offers, blog features & more.
[mc4wp_form id="4890"]
Zapisz Zapisz

Setting up a new Mac

Posted on 0 No tags 0

I’ve been using a Mac now for about 18 years and my periodic dipping into other OSs for work continues to validate that decision.  I deal with computers professionally, the last thing that I want to do is to “work on” my computer for fun.  When I’m at the keyboard I want to perform a task, not be reminded of my tools.

Having said that I recently moved to an iMac for my work system and subsequently reinstalled my laptop; doing so allowed me to rethink my setup and clean up my apps.

In a nutshell, the goal was to move all of my data – even my working set – onto cloud storage, and to make sure that my applications were all installed from the appropriate central repository.  Here’s how I layed everything out:

Any of my work files were moved to Google Drive.  This explicitly includes my working GitHub clones, allowing me to start something at the office then continue working on it from my laptop without blinking once they’ve synchronized (which only takes a minute or two).  Similarly, I enabled the iCloud Desktop/Documents folders and moved all of my personal documents over there.

With that out of the way, let me run through the workflow I used to set up each machine, starting with installing these apps from the MacOS app store:

  • Scrivener
  • SQLPro Studio
  • Slack
  • Elmedia
  • Affinity Photo
  • Kindle
  • Sketch 3
  • Xcode
  • Transmit

I actually prefer sandboxed applications wherever possible; they’re not a panacea for software security woes but every little helps.

Next, because not all applications are on the App Store, I install homebrew.  Step 1: open terminal.  That shows me that my settings are back to the default, so a quick trip to Preferences is in order:

  •    window: 120×48
  •    when shell exists cleanly: close window

Now I can install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Homebrew lets me install most of the other applications I need (or want).  Once its finished, which does take a minute or two, I add some sub-repositories:

brew tap \
caskroom/cask \
caskroom/fonts \
homebrew/php

Next I install the GUI applications I want:

brew cask install  \

firefox \

github-desktop  \

google-chrome  \

google-backup-and-sync  \

transmission  \

virtualbox-extension-pack  \

postman \

font-oswald \

font-roboto-condensed \

dropbox \

hermes \

google-featured-photos \

crashplan \

harvest \

java \

eclipse-java \

microsoft-office \

coconutbattery

And the command line applications:

brew install  \

adns \

bash-completion \

brew-cask-completion \

caddy \

dnsmasq \

fcgi \

gnupg \

heroku \

node \

php56

At this point I can sign in to Google Backup & Sync and Dropbox, and I do.

Also, start downloading a Microsoft virtual machine for Windows testing (choose the VirtualBox option):

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

Sometimes I really need to store files only on a local system and not in the cloud; rather than make that the “default” I prefer to create an explicit place for that:

mkdir -p ~/Local

Also some applications don’t deal well with spaces in their paths (even today, which is crazy), so:

ln -s ~/Google\ Drive/ ~/GD/

Now I go ahead and link some common files.  Whoever possible I prefer to keep everything in the cloud, so that’s pretty simple:

ln -s ~/Google\ Drive/Preferences/bash_profile .bash_profile

ln -s ~/Google\ Drive/Preferences/gnupg/ ~/.gnupg

ln -s ~/Google\ Drive/Preferences/m2_settings.xml ~/.m2/settings.xml

I use DNSMasq to provide an easy development hack – anything in the .test subdomain redirects to localhost:

sudo mkdir -p /etc/resolver

sudo ln -s ~/Google\ Drive/Preferences/etc_resolver_localhost /etc/resolver/internal

rm /usr/local/etc/dnsmasq.conf

ln -s ~/Google\ Drive/Preferences/usr_local_etc_dnsmasq.conf /usr/local/etc/dnsmasq.conf

sudo brew services start dnsmasq

Also I use Caddy for my local web server.  Generally I just use it to proxy requests to various .dev subdomains, redirecting them to localhost on different ports.  That’s how I keep my sanity running development API servers for several clients randomly without having them conflict with each other:

ln -s ~/Google\ Drive/Preferences/usr_local_etc_caddy.conf /usr/local/etc/caddy.conf

ln -s ~/Google\ Drive/Preferences/usr_local_etc_caddy.common.conf /usr/local/etc/caddy.common.conf

As a quick aside, I don’t like screen shots ending up on my desktop and prefer to delete them en mass occasionally, so let’s put them in their own folder:

mkdir -p ~/Screen\ Shots

defaults write com.apple.screencapture ~/Screen\ Shots

killall SystemUIServer

Now, occasionally I do need a PHP interpreter and its not built in to Caddy, so:

mkdir -p ~/Library/LaunchAgents

cp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist

That was easy.  Let’s also make sure that Apache doesn’t try to get in the way:

sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist

And while we’re at it, Caddy doesn’t automatically launch yet, so:

cd /Library/LaunchDaemons/

sudo ln -s ~/GD/Preferences/library_launchdaemons_local.caddy.plist local.caddy.plist

launchctl load -w /Library/LaunchDaemons/local.caddy.plist

That’s everything installed.  Next lets cover configuration, starting with Eclipse.  I generally try to do as little as possible, but I do add the following plugins:

https://marketplace.eclipse.org/content/os-x-eclipse-launcher

https://marketplace.eclipse.org/content/workspace-badge-plug-mac-os-x

https://marketplace.eclipse.org/content/php-development-tools

This allows me to easily keep a separate workspace for each client, which is how I prefer to work.

For ad-free browsing, I like uBlock origin:

https://github.com/el1t/uBlock-Safari/releases

I also use Firefox in a slightly peculiar way – time to go through the Preferences and set it to never remember anything and to clear all state on shutdown.  That’s surprisingly useful for debugging.  I also add uBlock origin, in part to make sure that none of my code gets disturbed by it:

https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/

Fire up Transmission and set the blocklist:

http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz

And for good measure, since its occasionally useful or required, I launch Chrome and add uBlock Origin to it as well:

https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en

Now that that’s done, I sign in to these apps:

Harvest

Hermes

Crashplan

Github Desktop

Excel

iBooks

iTunes

Slack

Launch Scrivener and set it to use Dropbox/Apps/Scrivener as its location (required to sync properly with the iOS client, grr) and tell it to back up to Local/Scrivener Backups

Next, go in to System Preferences and configure:

– General

– Scroll bars: always

– Screen saver

– Google Featured Photos

– 20 minutes

– Hot corner : bottom left

– Dock

– Automatically show/hide

– Security & Privacy

– Require password 1 minute after sleep

– Turn on FileVault

– Turn on Firewall

– Display

– Scaled +1

– Night Shift sunset to sunrise at 25%

– Energy Saver

– Display off after 3 hours

– Keyboard

– Use standard function keys

– Modifier keys caps lock no action

– Trackpad

– Tap to click

– Date and time

– Clock : show date

– Sharing

– Set name

– Screen Sharing, File Sharing and Remote Login

– App Store

– Install Mac OS updates

– Free downloads save password

– Internet Accounts

– Enable accounts and enter passwords

– iCloud

– Photos only select iCloud Photo Library

– Users

– Disable guest

These applications also need configuration:

Safari
https://extensions.apple.com/details/?id=com.wikiwand.safari-LT6875SP46
– Settings:

– advanced:

– Press Tab to highlight each item on a webpage

– Show Develop menu in menu bar

– Show full website address

Mail

– Settings: viewing: most recent at top

Calendar

– Settings: general: set default calendar

Photos

– accept iCloud photo library

Xcode

iTunes

– Authorize -> this computer

– Preferences

– devices – prevent sync

– playback – soundcheck

 

Finally, launch the Microsoft VM you previously downloaded, and configure the appropriate VirtualBox container for it:

– 4096MB RAM

– 128MB video ram with acceleration

– Shared auto mount folder at ~/VirtualBox\ Shared

– After booting: Devices -> Insert CD

All of this takes a couple of hours, after which I’m completely ready to work instead of faffing around with my computer – which as I said near the beginning is the entire point.

signature