[[ "$-" != *i* ]] && return

# Shell Options
#
# See man bash for more options...
#
# Don't wait for job termination notification
# set -o notify
#
# Don't use ^D to exit
# set -o ignoreeof
#
# Use case-insensitive filename globbing
# shopt -s nocaseglob
#
# Make bash append rather than overwrite the history on disk
# shopt -s histappend
#
# When changing directory small typos can be ignored by bash
# for example, cd /vr/lgo/apaache would find /var/log/apache
# shopt -s cdspell

# Programmable completion enhancements are enabled via
# /etc/profile.d/bash_completion.sh when the package bash_completetion
# is installed.  Any completions you add in ~/.bash_completion are
# sourced last.

# History Options
#
# Don't put duplicate lines in the history.
# export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
#
# 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'
# export HISTIGNORE=$'[ \t]*:&:[fb]g:exit:ls' # Ignore the ls command as well
#
# Whenever displaying the prompt, write the previous line to disk
# export PROMPT_COMMAND="history -a"

# Aliases
#
# Some people use a different file for aliases
# if [ -f "${HOME}/.bash_aliases" ]; then
#   source "${HOME}/.bash_aliases"
# fi
#
# Some example alias instructions
# If these are enabled they will be used instead of any instructions
# they may mask.  For example, alias rm='rm -i' will mask the rm
# application.  To override the alias instruction use a \ before, ie
# \rm will call the real rm not the alias.
#
# Interactive operation...
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
#
# Default to human readable figures
# alias df='df -h'
# alias du='du -h'
#
# Misc :)
# alias less='less -r'                          # raw control characters
# alias whence='type -a'                        # where, of a sort
# alias grep='grep --color'                     # show differences in colour
# alias egrep='egrep --color=auto'              # show differences in colour
# alias fgrep='fgrep --color=auto'              # show differences in colour
#
# Some shortcuts for different directory listings
# alias ls='ls -hF --color=tty'                 # classify files in colour
# alias dir='ls --color=auto --format=vertical'
# alias vdir='ls --color=auto --format=long'
# alias ll='ls -l'                              # long list
# alias la='ls -A'                              # all but . and ..
# alias l='ls -CF'                              #

# Umask
#
# /etc/profile sets 022, removing write perms to group + others.
# Set a more restrictive umask: i.e. no exec perms for others:
# umask 027
# Paranoid: neither group nor others have any perms:
# umask 077

# Functions
#
# Some people use a different file for functions
# if [ -f "${HOME}/.bash_functions" ]; then
#   source "${HOME}/.bash_functions"
# fi
#
# Some example functions:
#
# a) function settitle
# settitle ()
# {
#   echo -ne "\e]2;$@\a\e]1;$@\a";
# }
#
# b) function cd_func
# This function defines a 'cd' replacement function capable of keeping,
# displaying and accessing history of visited directories, up to 10 entries.
# To use it, uncomment it, source this file and try 'cd --'.
# acd_func 1.0.5, 10-nov-2004
# Petar Marinov, http:/geocities.com/h2428, this is public domain
# cd_func ()
# {
#   local x2 the_new_dir adir index
#   local -i cnt
#
#   if [[ $1 ==  "--" ]]; then
#     dirs -v
#     return 0
#   fi
#
#   the_new_dir=$1
#   [[ -z $1 ]] && the_new_dir=$HOME
#
#   if [[ ${the_new_dir:0:1} == '-' ]]; then
#     #
#     # Extract dir N from dirs
#     index=${the_new_dir:1}
#     [[ -z $index ]] && index=1
#     adir=$(dirs +$index)
#     [[ -z $adir ]] && return 1
#     the_new_dir=$adir
#   fi
#
#   #
#   # '~' has to be substituted by ${HOME}
#   [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}"
#
#   #
#   # Now change to the new dir and add to the top of the stack
#   pushd "${the_new_dir}" > /dev/null
#   [[ $? -ne 0 ]] && return 1
#   the_new_dir=$(pwd)
#
#   #
#   # Trim down everything beyond 11th entry
#   popd -n +11 2>/dev/null 1>/dev/null
#
#   #
#   # Remove any other occurence of this dir, skipping the top of the stack
#   for ((cnt=1; cnt <= 10; cnt++)); do
#     x2=$(dirs +${cnt} 2>/dev/null)
#     [[ $? -ne 0 ]] && return 0
#     [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}"
#     if [[ "${x2}" == "${the_new_dir}" ]]; then
#       popd -n +$cnt 2>/dev/null 1>/dev/null
#       cnt=cnt-1
#     fi
#   done
#
#   return 0
# }
#
# alias cd=cd_func
alias clidir='cd /cygdrive/d/cli'
alias gitdir='cd /cygdrive/d/Git'
alias mp3dir='cd /cygdrive/d/mp3'
alias datadir='cd /cygdrive/d/MEGA/Data'
alias nppdir='cd /cygdrive/c/Users/Administrator/AppData/Roaming/Notepad++/backup'
alias desktopdir='cd /cygdrive/c/Users/Administrator/Desktop'
alias furrydir='cd /cygdrive/d/Furry/Archive'
alias tempdir='cd /cygdrive/d/Temp'
# alias coredir='cd /cygdrive/d/zl-core'
alias coredir='cd /cygdrive/c/Users/Administrator/AppData/Local/Programs/Python/Python38/lib/ZL-Core'
alias scrapsdir='cd /cygdrive/d/Scraps'

