-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdater.sh
executable file
·190 lines (141 loc) · 4.64 KB
/
updater.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/bash
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo -e '\n------------------------------------------------------------------- [!] Hardware\n'
lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
free -b | grep Mem | awk '{print "memory: " $2/1073741824 " GB"}'
echo -e '\n--------------------------------------------------------------------- [!] Ubuntu\n'
lsb_release -a
echo -e '\n'
uname -r
echo -e '\n'
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get autoremove -y
sudo apt-get clean -y
echo -e '\n'
sudo aptitude update -y
sudo aptitude upgrade -y
sudo aptitude clean -y
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo -e '\n------------------------------------------------------------------- [!] Hardware\n'
sysctl machdep.cpu | egrep 'core_count|thread_count|brand_string'
sysctl -n hw.memsize | awk '{print "memory: " $0/1073741824 " GB"}'
echo -e '\n---------------------------------------------------------------------- [!] macOS\n'
sw_vers
echo -e '\n'
sudo softwareupdate --schedule off
sudo softwareupdate --verbose --install --all
echo -e '\n'
mas upgrade
echo -e '\n'
brew update-reset
brew update
brew upgrade
brew cleanup
brew doctor
brew tap homebrew/cask
brew tap homebrew/cask-versions
brew tap homebrew/services
fi
if [ -d "$HOME/updater" ]; then
(
echo -e '\n-------------------------------------------------------------------- [!] updater\n'
cd $HOME/updater && \
git fetch --all && \
git rebase
)
fi
if [ -d "$HOME/dotfiles" ]; then
(
echo -e '\n------------------------------------------------------------------- [!] dotfiles\n'
cd $HOME/dotfiles && \
git stash && \
git fetch --all && \
git rebase && \
git stash pop
)
source ~/.zsh_aliases
source ~/.zsh_functions
tmux start-server \; source-file ~/.tmux.conf
fi
if [ -d "$HOME/dotfiles_work" ]; then
(
echo -e '\n-------------------------------------------------------------- [!] dotfiles_work\n'
cd $HOME/dotfiles_work && \
git fetch --all && \
git rebase
)
source ~/.zsh_work
fi
if [ -d "$HOME/vim-ide" ]; then
(
echo -e '\n-------------------------------------------------------------------- [!] vim-ide\n'
cd $HOME/vim-ide && \
git fetch --all && \
git rebase
)
vim +PluginInstall +qa
fi
if [ -d "$HOME/zsh-syntax-highlighting" ]; then
(
echo -e '\n---------------------------------------------------- [!] zsh-syntax-highlighting\n'
cd $HOME/zsh-syntax-highlighting && \
git fetch --all && \
git rebase
)
source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
if [ -d "$HOME/dracula_zsh" ]; then
(
echo -e '\n---------------------------------------------------------------- [!] dracula_zsh\n'
cd $HOME/dracula_zsh && \
git fetch --all && \
git rebase
)
fi
if [ -d "$HOME/dracula_iterm" ]; then
(
echo -e '\n-------------------------------------------------------------- [!] dracula_iterm\n'
cd $HOME/dracula_iterm && \
git fetch --all && \
git rebase
)
fi
if [ -d "$HOME/dracula_terminal_app" ]; then
(
echo -e '\n------------------------------------------------------- [!] dracula_terminal_app\n'
cd $HOME/dracula_terminal_app && \
git fetch --all && \
git rebase
)
fi
echo -e '\n---------------------------------------------------------------- [!] pip upgrade\n'
pip install --upgrade pip
echo -e '\n--------------------------------------------------------------- [!] pyenv update\n'
pyenv update
echo -e '\n'
pyenv activate jupyter
pip install --upgrade pip
pyenv deactivate
echo -e '\n'
pyenv activate tools
pip install --upgrade pip
pyenv deactivate
echo -e '\n---------------------------------------------------------------- [!] asdf update\n'
asdf update
asdf plugin-update --all
echo -e '\n------------------------------------------------------------------------ [!] npm\n'
npm i -g npm
echo -e '\n----------------------------------------------------------- [!] docker cleansing\n'
docker system prune -af
docker image prune -af
docker container prune -f
docker volume prune -af
echo -e '\n----------------------------------------------------------------- [!] omz update\n'
omz update
echo -e '\n--------------------------------------------------------------------- [!] rehash\n'
if [[ "$SHELL" == "/bin/zsh" ]]; then
rehash
elif [[ "$SHELL" == "/bin/bash" ]]; then
hash -r
fi