blob: cf9f6c33adcbf0a47e1d7189f8774e3723430b2b (
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
|
# 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 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
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
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
ln -sf ~/.rc/.config/htop/htoprc ~/.config/htop/htoprc
ln -sf ~/.rc/.config/wtf/config.yml ~/.config/wtf/config.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 /usr/local/bin/bash >> /etc/shells'
chsh -s /usr/local/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
git clone https://github.com/danielmiessler/SecLists.git ~/SecLists
sudo mv ~/SecLists /usr/share/
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
```
## Languages
- Setup ruby/rbenv
```bash
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 rust
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
- Setup node/nvm
```bash
mkdir -p ~/.nvm
ln -sf ~/.rc/.npmrc ~/.npmrc
ln -sf ~/.rc/.nvmrc ~/.nvmrc
ln -sf ~/.rc/.nvm/default-packages ~/.nvm/default-packages
nvm install
nvm alias default
```
## Tools
- Git Crypt
```bash
brew install git-crypt
source ~/.bash_profile
git-crypt unlock
```
- Setup tmux plugins
```bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
brew install ansifilter
```
- 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
```
- [POW](http://pow.cx/)
```bash
# Install pow
curl get.pow.cx | sh
ln -sf ~/.rc/.powconfig ~/.powconfig
# Uninstall pow
curl get.pow.cx/uninstall.sh | sh
```
|