Skip to content

vs4vijay/dotfiles

Repository files navigation

dotfiles

SSH Public Keys: https://github.com/vs4vijay.keys

Bookmarklets

javascript:(() => {  
    const message = document.getSelection().toString().replace(/(<br>)|(<br\/>)/, '\n');
    fetch('https://ntfy.sh/vizext', { method: 'POST', body: message || window.location }); 
})();

Installation via Installer

# with curl
curl -s https://raw.githubusercontent.com/vs4vijay/dotfiles/master/installer.sh | bash -x
sh -c "$(curl -fsSL https://raw.github.com/vs4vijay/dotfiles/master/installer-for-win.sh)"

# with wget
wget https://raw.githubusercontent.com/vs4vijay/dotfiles/master/installer.sh -O - | bash -x
sh -c "$(wget -qO - https://raw.github.com/vs4vijay/dotfiles/master/installer-for-win.sh)"

Installation via Git

  • Install Terminator: sudo apt-get install terminator git
  • Open Terminator and Run following commands:
git clone git@github.com:vs4vijay/dotfiles.git
cd dotfiles
bash installer.sh

Another way to manage dotfiles

git init --bare ~/.dotfiles
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
config config status.showUntrackedFiles no

Pre-requisites

  • $TERM must be xterm-256color
  • $SHELL must be zsh

Tools used


Misc Tasks

  • Generate SSH Keys:
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "viz@soni"
  • Add to ~/.bashrc to auto attach to tmux
if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
  tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux
fi
  • Tmux Commands and Shortcut Keys

    • tmux new -s <session-name>
    • tmux ls
    • tmux attach -t <session-name>
    • + c - Create a window
    • + x - Kill current pane
    • + $ - Rename session
    • + , - Rename window
    • + d - Deattach
    • + w - List windows
    • + q - Show pane numbers
    • + ! - Break a pane to window
  • Configure Locale

sudo apt-get install locales
sudo dpkg-reconfigure locales
  • Use patched fonts on terminal
  • NerdFont
sudo apt-get install fonts-powerline

# OR

git clone --depth 1 https://github.com/powerline/fonts.git ~/fonts
bash ~/fonts/install.sh
rm -rf ~/fonts
  • Change current shell to zsh
chsh -s $(which zsh)

Misc Softwares and Tools

  • KDE Plasma Desktop Environment: sudo apt-get install kde-plasma-desktop plasma-nm
  • Yakuake Drop-down Terminal / Guake Terminal
  • Preload tool - sudo apt-get install preload
  • Clean up Apt - sudo apt-get clean && sudo apt-get autoremove --purge && sudo apt-get remove

Windows Specific

  • Windows Terminal + Cmder
    • cmd.exe /k M:\Tools\Cmder\vendor\init.bat
  • Winget
    • winget install Git.Git
    • winget install 7zip.7zip
    • winget install Python.Python.3.11
    • winget install OpenJS.NodeJS.LTS
    • winget install CoreyButler.NVMforWindows
    • winget install GoLang.Go.1.19
    • winget install Rustlang.Rustup
    • winget install Microsoft.WSL
    • winget install Microsoft.OpenJDK.17
    • winget install Notepad++.Notepad++
    • winget install Microsoft.VisualStudioCode
    • winget install Microsoft.VisualStudioCode.Insiders
    • winget install Microsoft.VisualStudio.2022.Enterprise
    • winget install Microsoft.VisualStudio.2022.BuildTools
    • winget install MSYS2.MSYS2
      • Add C:\msys64\usr\bin and C:\msys64\ucrt64\bin to PATH
      • NOT WORKING - setx PATH "%PATH%;C:\msys64\usr\bin;C:\msys64\ucrt64\bin"
      • Run commands:
        pacman -Syu
        pacman -Syyuu
        pacman -S zsh vim tmux
        pacman -S net-utils
        pacman -S compression
        pacman -S ncdu tree
        pacman -S mingw-w64-ucrt-x86_64-fzf mingw-w64-ucrt-x86_64-lsd mingw-w64-ucrt-x86_64-ag mingw-w64-ucrt-x86_64-jq
        pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain
        
        # pacman -S mingw-w64-ucrt-x86_64-SDL2 mingw-w64-ucrt-x86_64-SDL2_mixer
        # pacman -S mingw-w64-ucrt-x86_64-toolchain
        # pacman -S mingw-w64-ucrt-x86_64-gcc
        # pacman -S mingw-w64-x86_64-toolchain
        # pacman -S mingw-w64-ucrt-x86_64-tools-git
        
        # export MSYS=winsymlinks:nativestrict
    • winget install Microsoft.AzureCLI
    • winget install JetBrains.IntelliJIDEA.Community
    • winget install JetBrains.IntelliJIDEA.Ultimate.EAP
    • winget install neovim
    • winget install Microsoft.PowerToys
    • winget install Bruno.Bruno
    • winget install sysinternals
    • winget install VideoLAN.VLC
    • winget install magic-wormhole
    • winget install Google.PlatformTools
    • winget install Google.AndroidStudio
    • winget install RedHat.Podman
    • winget install -e --id RedHat.Podman-Desktop
    • winget install -e --id Adobe.Acrobat.Reader.64-bit
  • PowerToys
  • DevToys
  • Microsoft Terminal entry:
      {
        "commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 -use-full-path -shell zsh",
        "guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d115}",
        "icon": "C:/msys64/ucrt64.ico",
        "name": "Terminal",
        "startingDirectory": "C:/Users/%USERNAME%"
      },