alias bk1='/home/git.sh'
alias bk2='/home/upload.sh'
alias bk3='/home/git2.sh'

alias wgetx="head -n 1 /dev/clipboard | xargs wget"
alias wgetv="cd /cygdrive/c/Users/Administrator/Desktop/Video && head -n 1 /dev/clipboard | xargs wget"
alias ytv="cd /cygdrive/c/Users/Administrator/Desktop/Video && head -n 1 /dev/clipboard | xargs youtube-dl  -f 'bestvideo[height<=?480]+bestaudio/best' --no-playlist --user-agent Googlebot"
alias ytx="head -n 1 /dev/clipboard | xargs youtube-dl  -f 'bestvideo[ext=mp4][vcodec!*=av01][height<=?480]+bestaudio/best' --no-playlist --user-agent Googlebot"
alias ytl="head -n 1 /dev/clipboard | xargs youtube-dl -f worst --no-playlist"
alias ytor="head -n 1 /dev/clipboard | xargs youtube-dl --proxy socks5://127.0.0.1:9050 --merge-output-format mp4 --no-playlist"
alias ytmp3="head -n 1 /dev/clipboard | xargs youtube-dl --extract-audio --audio-format mp3 --no-playlist"
alias fat="fatty -p 0,0 & exit"
alias txtsort="cat sorted.txt | awk '{ print length, $0 }' | sort -n -s | cut -d' ' -f2- > sorted.txt"
alias mpv="head -n 1 /dev/clipboard | xargs mpv.exe"
alias mpv1="mpv & exit"
alias clshow="cat ~/clipboard.txt"
alias cladd="printf '\n-------------------------------------------------------------\n' >> ~/clipboard.txt && cat /dev/clipboard >> ~/clipboard.txt"
alias vivaldiinspect="C:\Users\Administrator\AppData\Local\Vivaldi\Application\vivaldi.exe --force-dark-mode --debug-packed-apps --silent-debugger-extension-api"
alias chromeapp="head -n 1 /dev/clipboard | xargs -i /cygdrive/c/Users/Administrator/AppData/Local/Chromium/Application/chrome.exe --disk-cache-size=0 --force-dark-mode --media-cache-size=0 --app={}"
alias urlwatch1="env LC_ALL=en_US.UTF-8 urlwatch"
alias commit-furry="printf '\r\n' >> /cygdrive/d/MEGA/ZLnote/X220/Commit/Furry.txt && cat /dev/clipboard >> /cygdrive/d/MEGA/ZLnote/X220/Commit/Furry.txt && tail -n 5 /cygdrive/d/MEGA/ZLnote/X220/Commit/Furry.txt"
alias catx="cat /dev/clipboard"
alias ls1="ls -la --group-directories-first"

