Sync macOS ssh config with iCloud

As a developer, sometimes I have to restore backups due to β€œbeta” system issues.

Fortunately, most of the data is stored on servers these days. Not only Safari, Photos, Calendar, Notes, and Reminders, but also other apps use iCloud storage. This is a great improvement. I just need to reinstall apps from the App Store and brew shell after reinstalling the system.

But it’s annoying to set up SSH and configurations again. Plus, I might lose my private keys.

So I created a new folder named β€œmacOS” in the iCloud Drive folder and copied all the files without a β€œ.” to it. For example: .gitconfig ~> gitconfig.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cd ~
macOS=/Users/art/Library/Mobile\ Documents/com~apple~CloudDocs/macOS

ln -sf $macOS/gitignore .gitignore
ln -sf $macOS/gitignore .gitignore_global
ln -sf $macOS/gitconfig .gitconfig

ln -sf $macOS/zshrc .zshrc
ln -sf $macOS/config .config
ln -sf $macOS/ssh .ssh

mkdir -p Blog

# hexo
npm install hexo-cli -g
hexo init Blog
cd Blog
npm install
rm -rf source
ln -s ~/Documents/Blog/source ~/Blog/source

brew install ruby python pandoc

brew install openssl youtube-dl ffmpeg pyenv rbenv rclone autojump mp4box

# ruby
rbenv install 2.7.0
rbenv global 2.7.0

brew cask install iterm2 sourcetree vmware-fusion flux sublime-text shadowsocksx-ng clashx wwdc spectacle losslesscut iina dropbox typora istat-menus 1password calibre imageoptim plex-media-server vscode osxfuse firefox chromium

# preview
brew cask install qlvideo qlstephen qlcolorcode quicklook-json qlmarkdown qlprettypatch qlimagesize suspicious-package provisionql


Any cloud drive (such as Dropbox) can achieve this, but considering privacy and the information provided in this letter by Tim Cook to customers,

I choose iCloud 😊

Translated by gpt-3.5-turbo