My Dot Files

Published Nov 19, 2021

Contents

Introduction

The configs are intentionally simple. I usually try to use the default configuration as much as possible, so I can easily switch between different computers without spending time configuring each of them. Also, I'm not too fond of code or configuration that I don't understand. It might do magical things, but when things go awry, which they do, I need to be able to fix it.

.zshrc

# PATH
export PATH=/opt/homebrew/opt/node@16/bin:/opt/homebrew/bin:/opt/homebrew/sbin:~/go/bin:$PATH

# PATH TO oh-my-zsh
export ZSH=$HOME/.oh-my-zsh

# THEME
#ZSH_THEME=""

# PLUGINS
#plugins=()

# SOURCE ZSH
source $ZSH/oh-my-zsh.sh

# ALIASES
alias ll="ls -la"
alias cleanmymac="brew update && brew upgrade && brew cleanup && brew doctor"
alias cleancahce="rm -rf ~/Library/Caches 2> /dev/null"
alias findgit="find . -type f -name config -not -path node_modules -exec grep -H github {} \; 2> /dev/null"

.vimrc

" https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
Plug 'kien/ctrlp.vim'
Plug 'airblade/vim-gitgutter'
Plug 'dracula/vim', { 'as': 'dracula' }
call plug#end()
" Theme
syntax on
syntax enable
colorscheme dracula
" Sets how many lines of history VIM has to remember
set history=500
" Make Vim more useful
set nocompatible
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
set clipboard=unnamed
" Enhance command-line completion
set wildmenu
" Allow cursor keys in insert mode
set esckeys
" Allow backspace in insert mode
set backspace=indent,eol,start
" Optimize for fast terminal connections
set ttyfast
" Add the g flag to search/replace by default
set gdefault
" Use UTF-8 without BOM
set encoding=utf-8 nobomb
" Change mapleader
let mapleader=","
" Don't create backups when editing files in certain directories
set backupskip=/tmp/*,/private/tmp/*
set nobackup
set nowb
set noswapfile
" Respect modeline in files
set modeline
set modelines=4
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Enable line numbers
set number
" Highlight current line
set cursorline
" Convert tabs to spaces
set expandtab
" Make tabs as wide as two spaces
set tabstop=2
" Show invisible characters
set list
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
" Highlight searches
set hlsearch
" Ignore case of searches
set ignorecase
" Highlight dynamically as pattern is typed
set incsearch
" Auto indent
set autoindent
" Always show status line
set laststatus=2
" Enable mouse in all modes
set mouse=a
" Disable error bells
set noerrorbells
" Don't reset cursor to start of line when moving around.
set nostartofline
" Show the cursor position
set ruler
" Don't show the intro message when starting Vim
set shortmess=atI
" Show the current mode
set showmode
" Show the filename in the window titlebar
set title
" Show the (partial) command as it's being typed
set showcmd
" Wrap
set wrap
" Linebreak
set linebreak

.gitconfig

[user]
  name = example
  email = example@email.com
[init]
  defaultBranch = main
[alias]
  l = log --pretty=oneline --graph --abbrev-commit
  s = status -s
  co  = checkout
  cob = checkout -b
  f   = fetch -p
  ba  = branch -a
  bd  = branch -d
  bD  = branch -D
  dc  = diff --cached

vscode settings.json

{
  "window.restoreFullscreen": true,
  "window.newWindowDimensions": "maximized",
  "terminal.integrated.fontSize": 15,
  "editor.tabSize": 2,
  "editor.fontSize": 15,
  "editor.insertSpaces": true,
  "editor.wordWrap": "on",
  "editor.tabCompletion": "on",
  "editor.cursorStyle": "block",
  "editor.cursorBlinking": "solid",
  "editor.matchBrackets": "never",
  "editor.renderWhitespace": "trailing",
  "editor.glyphMargin": false,
  "editor.parameterHints.enabled": false,
  "editor.hideCursorInOverviewRuler": true,
  "editor.snippetSuggestions": "top",
  "editor.minimap.enabled": false,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.guides.bracketPairs": "active",
  "editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",

  "workbench.startupEditor": "none",
  "workbench.settings.editor": "json",
  "workbench.settings.useSplitJSON": true,
  "workbench.editor.enablePreview": false,
  "workbench.editor.untitled.hint": "hidden",
  "workbench.iconTheme": "material-icon-theme",

  "breadcrumbs.enabled": false,
  "extensions.ignoreRecommendations": true,
  "diffEditor.ignoreTrimWhitespace": false,
  "telemetry.telemetryLevel": "off"
}

brew

#!/bin/bash

echo "$(uname) detected."

echo;echo;echo "Installing tools (part 1)"
if [ "$(uname)" == "Darwin" ]; then
  xcode-select --install
  if ( ! command -v brew &> /dev/null ); then
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    brew analytics off && brew analytics state
  fi
  brew update
  brew upgrade
  brew install jq
  brew install git
  brew install tmux
  brew install go
  brew install php
  brew install nvm
  brew install ruby
  brew install grep
  brew install curl
  brew install wget
  brew install netcat
  brew install whois
  brew install openvpn
  brew install openssl
  brew install awscli
  brew install mysql
  brew install postgresql
  brew install node@16
  brew install yarn
  brew install deno
  brew tap mongodb/brew && brew install mongodb-community@5.0
  brew install --cask lulu
  brew install --cask netiquette
  brew install --cask do-not-disturb
  brew install --cask 1password
  brew install --cask electrum
  brew install --cask ledger-live
  brew install --cask protonvpn
  brew install --cask mullvadvpn
  brew install --cask tunnelblick
  brew install --cask tor-browser
  brew install --cask firefox
  brew install --cask google-chrome
  brew install --cask istat-menus
  brew install --cask the-unarchiver
  brew install --cask folx
  brew install --cask vlc
  brew install --cask spotify
  brew install --cask signal
  brew install --cask telegram
  brew install --cask discord
  brew install --cask balenaetcher
  brew install --cask iterm2
  brew install --cask visual-studio-code
  brew install --cask postman
  brew install --cask docker
  brew install --cask wireshark
  brew install --cask burp-suite
  brew install --cask pgadmin4
  brew install --cask mysqlworkbench
  brew install --cask mongodb-compass
  npm i -g npm@latest
elif [ "$(uname)" == "Linux" ]; then
  sudo apt update -y
  sudo apt upgrade -y
  sudo apt install -y jq
  sudo apt install -y git
  sudo apt install -y g++
  sudo apt install -y gcc
  sudo apt install -y make
  sudo apt install -y tmux
  sudo apt install -y whois
  sudo apt install -y openvpn
  sudo apt install -y net-tools
  sudo apt install -y ruby-full
  sudo apt install -y python3-pip
  sudo apt install -y build-essential
  sudo apt install -y golang
  sudo apt install -y awscli
  sudo apt install -y tor
  sudo apt install -y proxychains
else
  exit
fi
echo "DONE"

rm -rf ~/tools
mkdir ~/tools && cd ~/tools

echo;echo;echo "Installing tools (part 2)"
if [ "$(uname)" == "Darwin" ]; then
  brew install nmap
  brew install masscan
  brew install john-jumbo
  brew install hydra
  brew install exploitdb
fi
if [ "$(uname)" == "Linux" ]; then
  sudo apt install -y nmap
  sudo apt install -y masscan
  sudo apt install -y john
  sudo apt install -y hydra
  sudo apt install -y exploitdb
fi
if [[ "$(uname)" == "Darwin" || "$(uname)" == "Linux" ]]; then
  go install github.com/OWASP/Amass/v3/...@master
  go install github.com/ffuf/ffuf@latest
  go install github.com/OJ/gobuster/v3@latest
  go install github.com/tomnomnom/gf@latest
  go install github.com/tomnomnom/fff@latest
  go install github.com/tomnomnom/meg@latest
  go install github.com/tomnomnom/waybackurls@latest
  go install github.com/projectdiscovery/dnsx/cmd/dnsx@latest
  go install github.com/projectdiscovery/httpx/cmd/httpx@latest
  go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest
  go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
  go install github.com/projectdiscovery/interactsh/cmd/interactsh-client@latest
  go install github.com/KathanP19/Gxss@latest
  go install github.com/hahwul/dalfox/v2@latest
  go install github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest

  git clone --depth 1 https://github.com/sqlmapproject/sqlmap sqlmap-dev && cd ~/tools
  git clone https://github.com/codingo/NoSQLMap && cd ~/NoSQLMap && python setup.py install && cd ~/tools
  git clone https://github.com/sullo/nikto
  git clone https://github.com/Dionach/CMSmap && cd CMSmap && pip3 install . && cd ~/tools
  git clone https://github.com/Tuhinshubhra/CMSeeK && cd CMSeeK && pip3 install -r requirements.txt && cd ~/tools
  git clone https://github.com/obheda12/GitDorker && cd GitDorker && pip3 install -r requirements.txt && cd ~/tools
  git clone https://github.com/s0md3v/Corsy && cd Corsy && pip3 install requests && cd ~/tools
  git clone https://github.com/EnableSecurity/wafw00f && cd wafw00f && python3 setup.py install && cd ~/tools
  git clone https://github.com/s0md3v/Arjun && cd Arjun && python3 setup.py install && cd ~/tools
  git clone https://github.com/devanshbatham/ParamSpider
  git clone https://github.com/devanshbatham/OpenRedireX
  git clone https://github.com/epinna/tplmap
  git clone https://github.com/defparam/smuggler
  git clone https://github.com/commixproject/commix
  git clone https://github.com/danielmiessler/SecLists
  git clone https://github.com/projectdiscovery/nuclei-templates

  curl "https://gitlab.com/kalilinux/packages/wordlists/-/raw/kali/master/rockyou.txt.gz?inline=false" -o rockyou.txt.gz && \
    gunzip rockyou.txt.gz
  curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
    chmod 755 msfinstall && \
    ./msfinstall

  sudo gem install wpscan
fi
echo "DONE"

echo;echo;echo "Cleaning..."
if [ "$(uname)" == "Darwin" ]; then
  brew update && brew upgrade && brew cleanup && brew doctor
  rm -rf ~/Library/Caches 2> /dev/null
  echo "Manually configure: Siri, Dock & Menu Bar, Keyboard, Trackpad, Sharing, Battery"
elif [ "$(uname)" == "Linux" ]; then
  sudo apt autoremove -y && sudo apt autoclean -y && sudo apt clean
else
  exit
fi
echo "DONE"