Technology

Speeding Up My New Mac Setup

I bought my first new Mac since 2010, and thanks to Past-Tim, it was pretty simple.

Past-Me has been a jerk many times. Past-Tim doesn’t think about Future-Tim, sav­ing him time, mon­ey, and some­times even heartache. Set­ting up a new Mac can be a huge pain, and thank­ful­ly Past-Me final­ly did some­thing nice for Future-Me.

I left great doc­u­men­ta­tion and resources that helped me get this new machine set­up in about thir­ty min­utes. That’s unheard of. But as with every­thing, there are still some holes that need patch­ing, so I thought I’d write some­thing up, to doc­u­ment the process even bet­ter for next time. After all, Past-Tim is now me.

Impor­tant Caveat: I don’t set­up new Macs from a back­up; I like to start fresh. If you like start­ing your new Mac from a Time Machine back­up, you don’t need most — if not all — of this.

Step one: clone dotfiles repo

# First we clone the repo
$ git clone git@github.com:smithtimmytim/dotfiles.git ~/.dotfiles

# Then we run the install script
$ cd .dotfiles
$ script/bootstrap

Hav­ing dot­files ver­sion con­trolled is awe­some, and this is the first machine I set­up with them. The repo comes with a list of pack­ages and apps to be installed. When I run the install script that comes with dot­files, it installs Home­brewsets up sen­si­ble macOS defaults, and much more. My vital apps like 1PasswordDrop­boxAlfredHyper, etc, are all installed. Also, because I use mas — which you can install via Home­brew — all of my favorite Mac App Store apps are installed too.

You may be ask­ing your­self, how is this pos­si­ble? In part to dot­files, but the Brew­file is where the mag­ic hap­pens. If you’re famil­iar with a Gem­file — a Brew­file is that, but for Home­brew. It con­tains a list of the pack­ages and apps I want installed. You can look at my Brew­file here, and you can read more about the whole con­cept on GitHub.

Also, once you clone dot­files you might notice that you can’t see it. That’s because files that begin with a peri­od are hid­den by default. Make those files vis­i­ble by enter­ing the fol­low­ing com­mand into the terminal:

$ defaults write com.apple.finder AppleShowAllFiles YES

Step two: install ruby versions and gems

$ rbenv install 2.3.0
$ rbenv install 2.3.1

I use rbenv to man­age my Ruby ver­sions. I don’t have to man­u­al­ly set this up, because it’s already been done for me with dot­files. At the time of this writ­ing, I’m using Ruby 2.3.0 and 2.3.1.

Now, let’s install the gems I need in each Ruby version:

$ gem install bundler jekyll rails

Step three: clone atom-con­fig repo

# First, quit Atom.
# Then remove the current Atom config
$ rm -rf ~/.atom

# Now clone the Atom config from GitHub
$ git clone git@github.com:smithtimmytim/atom-config.git ~/.atom

My text edi­tor of choice is Atom. Which still kind of sur­pris­es me since I stuck to Sub­lime Text for so long. Atom is reg­u­lar­ly updat­ed, and has a very vibrant com­mu­ni­ty. Peo­ple con­tin­u­ous­ly make all sorts of plu­g­ins for it.

I’ve seen a lot of peo­ple have their Atom con­fig inside their dot­files repo, but I felt like hav­ing it as its sep­a­rate thing and that’s worked for me. atom-con­fig comes with all the obvi­ous things you’d think would come with a con­fig. I also use pack­age-sync to get all of my dif­fer­ent pack­ages down­loaded and installed in no time.

To me, the ease in which I can ver­sion con­trol my pref­er­ences is a big rea­son to use Atom. I did check in my Sub­lime con­fig, but it wasn’t as easy to main­tain, and it felt dumb to check in all the pack­ages I was using instead of hav­ing a sim­ple list of them. It’s a nit pick, but it’s the type of thing that makes or breaks a devel­op­er workflow.

Step Four: Create new SSH and GPG Keys

You’ll need an SSH and GPG key for lots of things, but I pri­mar­i­ly use mine for GitHub. Cre­at­ing a new SSH key is pret­ty easy. Here’s some doc­u­men­ta­tion on how to do that.

Now, for the GPG key. This isn’t as sim­ple, and hon­est­ly I don’t know how this works. I did some research on whether you’re sup­posed to cre­ate a new GPG key when you move machines or whether you’re sup­posed to migrate them, and was still con­fused. If you know more infor­ma­tion about this, I’d love to hear from you on Twit­ter.

Any­way, first you need to down­load the GPG com­mand line tools to cre­ate new keys. I down­load GnuPG for OS X. Once you’ve done that, you can fol­low the steps from the GitHub doc­u­men­ta­tion to cre­ate your new key and add it to GitHub.

You might be won­der­ing, what the hell is GPG? Well, that’s quite the hefty answer. I found this page to be very informative.

Step Five: Login to 1Password App

I’m shocked at how amaz­ing the set­up for this has become. Kel­ly and I are using 1Password Fam­i­lies, so set­ting up the app on a new machine is now as easy as scan­ning a QR code, inputting my mas­ter pass­word, and… that’s it. I’m still baf­fled at how easy it was.

At this point, 1Password is the gate to every­thing else. Once I have 1Password installed and set­up, I now have access to all of my soft­ware license codes, web­site logins, and a whole lot more.

Step Six: Login to Dropbox App

I run most of my sys­tem through Drop­box. I pay for the Pro plan which get’s me a ter­abyte of space. I think the only things I don’t have on Drop­box are the sites and projects I work on, because all of that is on GitHub. Doing things this way is pret­ty con­ve­nient, and helps me take all my impor­tant files to the new computer.

How­ev­er, the ini­tial set­up of this is not fun. Because Drop­box on the Mac cur­rent­ly down­loads all of your files local­ly, when you first do this, it can take days to sync. This isn’t ide­al because some files are more impor­tant than oth­ers at the begin­ning. I want to have my Alfred pref­er­ences, or my Key­board Mae­stro macros first. But to do that, I have to go through the night­mare of set­ting up selec­tive sync and then redo­ing it once the right files have down­loaded. Even­tu­al­ly — who the hell knows when — Drop­box will launch Project Infi­nite for every­one. That’ll solve this prob­lem and more.

All this being said, it doesn’t mean you shouldn’t have a back­up! I use Time Machine to keep back­ups just in case things get wonky. Drop­box has lost files of mine before, so I like to have a plan b. The Sweet Setup’s advice on this top­ic is wise.

Conclusion

In sum­ma­ry, this set­up process is pret­ty awe­some. Automat­ing things like this saves so much time, and gets me cod­ing quick­er. I’m lov­ing my new Mac, and a large part of it, is that set­ting it up was headache free. If you decide to use this, I’d love to hear about it! If you need help, don’t hes­i­tate to get in touch.

Enjoy your new Mac!