-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-a-new-machine.sh
executable file
·132 lines (84 loc) · 3.74 KB
/
setup-a-new-machine.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# copy paste this file in bit by bit.
# don't run it.
echo "do not run this script in one go. hit ctrl-c NOW"
read -n 1
##############################################################################################################
### backup old machine's key items
mkdir -p ~/migration/home
cd ~/migration
# what is worth reinstalling?
brew leaves > brew-list.txt # all top-level brew installs
brew cask list > cask-list.txt
npm list -g --depth=0 > npm-g-list.txt
# then compare brew-list to what's in `brew.sh`
# comm <(sort brew-list.txt) <(sort brew.sh-cleaned-up)
# let's hold on to these
cp ~/.extra ~/migration/home
cp ~/.z ~/migration/home
cp -R ~/.ssh ~/migration/home
cp -R ~/.gnupg ~/migration/home
cp /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist ~/migration # wifi
cp -R ~/Library/Services ~/migration # automator stuff
cp -R ~/Documents ~/migration
cp ~/.gitconfig.local ~/migration
cp ~/.z ~/migration # z history file.
### end of old machine backup
##########################################################################################################
##############################################################################################################
### homebrew!
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# install all the things
sh brew.sh
sh brew-cask.sh
### end of homebrew
##############################################################################################################
##############################################################################################################
### install of common things
###
# Type `git open` to open the GitHub page or website for a repository.
npm install -g git-open
# fancy listing of recent branches
npm install -g git-recent
# better git diffs
npm install -g diff-so-fancy
# trash as the safe `rm` alternative
npm install --global trash-cli
# lint js-things
npm install -g eslint
# cli for optimizing images
npm install -g imageoptim-cli
# tiny care terminal - a little dashboard
npm install -g tiny-care-terminal
npm install -g git-standup
# install better nanorc config
# https://github.com/scopatz/nanorc
curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
# consider reusing your current .z file if possible. it's painful to rebuild :)
# z is hooked up in .bash_profile
# install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
##############################################################################################################
### remaining configuration
###
# go read mathias, paulmillr, gf3, alraa's dotfiles to see what's worth stealing.
# prezto and antigen communties also have great stuff
# github.com/sorin-ionescu/prezto/blob/master/modules/utility/init.zsh
# set up macOS defaults
# maybe something else in here https://github.com/hjuutilainen/dotfiles/blob/master/bin/osx-user-defaults.sh
sh .macos
# setup and run Rescuetime!
###
##########################################################################################################
##########################################################################################################
### symlinks to link dotfiles into ~/
###
# move git credentials into ~/.gitconfig.local http://stackoverflow.com/a/13615531/89484
# now .gitconfig can be shared across all machines and only the .local changes
# symlink it up!
sh symlink-setup.sh
# add manual symlink for .ssh/config
###
##############################################################################################################