-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-setup.sh
executable file
·66 lines (44 loc) · 1.71 KB
/
app-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
#!/bin/bash
echo "Installing applications..."
# See https://sipb.mit.edu/doc/safe-shell/
set -euf -o pipefail
grep -F '.bash_aliases' ~/.bashrc || \
echo '. ~/.bash_aliases' >> ~/.bashrc
grep -F '.bashrc.my' ~/.bashrc || \
echo '. ~/.bashrc.my' >> ~/.bashrc
grep -F '~/.bashrc' ~/.bash_profile || \
echo '. ~/.bashrc' >> ~/.bash_profile
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ln -v -s "$DIR"/{.gitconfig,.gitignore,.vimrc,.bash_aliases,.bashrc.my,vimp,.mplayer,.screenrc,.irbrc,.ctags,.my.cnf} ~/
crontab < .crontab
brew install git
brew install make curl wget htop unrar watch vim imagemagick rsync gifsicle asciinema mpv ffmpeg pgrep mtr tree jq ctags moreutils sqlite-utils shellcheck
brew install coreutils grep gnu-sed findutils
brew install fd ag fzf && /usr/local/opt/fzf/install
brew install bash bash-completion
BREW_BASH=$(brew --prefix)/bin/bash
sudo sh -c "echo $BREW_BASH >> /etc/shells"
chsh -s $BREW_BASH
# for the `www` alias
brew install nginx
git clone [email protected]:suzanshakya/nginx-server.git ~/src/nginx-server
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
function check_fzf_patch() {
source ~/.bashrc # load fzf that was installed above
local file=`source_location __fzf_history__ | awk '{print \$3}'`
if [ -z file ]; then
cat <<-EOF
__fzf_history__ function is not defined in the current shell; will not patch.
EOF
elif grep -F '# [email protected]: uniq history' $file; then
cat <<-EOF
fzf is already patched. It’s all good.
EOF
else
cat <<-EOF
++ Here is the file to patch: $file. Insert this line as appropriate:
tac | awk -F '^ *[0-9]+ ' '!x[\$2]++' | tac | # [email protected]: uniq history
EOF
fi
}
check_fzf_patch