alias zltool="cat ~/tool.txt"
alias dirsearch="python 'D:\cli\dirsearch\dirsearch.py'"
alias dirsearch1="python 'D:\cli\dirsearch\dirsearch.py' --proxy=socks5://localhost:9050"
alias subdomainizer="python 'D:\cli\SubDomainizer\SubDomainizer.py'"
alias commix="python 'D:\cli\commix\commix.py'"
alias harvester="cd /cygdrive/d/cli/theHarvester && python 'theHarvester.py'"
alias sherlock="python 'D:\cli\sherlock\sherlock'"
alias sherlock1="python 'D:\cli\sherlock\sherlock' --proxy socks5://127.0.0.1:9050"
alias amass0="amass enum -v -src -ip -brute -min-for-recursive 2 -d "
alias amass1="cd ~/.conf && amass enum -config amass.ini -v -src -ip -brute -min-for-recursive 2 -d "
alias amassorg="amass intel -org "
alias amasswhois="amass intel -whois -d "
alias ammasspassive="amass enum -passive -src -d "
alias amassactive="cd ~/.conf && amass enum -active -config amass.ini -v -src -ip -brute -min-for-recursive 2 -d "
alias nuclei1="nuclei -proxy-socks-url socks5://localhost:9050"
alias httpx1="httpx --http-proxy http://127.0.0.1:8123 -status-code -title -silent"
alias polipo1="cd /etc/polipo && polipo -c config"
alias infoga="cd /cygdrive/d/cli/Infoga && python infoga.py"
alias wlistdir="cd /cygdrive/d/MEGA/Data/#Tools/wordlists"
alias submove="find . -mindepth 2 -type f -print -exec mv --backup=numbered {} . \;"
alias treex="tree -a --dirsfirst"

alias bkdump="w3m -dump /home/sidebar/text/backup.html"

bktree(){
	treex /cygdrive/d/MEGA > ~/tree/mega.txt
	treex /cygdrive/d/MEGA -d > ~/tree/mega-dir.txt
	treex /cygdrive/d/Data > ~/tree/data.txt
	treex /cygdrive/d/Data -d > ~/tree/data-dir.txt
	treex /cygdrive/c/Users/Administrator/Desktop/P > ~/tree/p.txt
	treex /cygdrive/c/Users/Administrator/Desktop/P -d > ~/tree/p-dir.txt
	
	treex /cygdrive/d/MP3 > ~/tree/mp3.txt
	treex /cygdrive/d/MP3 -d > ~/tree/mp3-dir.txt
	treex /cygdrive/d/Furry/Archive -d > ~/tree/furry-dir.txt

	treex /cygdrive/d/temp > ~/tree/temp.txt
	treex /cygdrive/d/temp -d > ~/tree/temp-dir.txt
	treex /cygdrive/d/scraps -d > ~/tree/scraps-dir.txt
	treex /cygdrive/c/Users/Administrator/Desktop > ~/tree/desktop.txt
	treex /cygdrive/c/Users/Administrator/Desktop -d > ~/tree/desktop-dir.txt
}

bkoverview(){
	cd /home/overview/
	tree -a --dirsfirst Core
	tree -a --dirsfirst Network
	tree -a --dirsfirst Bookmark
	tree -a --dirsfirst Note
}

#alias urlwatchf="urlwatch --url ~/urlwatch/furry.yaml"

stringc(){
	egrep -o '"([^"]*)"' $1 | sed -r 's/"(.*)"/\1/'
}
save1(){
	script -q -c $1 $2
}
ff480(){
	ffmpeg -i $1 -filter:v scale=-"trunc(oh*a/2)*2:480" -c:a copy $1
}
findd(){
	find . -iname "*$1*" -type d
}
findf(){
	find . -iname "*$1*" -type f
}
alias grepx="head -n 1 /dev/clipboard | xargs grep -nr"
ytc(){
	youtube-comment-downloader --youtubeid "$1" --output "$1".json
}

