diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..70ddc3c --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,124 @@ +#!/bin/bash + +## DOWNLOADED FROM GITHUB ## + +# My Alias + +# Software + +# ffmpeg Customs +alias mp4-mp3-folder='for vid in *.mp4; do ffmpeg -i "$vid" -f mp3 -ab 32000 "${vid%.mp4}.mp3"; done' +alias mkv-mp4-folder='for vid in *.mkv; do ffmpeg -i "$vid" -vcodec copy -acodec copy "${vid%.mkv}.mp4"; done' +alias mkv-mp4='mkvmp4(){ ffmpeg -i "$1" -vcodec copy -acodec copy "${1%.mkv}.mp4"; unset -f mkvmp4;}; mkvmp4' +alias mp4-mp3='mp4mp3(){ ffmpeg -i "$1" -f mp3 -ab 32000 "${1%.mp4}.mp3"; unset -f mp4mp3;}; mp4mp3' + +# When you get bored +alias telnet-starwars='telnet towel.blinkenlights.nl' +alias nethack-online='ssh nethack@nethack.alt.org ; clear' +alias tron-online='ssh sshtron.zachlatta.com ; clear' + +# My IP Info +alias myip='MYIP=$(curl -s http://ipecho.net/plain; echo) && curl ipinfo.io/"$MYIP" && echo' +alias ports-in-use='sudo lsof -i -P -n | grep LISTEN' +# Mis typed whois +alias whosi='whois' +alias gti='git' +alias dc='cd' + +# untar +alias untar='tar xvf' + +#amass +alias amass-subdomain='domain(){ amass enum -passive -d "$1" >> /opt/amass-scans/"$1".txt; unset -f domain;}; domain' + + +#SAV Command +alias sav-start='sudo service sav-protect start' +alias sav-stop='sudo service sav-protect stop' + +# wget Shortcuts +alias get-nordserverlist="wget https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip" + + +# Make Life Easier + +alias wireshark-pfsense="sudo su -c 'wireshark -k -i <(ssh root@192.168.0.3 -p 2222 tcpdump -i lagg0 -U -w - )'" + +# Updates packages from all sources +function update() { + if command -v snap >/dev/null; then + echo "Updating Snaps..." + sudo snap refresh + fi + if command -v apt >/dev/null; then + echo "Updating Apt Packages..." + sudo apt clean && sudo apt update && sudo apt --autoremove full-upgrade -y + else + echo "No apt binary found. Is this actually a Debian-based system?" + fi +} + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" +else + PS1='┌──[\u@\h]─[\w]\n└──╼ \卌\n' +fi + +# Set 'man' colors +if [ "$color_prompt" = yes ]; then + man() { + env \ + LESS_TERMCAP_mb=$'\e[01;31m' \ + LESS_TERMCAP_md=$'\e[01;31m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[01;44;33m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[01;32m' \ + man "$@" + } +fi + +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi diff --git a/.bash_exports b/.bash_exports new file mode 100644 index 0000000..334bd67 --- /dev/null +++ b/.bash_exports @@ -0,0 +1,5 @@ + +## DOWNLOADED FROM GITHUB ## + +export EDITOR=/usr/bin/vim + diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..fd1ef91 --- /dev/null +++ b/.bashrc @@ -0,0 +1,137 @@ + +## DOWNLOADED FROM GITHUB ## + +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +export PATH=~/.local/bin:/snap/bin:/usr/sandbox/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/share/games:/usr/local/sbin:/usr/sbin:/sbin:$PATH + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" +else + PS1='┌──[\u@\h]─[\w]\n└──╼ \$ ' +fi + +# Set 'man' colors +if [ "$color_prompt" = yes ]; then + man() { + env \ + LESS_TERMCAP_mb=$'\e[01;31m' \ + LESS_TERMCAP_md=$'\e[01;31m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[01;44;33m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[01;32m' \ + man "$@" + } +fi + +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -lh' +alias la='ls -lha' +alias l='ls -CF' +alias em='emacs -nw' +alias dd='dd status=progress' +alias _='sudo' +alias _i='sudo -i' +alias please='sudo' +alias fucking='sudo' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..002bc95 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,38 @@ + +## DOWNLOADED FROM GITHUB ## + +# Send prefix +set-option -g prefix C-a +bind-key C-a send-prefix +unbind-key C-a + +# Use Alt-arrow keys to switch panes +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Shift arrow to switch windows +bind -n S-Left previous-window +bind -n S-Right next-window +set -g mouse off + +# Set easier window split keys +bind-key v split-window -h +bind-key h split-window -v + +# Easy config reload +bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded." + + +#set -g status-interval 60 +#set -sg escape-time 1000 +#set-option -g base-index 1 +setw -g aggressive-resize on +set -g status-justify centre +set -g status-left-length 150 +set -g status-left "#[fg=red]#(echo 'IP ')#(curl -s http://ipecho.net/plain)" + +#show session name, window & pane number, date and time on right side of status bar +set -g status-right-length 60 +set -g status-right "#[fg=blue]#(hostname)#(echo '\') #(whoami) #[fg=yellow]:: %d %b %Y #[fg=green]:: %l:%M %p :: #(date -u | awk '{print $4}')::" diff --git a/README.md b/README.md index 4a120a0..c2a5ed5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # Dotfiles +# Installation +### Download and change folder +``` +cd ~ +git clone https://github.com/ncltech/dotfiles.git + +cd dotfiles +``` +### Run install +``` +./install.sh +``` + +# Uninstallation + +### Change to dotfiles folder +``` +Working on it +``` + diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..27fe575 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +## DOWNLOADED FROM GITHUB ## + +# Find all dot files then if the original file exists, create a backup +# Once backed up to {file}.dtbak symlink the new dotfile in place +for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do + if [ -e ~/$file ]; then + mv -f ~/$file{,.dtbak} + fi + ln -s $PWD/$file ~/$file +done diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..e3e56d1 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +## DOWNLOADED FROM GITHUB ## + +# Loop through all the dotfiles, if the file is a symlink then remove it +# Then if the backup file exists, restore it to it's original location +for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do + if [ -h ~/$file ]; then + rm -f ~/$file + fi + if [ -e ~/${file}.dtbak ]; then + mv -f ~/$file{.dtbak,} + fi +done + +echo "Uninstalled"