WSL

[network]
generateResolvConf = false
  • /etc/resolv.conf
nameserver 1.1.1.1
  • Auto
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 1.1.1.1" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf

Security

  • Check if any wifi card supports monitor mode - iw list | grep -i monitor
  • Enable monitor mode on wifi card (If supported)
sudo ip dev

sudo ip link set wlan0 down
sudo iw wlan0 set monitor control
sudo ip link set wlan0 up
  
# OR

sudo ifconfig

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up
  
sudo iwconfig wlan0 mode managed

Containers

Setup Docker

curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $(whoami)
exit

# OR 

sudo apt install docker.io

Setup Wireguard VPN

  • Using algo
#!/usr/bin/env bash

export ONDEMAND_CELLULAR=true
export SSH_TUNNELING=true
curl -s https://raw.githubusercontent.com/trailofbits/algo/master/install.sh | sudo -E bash -x

Termux

pkg up -y

pkg install root-repo

pkg install aircrack-ng

Troubleshooting

  • Add apt source
sudo apt-add-repository 'deb http://myserver/path/to/repo stable myrepo'

# OR

sudo echo "deb <url>" | sudo tee -a /etc/apt/sources.list.d/<file>
  • Add gpg keys
curl -fsSL https://archive.kali.org/archive-key.asc | sudo apt-key add -

# OR

wget -O - https://re4son-kernel.com/keys/http/archive-key.asc | sudo apt-key add -

Work in-progress


git remote set-url origin <url>

https://github.com/sorin-ionescu/prezto


PyENV


set backspace=indent,eol,start

set nobackup
set nowritebackup
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time
set showcmd		" display incomplete commands
set incsearch		" do incremental searching


# Source a local zshrc if it exists
test -e "${HOME}/.zshrc.local" && source "${HOME}/.zshrc.local"


ln -sv “~/.dotfiles/git/.gitconfig” ~
ln -v


if [[ "$OSTYPE" != darwin* ]]; then
  echo "Mac"
fi


test -e "${HOME}/file" && source "${HOME}/file"
[[ -f $pub ]] || ssh-keygen -t ed25519


[ "${SHELL##/*/}" != "zsh" ] && echo 'You might need to change default shell to zsh: `chsh -s /bin/zsh`'


# Don't put duplicate lines in the history.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups:erasedups

# Ignore some controlling instructions
# HISTIGNORE is a colon-delimited list of patterns which should be excluded.
#         The '&' is a special pattern which suppresses duplicate entries.
export HISTIGNORE=$'[ \t]*:&:[fb]g:exit:ls:clear'

# Export hostory to a different file
export HISTFILE="${HOME}/.history/${CURRENT_SHELL}.history.txt"


alias change_tor_ip="printf 'AUTHENTICATE "password"\r\nSIGNAL NEWNYM\r\n' | nc 127.0.0.1 9051"
alias change_tor_ip="sudo killall -HUP tor"


bold=$(tput bold)
norm=$(tput sgr0)


Icons:
https://avatars3.githubusercontent.com/u/11850518?s=200&v=4
https://avatars3.githubusercontent.com/u/65011256?s=200&v=4
  
magic-wormhole