zlenc(){
cat /dev/clipboard | openssl aes-256-cbc -pbkdf2 -iter 100000 -a -salt -pass pass:$1
}
zldec(){
cat /dev/clipboard | openssl aes-256-cbc -d -a -pbkdf2 -iter 100000 -pass pass:$1
}
zlencf(){
cat "$1" | openssl aes-256-cbc -pbkdf2 -iter 100000 -a -salt -pass pass:$2 > "$1.txt"
}
zldecf(){
cat "$1.txt" | openssl aes-256-cbc -d -a -pbkdf2 -iter 100000 -pass pass:$2 > "$1"
}

sidebar(){
if (("$#" == 0)); then
	clear
	ls -1 /home/sidebar/text/
elif test -f "/home/sidebar/text/$1.html"; then
	w3m "/home/sidebar/text/$1.html"
elif test -f "/home/sidebar/text/$1.txt"; then
	clear
	cat "/home/sidebar/text/$1.txt"
fi
}

note(){
VAR=`cat /dev/clipboard`
cd /home/note/
#export PS1="\n> "
if (("$#" == 0)); then
	clear
	ls -lA --group-directories-first /home/note/
elif test -f "/home/note/$1.html"; then
	w3m "/home/note/$1.html"
elif [[ "$2" == 'add' ]]; then
	clear
	if (( $(grep -c . <<<"$VAR") > 1 )); then
		printf '\r\n-------------------------------------------------------------\r\n' >> "/home/note/$1.txt"
		cat /dev/clipboard >> "/home/note/$1.txt"
		printf '\r\n-------------------------------------------------------------\r\n' >> "/home/note/$1.txt"
	else
		cat /dev/clipboard >> "/home/note/$1.txt"
	fi
	printf '\r\n' >> "/home/note/$1.txt"
	cat -n "/home/note/$1.txt"
elif [[ "$2" == 'hr' ]]; then
	clear
	printf '\r\n-------------------------------------------------------------\r\n' >> "/home/note/$1.txt"
	cat -n "/home/note/$1.txt"
elif [[ "$2" == 'inline' ]]; then
	clear
	cat /dev/clipboard >> "/home/note/$1.txt"
	printf ' ' >> "/home/note/$1.txt"
	cat -n "/home/note/$1.txt"
elif [[ "$2" == 'man' ]]; then
	clear
	printf "$3" >> "/home/note/$1.txt"
	printf '\r\n' >> "/home/note/$1.txt"
	cat -n "/home/note/$1.txt"
#elif [[ $2 == 'del' ]]; then
#else
elif test -f "/home/note/$1.txt"; then
	clear
	cat -n "/home/note/$1.txt"
fi
}

anon(){
VAR=`cat /dev/clipboard`
# cd /home/anon/
ANON='/cygdrive/c/Users/Administrator/AppData/Local/Programs/Python/Python38/lib/X/Void/# Scraps/# Raw/╬ Void/anon'
cd "$ANON"
#export PS1="\n> "
if (("$#" == 0)); then
	clear
	ls -lA --group-directories-first "$ANON"
elif test -f "$ANON/$1.html"; then
	w3m "$ANON/$1.html"
elif [[ $2 == 'add' ]]; then
	clear
	if (( $(grep -c . <<<"$VAR") > 1 )); then
		printf '\r\n-------------------------------------------------------------\r\n' >> "$ANON/$1.txt"
		cat /dev/clipboard >> "$ANON/$1.txt"
		printf '\r\n-------------------------------------------------------------\r\n' >> "$ANON/$1.txt"
	else
		cat /dev/clipboard >> "$ANON/$1.txt"
	fi
	printf '\r\n' >> "$ANON/$1.txt"
	cat -n "$ANON/$1.txt"
elif [[ "$2" == 'hr' ]]; then
	clear
	printf '\r\n-------------------------------------------------------------\r\n' >> "$ANON/$1.txt"
	cat -n "$ANON/$1.txt"
elif [[ "$2" == 'inline' ]]; then
	clear
	cat /dev/clipboard >> "$ANON/$1.txt"
	printf ' ' >> "$ANON/$1.txt"
	cat -n "$ANON/$1.txt"
elif [[ "$2" == 'man' ]]; then
	clear
	printf "$3" >> "$ANON/$1.txt"
	printf '\r\n' >> "$ANON/$1.txt"
	cat -n "$ANON/$1.txt"
#elif [[ "$2" == 'archive' ]]; then
#else
elif test -f "$ANON/$1.txt"; then
	clear
	cat "$ANON/$1.txt"
fi
}

