-
Notifications
You must be signed in to change notification settings - Fork 32
/
install-utils.zsh
executable file
·86 lines (61 loc) · 1.4 KB
/
install-utils.zsh
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
#!/bin/zsh -e
typeset -A ubuntu_pkg
ubuntu_pkg[pcre]=libpcre3-dev
ubuntu_pkg[zlib]=libz-dev
ubuntu_pkg[readline]=libreadline-dev
ubuntu_pkg[ncurses]=ncurses-dev
ubuntu_pkg[sqlite]=libsqlite3-dev
ubuntu_pkg[uuid]=uuid-dev
# versions
# prepare
DOWNLOAD=/tmp
SRC=~/.local/src
mkdir -p $DOWNLOAD
mkdir -p $SRC
cd $SRC
# zsh config
setopt extended_glob # expand *(xx)
setopt equals # expand =program
setopt magic_equal_subst # expand xx=~yy
# functions
info() {
echo "\e[1;34m++++ $*\e[m"
}
error() {
echo "\e[1;31m!!! $*\e[m"
exit 1
}
bin() {
[[ -n ${commands[$1]} ]]
}
# prepend PATH
[[ $PATH =~ ~/.local/bin ]] && PATH=~/.local/bin:$PATH
# download
clone() {
[[ -d $2 ]] || git clone $1 $2
}
clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
mkdir -p ~/Dev/Bin
clone https://github.com/hugsy/gef ~/Dev/Bin/gef
clone https://github.com/zachriggle/pwndbg ~/Dev/Bin/pwndbg
clone https://github.com/Gallopsled/pwntools ~/Dev/Bin/pwntools
# install
install_system_pkgs() {
info apt-get install ${(v)ubuntu_pkg}
read
}
install_haskell() {
# stack
curl -sSL https://get.haskellstack.org/ | sh
# structred-haskell-mode
stack install structured-haskell-mode
# intero
# git clone https://github.com/commercialhaskell/intero
# cd intero && stack build && stack install
}
preexec() {
echo "\e[1;33m== $2\e[m"
}
((${1+1})) && "$@"
#install_stack
#install_system_pkgs