README.md 8.37 KB
Newer Older
Pedro Pombeiro's avatar
Pedro Pombeiro committed
1
2
3
4
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# Table of Contents

5
- [Table of Contents](#table-of-contents)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
6
- [Abstract](#abstract)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
7
8
9
- [Prerequisites](#prerequisites)
  - [Mac OS X](#mac-os-x)
  - [Linux Debian/Ubuntu](#linux-debianubuntu)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
10
11
12
13
14
15
- [Post-install procedure](#post-install-procedure)
  - [On a fresh installation - Linux](#on-a-fresh-installation---linux)
  - [On a fresh installation - Mac OS X](#on-a-fresh-installation---mac-os-x)
    - [After factory reset](#after-factory-reset)
    - [Mac OS X Settings](#mac-os-x-settings)
    - [Apps to install](#apps-to-install)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
16
17
18
19
20
- [Features](#features)
- [Misc](#misc)
  - [Profiling ZSH](#profiling-zsh)
  - [Useful software (not installed by default)](#useful-software-not-installed-by-default)
  - [Checklist before reinstall](#checklist-before-reinstall)
21
  - [Checklist after install](#checklist-after-install)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
22
23
24
25
- [Acknowledgments](#acknowledgments)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Pedro Pombeiro's avatar
Pedro Pombeiro committed
26
27
28
29
# Abstract

This dotfiles repo leverages [YADM](https://yadm.io/) as the dotfiles manager.

Pedro Pombeiro's avatar
Pedro Pombeiro committed
30
31
32
33
# Prerequisites

## Mac OS X

Pedro Pombeiro's avatar
Pedro Pombeiro committed
34
35
36
Log in to the App Store.

Install the YADM and the [Brew package manager](https://brew.sh/):
Pedro Pombeiro's avatar
Pedro Pombeiro committed
37
38
39

```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Pedro Pombeiro's avatar
Pedro Pombeiro committed
40
brew install yadm
Pedro Pombeiro's avatar
Pedro Pombeiro committed
41
42
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
43
Install dotfiles:
Pedro Pombeiro's avatar
Pedro Pombeiro committed
44
45

```shell
Pedro Pombeiro's avatar
Pedro Pombeiro committed
46
# Use HTTPS protocol for anonymous access
47
48
49
yadm clone --no-bootstrap https://gitlab.com/pedropombeiro/dotfiles.git && \
yadm config local.class Personal && \
yadm bootstrap
Pedro Pombeiro's avatar
Pedro Pombeiro committed
50
source ~/.zshrc.shared
Pedro Pombeiro's avatar
Pedro Pombeiro committed
51
52
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
53
See [Installation](#Installation) and then the [fresh install section](#on-a-fresh-installation---mac-os-x) below.
Pedro Pombeiro's avatar
Pedro Pombeiro committed
54
55
56
57

## Linux Debian/Ubuntu

```shell
58
sudo apt update && sudo apt install -y yadm
Pedro Pombeiro's avatar
Pedro Pombeiro committed
59
60
```

61
Install dotfiles:
Pedro Pombeiro's avatar
Pedro Pombeiro committed
62

Pedro Pombeiro's avatar
Pedro Pombeiro committed
63
```shell
64
65
66
67
68
69
70
71
# Use HTTPS protocol for anonymous access
yadm clone --no-bootstrap https://gitlab.com/pedropombeiro/dotfiles.git && \
yadm config local.class Personal && \
yadm bootstrap
source ~/.zshrc.shared
```

# Post-install procedure
72

73
```shell
Pedro Pombeiro's avatar
Pedro Pombeiro committed
74
75
# Symlink the dotfiles in Syncthing
~/.config/yadm/scripts/relink-dotfiles.sh
Pedro Pombeiro's avatar
Pedro Pombeiro committed
76
77
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
78
79
80
81
82
83
84
85
## On a fresh installation - Linux

```shell
# Verify you can connect to github and gitlab with the generated SSH keys:
ssh -T git@github.com
ssh -T git@gitlab.com
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
86
## On a fresh installation - Mac OS X
Pedro Pombeiro's avatar
Pedro Pombeiro committed
87

Pedro Pombeiro's avatar
Pedro Pombeiro committed
88
### After factory reset
Pedro Pombeiro's avatar
Pedro Pombeiro committed
89
90
91
92
93
94

1. Install any OS upgrade
1. Install XCode from the App Store. Open it and accept the T&C.
1. Run the steps below

```shell
95
# Verify you can connect to github and gitlab with the generated SSH keys:
Pedro Pombeiro's avatar
Pedro Pombeiro committed
96
97
98
99
ssh -T git@github.com
ssh -T git@gitlab.com
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
100
101
102
103
104
105
1. After doing the first sync with Syncthing, restore Mackup backup:

```shell
mackup restore
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
106
### Mac OS X Settings
Pedro Pombeiro's avatar
Pedro Pombeiro committed
107
108

- Change the computer name
109
- Change the default terminal font to 'MesloLGS NF'
Pedro Pombeiro's avatar
Pedro Pombeiro committed
110
111
112
113
114
- [Disable notifications when screen is off](https://www.jeffgeerling.com/blog/2016/external-display-waking-disable-notifications-when-your-screen)
- Disable Location Services
- Set keyboard shortcuts
  - Set the change input source shortcuts

Pedro Pombeiro's avatar
Pedro Pombeiro committed
115
### Apps to install
Pedro Pombeiro's avatar
Pedro Pombeiro committed
116

Pedro Pombeiro's avatar
Pedro Pombeiro committed
117
118
- Installed via brew:
  - [1Password](https://1password.com/downloads/mac/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
119
  - [Alfred](https://www.alfredapp.com/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
120
  - [Beyond Compare](https://scootersoftware.com/download.php)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
121
  - [Boom 3D](https://www.globaldelight.com/boom/)
122
  - [Camera Live](https://github.com/v002/v002-Camera-Live)
123
  - [Croc file transfer](https://github.com/schollz/croc)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
124
  - [Dash](https://kapeli.com/dash)
125
  - [Docker](https://www.docker.com/products/docker-desktop)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
126
127
128
  - [Dropbox](https://www.dropbox.com/install)
  - [Fork Git client](https://git-fork.com/update/files/Fork.dmg)
  - [Google Chrome](https://www.google.com/chrome/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
129
  - [iTerm2](https://www.iterm2.com/downloads.html)
130
  - [Kap](https://getkap.co/)
131
  - [KeePassXC](https://keepassxc.org/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
132
133
  - [Krisp](https://krisp.ai/)
  - [LibreOffice](https://www.libreoffice.org/download/download/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
134
  - [Little Snitch](https://www.obdev.at/products/littlesnitch/download.html)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
135
  - [Mac App Store command line interface](https://github.com/mas-cli/mas)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
136
  - [Mackup](https://github.com/lra/mackup)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
137
  - [Microsoft Edge](https://www.microsoft.com/en-us/edge)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
138
  - [Muzzle](https://muzzleapp.com/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
139
  - [Numi](https://numi.io/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
140
  - [P4Merge](https://www.perforce.com/products/helix-core-apps/merge-diff-tool-p4merge)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
141
142
143
144
145
146
147
  - [Plex](https://www.plex.tv/media-server-downloads/#plex-app)
  - [ProtonMail Bridge](https://protonmail.com/bridge/install)
  - [ProtonVPN](https://protonvpn.com/download)
  - [Skype](https://www.skype.com/en/get-skype/)
  - [Slack](https://slack.com/downloads)
  - [Spotify](https://www.spotify.com/download/mac)
  - [Syncthing](https://syncthing.net/downloads/)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
148
  - [switchaudio-osx](https://github.com/deweller/switchaudio-osx)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
149
150
151
  - [TripMode 2](https://www.tripmode.ch/)
  - [Visual Studio Code](https://code.visualstudio.com/Download)
- Installed via mas-cli:
152
  - Amphetamine ([App Store](https://apps.apple.com/us/app/amphetamine/id937984704))
Pedro Pombeiro's avatar
Pedro Pombeiro committed
153
154
155
156
157
158
159
  - Annotate ([App Store](https://apps.apple.com/us/app/annotate-text-emoji-stickers-shapes-on-photos-screenshots/id994933038))
  - Keynote ([App Store](https://apps.apple.com/us/app/keynote/id409183694))
  - Numbers ([App Store](https://apps.apple.com/us/app/numbers/id409203825))
  - Pages ([App Store](https://apps.apple.com/us/app/pages/id409203825))
  - Pocket ([App Store](https://apps.apple.com/us/app/pocket/id568494494))
  - Simplenote ([App Store](https://apps.apple.com/us/app/simplenote/id692867256))
  - Toggl Desktop ([App Store](https://apps.apple.com/us/app/toggl-time-tracker-for-work/id957734279))
160
  - Time Out - Break Reminders ([App Store](https://apps.apple.com/us/app/time-out-break-reminders/id402592703))
Pedro Pombeiro's avatar
Pedro Pombeiro committed
161
162
  - TweetDeck ([App Store](https://apps.apple.com/us/app/tweetdeck-by-twitter/id485812721))
  - WhatsApp ([App Store](https://apps.apple.com/us/app/whatsapp-desktop/id1147396723))
Pedro Pombeiro's avatar
Pedro Pombeiro committed
163
164
- [Elgato Control Center](https://www.elgato.com/en/gaming/downloads)
- [Microsoft To Do](https://todo.microsoft.com/tasks/)
165
- [Oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) (installed via curl/git clone)
166
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
167
168
169
170
171
- GitLab-specific:
  - [Install GitLink](https://plugins.jetbrains.com/plugin/8183-gitlink)

Setup the following apps:

Pedro Pombeiro's avatar
Pedro Pombeiro committed
172
- Beyond Compare (import settings backup and install command line tools)
Pedro Pombeiro's avatar
Pedro Pombeiro committed
173
174
175
176
- Dropbox
- Password application
  - 1Password
  - MacPass
177
- Syncthing
Pedro Pombeiro's avatar
Pedro Pombeiro committed
178
- Time Machine
Pedro Pombeiro's avatar
Pedro Pombeiro committed
179
- Microsoft Edge
180
- Visual Studio Code
181
  - Enable settings sync
Pedro Pombeiro's avatar
Pedro Pombeiro committed
182
- Printers
183
184
- Time Out
  - Name: Pomodoro
185
186
  - Pomodoro time: 20m
  - Break time: 1m
187
188
189
190
  - Theme: Muscles
  - Show button to postpone: 1 minutes
  - Show button to postpone: 5 minutes
  - Show button to skip break
Pedro Pombeiro's avatar
Pedro Pombeiro committed
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

# Features

- [fzf](https://github.com/junegunn/fzf): fuzzy file finder. To use it on the command line, prefix with `**`, then press tab. For instance: `vim **<TAB>`.
- [autojump](https://github.com/wting/autojump): a cd commands that learns
  about your favorite directories.

# Misc

## Profiling ZSH

Use `zprof`:

```shell
# At the beginning of your file, e.g. zshrc
zmodload zsh/zprof

...

# At the end:
zprof
```

## Useful software (not installed by default)

## Checklist before reinstall

- Backup SSH keys
- Check each app for backup
- Backup hidden files in repo
- Backup `/Library/`
- Backup `~/Library/`
- Make sure branches in repo are pushed
- Search for "what folders to backup"
- Search for "checklist before factory reset"
- Make sure iCloud sync is finished (check status bar in Finder)
- What's most important? Is it backed up?

229
230
## Checklist after install

Pedro Pombeiro's avatar
Pedro Pombeiro committed
231
232
- Add Terminal, iTerm, Visual Studio Code, RubyMine, and GoLand to `System Preferences/Security & Privacy/Privacy/Developer Tools` list, to avoid Apple notarisation checks that cause slowdowns.
- Configure [`$HOME/.git-peek`](https://awesomeopensource.com/project/Jarred-Sumner/git-peek#private-repositories--choosing-an-editor)
233
- `ln -sf ~/Sync/pedro/Briefcase/Backups/MBP16/.pry_history ~/.pry_history` to keep IRB terminal history synced
234

235
236
237
238
239
240
241
242
243
244
## Useful commands

### Use vim in YADM Git context

Running vim from inside yadm ensures that integration with fzf.vim works correctly, and the Git worktree is correctly configured:

```shell
yadm enter vim
```

Pedro Pombeiro's avatar
Pedro Pombeiro committed
245
246
247
# Acknowledgments

- [holman](https://github.com/holman/dotfiles)
248
249
- [thoughtbot](https://github.com/thoughtbot/dotfiles)
- [conf.d like directories for zsh/bash dotfiles](https://chr4.org/blog/2014/09/10/conf-dot-d-like-directories-for-zsh-slash-bash-dotfiles/)