anti(){
ANTI='/cygdrive/c/Users/Administrator/AppData/Local/Programs/Python/Python38/lib/X/Void/[ Network ]/[ Message ]/# ANTI'
cd "$ANTI"
if (("$#" == 0)); then
	clear
	ls -lA --group-directories-first "$ANTI"
elif test -f "$ANTI/[ REKT ]/$1.html"; then
	w3m "$ANTI/[ REKT ]/$1.html"
elif [[ $2 == 'read' ]]; then
	clear
	cat "$ANTI/[ REKT ]/$1.txt" > /dev/clipboard
	cat -n "$ANTI/[ REKT ]/$1.txt"
elif [[ $2 == 'aread' ]]; then
	clear
	if test -f "$ANTI/# Meta/$3.txt"; then
		STR1=$(cat "$ANTI/[ REKT ]/$1.txt")
		STR2=$(cat "$ANTI/# Meta/$3.txt")
		STR="$STR1\n\r\n\r===============================\n\r\n\r$STR2"
		echo -e "$STR" > /dev/clipboard
		echo -e "$STR"
	fi
elif test -f "$ANTI/[ REKT ]/$1.txt"; then
	clear
	cat "$ANTI/[ REKT ]/$1.txt"
fi
}

scraps(){
VAR=`cat /dev/clipboard`
NOW=`date +%s`
cd /cygdrive/d/scraps/
if (("$#" == 0)); then
	clear
	ls -lA --group-directories-first /cygdrive/d/scraps/
elif test -f "/cygdrive/d/scraps/$1.html"; then
	w3m "/cygdrive/d/scraps/$1.html"
elif [[ $2 == 'add' ]]; then
	clear
	mkdir -p "/cygdrive/d/scraps/$1"
	cat /dev/clipboard >> "/cygdrive/d/scraps/$1/$NOW.txt"
	cat -n "/cygdrive/d/scraps/$1/$NOW.txt"
	echo -e "\n"
	echo "[ Path ]: /cygdrive/d/scraps/$1/$NOW.txt"
else
	clear
	find . -iwholename "*$1*" -type f
fi
}

upload(){
	UPLOAD='/cygdrive/c/Users/Administrator/AppData/Local/Programs/Python/Python38/lib/X/Void/[ Network ]/Upload'
	echo -e "\n" >> "$UPLOAD/$1.txt"
	curl -F"file=@"$1 https://ttm.sh >> "$UPLOAD/$1.txt"
	curl "http://bashupload.com" -T $1 | grep -m 1 "bashupload.com" >> "$UPLOAD/$1.txt"
	curl -F"file=@"$1 https://0x0.st >> "$UPLOAD/$1.txt"
	curl -F"file=@"$1 https://hashru.link | grep -m 1 http >> "$UPLOAD/$1.txt"

	curl -F "reqtype=fileupload" -F "fileToUpload=@"$1 https://catbox.moe/user/api.php | grep -m 1 files >> "$UPLOAD/$1.txt"
}

core(){
	mkdir -p "/cygdrive/d/scraps/# Core/$1"

	coredir
	findf $1 > "/cygdrive/d/scraps/# Core/$1/findf.txt"
	findd $1 > "/cygdrive/d/scraps/# Core/$1/findd.txt"
	grep -nir $1 > "/cygdrive/d/scraps/# Core/$1/grep.txt"

	if [[ $2 == 'void' ]]; then
		cd "/cygdrive/d/scraps/"
		grep -nir $1 void "~ Old" "~ Ref" >> "/cygdrive/d/scraps/# Core/$1/grep.txt"
	fi
}

grepb(){
cd /cygdrive/c/Users/Administrator/Desktop/bookmark
grep -ni "$1" bookmarks.html
}

ffmpegwebm(){
ffmpeg -i "$1" -c:v libvpx -crf 12 -b:v 500K "$1".webm
}


export GITROB_ACCESS_TOKEN=359e6571cd7fbb6b7251a6eafef8ec292263cada
cd /cygdrive/c/Users/Administrator/Desktop
#export PS1="\n\u@\h \@ \w \n> "
export PS1="\n\n\[\e[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\e[0;31m\]\342\234\227\[\e[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\e[01;31m\]root\[\e[01;33m\]@\[\e[01;96m\]\h'; else echo '\[\e[0;92m\]\u\[\e[01;33m\]@\[\e[0;96m\]\h'; fi)\[\e[0;31m\]]\342\224\200[\[\e[1;31m\]\w\[\e[0;31m\]]\n\[\e[0;31m\]\342\224\224\342\224\200\342\224\200 \[\e[0m\]\[\e[1;33m\]‡\[\e[0m\] "
tabs 4

#https://gist.github.com/RabaDabaDoba/145049536f815903c79944599c6f952a
alias nmap-=""
alias amass-=""

printf "\e[0;91mProxy\e[0m: tor polipo1\n"
printf "\e[0;91mRecon\e[0m: amass\e[0;93m0|1|org|whois\e[0m subfinder \e[0;96m-d\e[0m harvester \e[0;96m-d\e[0m\n"
printf "\tcat \e[0;96mdomain.txt\e[0m | httpx1\n"
printf "\tdirsearch -u <target> -w <wordlist> -e <extension>\n"
printf "\tnmap\e[0;93m|1|2|3\e[0m\n"
printf "\tpython wafw00f\n"
printf "\t\e[0;91mOSINT\e[0m: sherlock|\e[0;93m1\e[0m \e[0;96m[username]\e[0m\n"
printf "\t\tinfoga \e[0;96m-d\e[0m\n"
printf "\t\tphoneinfoga \e[0;96m-d\e[0m\n"
printf "\e[0;91mbindutil\e[0m: host dig whois\n"
printf "\e[0;91mbinutil\e[0m: strings string\e[0;93mc\e[0m file\n"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
#--------------------
printf "\e[0;91mSearch\e[0m: shodan\n"
printf "\e[0;91mExploit\e[0m: metasloit nuclei\n"
printf "\tcommix\n"
printf "\e[0;91mRepository\e[0m: gitrob \e[0;96m--threads 10\e[0m\n"
printf '\e[1;30m%*s\n\e[0m' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
printf "\e[0;91mCDX Archive\e[0m: waybackurls cdxt \e[0;96m--cc|ia warc [url]\e[0m\n"
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
#--------------------
printf "\e[0;91mMedia\e[0m: youtube-dl twitch-dl gallery-dl peerflix ffmpeg|webm bitglitter ff\e[0;93m480\e[0m yt\e[0;93mv|x|l|mp3\e[0m y\e[0;93mtor\e[0m mpv\e[0;93m|1\e[0m\n"
printf "\e[0;91mNetwork\e[0m: \e[1;35murlwatch\e[0m\n"
printf "\e[0;91mSocial\e[0m: youtube-comment-downloader ytc \n"
printf "\e[0;91mDocument\e[0m: xpdf docx2txt \n"
printf "\e[0;91m[Utility]\e[0m: save1 fat txtsort wgetx findf|d catx cl\e[0;93madd|show\e[0m commit-\e[0;93mfurry\e[0m grep\e[0;93mb\e[0m anon sidebar note\n"
printf "\e[0;91m[Backup]\e[0m: bk\e[0;93m1|2|3|dump|tree\e[0m upload surge rclone\n"
printf "\e[0;91m[Encryption]\e[0m: zl\e[0;93menc|dec|f\e[0m\n"
printf "\e[0;91mdir\e[0m: cli data git wlist desktop note commit furry\n"
printf "\e[0;91mWordlist\e[0m: \n"
printf "\e[0;30m[Unavailable]: ffuf|wfuzz recon-ng striker photon reconnoitre gobuster sublist3r\e[0m\n"

printf "\n\e[0;92m===[Clipboard]===\n"
cat /dev/clipboard
printf '\n%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
