summaryrefslogtreecommitdiffstats
path: root/README.md
blob: a853c542eded7a7757f0905b46766b3fd87749e2 (plain) (blame)
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
191
192
193
194
195
196
197
# Prerequisites :

## MacOS
Install xcode and homebrew

```bash
xcode-select --install
git clone https://git.sr.ht/~a14m/.rc ~/.rc
cd ~/.rc

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew analytics off
brew tap Homebrew/bundle
brew bundle
```
## Debian Linux
- Add missing dependencies
```bash
sudo apt update -y
sudo apt upgrade -y
sudo apt install scdaemon vim htop tmux pass pass-extension-otp git-crypt pinentry-tty -y
git clone https://git.sr.ht/~a14m/.rc ~/.rc
ln -sf ~/.rc/.bashrc ~/.bashrc

sudo ln -sf /usr/bin/pinentry-tty /usr/local/bin/pinentry-tty
ln -sf ~/.rc/.gnupg/gpg.conf ~/.gnupg/gpg.conf
```

# Installation :

## Essentials
```bash
ln -sf ~/.rc/.bash_profile ~/.bash_profile
ln -sf ~/.rc/.editorconfig ~/.editorconfig
ln -sf ~/.rc/.inputrc ~/.inputrc
ln -sf ~/.rc/.netrc ~/.netrc
ln -sf ~/.rc/.screenrc ~/.screenrc
ln -sf ~/.rc/.terraformrc ~/.terraformrc
ln -sf ~/.rc/.tmux.conf ~/.tmux.conf
ln -sf ~/.rc/.tmux-osx.conf ~/.tmux-osx.conf
chmod 600 ~/.netrc
chmod 600 ~/.terraformrc

ln -sf ~/.rc/.gitconfig ~/.gitconfig
ln -sf ~/.rc/.gitignore_global ~/.gitignore_global

mkdir -p ~/.ssh
ln -sf ~/.rc/.ssh/config ~/.ssh/config

mkdir -p ~/.aws
ln -sf ~/.rc/.aws/config ~/.aws/config
ln -sf ~/.rc/.aws/credentials ~/.aws/credentials

mkdir -p ~/.config/htop ~/.config/wtf ~/.config/tmuxinator
ln -sf ~/.rc/.config/htop/htoprc ~/.config/htop/htoprc
ln -sf ~/.rc/.config/wtf/config.yml ~/.config/wtf/config.yml
ln -sf ~/.rc/.config/tmuxinator/vpn.yml ~/.config/tmuxinator/vpn.yml
ln -sf ~/.rc/.config/tmuxinator/ee.yml ~/.config/tmuxinator/ee.yml

git remote remove origin
git remote add origin [email protected]:~a14m/.rc
```

## GPG smart key
- GPG setup
```bash
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
ln -sf ~/.rc/.gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf
ln -sf ~/.rc/.gnupg/sshcontrol ~/.gnupg/sshcontrol

gpg-connect-agent killagent /bye
gpg-connect-agent updatestartuptty /bye
gpg-connect-agent /bye
gpgconf --kill all
```

- Load pgp key from card and trust it
```bash
gpg --edit-card
> fetch

gpg --edit-key [email protected]
> trust
```

## MacOS (extras)
- Bash shell default
```bash
sudo bash -c 'echo $(brew --prefix)/bin/bash >> /etc/shells'
chsh -s $(brew --prefix)/bin/bash
```

## ParrotOS (extras)
```bash
# Allow ssh into the machine
ssh-add -L > ~/.ssh/authorized_keys
sudo ln -sf ~/.rc/etc/ssh/sshd_config /etc/ssh/sshd_config
sudo systemctl enable ssh

# Setup extra PenTools
## SecLists
git clone https://github.com/danielmiessler/SecLists.git ~/SecLists
sudo mv ~/SecLists /usr/share/

## Arsenal
git clone https://github.com/Orange-Cyberdefense/arsenal.git ~/arsenal
sudo mv ~/arsenal /usr/share/
cd /usr/share/arsenal/
python3 -m pip install -r requirements.txt

## searchsploit
sudo git clone https://github.com/offensive-security/exploitdb.git /opt/exploitdb
sudo ln -sf /opt/exploitdb/searchsploit /usr/local/bin/searchsploit
cp -n /opt/exploitdb/.searchsploit_rc ~/

## ffuf
sudo apt install ffuf -y

## dotdotpwn.pl
git clone https://github.com/wireghoul/dotdotpwn.git ~/dotdotpwn
sudo mv ~/dotdotpwn /opt/
```

## Languages

- Setup ruby/rbenv
```bash
brew install rbenv
mkdir -p ~/.bundle
ln -sf ~/.rc/.bundle/config ~/.bundle/config

git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
git clone https://github.com/sstephenson/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars
git clone https://github.com/tpope/rbenv-ctags.git ~/.rbenv/plugins/rbenv-ctags
git clone https://github.com/sstephenson/rbenv-default-gems.git ~/.rbenv/plugins/rbenv-default-gems
git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update

ln -sf ~/.rc/.gemrc ~/.gemrc
ln -sf ~/.rc/.rbenv/default-gems ~/.rbenv/default-gems
rbenv install $(cat ~/.rc/.rbenv/version)
ln -sf ~/.rc/.rbenv/version ~/.rbenv/version
```

- Setup python
```bash
brew install pyenv
mkdir -p ~/.pyenv
pyenv install $(cat ~/.rc/.pyenv/version)
ln -sf ~/.rc/.pyenv/version ~/.pyenv/version
```

- Setup GO
```bash
brew install golang
```

- Setup rust
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

- Setup node/nvm
```bash
brew install nvm
mkdir -p ~/.nvm
ln -sf ~/.rc/.npmrc ~/.npmrc
ln -sf ~/.rc/.nvmrc ~/.nvmrc
ln -sf ~/.rc/.nvm/default-packages ~/.nvm/default-packages
exec $SHELL -l

nvm install
nvm alias default
```

## Tools

- Git Crypt
```bash
brew install git-crypt
source ~/.bash_profile
cd ~/.rc
git-crypt unlock
```

- Setup password store
```bash
git clone [email protected]:a14m/.pass ~/.password-store
```

- [cht.st](https://github.com/chubin/cheat.sh)
```bash
curl https://cht.sh/:cht.sh | sudo tee /usr/local/bin/cht.sh
sudo chmod +x /usr/local/bin/cht.sh
brew install rlwrap
sudo apt install rlwrap xsel -y
```