-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·139 lines (120 loc) · 3.47 KB
/
setup.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
133
134
135
136
137
138
#!/bin/bash
set -e
DOTFILES_DIR=~/.dotfiles
function homebrew() {
echo ">"
echo "> Installing Brewfile"
brew bundle
}
function pip() {
echo ">"
echo "> Install python packages"
pip3 install mkdocs
pip3 install mkdocs-gitbook
pip3 install --upgrade gimme-aws-creds
}
function terraform() {
echo ">"
echo "> Installing terraform versions"
mkdir -p ~/.terraform.d/plugin-cache
tfenv install 1.0.0
tfenv install 0.15.3
tfenv install 0.13.4
tfenv install 0.12.29
tfenv install 0.11.11
tfenv use 1.0.0
}
function sdkman() {
echo ">"
echo "> Installing sdkman"
curl -s "https://get.sdkman.io" | bash
}
function gitconfig() {
echo ">"
echo "> Setting up gitconfig"
git config --global alias.lg 'log --graph --abbrev-commit --decorate --date=relative'
git config --global alias.lgs 'log --graph --oneline --decorate --date=relative --all'
git config --global alias.amend 'commit --amend --no-edit'
git config --global --replace-all user.name 'Gavin Bunney'
git config --global --replace-all user.email '409207+gavinbunney@users.noreply.github.com'
git config --global commit.gpgsign false
git config --global pull.rebase true
git config --global rebase.autoStash true
git config --global push.default simple
git config --global --replace-all core.excludesfile '/Users/gbunney/.gitignore_global'
git config --global commit.message "${DOTFILES_DIR}/.gitmessage"
}
function max_files() {
echo ">"
echo "> Enabling higher max file/proc limits"
cat <<EOF | sudo tee /Library/LaunchDaemons/limit.maxfiles.plist > /dev/null
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string>524288</string>
<string>524288</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
EOF
cat <<EOF | sudo tee /Library/LaunchDaemons/limit.maxproc.plist > /dev/null
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxproc</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxproc</string>
<string>2048</string>
<string>2048</string>
</array>
<key>RunAtLoad</key>
<true />
<key>ServiceIPC</key>
<false />
</dict>
</plist>
EOF
sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
sudo chmod 644 /Library/LaunchDaemons/limit.maxproc.plist
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxproc.plist
}
function profile() {
echo ">"
echo "> Creating ~/.profile"
cat <<EOF > ~/.profile
#!/bin/bash
SHELL_ROOT=${DOTFILES_DIR}
for file in \$SHELL_ROOT/dotfiles.d/*; do
. \$file
done
EOF
}
homebrew
#pip
gitconfig
#terraform
sdkman
max_files
profile
echo ">"
echo "> Done!"