Skip to content

Instantly share code, notes, and snippets.

@ryantuck
Last active August 16, 2021 19:49
Show Gist options
  • Save ryantuck/73b8df1b2aa728af01bc47ac364a205a to your computer and use it in GitHub Desktop.
Save ryantuck/73b8df1b2aa728af01bc47ac364a205a to your computer and use it in GitHub Desktop.
instructions on setting up a new osx machine

1Password

Download and install 1Password before doing anything else.

keyboard

key bindings

Download karabiner-elements: https://pqrs.org/osx/karabiner/

Map caps lock to ctrl / esc, and esc to shift+cmd

More detailed discussion here: pqrs-org/Karabiner-Elements#8

Add the following to ~/.config/karabiner/karabiner.json (path created only once Karabiner Elements app is opened):

https://gist.github.com/ryantuck/2fd48d0568e6fec4059c282d5a53f699

key repeat rate

Requires restart to take effect.

defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1

disable silly accented characters dialog box on keypress

Requires restart to take effect.

defaults write -g ApplePressAndHoldEnabled -bool false

remove ridiculous defaults

System Preferences > Keyboard > Text

  • uncheck 'Capitalize words automatically'
  • uncheck 'Add period with double-space'
  • uncheck 'Use smart quotes and dashes'
  • remove 'omw' = 'On my way!' replacement

brew

get brew http://brew.sh/

brew install git python vim tmux node pyenv direnv

vim

git clone git@github.com:VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim
:PluginInstall

pyenv

brew install pyenv
pyenv install 3.9.6
pyenv global 3.9.6

Add the following to ~/.zshrc:

eval "$(pyenv init --path)"

git

git config --global user.name "Joe Schmo"
git config --global user.email "joe.schmo@gmail.com"

tmux

system clipboard

i have the following line in my .tmux.conf file:

# use system clipboard
set-option -g default-command "reattach-to-user-namespace -l bash"

and so i need to do the following to get tmux working out of the box on a mac:

brew install reattach-to-user-namespace

ssh keys

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

aws

pip install awscli

Ensure the following files are populated (assumes rt is default profile):

# ~/.aws/credentials
[rt]
aws_access_key_id = xxx
aws_secret_access_key = xxx
# ~/.aws/config
[profile rt]
region = us-east-1
output = json

And you set the appropriate environment variable:

export AWS_PROFILE="rt"

docker

get docker for mac. it's great. install takes 2 seconds and you're ready to rock.

https://download.docker.com/mac/stable/Docker.dmg

Or whatever the latest download links are provided at this thread: docker/docs#6910

Ctrl-P in docker

To ensure Ctrl-P works within containers, add the following to ~/.docker/config.json:

{
  ...
  "detachKeys": "ctrl-e,e",
  ...
}

ipython

pip install ipython

enable autoreload

Autoreload ensures you can work on python module logic and have the changes show up instantly in ipython.

Create a file at ~/.ipython/profile_default/ipython_config.py with the following lines:

c.InteractiveShellApp.extensions = ['autoreload']
c.InteractiveShellApp.exec_lines = ['%autoreload 2']

chrome

Extensions:

  • uBlock
  • Merge Windows
  • Open in new tab

Disable swipe-to-go-back (requires chrome restart after):

defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE

messages

Edit > Spelling and Grammar > Uncheck 'Correct Spelling Automatically' (phew)

terminal

osx-terminal-themes - Symfonic theme is neat.

fonts

droid sans mono

download, unzip, then:

open DroidSansMono.ttf

and select 'install font'.

postgres

brew install postgresql
brew services start postgresql
createdb ryan
psql -U ryan

Also be sure to edit the file at /usr/local/var/postgres/postgresql.conf to update any timezone settings to UTC.

etc

Python code formatter:

pip install black

Simpler man pages:

npm install -g tldr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment