From 48deb314a599b7fa16aa95fd170b9eb0952c32f3 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Tue, 2 Dec 2025 22:02:26 -0600 Subject: [PATCH] adding bashrc configs; added more dev related apps; setting image memory to 4GB --- Docker/Dockerfile | 21 ++++++++++++--- Docker/env/.bash_aliases | 52 ++++++++++++++++++++++++++++++++++++++ Docker/env/.bash_colors | 50 ++++++++++++++++++++++++++++++++++++ Docker/env/.bash_exports | 24 ++++++++++++++++++ Docker/env/.bash_functions | 48 +++++++++++++++++++++++++++++++++++ Docker/env/.bash_ps1 | 17 +++++++++++++ Docker/env/.bashrc | 42 ++++++++++++++++++++++++++++++ Docker/env/.gitconfig | 8 ++++++ Docker/scripts/start.sh | 2 +- 9 files changed, 260 insertions(+), 4 deletions(-) create mode 100644 Docker/env/.bash_aliases create mode 100644 Docker/env/.bash_colors create mode 100644 Docker/env/.bash_exports create mode 100644 Docker/env/.bash_functions create mode 100644 Docker/env/.bash_ps1 create mode 100644 Docker/env/.bashrc create mode 100644 Docker/env/.gitconfig diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 53e4a9b..ef48ae1 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -39,15 +39,15 @@ COPY package.json . COPY src/* . COPY Docker/scripts/run.sh . COPY Docker/opt/ /opt/ +COPY Docker/env/* /home/abaddon/ # 4. A: Install dependencies # RUN apt update # RUN apt install RUN apt-get update -RUN apt-get install \ +RUN apt-get install -y \ --no-install-recommends \ --no-install-suggests \ - -y \ pkg-config \ ca-certificates \ libreadline-dev \ @@ -57,12 +57,27 @@ RUN apt-get install \ libncursesw5-dev \ libgirepository1.0-dev \ libssl-dev libcairo2-dev \ + bash-completion \ + parallel \ + 7zip \ + zip \ + tar \ curl \ wget \ + git \ clang \ clangd \ + gdb \ + php \ gopls \ - git + htop \ + ranger \ + nano \ + fzf \ + bat \ + less \ + tree \ + ripgrep # RUN apk update # RUN apk add --no-cache \ diff --git a/Docker/env/.bash_aliases b/Docker/env/.bash_aliases new file mode 100644 index 0000000..a8d5be0 --- /dev/null +++ b/Docker/env/.bash_aliases @@ -0,0 +1,52 @@ +# Aliases + + +alias ls="ls --block-size=M" +alias lsd="ls -d --block-size=M */" +alias lines-of-code="cloc --no3 --by-file-by-lang" +alias list-biggest-dirs="du -a . | sort -n -r | head -n 50" +alias list-biggest-files="find -type f -exec du -Sh {} + | sort -rh | head -n 50" +alias fman="compgen -c | fzf | xargs man" + +# Docker +alias docker="podman" + +# Archiving +alias ltar="tar -ztvf" +alias untar="tar -zxvf" +alias atar="tar -cvzf" + +# NPM +alias npm-list-global='npm list -g --depth 0' +alias npm-update-npm='npm install -g npm' +alias npm-list-local='npm list --depth 0' + +# Common used command +alias wget='wget -c' +alias cls='clear' +alias less="less -S +G" +alias ls="ls -F -h -s --group-directories-first --color=always" +alias lt='ls --human-readable --size -1 -S --classify' +alias count='find . -type f | wc -l' +alias refresh-bash='. ~/.bashrc' +alias du="du -h -d 1" +alias grep="grep -n -R" + +#gdb no copyright start and use better gui look +alias gdb='gdb -tui -q' + +#Git +alias gitA="git add -A ." +alias gitC="git commit -m" +alias gitP="git push" + +# Python +alias pySimpleServer='python -m http.server' # Python 3 +#alias pySimpleServer='python -m SimpleHTTPServer' # Python 2 +alias pyCgiServer='python -m CGIHTTPServer' +alias py-venv='python3 -m venv' +alias py-src-activate='source ./bin/activate' +alias py-freeze='pip freeze --local > requirements.txt' +alias py-upgrade-all='python -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U' +#alias py-trace='python -m trace --ignore-dir=../lib --trace' +#alias py-trace="python -m trace --ignore-dir=$(python -c 'import sys ; print(\":\".join(sys.path)[1:])') --trace" diff --git a/Docker/env/.bash_colors b/Docker/env/.bash_colors new file mode 100644 index 0000000..59c605e --- /dev/null +++ b/Docker/env/.bash_colors @@ -0,0 +1,50 @@ +# Simpler colors in terminal scripts +bold=`echo -en "\e[1m"` +underline=`echo -en "\e[4m"` +dim=`echo -en "\e[2m"` +strickthrough=`echo -en "\e[9m"` +blink=`echo -en "\e[5m"` +reverse=`echo -en "\e[7m"` +hidden=`echo -en "\e[8m"` +normal=`echo -en "\e[0m"` +black=`echo -en "\e[30m"` +red=`echo -en "\e[31m"` +green=`echo -en "\e[32m"` +orange=`echo -en "\e[33m"` +blue=`echo -en "\e[34m"` +purple=`echo -en "\e[35m"` +aqua=`echo -en "\e[36m"` +gray=`echo -en "\e[37m"` +darkgray=`echo -en "\e[90m"` +lightred=`echo -en "\e[91m"` +lightgreen=`echo -en "\e[92m"` +lightyellow=`echo -en "\e[93m"` +lightblue=`echo -en "\e[94m"` +lightpurple=`echo -en "\e[95m"` +lightaqua=`echo -en "\e[96m"` +white=`echo -en "\e[97m"` +default=`echo -en "\e[39m"` +BLACK=`echo -en "\e[40m"` +RED=`echo -en "\e[41m"` +GREEN=`echo -en "\e[42m"` +ORANGE=`echo -en "\e[43m"` +BLUE=`echo -en "\e[44m"` +PURPLE=`echo -en "\e[45m"` +AQUA=`echo -en "\e[46m"` +GRAY=`echo -en "\e[47m"` +DARKGRAY=`echo -en "\e[100m"` +LIGHTRED=`echo -en "\e[101m"` +LIGHTGREEN=`echo -en "\e[102m"` +LIGHTYELLOW=`echo -en "\e[103m"` +LIGHTBLUE=`echo -en "\e[104m"` +LIGHTPURPLE=`echo -en "\e[105m"` +LIGHTAQUA=`echo -en "\e[106m"` +WHITE=`echo -en "\e[107m"` +DEFAULT=`echo -en "\e[49m"` +export LESS_TERMCAP_so=${white}${BLACK} # begin standout-mode - info box +export LESS_TERMCAP_mb=${lightred} # begin blinking +export LESS_TERMCAP_md=${lightyellow} # begin bold +export LESS_TERMCAP_us=${lightgreen} # begin underline +export LESS_TERMCAP_me=${default}${DEFAULT} # end mode +export LESS_TERMCAP_se=${default}${DEFAULT} # end standout-mode +export LESS_TERMCAP_ue=${default}${DEFAULT} # end underline diff --git a/Docker/env/.bash_exports b/Docker/env/.bash_exports new file mode 100644 index 0000000..c4094fc --- /dev/null +++ b/Docker/env/.bash_exports @@ -0,0 +1,24 @@ +# Python +export PYTHONDONTWRITEBYTECODE=1 + + +# Launchpad Config Parts +export DEBFULLNAME="Maxim Stewart" +export DEBEMAIL="1itdominator@gmail.com" + + +shopt -s cdspell +shopt -s autocd shift_verbose +shopt -s dirspell + + +# Bash history settings +export HISTSIZE=3000 +export HISTCONTROL=$HISTCONTROL:ignoredups + +# Default Editor +export EDITOR=nano + +# Default FZF +# Note: bat is cat but with colors +export FZF_DEFAULT_OPTS="--layout=reverse --height=100% --preview='bat -p --color=always {}'" diff --git a/Docker/env/.bash_functions b/Docker/env/.bash_functions new file mode 100644 index 0000000..6da60e8 --- /dev/null +++ b/Docker/env/.bash_functions @@ -0,0 +1,48 @@ +# Functions + + +# Python based scripts + +function py-trace() { + python -m trace --ignore-dir=$(python -c 'import sys ; print(":".join(sys.path)[1:])') --trace "$@" +} + +# Everything else + +function git-branch() { + branch=`git branch | fzf | xargs` + git checkout "${branch}" +} + +function ex() { + if [ -f $1 ]; then + case $1 in + *.tar.bz2) tar xjf $1 ;; + *.tar.gz) tar xzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar x $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xf $1 ;; + *.tbz2) tar xjf $1 ;; + *.tgz) tar xzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) 7z x $1 ;; + *.deb) ar x $1 ;; + *.tar.xz) tar xf $1 ;; + *.tar.zst) tar xf $1 ;; + *) echo "'$1' cannot be extracted using ex()" ;; + esac + else + echo "'$1' is not a valid file" + fi + +} + +function php-server() { + if [ $1 <= 1024 ]; then + authbind php -S 0.0.0.0:"$1" + else + php -S 0.0.0.0:"$1" + fi +} diff --git a/Docker/env/.bash_ps1 b/Docker/env/.bash_ps1 new file mode 100644 index 0000000..1c03f02 --- /dev/null +++ b/Docker/env/.bash_ps1 @@ -0,0 +1,17 @@ +#sysInfo="$(screenfetch)" +#export PS1="${sysInfo} + + + +function prompt_command() { + _COMMAND="parts = '$(pwd)'.split('/'); print('$(pwd)') if not len(parts) > 3 else print(f'.../{parts[-3]}/{parts[-2]}/{parts[-1]}')" + _PATH=$(python <<< "${_COMMAND}" || pwd) + _BRANCH="$(git rev-parse --symbolic-full-name --abbrev-ref HEAD 2>/dev/null)" + + # Week Day/Month/Day : Time -- user@group -- current dir path -- git branch + PS1="\[\e[32m\]\d\[\e[m\]: \[\e[36m\]\@\[\e[m\] -- \[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\] -- \[\e[35m\]${_PATH}\[\e[m\] -- ${_BRANCH} \\$ " +} + + + +export PROMPT_COMMAND=prompt_command diff --git a/Docker/env/.bashrc b/Docker/env/.bashrc new file mode 100644 index 0000000..a3ca88e --- /dev/null +++ b/Docker/env/.bashrc @@ -0,0 +1,42 @@ +# Colors +if [ -e $HOME/.bash_colors ]; then + source $HOME/.bash_colors +fi + +# Exports Variable Settings +if [ -e $HOME/.bash_exports ]; then + source $HOME/.bash_exports +fi + +# Paths +if [ -e $HOME/.bash_paths ]; then + source $HOME/.bash_paths +fi + +if [ -e $HOME/.bash_ld_library_path ]; then + source $HOME/.bash_ld_library_path +fi + +# Aliases +if [ -e $HOME/.bash_aliases ]; then + source $HOME/.bash_aliases +fi + +# Functions +if [ -e $HOME/.bash_functions ]; then + source $HOME/.bash_functions +fi + +# Auto complete -- Note: Must have bash-completion package +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash + + +# Terminal look and feel with logo and then custom prompt line +echo "${lightred}Welcome to the dark side of the moon, $(whoami)!${default}" +if [ -e $HOME/.bash_ps1 ]; then + source $HOME/.bash_ps1 +fi diff --git a/Docker/env/.gitconfig b/Docker/env/.gitconfig new file mode 100644 index 0000000..2f82ea3 --- /dev/null +++ b/Docker/env/.gitconfig @@ -0,0 +1,8 @@ +[user] + email = 1itdominator@gmail.com + name = itdominator +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/Docker/scripts/start.sh b/Docker/scripts/start.sh index 0b074a4..56e2972 100755 --- a/Docker/scripts/start.sh +++ b/Docker/scripts/start.sh @@ -23,7 +23,7 @@ function main() { CONFIG_HOST="${HOME}/.config/lsps" CONFIG_CONTAINER="${HOME}/.config/lsps" - podman run -d \ + podman run -d -m 4G \ -p 9999:9999 \ -e HOME="${HOME}" \ -e MAVEN_OPTS="-Duser.home=${HOME}" \